LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

machine control

Tom,

I've got LV8 running and have had a look at your example. So, it seems straight forward to monitor a range of inout digital lines. What is the Event? A change is state at one of the I/O in the range?That happens a lot as the machine is stepping through it's various states, I guess this structure will execute each time?

So, based on the states I make a decision for program flow. How do I take that information out of the event structure to run other VI's?

Maybe I have to use Queued Messages. I did go over that on the intermedate course, but I'm not comfortable with that technique yet.

LV has had so many great examples that I could learn from (plagerize) that I've grown used to not re-inventing the wheel. I wish there were some examples of how LV can control machine states. The Simple State Machine may be easiest for me try first, but I like the concept of events. Can it be done without Queued Messages?




~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 11 of 12
(557 Views)

Hi Paul-

Yes- several things take place each time any of the indicated lines change.  First, the hardware physically samples all lines in the task and latches values into memory.  In response, the software event fires and we read a single array of booleans that correspond to the new line states. 

The easiest way to interpret the various control signals required for your app is to look at the value of the array and determine some state to execute.  By doing this, you can dynamically choose which state to enter in response to the states on the lines, whatever they may be.  So, you can just look at the binary value returned by the boolean array and execute a case in your state machine based on that value.  This allows you to take advantage of event-driven programming (i.e. non-polling) for better efficiency, but you can still use the state machine-esque architecture you're already familiar with.

Let me know if I can offer any other tips-

Tom W
National Instruments
0 Kudos
Message 12 of 12
(545 Views)