About macro

Professional Windows® software to communicate with CAN and CAN FD busses and its add-ins: Plotter, CANdb Import, Instruments Panel, and J1939
Post Reply
Ryans
Posts: 2
Joined: Fri 17. Sep 2021, 08:18

About macro

Post by Ryans » Fri 17. Sep 2021, 11:12

Hello there,
Please find the attachment in this post.

I tried to make a macro file to send CAN message simply.
But, It doesn't seem to work my macro with "Waitdata function".

What should I check for it?

Thank you in advance.

Regards,
Attachments
XImage 404.png
XImage 404.png (18.81 KiB) Viewed 1581 times

M.Heidemann
Sales & Support
Sales & Support
Posts: 673
Joined: Fri 20. Sep 2019, 13:31

Re: About macro

Post by M.Heidemann » Fri 17. Sep 2021, 13:07

Hello,

You seem to have missed the length parameter, the standard macro needs
to know how long the message actually is:
WaitDataParameters.png
WaitDataParameters.png (10.79 KiB) Viewed 1571 times
Your incoming message is actually 8 Bytes long and you will have to
specify this appropiately, your current macro actually waits for:

Code: Select all

+----------+------+-----+--------+--------+-------------+
| WaitData | Time | Bus | CAN-ID | Length |  DataBytes  |
+----------+------+-----+--------+--------+-------------+
|        - |    0 |   1 | 0x7DFh |      2 | 0x10h 0x81h |
+----------+------+-----+--------+--------+-------------+
however to wait for the actual message shown in your screenshot, you macro would look like this

Code: Select all

WaitData 0 1 7DFh 8 02h 10h 81h 55h 55h 55h 55h 55h
To actually represent the message your are waiting for:

Code: Select all

+----------+------+-----+--------+--------+-------------------------------------------------+
| WaitData | Time | Bus | CAN-ID | Length |                    DataBytes                    |
+----------+------+-----+--------+--------+-------------------------------------------------+
|        - |    0 |   1 | 0x7DFh |      8 | 0x02h 0x10h 0x81h 0x55h 0x55h 0x55h 0x55h 0x55h |
+----------+------+-----+--------+--------+-------------------------------------------------+
If you only want to check the first 3 bytes, you still need to give the actual length, but you can
use wildcards isntead of actual values for bytes you do not care about:

Code: Select all

WaitData 0 1 7DFh 8 02h 10h 81h * * * * *
Please let us know if you were able to solve this using the provided information.

Best Regards

Marvin

Ryans
Posts: 2
Joined: Fri 17. Sep 2021, 08:18

Re: About macro

Post by Ryans » Fri 17. Sep 2021, 13:51

Many thanks
I will try to do it again.

Post Reply