LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically passing data into a running while loop from a DAQ assist. in an ouside while loop

Hello,  I'm currently a student working on a senior project and I'm trying to do a state machine that will turn off and turn on a compressor depending on time and coprocessor failure. 
 
In the run state, wich is #1 on the case structure box I placed the DAQ assist.  Which takes in data from an accelerometer.  If the accelerometer's value is above the limit four times it will end the loop or if the time runs out it will end the loop. 
 
The problem I am having is that i need to run four compressors.   I was thinking about having four case structures all within the outside loop, but I can only have the DAQ assist in one location.  This means that I now have to move the DAQ assist out of the run loop or run all four compressors in the one case structure.  If i remove the DAQ assist.  I can only get it take in data once when the loop starts and never again.  I understand why, but is there a way to dynamically pass data froma  DAQ assist.  into a running loop? 
 
Also on a side note, i can't find a tutorial on how to really create a state machine using Enums.  Does any one know where to find this. 
 
I have attached my curent program.
 
Thank you for your help,
 
Ryan
0 Kudos
Message 1 of 5
(2,989 Views)
in labview choose file->new... then pick standard state machine and there are instructions.
 
you can create a custom control and either use an enum, text ring or menu ring.  Edit the values and then save the control and drop into your vi and you can wire this to your case structure
- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 2 of 5
(2,980 Views)
to pass data to parallel loops try using queues 
 
again go to file->new...->producer/consumer to start with

Message Edited by James R on 03-30-2007 12:01 PM

- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 3 of 5
(2,978 Views)

Thank  you James R.   I found the two Vi's that you were talking about.   I don't really understand the producer/consumer program,  but i will do some more research on this. 

 

Regards,

 

Ryan

0 Kudos
Message 4 of 5
(2,968 Views)
Ryan-

The producer consumer template is essentially two loops communicating with queues. The first loop generates (produces) data and places it into the queue and the second loop takes data out of the queue for processing (consumer). This model is used a lot when trying to communicate between loops. Let us know if you run into any problems.

Xaq
0 Kudos
Message 5 of 5
(2,935 Views)