I am controlloing an inverter with a CAN message. The message should include a toggle bit (which is toggled at every new message sent). I tried to this in two ways:
1) Define a message in my TransmitList with 100ms timer and use a macro to insert the toggle bit.
2) Use a macro toggling the bit and sending the message automatically.
Both my macros use the instruction "Wait 100" in an endless while loop to time, respectively, the bit toggling and the message sending.
With method 1) I encounter the issue that the macro in not synched with the transmit list and this results in the bit not getting toggled at some random point in time
With method 2) I encounter the problem that if I do something else on my laptop the macro gets stuck for a while and the message is not sent in 100ms (and timeout occurs on inverter).
My question is: how can I synch the macro with the transmit list? I mean, when the transmit list is "building" the message to be sent, I want my macro to jump into there and insert the correct toggle bit.
Alternatively, I can I perfectly time the macro and its message sending with my laptop system time?
Basically I would like my macro to be executed as "compiled code" by my laptop's microprocessor and not as an "interpreted" code run over system time..
Is that possible?
Thanks for your answers!
You need to send the message only from the VBS script - that should work. In PE6 we offer a callback lib which is the better solution. But PE5 is out of maintance.
Technical Support Team