LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting element into an array

Hi,

 

I am a new user to LabVIEW so this question might seems dumb, but I really appreciate with your help.

The file attached is a simplified version of what I am trying to do.

 

I am using an IR temperature sensor to measure temperature (represented by Random Value Generator in the attached program). Once the temperature reaches peak value, then the peak temperature should insert into an array. The array doesn't have a fixed size, and it should save the previous peak temperature and keep insert new values along the way.

 

The problem I am struggling here is that although the temperature is keep updated, it is only updating the first element in the array. I tried to debug it using probes placed in different location, and I found the Shift Register is not working for some reason.

 

Notice: Due the some restriction, the temperature (Random Value Generator) has to keep outside of the For Loop.

 

Please let me know what I am doing wrong here.

 

Thank you very much!

 

 

 

0 Kudos
Message 1 of 3
(1,223 Views)

Hi,

 

Still using LV 2015&LV 2017, So please do share the files in LV 2017.

 

Based on your requirement you can use Build array, where new spike will get appended in the array (use shift register to hold array values)

 

----------------------------------------------------------------------------------------------------------------
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 2 of 3
(1,178 Views)
  • Get rid of the inner loop.
  • Anchor the shift register on the outer loop
  • Don't maximize the front panel and diagram to the monitor. Annoying.

 

Here's a quick draft. Place the "built array" in a case structure if you only want to add a value under certain conditions and wire the array across in the other case. Make sure to define a reasonable loop rate. Note that if this runs forever, you will run out of memory eventually.

 

altenbach_0-1634807321914.png

 

0 Kudos
Message 3 of 3
(1,172 Views)