LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Initialize and Index real time data into 2D array

Hello Everyone,
I am trying to index multiple rows and columns into 2d array  
My program consists of real-time data streaming through the com ports (VISA), running in a continuous while loop. I was hoping someone could help me with the following:


1) How do I initialize a 2D array of 16 rows and 16 columns
2) How to I index this array and represents the rows and columns
3) How do i present my data over an intensity graph within specific dimensions  (please check the difference between graph 1 and 2).

Most examples I find to create rows and columns of arrays use random number vi embedded INSIDE a for loop, then auto-indexing it. However how do I index my data through rows and columns. I tried to index and i know that my VI is Spaghetti, but i indexed only one row, cause when i tried to index a column the VI breaks.

 

I'm reading my data from Arduino UNO with 9600 baud rate. 


It would be great if someone could help me out because I have tried countless ways to create my array  

Thank you!

0 Kudos
Message 1 of 18
(4,035 Views)

Hi N.,

 

unfortunately I cannot open your VI because of its LabVIEW version, but the answers to your 3 questions are quite simple:

check.png

Question 1 and 2 are asking for very basic LabVIEW stuff: did you take the free online resources to learn LabVIEW?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 18
(4,030 Views)

GredW,

 

the answer for your question, i'm learning from youtube and i'm trying. but when it's coming to real time i'm having those problems. 

please check the VI .

 

the pic represents first two questions

Download All
0 Kudos
Message 3 of 18
(4,019 Views)

Hi N.,

 

I'm limited to LV2014 (as indicated in my signature).

And before posting images of a block diagram you should use the AutoCleanup tool to unbend all those wires…

 

Why do you need to initialize those arrays in each loop iteration again?

 

i'm learning from youtube

This is bad behaviour (IMHO) - why don't you use those free lessons offered by NI?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 18
(4,015 Views)
0 Kudos
Message 5 of 18
(4,009 Views)

Mr. GredW,

 

thanks for the learning link, haven't knew about it before. i'm already in. 

 

regarding the VI, what i'm trying is, represent each column and row in the intensity graph and that's will help me to detect the resolution. 

but when i tried to do columns and rows in the indexing array, my VI start to break. 

 

 

 

Regards,

0 Kudos
Message 6 of 18
(4,003 Views)

Hi N.,

 

see this snippet:

check.png

You need to learn how tu use shift registers and the proper array functions…

 

Btw. I'm pleased when people spell my nickname correctly… 😉

Best regards,
GerdW


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

GerdW 

thanks for your reply, but still not working 

check the attached pic please 

0 Kudos
Message 8 of 18
(3,976 Views)

Hi N.,

 

LabVIEW will tell you why the run arrow is broken!

 

If you would use AutoCleanup more often I would be sure to spot the problem - so I can only guess.

But I'm sure LabVIEW will tell you the exact problem… 😄

Spoiler
The error message will say something about the shift register…
Best regards,
GerdW


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

Hello GerdW,

first of all thanks for your advices till now.

 

I have couple of question if you don't mind. 

 

1- i used index array function to specify my data, but why my columns are disabled and i can't send the data to them ?

 

2- i build a 3rd intensity graph, through the process , this graph display the results only once, how can i make it read the data all the time similar to the 1st and 2nd graphs. ?

please check the attachment. 

 

 

PS: thanks for the link regarding the labview training. 

 

 

 

 

many thanks.

0 Kudos
Message 10 of 18
(3,923 Views)