Sending a symbol (CAN message) periodically from a VBScript?

Comprehensive CAN monitor for Windows® and its add-ins: Plotter, CANdb Import, Instruments Panel, and J1939
Post Reply
User avatar
sebnil
Posts: 5
Joined: Mon 8. Jun 2015, 12:59

Sending a symbol (CAN message) periodically from a VBScript?

Post by sebnil » Mon 8. Jun 2015, 13:25

How do I send a symbol (CAN message) periodically from a VBScript? I want the message to be sent from a PCAN USB device and I want to use a database file instead of raw CAN-ids and values.

Dim sig1, sig2
Set sig1 = Signals("Foo.Speed")
Set sig2 = Signals("Foo.Heading")
sig1.Value = 1 ' m/s
sig2.Value = 0.5 ' rad
' ??. Here is when I want to send this periodically with 100ms on a PCAN USB device.

K.Wolf
Software Development
Software Development
Posts: 141
Joined: Wed 22. Sep 2010, 15:37

Re: Sending a symbol (CAN message) periodically from a VBScr

Post by K.Wolf » Tue 9. Jun 2015, 11:46

The answer is

Code: Select all

sig1.Source.Parent.Send 1, peSendPeriodic, 100
sig1.Source is the Variable object representing the signal in the CAN message
sig1.Source.Parent is the Multiplexer object containing the Variable

The Multiplexer.Send method has 3 parameters: bus, options, and cycle time. Please see the online help for more information.

User avatar
sebnil
Posts: 5
Joined: Mon 8. Jun 2015, 12:59

Re: Sending a symbol (CAN message) periodically from a VBScr

Post by sebnil » Fri 12. Jun 2015, 18:47

Thank you. I got it working.

Post Reply