09-22-2022 08:35 AM
I managed to sort out the Drivers by reinstalling the NI CAN and selecting LABVIEW 32 bit
I managed to monitor traffic in the CAN network using NI MAX, and CAN bus monitor. Below are the results.
NI MAX Bus Monitor
I am trying to replicate this on the LABVIEW. I will develop the logic to decipher from HEX to readable values with signal names.
But the issue now is that I can't see all of the Arbitration ID some ID's repeat. Not sure if it's my array size that is wrong or what.
My LABVIEW VI Attempt
09-22-2022 09:01 AM
Hi Kulani,
@Kulani93 wrote:
But the issue now is that I can't see all of the Arbitration ID some ID's repeat. Not sure if it's my array size that is wrong or what.
In the bus monitor you see the "sample rate" of those messages: they vary from ~20 to ~200Hz!
So why do you wonder you receive the same ArbID repeatedly?
You have initialized the array size to "31 rows" and there are 31 rows shown on your UI. Coincidence?
Btw. what kind of ECU is this? (Which vehicle?)
09-22-2022 09:27 AM
Wow yes, you are right, the CAN messages are at different speeds.
I am reading random signals just to check if the hardware works.
We are using the OpenECU M580 by Pi-Innovo to use a controller for our control system that we are developing.
I have just set the array size to what I saw would be monitor.
What would be the correct logic to read these CAN messages?
09-22-2022 09:36 AM - edited 09-22-2022 09:44 AM
I can see now that if I am reading at 200 Hz or every 5 ms, I get 4 signals in the array because they are the ones updating the fast, then as soon as the 2nd fastest signals broadcast, they get append in the array as well and so on.
So the way I have designed my VI, will not allow me to see them as in the Bus Monitor.
Not sure what to do now.
Edit: I also have my Attribute block to Read Entries Pending. Which might prioritize faster signals.
09-22-2022 10:12 AM
Hi Kulani,
@Kulani93 wrote:
So the way I have designed my VI, will not allow me to see them as in the Bus Monitor.
Your VI only shows the latest messages.
The busmonitor shows the value of the last message per ArbID and some statistics, like number of received messages per ArbID and their rate. This is different/more than your VI is doing right now…
09-22-2022 11:02 AM
Thank you much.
How can I make work similar to the Bus Monitor? Make it show and keep the last message per ArbID?
09-22-2022 11:41 AM - edited 09-22-2022 11:42 AM
@Kulani93 wrote:
Thank you much.
How can I make work similar to the Bus Monitor? Make it show and keep the last message per ArbID?
The Producer/Consumer example is what I would recommend.
But in general to do a scrolling Table (a Table in LabVIEW is just Fancy String Array) you need to use shift registers on your loop and Build Array to append each iteration to the Table (array).
Don't forget to limit the maximum Table (array) size or you will end up with a memory leak as the Table (array) grows.
09-22-2022 01:16 PM
I struggle to recognise some of the APIs used in Indexing the enquired data.
Would you be able to upload your VI for me to see?
09-22-2022 02:27 PM
Sure, here's one for a Toshiba lithium ion battery pack.
It requires the NI-CAN package to be installed.
10-06-2022 01:15 AM
Hi all.
I am using the USB 8473 and Frame API (instead of CAN API) because it seems to be the one with the most support by my device.
I need to be able to decode the data from my can line, and I saw that I can just config this on NI MAX CAN Channel properties. Link:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000PAMISA4&l=en-ZA
How do I then integrate this into my VI?