Assignment
Modify your temperature-monitoring VI so that the time and temperature data is stored in a two-dimensional array that is visible on the screen and updated as each new point is acquired. The array should have four columns: Time, Celsius T, Kelvin T, and Fahrenheit T.
Download
Working version of VI (no block diagram access)
Textbook sections
Arrays and auto-indexing (pp. 88-91)
Initializing arrays (p. 294-296)
Programming hints
Creating a data array is easy, especially with the autoindexing option on While and For loops. But this assignment is made more difficult by the requirement to update the array as new data points are acquired. I would begin by placing a shift register on the While loop and using the Initialize Array function on the Array palette to initialize the shift register as a 2-D array with all elements equal to zero. (Make sure to expand the Initialize Array function icon downward to make it 2-D instead of the default 1-D.)
Select the Build Array function from the Array palette, place it inside the While loop, and expand it to show 4 inputs. Wire the elapsed time to the top input, Celsius T to the second, Kelvin T to the third, and Fahrenheit T to the fourth. This creates a single 1-D array off all four values.
Now we need to turn the 1-D array just created into a new row in the 2-D array in the shift register. Select the Insert Into Array function from the Array palette, place it in the While loop, and expand it to 2-D. Wire the left shift register into the array input of the function. Then wire the Loop Iteration counter from the While loop to the index (row) input. (This will make the first set of data the first row in the 2-D array, the second set of data becomes the second row, and so on.) Next, wire the 1-D array created above to the new element/subarray input. Finally, wire the output of the array to the right shift register. This assures that the updated 2-D array will be updated again on the next iteration of the While loop.
Front panel (example)