Send CAN message and await response until sending the next one

This forum covers issues concerning multiple software products.
Post Reply
kepan13
Posts: 4
Joined: Tue 4. Aug 2020, 16:08

Send CAN message and await response until sending the next one

Post by kepan13 » Wed 5. Aug 2020, 10:31

Hello,

I am trying to create a python script to send some CAN messages using the PCANBasic Api. For example, say i want to send 35 messages. I've been searching this forum, and I think i've read it's not possible to have more than 1 instance of the CAN_BUS using this API at the same time. I need to both write and read in the same program. Is this possible?

Like this: send msg -> wait for response -> message received! go on to next msg -> send msg ...

Best regards,
Kepan13

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

Re: Send CAN message and await response until sending the next one

Post by M.Heidemann » Wed 5. Aug 2020, 11:25

Hello Kepan,

I assume you mean a CAN hardware channel by "CAN_BUS", in which case this statement is the complete opposite of what actually is the case, let me clearify:

A PCANBasic application cannot access a CAN-Channel used by another application.

A PCANBasic application can use up to 16 channels per hardware-type.

Have you checked out our PCANBasic example application?
PCANBasic_python.PNG
PCANBasic_python.PNG (25.08 KiB) Viewed 354 times
Sending and reading from the same application is not an issue at all.

You may wanna start looking at the example-application and take a look at the examples given in the PCANBasic documentation:

https://www.peak-system.com/fileadmin/m ... -basic.zip

Best Regards

Marvin

Post Reply