Jump to content

CANUSB & How to set RTR Bit?


KoBe

Recommended Posts

Hi people,

I'm working with Labview 2010. A part of my project is the CAN communication between PC and some custom hardware. I'm using CANUSB with the delivered DLL Library in Labview. For test purposes only, I connect a second CANUSB device (running on the same PC) to the bus. With the WGSoft CAN Monitor Pro I should be able to define message triggers to which it has to answer:

Example:

Sending with Labview

CANUSB1:

ID:0x385

Message: 0x01

Length: 1

Message Trigger in WGSoft

ID: 0x385

Message 0x01 (00 00 00 00 00 00 00)

Mask: 0x 00 00 00 00 00 00 00 00 (????)

Length: 1

CANUSB2 should then respond on the message with

ID: 0x065

Message 0x 08 98 09 60 0A 28 00 (00)

Length: 7

Problem description:

CANUSB2 responds only the first time to a request by CANUSB1

WGSoft Monitor shows first:

ID: 0x387 EXT: 0 RTR: 0 DLC: 1 MSG: 0x 01 00 00 00 00 00 00 00

ID: 0x065 EXT: 0 RTR: 0 DLC: 7 MSG: 0x 08 98 09 60 0A 28 00 00

second time

ID: 0x387 EXT: 0 RTR: 0 DLC: 1 MSG: 0x 01 98 00 00 00 00 00 00

Strange that the Monitor Program shows 0x 01 98 ..., seem like the second byte from CANUSB1 gets overlayed with the second byte of CANUSB2. Has anyone an idea how to fix this problem?

I get often also arbitration error, a red constant led on the CANUSB appears and I don't know how to clear this error by software and i don't know how to prevent it.

Does anyone know if i should set the RTR in my request to 0x 01, even though the response has a different ID?

Each second time I connect to CANUSB via Labview my Labview gets stuck somewhere in the open Dll call. I leave the szID empty, because it doesn't work if I would like to search for a certain CANUSB device with it's serial number? Anyone an idea why Labview gets stuck so often with this CANUSB driver??

I know, lots of text, but if you even have only answer to one of all these questions I would be really happy to know it an to share it with LAVAG.

Thanks

Link to comment

Problem description:

CANUSB2 responds only the first time to a request by CANUSB1

WGSoft Monitor shows first:

ID: 0x387 EXT: 0 RTR: 0 DLC: 1 MSG: 0x 01 00 00 00 00 00 00 00

ID: 0x065 EXT: 0 RTR: 0 DLC: 7 MSG: 0x 08 98 09 60 0A 28 00 00

second time

ID: 0x387 EXT: 0 RTR: 0 DLC: 1 MSG: 0x 01 98 00 00 00 00 00 00

Strange that the Monitor Program shows 0x 01 98 ..., seem like the second byte from CANUSB1 gets overlayed with the second byte of CANUSB2. Has anyone an idea how to fix this problem?

I get often also arbitration error, a red constant led on the CANUSB appears and I don't know how to clear this error by software and i don't know how to prevent it.

I note that in the "second time" packet the Data Length Code is 1, so any data after the first byte is probably invalid. As such it should not matter what data is there, although it is weird that you get a non-zero value.

If you're getting an arbitration error you need to make sure that only one device is sending on the same arbitration ID at a time, and I'd also check that your CAN network is properly terminated since that can cause random errors.

Does anyone know if i should set the RTR in my request to 0x 01, even though the response has a different ID?

Probably not, but you would need to consult your system's documentation to be sure. In my experience Remote Transmit Request is rarely used, although I did work with one system that relied on it.

Each second time I connect to CANUSB via Labview my Labview gets stuck somewhere in the open Dll call. I leave the szID empty, because it doesn't work if I would like to search for a certain CANUSB device with it's serial number? Anyone an idea why Labview gets stuck so often with this CANUSB driver??

I don't know anything about this driver, and you haven't provided any links to documentation that would help explain it. Who makes it? Are you sure you've configured the DLL calls properly? Can you attach the VI that's generating errors? (I should add, I'm still using LabVIEW 2009, so you would need to Save for Previous Version from 2010 for me to be able to open it)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.