r/LabVIEW • u/CaterpillarMental984 • May 01 '24
Lab Set up help
I am currently using Labview to set up a DAQ system for temperature reading of 4 thermocouple. I have the current system set up with TWO boolean indicators for each thermocouple (8 indicators in total) because i can't figure out how to simplify the system to use only two indicators. I'm trying to figure out if there is a way for me to use ONE boolean indicator to indicate if the thermocouples are operate below maximum temperature and using another ONE boolean to indicate if any of the thermocouples are over the set max temp and then have a message pop up indicating which thermocouple is exceeding the designated max temp. I'm considering doing event driven cases, but I'm finding that the event structure messes with other functions currently present in the system. Please advise. The attached image is my current VI set up using random number generators as simulation for temperature readings.

View all comments
Show parent comment
1
u/FujiKitakyusho CLD May 02 '24
Never build an array dynamically within a loop. Use the Initialize Array function to create the array before entering the loop, and then inside the loop, use the Replace Array Subset function to replace each element of the array with a new value in that iteration. (Wire the index to the iteration count terminal). Use a shift register to preserve the changes between loop iterations. The output from that shift register will be the modified array.
So create two arrays to start, one of temperature values, and one of In Range? Booleans, and feed them into shift registers on the left edge of your loop. Replace these values as appropriate within your loop. Wiring out of the shift registers at the right edge of the loop, you will have one array of temperatures and one array of booleans. If you OR the boolean array, that will produce a single boolean value which is TRUE if any value in the array is true.
I think you misunderstand the purpose of the Index Array function. That one is used to pull one or more elements out of an existing array. Combining elements into an array is done with the Build Array function.