Jump to content

Create CAN Message


Ravi0709

Recommended Posts

Hi....

I have created CAN interfaces in MAX explorer using vector dbc file successfully and transfered to RT Target (a Desktop PC converted into RT). When I supplied raw data for each message, these interfaces generate CAN message and directly sending over physical CAN port. I wish to use this generated message internally in code further, instead of sending over physical port. We have a custom checksum generation code (in C). I wish to pass this generated CAN message to checksum code to generate checksum byte. In latter stage, I'll send CAN message and checksum byte together over physical port. My problem is, I'm unable to use the generated CAN message in LabVIEW code further. I need help to access this CAN message. How can I generate CAN message (from raw data) for internal purposes ??

If I posted this topic in wrong place please inform me.

Thankyou,

Ravinder

Link to comment

QUOTE (Ravi0709 @ May 20 2008, 04:14 AM)

I have created CAN interfaces in MAX explorer using vector dbc file successfully and transfered to RT Target (a Desktop PC converted into RT). When I supplied raw data for each message, these interfaces generate CAN message and directly sending over physical CAN port. I wish to use this generated message internally in code further, instead of sending over physical port. We have a custom checksum generation code (in C). I wish to pass this generated CAN message to checksum code to generate checksum byte. In latter stage, I'll send CAN message and checksum byte together over physical port. My problem is, I'm unable to use the generated CAN message in LabVIEW code further. I need help to access this CAN message. How can I generate CAN message (from raw data) for internal purposes ??

NI-CAN provides two "virtual interfaces," numbered 256 and 257. Those two interfaces are directly connected to each other; anything sent over one is received on the other. So, you can send your initial packet over one virtual interface, read it back in over the other virtual interface and generate your checksum, then resend it over the physical port. Take a look at the NI examples, and the section on "Frame to Channel Conversion" in the NI-CAN manual.

Link to comment

Hi.....ned,

Thank you very much....for ur reply. Initially I tried same but with Channel APIs. It didn't work properly. After ur reply I tried with frame APIs. Now It's working fine. Really... this is the only way to workout ??. No direct way....?? If I want to send more than one CAN message at a time then how to workout with this problem ??

Once again Thank you very much,

Ravinder

Link to comment

QUOTE (Ravi0709 @ May 21 2008, 06:38 AM)

I just noticed this library on NI's site, which might help you: the http://joule.ni.com/nidu/cds/view/p/id/884/lang/en' target="_blank">Frame Channel Conversion Library.

I don't fully understand what you're trying to do, but if that NI library doesn't help you, here's what I'd suggest:

Write all your CAN messages, through the Channel API, to virtual interface 256. In a separate loop, wait for messages to arrive on virtual interface 257; read them using the Frame API to get the raw data. Whenever a frame arrives, calculate the checksum (if necessary) and resend it through the physical interface.

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
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.