01-13-2017 05:45 AM
Hello
I started to develop a Labview program using a state machine. I would like to know how to fill an array in one of the states of a state machine.
My program works as follow:
- Initialization sequence
- Machine state sequence
- Close sequence
One of the state is the aquisition state. For now, I only added the aquisition part for 1 sensor to test the program at first.
At each loop, a cluster is updated with the aquired data (the cluster is defined as a a type definition .ctl file). The data type updated in the cluster is a numeric.
Now, i would like to know how to process to store aquired data in an array, incremented inside the state machine . I was thinking to modify the data type inside the cluster and turn it into a numeric array but it does not work.
Do you have any suggestions?
I enclose the program main.vi and the data.ctl.
Thanks,
Coralie
Solved! Go to Solution.
01-13-2017 06:08 AM
Unbundle By Name to get your array out of your cluster, Build Array to add an element to it, and then Bundle By Name to put the updated array in the cluster. Alternatively, you can use an In Place Element Structure to do the Unbundle and Bundle.
01-13-2017 09:37 AM
Also lose the giant flat sequence you have surounding everything. You don't need it.
01-16-2017 09:41 AM
Hi,
Thanks for your reply. It works perfectly and moreover I learnt the use of In Place Element Structure which I did not know before!
Coralie