LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event driven programming

 

A Flat Sequence Structure is running in a While Loop. The time pause between two adjacent frames is 200 m-Sec. All the sequences are executing continuously.  If I want to make an event (Boolean action  by a button on UI) and to perform some operation (Digital pulse On/Off at DAQ card output Port-0,Line-0)  then how shall I proceed?  Shall I use Event Structure?  I am new to Labview.

I have tested the action without event structure.  I have observed the logic change at DAQ card output at the end of currently running cycle.  But my purpose it to get the change instantaneously as soon as I press the button.

How to do it?

A. Das

 

 



0 Kudos
Message 1 of 4
(2,710 Views)
Events would indeed be ideal for your application
Configure/Edit an event case for value change of a boolean control
Each time you change the value of a boolean, inside that event case pass the New value of the boolean to the Digital DAQ write function to generate a 'Digital pulse On/Off at DAQ card output Port-0,Line-0'
0 Kudos
Message 2 of 4
(2,700 Views)
hai,
u have not explained the code present in the frames of the sequence structure.
i feel that this is very simple but why not for u? whether u have some constraints in ur mind?
i hope that if u can send this vi, i can help u.
 
 
Thanks,
Sathish
0 Kudos
Message 3 of 4
(2,696 Views)

One nice architecture I have found to work quite well for user controled daq is to use the event structure running in its own loop and send messages via a wueue to control a daq state machine running in a seperate thread.  One thing this solves is that event code should be kept short to allow for responsive GUIs.  If you execute the DAQ dirrectly inside of the event structure and the daq is a synchronous vi call which takes some finite amount of time, you will not beable to execute any other events until the first event finishes.  Using seperate threads for user events and data acquisition allows for a responsive and managable architecture.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 4 of 4
(2,685 Views)