Hallo,
I am currently using PCAN Explorer 5 and would like to simulate a CAN node which will transmit the answer I want everytime a message with certain ID is received.
I would like to do this by using the standard macro but I have no idea if this is possible or how to do it. It will be very helpful if I could get some example/help here.
For example I want to transmit a message with ID 101h everytime i receive a message of 100h.
Thanks
Simulation of a CAN node
Re: Simulation of a CAN node
Hi,
here the simple macro for that application:
waitid 0 1 100h
send 1 101h 2 AAh 01h
repeat
see help files for more information on how to use those standard macro commands
regards
Michael
here the simple macro for that application:
waitid 0 1 100h
send 1 101h 2 AAh 01h
repeat
see help files for more information on how to use those standard macro commands
regards
Michael
Re: Simulation of a CAN node
Hallo thanks for the reply and I found out similar examples in the help Content too which helps me out alot.
However I do face another Problem. My code now look like this
FormatVersion=5.0
WaitId 0 1 100h
If True
WaitId 20 1 101h
If False
Send 1 101h 2 00h 00h
Repeat
My aim is to simulate a CAN node to react when a bus in the can network stop answering. So i check if the request (100h) if received, if yes i check next if (101h) is answered, if no the macro shall transmit the 101h message which works perfect with the code above.
My Problem is the node that I want to simulate shall parallel react to not only 100h but also 110h 120h and 130h. Which means if any 110h/120h/130h is received it must check if the correspond answer is available, if yes do nth if no transmit a message. The sequence if 100h or 100h or 120h or 130h is received is completely random and not predictable. Is this Task still be possible to be executed with Standard macro or I need to use the vbscript instead? If so is the command WaitId works in vbscript too?
I would really appreciate for ur help. Thanks
However I do face another Problem. My code now look like this
FormatVersion=5.0
WaitId 0 1 100h
If True
WaitId 20 1 101h
If False
Send 1 101h 2 00h 00h
Repeat
My aim is to simulate a CAN node to react when a bus in the can network stop answering. So i check if the request (100h) if received, if yes i check next if (101h) is answered, if no the macro shall transmit the 101h message which works perfect with the code above.
My Problem is the node that I want to simulate shall parallel react to not only 100h but also 110h 120h and 130h. Which means if any 110h/120h/130h is received it must check if the correspond answer is available, if yes do nth if no transmit a message. The sequence if 100h or 100h or 120h or 130h is received is completely random and not predictable. Is this Task still be possible to be executed with Standard macro or I need to use the vbscript instead? If so is the command WaitId works in vbscript too?
I would really appreciate for ur help. Thanks
Re: Simulation of a CAN node
Hi,
yes, for complex applications, you should use a VBmacro instead. See WaitForID100 example macro in the macro list for a good startup for your VBmacro.
regards
Michael
yes, for complex applications, you should use a VBmacro instead. See WaitForID100 example macro in the macro list for a good startup for your VBmacro.
regards
Michael