LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array sequence

Hi,

 

I'm relatively new to Laview and would be open to any advice with a small project which I've assigned myself to experiment with arrays, clusters, etc., At this moment in time, I have an array with data read from a specified file path - the data from this file is in the 2D array which displays the information regarding the sensor values - in the left hand side column the period is displayed with the corresponding sensor value being read in the right hand side column.

 

Now the issue I'm having is that I cant think for the life of me how to get the array to follow the sequence continuously without setting the desired column and row number - I want the program to automatically go through the sequence of period with the sensor value continuously until stopped, for example when the period is 10, it should display this on an indicator with the sensor value in the column next to it. The system should automatically go through the sequence and return back to the first number and continue...

 

If there is any suggestions on how I can get my array to follow the sequence then I would appreciate it a lot. 

 

(The photo shows what I have up to now, I have to manually input the row and column number and cant find any information on how I'm supposed to set this automatically. Thank you.)

0 Kudos
Message 1 of 4
(1,986 Views)

Hi,

 

I'm relatively new to Laview and would be open to any advice with a small project which I've assigned myself to experiment with arrays, clusters, etc., At this moment in time, I have an array with data read from a specified file path - the data from this file is in the 2D array which displays the information regarding the sensor values - in the left hand side column the period is displayed with the corresponding sensor value being read in the right hand side column.

 

Now the issue I'm having is that I cant think for the life of me how to get the array to follow the sequence continuously without setting the desired column and row number - I want the program to automatically go through the sequence of period with the sensor value continuously until stopped, for example when the period is 10, it should display this on an indicator with the sensor value in the column next to it. The system should automatically go through the sequence and return back to the first number and continue...

 

If there is any suggestions on how I can get my array to follow the sequence then I would appreciate it a lot. 

 

(The photo shows what I have up to now, I have to manually input the row and column number and cant find any information on how I'm supposed to set this automatically. Thank you.)

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

Hi Climerator,

 


@Climerator wrote:

Now the issue I'm having is that I cant think for the life of me how to get the array to follow the sequence continuously without setting the desired column and row number - I want the program to automatically go through the sequence of period with the sensor value continuously until stopped, for example when the period is 10, it should display this on an indicator with the sensor value in the column next to it. The system should automatically go through the sequence and return back to the first number and continue...

 

If there is any suggestions on how I can get my array to follow the sequence then I would appreciate it a lot. 


Use a FOR loop to (auto-)iterate over the rows of your 2D array.

(This is pretty basic LabVIEW stuff, so I suggest to take the "Training resources" offered in the header of the LabVIEW board!)

 

Why do you need a "Sensor profile" local variable? (You have a big race condition!) Use a wire instead!

Best regards,
GerdW


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

LabVIEW is set up to do indexing of arrays into loops.

Disable that  and use the   i  of the loop to index into your array instead.

0 Kudos
Message 4 of 4
(1,962 Views)