Page 1 of 1

My frame is going out, each time I set a variable

Posted: Wed 3. Oct 2012, 16:40
by davidsoco
Hello,

I would like prepare the content of a frame, and then send it out.

I'm using a panel, in which I set virtual variables with my values. when I click on the a send button I copy the virtual var into the frame var like this

Code: Select all

Sub SendBus1()

   dim symbols
   
   set symbols = SymbolsManager("CanOpenTester")
   
   Signals("SdoReqData0").Value = Signals("SDOTmpReq0").Value
   Signals("SdoReqData1").Value = Signals("SDOTmpReq1").Value
   Signals("SdoReqData2").Value = Signals("SDOTmpReq2").Value
   Signals("SdoReqData3").Value = Signals("SDOTmpReq3").Value
   Signals("SdoReqIndex").Value = Signals("SDOTmpReqIndex").Value
   Signals("SdoReqSubIndex").Value = Signals("SDOTmpReqSubIndex").Value			
   symbols("SDOReq").DefaultMultiplexer.Send (Signals("CanBus").Value) 

End Sub
my problem is that the frame is output 7 times when I click on send (ones per "set" of variable)

Want is the right solution to output the frame only at the end ?

thanks

Re: My frame is going out, each time I set a variable

Posted: Thu 4. Oct 2012, 10:52
by K.Wolf
This auto-transmit behavior enabled by default. You can switch it off, but you have to do it for each variable separately:

Code: Select all

Signals("SdoReqData0").Source.AutoTransmit = False
Signals("SdoReqData1").Source.AutoTransmit = False
Signals("SdoReqData2").Source.AutoTransmit = False
Signals("SdoReqData3").Source.AutoTransmit = False
Signals("SdoReqIndex").Source.AutoTransmit = False
Signals("SdoReqSubIndex").Source.AutoTransmit = False
If you leave the AutoTransmit property enabled for the last variable SdoReqSubIndex, assigning the last value will send the frame once and you can omit the separate call of the Multiplexer.Send method.