01-27-2012 02:14 PM
I am trying to monitor a Digital input and create an array/cluster that will place the boolean change and time stamp in an array and add to this array each time the change occurs. See attached vi for where I am up to now. It will only record the current change. Thanks for any help.
01-27-2012 04:30 PM
You may be making things too complicated.
1. The case structure causes you to only record data if it is True. Do you want to ignore all the False data? Do you want to record every True point even when the previous point was True? In your post you talk about "change" but you do not attempt to detect changes.
2. The 1-iteration for loop does not accomplish anything. Move the shift registers out to the while loop. Wire straight through the false case (for the same functionality you have now). Move the indicator terminals outside the case structure and connect them to the shift registers right of it.
3. Initialize your arrays to a size as large or larger than the maximum number of data points you will collect. Wire the initialized arrays where you now have the empty constant arrays at the left. Inside the loop use Replace Array Subset to put new data into the arrays. You may need to add a shift register for keeping track of the array index.
4. No need for single element Build Arrays as inputs to the Repalce Array Subset - just wire the element. Also, just use a numeric constant = 1 rather than True constant to Boolean to (0,1).
Lynn