LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Invoking an event from another event

Hi,

I'm kind of new to the event structure in LV 7. Can anyone tell me how to invoke another event from the other one. For example i have two events say "calculate" to do something and "popmessage" to pop-up a user defined message box. How do i trigger the popmesage event upon timing out?
0 Kudos
Message 1 of 7
(3,600 Views)
You can use dynamic or user event to do this. This is a new feature in LV7. However, I would consider using a combination of event structure and a state machine.

Joe
0 Kudos
Message 2 of 7
(3,600 Views)
Hi Joe,

Thanks for your comment. Since I'm new using this feature, could you explain bit further how I could go about doing this. Would appreciate it.
0 Kudos
Message 3 of 7
(3,600 Views)
The attached file is a VI template I use all the time. I did not use user defined events in it, however. You will have to add them yourself.

Joe
0 Kudos
Message 4 of 7
(3,600 Views)

Hello,

In order to invoke a new event from within an existing event, you need to use programmatically generated (or user) events.

To find more information on programming with events,
See the LabVIEW User's Guide

    1. In LabVIEW, go to Help, Search the LabVIEW Bookshelf

 

    1. Click the LabVIEW User Manual

 

    1. Chapter 9 describes Event-Driven Programming.




Read the event-programming tutorials.

    1. Go to http://www.ni.com and click on Support at the top.

 

    1. In Option 3, enter keywords "events labview" (without quotes).

 

    1. The first link should be Event-Driven Programming in LabVIEW and the
      third should be Advanced Event Handling with LabVIEW 7 Express.




Look at example code in LabVIEW

    1. In LabVIEW, go to Help, Find Examples.

 

    1. On the Search tab, enter "events."

 

  1. Open "Programmatically Fire Events" for an example of triggering a new event from within an existing event.



I have also attached a simple example showing how to use programmatic events to invoke a new event from within the current event. However, the new event will not be processed until the current event is finished.

Is your situation that the calculate event may take a long time and you'd like to pop up a message after a certain amount of time? If so, one solution is to have parallel event structures. In the second structure, only process the user event. However, a simpler solution may be to check the clock before your processing loop and com
pare this value periodically in the loop to see if a certain amount of time has elapsed.

Happy coding,

Grant M.
National Instruments

0 Kudos
Message 5 of 7
(3,600 Views)
Thanks a lot Grant,

Your example came close to what I wanted to do.
0 Kudos
Message 6 of 7
(3,600 Views)
Hi Joe,

Thanks for the template. I think now I know what you were talking about.

Thanks
Kumar
0 Kudos
Message 7 of 7
(3,600 Views)