LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting an array out of a State machine

Attached is an image of my block diagram.  My question is about the "Data" array that comes out of the state machine.  The way I have it wired right now, it looks like I am going to get a 0 value passed through to the array whenever it hits the other states (there are 2 other states that don't have the dvm taking a measurement).  Am I worried over nothing or is there a better way to get the data out of the state machine?

 

The state machine basically preforms a frequency sweep that starts at 10 Hz (the constant starts right under the "Send" string) that is multiplied by 1.01 until it hits the limit of 5 kHz (handled in another state).  If the current frequency is under 5 kHz, the state machine keeps running, otherwise it goes to the complete state.  Maybe the best way to do this is to build the array inside the state machine and then pass all the data out after it is finished?  Let me know what you think. 

0 Kudos
Message 1 of 2
(2,521 Views)

You could use a shft register instead of auto indexing exit to while loop.  Inside the SEND case make the reading and add the value to the array using bulid array.  For the other cases where no readingas are taken just wire the array straight through

 

Ken

Message 2 of 2
(2,512 Views)