Page 1 of 1

Send message in macro VBS

Posted: Thu 5. Sep 2019, 10:09
by PPC63
Hello,

I have a problem with VBS macro, for send data with multiplexers not have a problem like :

Code: Select all

Sub Send_TestMux()

   Dim sym

   Set sym = SymbolsManager("Ctrl").Item("TestMux")

   sym.Multiplexers("Multiplexer1").Send(1)
   
End Sub 
It's okay! But send data without multiplexers like that:

Code: Select all

Sub Send_TestNoMux()

   Dim sym

   Set sym = SymbolsManager("Ctrl").Item("TestNoMux")

   sym.Send(1)
   
End Sub 
Does not work. I can't find an example or explanation in the documentation. I suppose that some methods are used depending on the class but I don't see where to find this class...

Thank you for your help,
Paul


PS my SymbolsManager :

Code: Select all


[TestMux]
ID=000h
DLC=1
Mux=Multiplexer1 0,0 0
Var=Toto unsigned 0,8

[TestNoMux]
ID=001h
DLC=1
Var=TotoNoMux unsigned 0,1


Re: Send message in macro VBS

Posted: Fri 6. Sep 2019, 10:59
by PEAK-Support
To send a CAN Frame simple set the Value of ony signal, so the CAN Engine knows what to send:

Code: Select all

Sub Send_TestNoMux()
   Dim MySignal
   Set MySignal = Signals("TotoNoMux")
   MySignal.Value = 120
End Sub
To send the complete Symbol, you need to use the DefaultMultiplexer

Code: Select all

Sub Send_TestNoMux()   
   Dim sym, mux
   Set sym = SymbolsManager("Ctrl")
   Set mux = sym("TestNoMux").DefaultMultiplexer
   mux.Send(1)
End Sub   

Re: Send message in macro VBS

Posted: Fri 6. Sep 2019, 14:38
by PPC63
Thank you for your responce !
I wanted to send a frame without data.

Paul

Re: Send message in macro VBS

Posted: Mon 9. Sep 2019, 16:21
by K.Wolf
To send a frame without data, set DLC to 0 in your symbol:

Code: Select all

[TestNoMux]
ID=001h
DLC=0
And use this (simplified) code from the previous post to send the frame:

Code: Select all

Sub Send_TestNoMux()   
   SymbolsManager("Ctrl").Item("TestNoMux").DefaultMultiplexer.Send(1)
End Sub