Jump to content

How do I Pause Event Handling


Recommended Posts

There is an easy sample: two buttons Start and Pause, and String Box.

Event Structure has case Value Change for Start button.

If Start button is pressed value in String Box increases each second (I used Loop Structure).

After you have pressed Pause button loop execution pauses and waits until you press Pause button the second time.

The problem is: event for Pause button is not handled until event handling for Start button has been finished

Link to comment

If I read your mail correct, the "increasing loop" is inside the start event case. If so you have two possiblities:

Either move your "increasing loop" outside the event-loop and communicate with notifiers or queues.

Or, set the timeout of your event-structure to -1, Start-case sets it to e.g. 1000ms and pause/stop-case sets it back to -1. In the timeout-case increase your value by +1. (see example)

Didier

Download File:post-253-1146231692.vi

Link to comment
Could you please describe th way of using notifiers or queues in detail

First of all, this is definitely a wrong forum to post such questions :nono:

Well, OK

Nu vot tak, naprimer. :D

Here is a simple event-driven state machine example. Of course, there exist simpler and more advanced patterns.

Using car analogy the state machine pattern NI pushes as THE state machine will be a Ford Escort (that's for for US readers, Zaporozhets - for former Soviet Union residents). The attached one is then a Chevrolet Malibu maybe. For the Rolls-Royce of state machines see labhsm.com :yes:

First of all, this is definitely a wrong forum to post such questions :nono:

Well, OK

Nu vot tak, naprimer. :D

Here is a simple event-driven state machine example. Of course, there exist simpler and more advanced patterns.

Using car analogy the state machine pattern NI pushes as THE state machine will be a Ford Escort (that's for for US readers, Zaporozhets - for former Soviet Union residents). The attached one is then a Chevrolet Malibu maybe. For the Rolls-Royce of state machines see labhsm.com :yes:

Sorry, can't upload anything from my computer for some reason right now. Not even to my web site with Frontpage. Gotta talk to the ISP :(

OK here it is:

http://labhsm.com/Simple_event_driven_SM.zip

Link to comment
The problem is: event for Pause button is not handled until event handling for Start button has been finished

Yes well just put a condition to stop the execution of the start event activities while they are executing. That is inside the start event activities be sure you also check for some sort of exit or termination condition (in this case not event triggered but checking a flag of some kind).

Link to comment
If you don't want the traffic, you might want to edit your original post and remove the link there.

Nah, it's not a big deal.

However, editing previous posts - that's interesting! I can see the Edit button for my latest post, so, apparently I can edit it, but how can I edit my earlier posts?

OK, here: this sentence was added after posting the above had been done: at that moment my 2 last posts had Edit button, but not the one where I posted the link!

Link to comment
I think that that thread already makes the point pretty clearly.

Agree. The certification helped me to find previous gigs. The main (negative) factor in my personal job search is not the posession/lack of certification but the xenophobic, cruel, exploitive, unfair and simply totally screwed up US immigration system, in which I and hundreds of thousands of other people are trapped now. (See immigrationvoice.org, for example, for shocking details that are unknown to the majority of Americans.) So, as Chris knows, I am on the world wide job search now and hope my CLA will help me.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.