LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Capture and execute multiple events at the same time

Hi Experts,

  I am facing a problem where when event structure is executing some nodes, other events are not captured and not run

Is there any way to make event structure to be responsive to ALL defined events?

 

Please see attached vi. 

Once "RunLongProcess" button is clicked, other events are not processed.....

 

 

Look forward to your reply.

 

Thanks

 

Warmest regards,

Vincent

 

0 Kudos
Message 1 of 4
(2,426 Views)

Hi Vincent,

 

The code that you provided does respond to the user inputs. It's just that your "Run Long Process" event takes 30 seconds to execute.

 

Run the program, press Run Long Process, then select Item 4. 30 seconds later, Item 4 will show up.

 

LabVIEW must complete the event that it is in before responding to a new event.

Events will be "queued" up and will execute when given the chance to run.

 

You should almost never put code in an Event structure that hangs up the user interface.

Instead use a Producer/Consumer architecture and place the "Run Long Process" operation in a separate parallel loop.

 

If you really need to keep the user from doing anything for a while, put an indicator on the front panel that tells the user that the program is busy.

(A count down timer or busy cursor.)

 

steve

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 4
(2,411 Views)

You are seeing normal behaviour. The event structure can only execute one case at a time just like a normal case structure. You should put any long running process in another loop. Check out the attached which uses a queue to cause another loop to iterate.

 

Some suggestions:

 

  • use value change not mouse down event
  • put controls in event case that handles it. Helps with clutter and helps find the event for the control. Just double click on the FP.
  • shut down the consumer loop with a message not an error. Do as I say not as I do Smiley Happy
  • variables in general should not be used except for quick examples like this
  • run error through a shift register
=====================
LabVIEW 2012


Message 3 of 4
(2,406 Views)

Thanks Steve(s)... 🙂

 

0 Kudos
Message 4 of 4
(2,393 Views)