LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV 6.1 raise event programmatically

we are using the new event structure in LV 6.1 to trigger user action.
Is it possible to raise an event programmatically within LV 61. Just defining an event for example a button and changing the value within th labview code, does not raise an event.

Thank you very much for your help.

Michael Leeb
0 Kudos
Message 1 of 4
(3,467 Views)
Michael,
I have also tried to perform this task, and according to NI documentation about the Event structure, this is not possible. You will have to poll the button to see if it has changed. I ran into the trouble trying to trigger an event using the VI Server.

Chris Davis
0 Kudos
Message 2 of 4
(3,467 Views)
Event structures only respond to user actions (or inactions). My method for implementing the event structure combines it with a state machine. I avoid complex operations in the event structure. I only use it to capture user interactions with the interface. Each event case can then call a state in the state machine if the state machine is driven by a queue. Note that a queued state machine is the key here! You can include some logic in your states to better interpret the user's actions, but you should not have stuff in there that you would want to call programmatically.

If you have that architecture, you do not need to programmatically cause events. You can just place an element on the state machine's queue and it will get executed.

Daniel L. Pre
ss
PrimeTest Corp.
www.primetest.com
Message 3 of 4
(3,467 Views)
Here is some code I wrote to simulate programmatic events. It is not acutally calling the event programmatically--the program is written so that the event and the program will call the same code. It uses occurrences to reduce the usage of CPU resources.

Jeremy Braden
National Insruments
Message 4 of 4
(3,467 Views)