LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Store readings in an array using loop and time elapsing.

Solved!
Go to solution

Hi,  

I'm trying to save readings that are being received from Firebase to LabVIEW every 3 seconds with 150 Readings,

 

my problem is that while I'm trying to store the data for 1 min to be saved into an array I created a while loop with time elapsed 1 min but the values are not being stored! can anyone help?

 

The array must delete the previous min values and store the next min continuously.

   

Ahmedsoma_0-1681246503050.png

0 Kudos
Message 1 of 7
(1,188 Views)
Solution
Accepted by topic author Ahmedsoma

You need to use a shift register to store the data.

ZYOng_0-1681257218535.png

 

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
0 Kudos
Message 2 of 7
(1,160 Views)

Thank you for the response, I tried it but I have some questions.

 

1- The input data is array size 150 and every 3 seconds 150 readings are sent example for when the time elapsed is 9 seconds 450 readings must be stored, so which type of array is suitable to store the readings?

 

2- The readings in array2 (the pic attached) values are deleting directly how can I make it hold it until the next loop?

 

3- The array size should increase with 150 readings each time but in the code, it starts from 150 which is correct, but it increases by 1 reading after that why is that?

 

 

Ahmedsoma_0-1681263469401.pngAhmedsoma_1-1681263526903.png

 

 

 

 

 

0 Kudos
Message 3 of 7
(1,143 Views)

Based on the attached VI Once the IR Measurements are done it enters to Loop where it will close only when time gets elapsed, It that case it wont Measure new IR values.

I recommend you use state machine and using shit register you can store the Array using Build array and and Initialize to empty when time elapses (Build Array Not recommended for large array size)

 

Also use state Machine architecture to achieve your requirement easily.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 7
(1,114 Views)

Check out the attached VI, where i made a skeleton using state machine.

 

You can work on top of this.

 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 7
(1,105 Views)

Thank you for your help tried with the first solution sent and it is working.

0 Kudos
Message 6 of 7
(1,091 Views)

Thank you, this was helpful I just adjust the "False" condition and also I used a collecter to store the data.

Ahmedsoma_0-1681305057047.pngAhmedsoma_1-1681305073679.png

 

0 Kudos
Message 7 of 7
(1,090 Views)