LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

State machin and array

Solved!
Go to solution

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

Download All
0 Kudos
Message 1 of 4
(2,688 Views)
Solution
Accepted by topic author coralie38

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4
(2,671 Views)

Also lose the giant flat sequence you have surounding everything. You don't need it.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 4
(2,630 Views)

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

0 Kudos
Message 4 of 4
(2,584 Views)