Ravi0709 Posted May 21, 2008 Report Share Posted May 21, 2008 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 Quote Link to comment
ned Posted May 21, 2008 Report Share Posted May 21, 2008 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. Quote Link to comment
Ravi0709 Posted May 22, 2008 Author Report Share Posted May 22, 2008 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 Quote Link to comment
ned Posted May 23, 2008 Report Share Posted May 23, 2008 QUOTE (Ravi0709 @ May 21 2008, 06:38 AM) 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 ?? 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. Quote Link to comment
Ravi0709 Posted May 24, 2008 Author Report Share Posted May 24, 2008 Hi...ned, Thank you very much......what you have understood was absolutely right.ur solution works correctly for my problem. Thank you...... Ravinder Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.