LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic while array

Highlighted

Hi, I was searching in this forum, but I haven´t found an answer for this situation. I have this VI

 

ask.jpg

 

Basically im reading Temperature values each 10 ms from the marked subVI, and what i want to do is to read all of the data and store it in an array, but I dont want the array to be generated at the end of the loop, I want it to be a dynamic array, so I can acces to all the data that has been generated in each iteration.

 

Thanks.

0 Kudos
Message 1 of 4
(430 Views)

Search the forums for the phrases Build Array and Shift Register.

 

You build the array in the loop and store it in a shift register.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

0 Kudos
Message 2 of 4
(428 Views)

You started doing something with build array in the lower part of your code, so you are almost there. Still, you are using way too much code as well as questionable code.

 

I would not initialize the min and max shift registers with 0 and 100, resp. What if all temperature values are negative? What if all are >100? Use +inf and -inf instead to guarantee that the code works universally.

 

You don't really need the "temperatura actual" indicator. you could just show the digital display of the chart.

 

Since you are building an array without any upper limit, you will eventually run out of memory. How long should the VI run?

 

Here's an example how things could be simplified. No case structures, no comparisons, no birds nest of wires.

 

Make sure you study it well and completely understand everything. If this is a school project, you need to be able to fully explain the purpose of every single wire and function. Smiley Very Happy

 


LabVIEW Champion Do more with less code and in less time
Message 3 of 4
(401 Views)

Wow, thanks for both of you, I really appreciate your answers. It works now Smiley Happy

0 Kudos
Message 4 of 4
(377 Views)