LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write CAN data to array problem

Hi,

 

Ive attahced my .vi file to show my current state.

 

I revieve CAN messsages of 8 byte in length, this message contians address and data which i'm trying to place in a 2d array, row and column respectively.

 

So the address and data bytes are concatonated and the 16 boolean data bits are then read and if it is true then the address is used to select the row in the array and the column is selected via i, this element is then incremented.  If the boolean bit is false then nothing is done.

 

To me this should work but the array does not retain any data and it is not seen in the indicator array.

 

Can anyone show me what i'm doing incorrectly, as the array is not accessed when there are no true bits then the array should remain intact.

 

cheers!

0 Kudos
Message 1 of 4
(2,901 Views)

I think you need a shift register to hold your latest numeric array.  You are currently only updating values from the initial array and never updating.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4
(2,890 Views)

Hi, thanks for the tip, it worked perfectly, but only for one array, I've since tried to expand the project for multiple arrays but its stopped working.

 

I've attached the updated file.

 

All are set with shift registers and as use default unless wired, so unless the array is accessed, they shoud be passed through un-edited. 

 

So I'm not sure why it stops working, the .csv files at the end are blank.

 

cheers!

0 Kudos
Message 3 of 4
(2,777 Views)

Hello, I didnt' look at your code but I think I know the problem.  If you select us default if unwired, it does not pass through the data.  You need to select the tunnel and select link to input tunnel and wire to unwired cases.  Then you're data will flow through.  Good luck.

0 Kudos
Message 4 of 4
(2,771 Views)