LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I keep running event-based state machine by a single event

Solved!
Go to solution

@mcduff wrote:

@RTSLVU wrote:


In my case there is no "measure button" for the end user to operate, in facts it's a hidden indicator. There is no user interaction except a Stop button that is handled in another Event Case. 

 

It probably would have been better to put this in the Time Out Case, (Where I initialize my instruments) and make an Initialize case that runs first.

 

But it was one of my first attempts at a EDSM and I just learned about putting initialization in the Time Out case and then setting the Timeout to -1 so it only runs once.


This is a case where a USER Event would be better. Since there "measure" control is hidden, it is unneeded, just trigger a User Event as needed. Once again, I suggest a proper State Machine architecture of your choice, keep your event cases mostly empty when possible. If you don't want to go that route then seriously check out and try to understand @altenbach's suggestion/solution. As usual, it is elegant, simple, and this time, the size of an address label.

 

mcduff


Don't challenge him. I'm sure that given a little time altenbach could reduce it to the size of a postage stamp.

Message 21 of 23
(615 Views)

@mcduff wrote:

@RTSLVU wrote:


Interesting, as I picked up using a hidden indicator and popery node to trigger an EDSM right here on this forum by one of the major players...

 

They even described it as a "Pro Tip".


I am NOT a PRO, so take everything I write with a good dose of healthy skepticism. I have no idea why that method would be preferred over generating a User Event. Do you still have the link to that thread? One thing I don't like about that suggestion is the "property node" which signals the event; I believe that runs in the UI thread, whereas user events can be generated in any thread. (I normally use user events coupled to JKI State machines to have asynchronous communications between processes. Events allow: many to one, one to many, different message types to the same mailbox, etc, highly flexible. The same event structure can handle UI events, incoming messages from User events, etc)


Using the Property Node was not exactly in any of the forum threads but I was sent some code that introduced me to it along with a few other EDSM tips...

 

pnoCapture.PNG

I don't want to cause a bunch of forum drama by posting the author.

 

They are considered a Knight of NI

========================
=== Engineer Ambiguously ===
========================
Message 22 of 23
(612 Views)

@RTSLVU wrote:

@mcduff wrote:

@RTSLVU wrote:


Interesting, as I picked up using a hidden indicator and popery node to trigger an EDSM right here on this forum by one of the major players...

 

They even described it as a "Pro Tip".


I am NOT a PRO, so take everything I write with a good dose of healthy skepticism. I have no idea why that method would be preferred over generating a User Event. Do you still have the link to that thread? One thing I don't like about that suggestion is the "property node" which signals the event; I believe that runs in the UI thread, whereas user events can be generated in any thread. (I normally use user events coupled to JKI State machines to have asynchronous communications between processes. Events allow: many to one, one to many, different message types to the same mailbox, etc, highly flexible. The same event structure can handle UI events, incoming messages from User events, etc)


Using the Property Node was not explicitly in any of the forum threads but I was sent some code that introduced me to it along with a few other EDSM tips...

 

pnoCapture.PNG

I don't want to cause a bunch of forum drama by posting the author.

 

They are considered a Knight of NI


Not trying to cause drama, just trying to learn something. Thanks.

0 Kudos
Message 23 of 23
(606 Views)