LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

periodic reading data with event driven programming

Hi all

I want to read data from a device periodically, for example every 2 seconds.

but I want to use event driven programming in order to response user events.

now I don't know how to do this......!!

 

maybe I should use timed loop or timed sequence structure

if I use this structures, should I use then inside the while loop or outside the while loop( I mean the while loop that contains the event cases)?

 

please help me and accept my thanks....

 

 

0 Kudos
Message 1 of 2
(2,709 Views)

You ned to run these in two separate loops. Look at the Producer/Consumer template. Put a two second time-out on the Dequeue Element and you have a loop that will run every two seconds. The loop should also handle information from the event structure.

 

Separate loops is the best way of handling this.

 

Rob

Message 2 of 2
(2,708 Views)