07-11-2013 10:07 AM
I need help storing two different measurements into two different arrays. Both are within a state machine in the same case, and I need to place them into arrays so that I can use the two to get a linear fit. The two values are located in the "Calc" case of the state machine. The first is Meas 3 (Sample Average), and the second is ^T. I've tried simply initializing an array and then using the add to array option, but this results in only one value being stored to the array, as with every time through it makes a brand new one-value array, which is not what I need.
The two can be easily identified, as they are in the "Calc" case and each go into icons which display them on the front panel.
I feel like there is a simple solution to this that I am just missing, so any contributions are welcomed.
Attached is the VI, and thank you for all your help.
Solved! Go to Solution.
07-11-2013 10:21 AM
@gbaby wrote:
I need help storing two different measurements into two different arrays. Both are within a state machine in the same case, and I need to place them into arrays so that I can use the two to get a linear fit. The two values are located in the "Calc" case of the state machine. The first is Meas 3 (Sample Average), and the second is ^T. I've tried simply initializing an array and then using the add to array option, but this results in only one value being stored to the array, as with every time through it makes a brand new one-value array, which is not what I need.
The two can be easily identified, as they are in the "Calc" case and each go into icons which display them on the front panel.
I feel like there is a simple solution to this that I am just missing, so any contributions are welcomed.
Attached is the VI, and thank you for all your help.
Have 2 shift registers for the 2 arrays or 1 Shift register for a 2-D array. Use a build array terminal inside Calc to append elements each loop. In all the other cases, just pass the wire through it.
07-11-2013 10:25 AM
I don't see any arrays. Were you trying to store them in a shift register?
What you really want to use is Build Array. Make sure you are appending the new value to the array.
07-11-2013 11:54 AM
I just wanted to say thanks, you two were able to steer me in the right direction. Now I can get stuck on something else!
07-11-2013 11:33 PM
Hi,
Have a look on this state machine example