LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CAN bus and cRIO FPGA

Hi,

 

I am currently working on a project with a 3 degree of freedom sensor that uses a CAN bus protocol, and the 11 bit standard base frame format.  I have a cRIO 9014 and a NI 9853 CAN bus module.  I need to send and receive data on one CAN port, to do this I was hoping to use the power port CAN0.

 

I need to send and receive periodic messages from the sensor on startup to put it into the correct mode.  Once the sensor is setup into the correct mode, the sensor will send data every millisecond until stopped.  This will need to be logged to a file for interrogation later.  Each test will have its own results file ideally to make identification easier.

 

I must add that I am new to LabVIEW and am currently working through tutorials and self-paced learning to try and increase my understanding. 

 

I have checked through the NI Example Finder, but I struggling to make progress with those.  I was just wondering if anyone would have any advice on the best way to approach this problem or could point me in the right direction with this.  I want to learn how to use the system correctly but am uncertain at the moment where to start

 

Many thanks for any help

0 Kudos
Message 1 of 7
(6,533 Views)
Hi,

I use the 9853 module all the time with cRIO devices, that's ok.
But I think you should take a different project to learn LabVIEW instead of diving fresh into host, RT target and FPGA programming...
Use all tutorials you can get to learn the basics of LabVIEW and CAN bus!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(6,518 Views)

If you can, follow GerdW's advice, but I understand that it isn't always an option. If you need to start working on this now just take everything one step at a time.

 

First, make sure that you can add the cRIO to a LabVIEW project and compile a VI. Try just adding two numbers on the FPGA. Once you know that you can do that, try running a VI interactively that just reads whatever is on the CAN bus. To get that information somewhere you can save it to file, send it through a target to host DMA FIFO. Don't worry about doing anything with the data, just read it to make sure you are receiving the correct data from the FPGA. Once you know that you are receiving the data you need, try saving it to a file. Although long, the link below is a very good resource. If you run into any roadblocks, show us what you have tried.

 

http://www.ni.com/compactriodevguide/

Matt J | National Instruments | CLA
0 Kudos
Message 3 of 7
(6,480 Views)

Hi GerdW/Jacobson,

 

Many thanks for your advice on this.  I will certainly try and follow your advice by starting off with something simple.  My main restraint unfortunately is time; I need to get the system up and running relatively soon.  So that I can start my testing, but I will have to see how I get on.

 

Just so that I know what I am up against, for someone who is conversant in LabVIEW and FPGA etc., how long would this take to develop?  Are we talking a few hours or a few days/week?  I know this is a bit of an open question but it would just give me an idea of what I am up against.

 

I've got the cRIO working with a LabVIEW project and can compile a VI.  I had a practice of this earlier, with one of the example problems supplied.

 

Kind regards

0 Kudos
Message 4 of 7
(6,468 Views)

If you are familiar with LabVIEW and cRIO, you can start your development with one of the example projects provided for NI 9853 module. It will give you some idea on how to work with the module and communicate with other devices with CAN protocol.

 

The project can be found in examples while searching for 9853 module examples (LV project name is "CAN Basic").

 

Thanks,

Arev

 

CTO | RAFA Solutions

 

Certified-LabVIEW-Embedded-Systems-Developer_rgb.jpgCertified-LabVIEW-Architect_rgb.jpg

0 Kudos
Message 5 of 7
(6,453 Views)

Hi LR,

 

how long would this take to develop?  Are we talking a few hours or a few days/week?

Well, if I would have to do this: I would take one of my current projects involving cRIO+CAN, adapt the CAN message generation/analysis part and would be done within some hours.

 

But if I would need to start from scratch, including learning how to handle CAN with 9853 on cRIO, it could easily take weeks…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(6,439 Views)

Well I've been doing LabVIEW for 10+ years, I have no existing projects to start from that is similar to this.  I'd say a weeks for me to get it going assuming all hardware were available (I got nothing on GerdW), and then maybe a few days to debug, work on any testing, and other integration issues.  There are 15 week college courses on just using LabVIEW on Windows.  I'm not saying you need to take that long to get up to speed, but one shouldn't be surprised if it takes multiple months to get things done, and done right.

0 Kudos
Message 7 of 7
(6,368 Views)