LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

State machine for data logging

Solved!
Go to solution

Hello, I am learning a state machine for data acquisition purposes so I developed a code that will be similar to my system. I have 4 states ( Initialization, Acquire, UserResponse, and Stop). I want to be able to build an array from the initialization and acquire states into the same row. At the moment, my array is plotting all my states (shown in the picture) I would like my Initialization and Acquire code to display in the same row... In the excel picture is the intended goal. Any recommendations?

 

Thank you so much!

Download All
0 Kudos
Message 1 of 5
(1,332 Views)
Solution
Accepted by topic author kepham
  1. Move both of your Build Arrays to the inside of the Acquire Case
  2. Move your Switch Boolean, 1 & 0, and your Random Number VI to the Acquire Case as well
  3. Remove the double scalar wires (thin orange wire) to the left of the case structure. Those aren't needed now.
  4. Wire the Select & Random Generator VI to the top and bottom inputs of the first Build Array function
  5. Take the output of the first Build Array and wire this to the lower part of the 2nd Build Array.
  6. Take the 2D wire and plug this into the top of the second Build Array function.
  7. Wire across the 2D array wire through the other case statements.

That should be it. Give it a try and see what you get.

0 Kudos
Message 2 of 5
(1,313 Views)

One other thing, get rid of that while loop inside one of the case structures. It's not needed.

0 Kudos
Message 3 of 5
(1,308 Views)

Have you looked at the finite data acquisition project template?  I think that would be a better starting point. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 5
(1,294 Views)

Hi, where could I find this? I have been looking for something similar to this and couldn't find it.

0 Kudos
Message 5 of 5
(1,290 Views)