LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure state machine

The event structure subscribes to the registered events, if any of those happens it'll run. This includes the timeout event which'll auto generate after the wait time. I'd set 10 or 100 as fixed timeout to have a responsive program which still will be calm and wait for the events.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 11 of 18
(820 Views)

@rcote1 wrote:
Yes, that's what I did, but its the Timeout event that decides if its goig to be a 0 or -1 that the Timeout terminal takes. My question is, how does the timeout event gets notified of any event that need to be handled?

Why would the timeout case determine its own timeout?  That makes no sense to me.  The timeout should be determined based on what actions you are performing.  So it should be the button presses that determine the timeout.

 

Can you post some code so we can see where you are at?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 12 of 18
(812 Views)

Is there a way to prioritize the other events if they happen instead of the Timeout event. I use a Timeout of 0 and if there are other events I would like them to be handled first. That would truly simplify.

0 Kudos
Message 13 of 18
(799 Views)

Producer/Consumer.  This thread is going down a path that is not following best practices.  Handling the events in the same loop as the state machine makes no sense to me.  Separate the two.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
Message 14 of 18
(795 Views)

Here is my program.

 

Richard

0 Kudos
Message 15 of 18
(785 Views)

@rcote1 wrote:

Is there a way to prioritize the other events if they happen instead of the Timeout event. I use a Timeout of 0 and if there are other events I would like them to be handled first. That would truly simplify.


If there is an event in the queue, the Timeout will not be selected.  The event that was queued up will run instead.  The given timeout is just how long the structure will wait for an event starting when the event structure was reached.  Events could be queued up before the event structure was reached.  If so, they will run, not the timeout.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 16 of 18
(782 Views)

@kbbersch wrote:

Producer/Consumer.  This thread is going down a path that is not following best practices.  Handling the events in the same loop as the state machine makes no sense to me.  Separate the two.

 


You mean like the State Machine fundamental example?

It sounds like a valid design.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 17 of 18
(766 Views)

Using a Producer/Consumer design pattern with a queued state machine would make a lot more sense in this application.  There would be no chance of blocking the state machine.  Easier to extend.  Lots of pluses.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 18 of 18
(757 Views)