LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

trigger event/case every 2 seconds after a certain time

I am attempting to trigger an case every 2 seconds after a cetain time say 12h00 i.e. Every couple seconds after 12h00 a case statement needs to  run.

Attached is a vi of what my code look likes.

 

I need help in figuring out how to trigger the event every couple second.

 

 

0 Kudos
Message 1 of 3
(3,238 Views)

Hi havok,

 

you can have more than one case in an event structure...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(3,229 Views)

It sounds as though you would be better off with a Producer/Consumer architecture.  You would have one loop (the Producer) with the event structure handling the user interface events and a second loop (the Consumer) which actually does all the work in a state machine.  The task whihc needs to be repeated would be handled in the state machine.  The event structure would only send commands (including parameters) to the state machine.  So one command could be Repeat and the parameters could be Start Time and Repetition Interval.

 

This approach is much more robust than your nested sequence structures.

 

Look at the examples and Design Patterns which come with LV.

 

Lynn

0 Kudos
Message 3 of 3
(3,221 Views)