Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading CAN with cRIO

Solved!
Go to solution

I´m begin a application to read CAN with the NI 9853 and NI 9852 Modules, but I´m having a problem to transfer the information to the Real-Time module. I made this VI to transfer the CAN information to a FIFO in the FPGA module:
FPGA-1.JPG

 

I can see in my probes ("Mod2/CAN0" and "Mod1/CAN0") that the information is being read. So I made this VI in RT to read and show the information:

RT-1.JPG

 

But when i RUN the system the information doesn´t appear in "Data". The information flash sometimes but allmost all the time there is no information "Data", and when the information is read it desapear after a few seconds. Any ideas?

 

0 Kudos
Message 1 of 6
(6,138 Views)

Good afternoon, MarcusBianchi,

 


Please check these links help you in your application to do some tests. Any questions please contact us.

 

How to Use 985x CAN C-Series Modules with a cRIO VxWorks Controller

http://digital.ni.com/public.nsf/allkb/804FC636F172426A8625729F00185149?OpenDocument

 

NI 9853 and 9852 with CompactRIO FAQ

http://digital.ni.com/public.nsf/allkb/511639E8C5ED353686257538005EB4A9?OpenDocument

 

NI-985x Write and Read on One CAN Port

http://digital.ni.com/public.nsf/allkb/511639E8C5ED353686257538005EB4A9?OpenDocument

 

CANopen Basics for cRIO

http://zone.ni.com/devzone/cda/epd/p/id/5474


Sincerely,

Mauro Vera
Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(6,109 Views)

You might need to insert an FPGA I/O Method Node for your CAN channels using the Reset function. So my CAN loop in the FPGA code has the typical timed loop in the first frame, then the reset, then the regular acquire loop containing a read - wait - write - wait sequence. I found that improved connectivity tremendously.

Adrian C. Keister, Ph.D.

Certified LabVIEW Architect
Certified Professional Instructor

B.S. in Applied Physics/Computer Hardware and Software Systems, Mathematics, 2001, Grove City College.
M.S. in Mathematical Physics, 2004, Virginia Polytechnic Institute and State University.
Ph.D. in Mathematical Physics, 2007, Virginia Polytechnic Institute and State University.
0 Kudos
Message 3 of 6
(6,073 Views)

After some tests I was able to read the CAN0 entrance from the NI-9853 Module, but I couldn´t read the CAN1 of the same module or any of the entrance from NI-9852. My code is this:

FPGA-2.JPG

Mod1 is a NI-9853 and Mod8 is a NI-9853. The others are NI-9211 Modules.

But I still got no information in Mod8/CAN0. I´m using NI CAN DemoBox to test the program.

 

0 Kudos
Message 4 of 6
(6,065 Views)
Solution
Accepted by topic author MarcusBianchi

CAN0 and CAN1 are powered differently. Have you taken that into account in your wiring? I believe CAN0 is powered internally to the NI card, but CAN1 must be powered externally. Also, the 9853 and 9852 work at different speeds. Have you taken that into account?

Adrian C. Keister, Ph.D.

Certified LabVIEW Architect
Certified Professional Instructor

B.S. in Applied Physics/Computer Hardware and Software Systems, Mathematics, 2001, Grove City College.
M.S. in Mathematical Physics, 2004, Virginia Polytechnic Institute and State University.
Ph.D. in Mathematical Physics, 2007, Virginia Polytechnic Institute and State University.
0 Kudos
Message 5 of 6
(6,062 Views)

I was taking that in to account, but I saw in the NI CAN DEMOBOX the exit was already powered. When I checked with a multimeter my surprise was that the exits AREN´T powered, so the manual is worng or my DemoBox is broken. Anyway thanks for the help.

0 Kudos
Message 6 of 6
(6,057 Views)