LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What situations result in an event structure not capturing the change of a boolean value?

Solved!
Go to solution
I think this is closer to what you want.
Tim
GHSP
0 Kudos
Message 21 of 33
(1,055 Views)

On your block diagram, put the stop boolean inside the stop event so that the boolean gets updated.  Otherwise the control gets stuck on and the program ends.  If you run it again, you have to click the stop button to turn it off before you run.  Putting the control inside the event will prevent that from happening.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 22 of 33
(1,025 Views)

I am trying to trigger event structure on value change of a control I have on front panel. I have 2 other events being handeled similarly (trigerring on value change from controls on Front Panel) and they work fine, I am having problems with only one case(EXIT). I have attached screen captures if somone wants to look at it.

 

I am using LV 8.0. Limits my ability to open any of the above examples. Can someone save it as a previous version and repost it?

 

 

Would be a great help.

 

Thanks,

Nevil

Download All
0 Kudos
Message 23 of 33
(910 Views)

(First of all, you should not append your question to a thread marked as solved. Start a new thread and link to this thread if it seems relevant! Since you did not start this thread, you cannot mark a solution.)

 

A screen capture image is probably not sufficient to troubleshoot the problem, but I give it a try.

 

 

What is happening in the other cases?

It seems you have a loop in the start case. Does that loop terminate in a reasonable amount of time so the event structure is ready to handle the next event?

 

Probably unrelated to your problem, but why in the world would you write to a "signaling property" of the exit button the the event that handles the exit button???? That makes no sense!

0 Kudos
Message 24 of 33
(898 Views)

 

Thanks for the reply Altenbach. I agree, it does not make sense. I did not have it initially. I put it in only because I read stuff about putting in Value(Signaling) Property node to it. I was not sure when to use it and forgot to remove it before screen capture. I did not have it to begin with.

 

The 3 events I have are START, STOP and EXIT:

START: State machine which runs through the entire test routine.

STOP: Terminates  communication with all the equipment and sets them to a known safe sate.

EXIT: Close front Panel and disable some equipments.

 

I am not sure how do I have sufficienct amount of time between events as they are all more or less exclusive.

 

Thanks,

Nevil

0 Kudos
Message 25 of 33
(886 Views)

 


@nevil wrote:

 

The 3 events I have are START, STOP and EXIT:

START: State machine which runs through the entire test routine.

 


 

How long does the "entire test routine" take, and do you require that it can be interrrupted by stop or exit?

Are the events set to lock the front panel?

0 Kudos
Message 26 of 33
(882 Views)

The amout of time required for the test routine depends on the #of tests to be run. #of tests and test configurations are obtained from a configuration file. It can be interrupted by STOP if the test settings in config.file are not correct.STOP is a boolean latch. I require it to be interrupted by STOP but not EXIT.

 

Exit is used only to close the vi.

0 Kudos
Message 27 of 33
(879 Views)

The STOP even cannot execute until the Start even completes.

How long does the start event take to complete if the settings are not right?

Do you need to be able to stop even if the settings are right?

 

Your code is quite a dinosaur. You should use a proper queued state machine for the toplevel (not just in the inner loop!) to handle events in a clean loop in parallel such that the event structure does not get held up by lengthy procedures.

 

(There are also quite a few potential race conditions and overly complicated constructs. In the "Start event" you do an "equals false". That is the same as an invert. Or even easier just swap the cases and wire directly to the case ;). You read "all data" from a terminal and from a local variable in parallel. This is unpredictable because the value can potentially change between the two reads. Instead, eliminate the local and branch from the terminal to both locations.)

0 Kudos
Message 28 of 33
(873 Views)

Looking further, you have TWO event structures (I did not notice the small one!) with a data dependecy between them. That does not look good!

 

While the inner event can potentially service successive start events, the outer cannot and will queue n potentially infinite amount of events.

 

This code needs to be re-architected from scratch!

 

0 Kudos
Message 29 of 33
(869 Views)

It does look like a lot to fix.

 

I am not sure how do I have a queued state machine for the top level as well. Some insight on it would definitely help. The way I was thinking was START will execute the test routine, stop would terminate the test in between if required and EXIT to exit the program.

 

 

 

 

0 Kudos
Message 30 of 33
(860 Views)