From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

CAN module with VeriStand

Hello everyone, 

I'm new to VeriStand, but at first wanted to use the NI 9853 CAN module in the scan mode, but then I figured out it is not supported and I have to use the FPGA mode. Can anyone confirm that the module is actually compatible with NI VeriStand FPGA module, and that I would be able to read the CAN bus data in VeriStand. Can anyone guide me on where to start looking for some example in that manner? 

Thanks in advance 

0 Kudos
Message 1 of 5
(2,080 Views)

NI VeriStand only natively provides support CAN for NI-XNET driver.

NI 985x is programmed using NI-RIO driver thus it is not natively supported under VeriStand. See NI 9853 and 9852 with CompactRIO FAQ. It is possible to create your own custom device but I would recommend to use NI-986x which is programmed using NI-XNET driver. See Do I Need to Compile a Blank Bitfile for NI-XNET in VeriStand.

Senior Technical Support Engineer | CLD CTA | NI


DISCLAIMER: The attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

0 Kudos
Message 2 of 5
(2,016 Views)

I realize this is an old thread but I'm facing the same challenge.

I need to get a CAN module working on a cRIO-9039 chassis on very short notice and all I have available on-site is a NI-9853 module.
I'm aware of the XNET capability of the 986x modules but unfortunately ordering one would delay the project to much, so I'll have to make do with what I've got.


As I understand it, I'll need to add some code in the FPGA bitfile to read/write CAN frames from the bus and send/recieve them to/from the controller. Then, I'll need a custom device that converts the CAN frames to/from Veristend channels, using a DBC file. Right?

 

Is there any Example code/documentation/guidance available that could help me get started and hopefully bring this to a successfull result?

0 Kudos
Message 3 of 5
(1,509 Views)

This does sound like a pain.  I have used one of those C Series modules, with an R series FPGA card, and an expansion chassis, to read CAN frames.  There was an example in the Help >> Find Examples that showed how to do it.  I don't remember the details but it created a DMA buffer both to and from the FPGA card that CAN frames were put on as an array of bytes.  Then the host needed to convert those back into raw frames.  If you need to then convert those to signals, you can use XNet.  I created some example code on how this can be done here.

 

It all sounds possible, but I'm less familiar with the VeriStand side so I don't know what limitations you'll run into.

0 Kudos
Message 4 of 5
(1,496 Views)

Hi Pianne,

I would recommend you to refer to the shipping examples at Example Finder >> Hardware Input and Output >> CompactRIO >> Module Specific IO >> CAN >> 985x with NI-XNET

You can also refer to Protection-and-Counter-Addon as a starting point for the custom device.

Senior Technical Support Engineer | CLD CTA | NI


DISCLAIMER: The attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

0 Kudos
Message 5 of 5
(1,495 Views)