LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CAN Communication Real-Time data FPGA NI-9853

Currently using CAN communication to communicate with supercapacitors and trying to collect voltage data. When attempting to display the voltage the graph isn't smooth, there are short jumps. Is there a way to smooth out the graph while running in real-time? Is there a way to make the data smoother or is it due to slow reading time? Can someone explain how to read the data faster if that is the issue? 

0 Kudos
Message 1 of 8
(843 Views)

It is usually related to the timing you use to read the data. Share your project and code, then we will be able to provide suggestions for improvement.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 8
(826 Views)

Hi Ryan,

 


@Ryan8542 wrote:

When attempting to display the voltage the graph isn't smooth, there are short jumps.


What is the resolution of the voltage signals of those supercaps?

Mind to share some information (like a DBC file or detailed manual)?

How do you read the CAN messages? How many messages do you receive from your supercap per second?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 8
(806 Views)

ReadWrite.png

FPGA.png

Files.png

   

Download All
0 Kudos
Message 4 of 8
(801 Views)

Hi Ryan,

 

  • you set a samplerate of 40Hz in your RT VI, regardless of samplerate setting in supercap. What's the samplerate setting in your supercap?
  • the manual mentions the conversion factor for those voltage signals in mV/count: you will not get "smoother" values than possible with those scaling factors…
  • the same for the temperature readings, which are given with a factor of 1K/count…
  • have you considered using a FIFO to transfer ALL CAN messages to your RT host?

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 8
(790 Views)

Would changing the sample rate of my RT VI fix my issue and if changing it fixes it how do I change it?

The thing is when I read in it comes out as a cluster and FIFO doesn't seem to work with clusters.

0 Kudos
Message 6 of 8
(780 Views)

Hi Ryan,

 

you can easily parse the CAN message(s) in the FPGA and use a FIFO to send "just" the voltage values (suggestion: pack 2/4 values into a U32/U64 packet) to your RT host. The RT host can then rather easily unpack the U32/U64 data to the resulting 2/4 U16 values and apply the scaling factor to receive the resulting DBL voltage values…

 

The nice thing about CAN messages is their known/pre-defined message formatting: this allows to offload parsing work into the FPGA "for free"!

Best regards,
GerdW


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

Although personally, I don't like to see many wires lying around, I want to give a Kudo for the neat placement of the wires.

 

When it comes to CAN communication, you should bear in mind that it is non-deterministic by nature. What is the sending rate of the CAN frame? The manual states that it is 0 (polling) by default but can be configured for a specific rate.

 

Apart from the latency from the CAN communication, you are using shared variables (which is polling by nature) to send data from cRIO to host VI for displaying. Network communication is again non-deterministic as well. If you want the data to be sent at interval, you should use Network Streams instead.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 8 of 8
(764 Views)