04-10-2025 08:48 AM
Hello,
I'm new to LabView and came across this problem which I hope is very easy to someone more experienced. I am to read a changing value (like from a temperature sensor but in this case a random value from the outside) and save it to an array.
I tried auto-indexing the values as well but every reading comes out as the same.
What can I do to save the unique number to the array per every iteration of the while loop?
Many thanks in advance.
Solved! Go to Solution.
04-10-2025 09:23 AM - edited 04-10-2025 09:24 AM
You are reinitializing an array every iteration of the while loop. Moreover, you change its size every iteration.
To add a value to an array while keeping previous values, use a shift register:
04-11-2025 02:25 AM
Hi rad,
@asciirad wrote:
I tried auto-indexing the values as well but every reading comes out as the same.
You already got a solution…
Now look at your own VI again: it does exactly what you have it programmed to do…
So try to understand your own VI:
You should enhance your LabVIEW training (atleast) in two areas: "THINK DATAFLOW" and "array handling"!
04-11-2025 05:38 AM
Thank you for your solution, in the end it all comes down to thinking outside the box. 🙂
04-11-2025 05:49 AM
Hi rad,
@asciirad wrote:
Thank you for your solution, in the end it all comes down to thinking outside the box.
No, in LabVIEW it still is "THINK DATAFLOW!"…
04-11-2025 08:57 AM
@asciirad wrote:
Thank you for your solution, in the end it all comes down to thinking outside the box.
The box is defined by the rules of dataflow and you should think inside that. I also recommend to "just follow the wire!"
A useful tool is execution highlighting. Just click on the lightbulb and then run your VI while watching the diagram. You'll see exactly what is happening. 😄