Handle Multiframe request using VBA or VBS

Comprehensive CAN monitor for Windows® and its add-ins: Plotter, CANdb Import, Instruments Panel, and J1939
Post Reply
rohan4pcan
Posts: 6
Joined: Thu 26. Sep 2013, 14:11

Handle Multiframe request using VBA or VBS

Post by rohan4pcan » Thu 26. Sep 2013, 14:45

Hello :D ,

In our company we are trying to look for options to replace CANalyser( at least most of the functionality). PCAN Explorer is one of the options we short listed . Right now we are doing an initial proof of concept where we are creating an application using VBA and have imported all the PCAN object into it. One use case that we are "struggling" to implement is to wait for response to a message that we have transmitted ( basically we are trying to implement a multi frame transmission) . We found that you have got some support for J1939 where there is a object called J1939Node object(OnMessageReceived Event) .However there is no such support for 11 bit CAN message .

1. How do we wait for an message ( We did find an example macro with do while condition and .Read + .Wait method combination but our concern is that there is no way to do any thing else in that duration ) . We are in other words looking for something similar to " On Message" command in CANalyser.

Can you please guide or provide us some solution . Let me know if you need any further details .

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

Re: Handle Multiframe request using VBA or VBS

Post by K.Wolf » Fri 27. Sep 2013, 15:09

Hi,

you could handle multi-packet transmissions with J1939Node and its associated objects. But you're right, the J1939Node doesn't handle 11-bit messages. Waiting for a received J1939 message can be done with the OnMessageReceived event.
Unfortunately, there is no OnMessageReceived event in the PCANClient object, which handles standard CAN messages. If you rely on VBA or VBS, there is no other option than to wait for a message as it is demonstrated in the macro, I'm sorry.

rohan4pcan
Posts: 6
Joined: Thu 26. Sep 2013, 14:11

Re: Handle Multiframe request using VBA or VBS

Post by rohan4pcan » Tue 1. Oct 2013, 07:40

Hi ,

Appreciate your response and there is no need to be sorry :) . So I will at least try to accomplish multi frame using 29 bit ids . If I have any issues while getting this done I will definetely like to contact you .

Meanwhile , I was looking at another option ( UDS API's which I guess are in beta phase right now ) . Will these be able to support transport protocol ( or multi frame messages) for 11 bit ids ?

.

K.Wagner
Software Development
Software Development
Posts: 1082
Joined: Wed 22. Sep 2010, 13:36

Re: Handle Multiframe request using VBA or VBS

Post by K.Wagner » Tue 1. Oct 2013, 09:45

Hello rohan4pcan,

yes, we are working currently on the UDS API to fully support its transport protocol (ISO 15765-2 aka ISO-TP).
Best regards,
Keneth

rohan4pcan
Posts: 6
Joined: Thu 26. Sep 2013, 14:11

Re: Handle Multiframe request using VBA or VBS

Post by rohan4pcan » Wed 6. Nov 2013, 15:07

Hi,

I tried to use OnMessageReceived event of J1939Node object. But i was unable to trigger the event based on received message. I think i am not able to figure out how to use this event correctly. So can you provide me with some sample code example in VBA which will describe how to use this event.
Thanks in advance :)

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

Re: Handle Multiframe request using VBA or VBS

Post by K.Wolf » Thu 7. Nov 2013, 11:37

Hi,

I don't know how VBA can be used to work with this. And when trying VBS, I even failed to connect the J1939Node events to the script. I've no idea what is wrong.
Basically, the OnMessageReceived event is fired only if you set the J1939Node.NotificationOnMessageReceived property to True. And don't forget to open the filter, e.g. by calling J1939Node.Filters.OpenThroughout()

Post Reply