LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I determine whether to use an event structure or a case structure?

Solved!
Go to solution

I'm starting a large project and need a state machine. I can't decide on whether to use a case structure or event structure. Is there an article  or other information that describes criteria for selecting between the two approaches?

 

Thank you,

Chuck

0 Kudos
Message 1 of 4
(3,083 Views)
Solution
Accepted by topic author chuck72352

Normally a state machine is implemented with a case structure. It's possible to implement it with an event structure, but it's not the way I'd go. I think the two articles you really want to read are:

Application Design Patterns: Producer/Consumer

Application Design Patterns: State Machines

Message 2 of 4
(3,076 Views)

Hi Chuck,

Well case structures and event structures differ quite alot.  Here's a link for indepth information on Event Structures, and using them in state machines: http://zone.ni.com/devzone/cda/tut/p/id/2962.  Hopefuly this will help you make up your mind.  

Let me know if you have any questions after reading it. 

 

Regards,

Dominic Walker
Cardiff University
Electrical and Electronic Engineering Student
Message 3 of 4
(3,068 Views)

Chuck,

 

You may actually use both event structure and case structure, i.e., put an event structure in one of the case structure of your state machine to watch for user events such as front panel events. I also found it useful to have two parallel state machines with one to handle time consuming states and the other to handle easy states so that user interfaces are very responsive. Just my 2 cents.

 

Regards,

Bryan

Message 4 of 4
(3,035 Views)