LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to manipulate with menus and events

Hi

 

I have an application like the example from Labview called "Menu selection with events" and want to force the event handler to enter a certain stage when the condition is right without having to manually use the menu selection from the front panel. This enables me to implement a command line application where the application is automatically configured and automatically press the RUN button in the user menu. The RUN button is event driven.

Is this possible?

 

Thanks!

 

Br,

Peter

0 Kudos
Message 1 of 12
(4,171 Views)
Hai sandman,
 
Could you please post your code.
 
Thanks,
Mathan
0 Kudos
Message 2 of 12
(4,169 Views)

It sounds from your Q that Ton's "Dynamic Event Registration" Nugget may be a good thread for you to read if you are asking how to dynamically fire an event.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 12
(4,163 Views)
Your explanation isn't very clear. You want an event to call another VI? Or another program altogether?? I have no idea what you mean by "the RUN button is event driven"... In general you can do any of those things...Calling a vi or progam from an event structure (or any where else) and running (controlling it to some degree, depending on the methods used) it dynamically.
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 4 of 12
(4,161 Views)

Hi It would be too much to post my original code here and to explain this but the event handler in my program is a true copy of the example found in the the LV help section called "Menu selection with event" But anyway I have attached the example here.

at runtime the menu selection can be performed manually but I want to force the event handler to enter a e.g. About selection when a certain condition is correct.

Br

Peter

0 Kudos
Message 5 of 12
(4,159 Views)

Hi again

This attached code would do the job as I want to, but I would have to duplicate the event case and having two about boxex in the same event.. And this was not the purpose.

The purpose is to have the originally code and virtually be able to press the About button from the code like this attached code does when selecting the condition from the front.

br,

Peter

0 Kudos
Message 6 of 12
(4,150 Views)
Hi Peter,
you can use a parallel loop and Queues. Send the commands from your event loop to the other while loop. You have only one About box, but you can call it from different points. See the attached example.
Hope it helps.
 
Mike
0 Kudos
Message 7 of 12
(4,135 Views)
Unfortunately, your explanation is still not clear. This is primarily because it's not clear whether we're talking about menu items or buttons. You seem to be using these terms interchangeably, and they're not. In your original email you said "automatically press the RUN button in the user menu.". I have no idea whether we're talking about a button or a menu. In the latest message you say "virtually be able to press the About button", so now it seems we're talking about a button.

You should be aware that for buttons you can fire events by simply programmatically writing to the "Value (Signaling)" property. This is the same as if a user had pressed the button on the panel. If you're talking about menus, then you can simply create user events, which you've already done.

Also, your statement
"but I would have to duplicate the event case and having two about boxex in the same event" doesn't make much sense either. Perhaps you are not aware: an event case can handle more than one event.
Message 8 of 12
(4,099 Views)

Hi All

Unfortunately I only have LV7 at work so I can not see your example Mike

Sorry for the button / menu select confusion..
OK, let me explain. On a LV form I have a menu bar where I can select File, Edit and Help (see my previously attached example) which is similar to what I use in the originally program. The menu is handled by a Event handler which has several cases inside for each menu selection. 
This configuration has been running in my program for several years now. Now there has been a demand for make my tool command line based so my program can be called from a batch job like " C:\MyProgram.exe /param1 /param2 /param3 " a.s.o. But in this configuration I need to continue the execution automatically by selecting the menu and selecting a menu item called "RUN" which in this case example I refer to the "about box". This enables the user to do several automatic test runs in a row with different parameters without "touching" the tool at all. However my only obstacle now is to automatically force the event handler into one of the cases which will continue the program execution. As in the example I can define a new USER event and when I configure the event handler, some of my Items in the event data node for controlling the test cases inside the event handler disappears and I am forced to define a new event structure which takes care of my user defined event but this was not the purpose. the purpose is to define that the event handler enters the test case "RUN" / about box in the example defined by the user event outside the event handler as if the user had selected the menu item "RUN" / about box in the example code..

So my question: Is it possible to "fool" the event handler to enter a test case selected by a defined user event without manually select the menu bar and select the "RUN" or the about menu item in the example code so the execution can continue beyond the event handler and do some measurements automatically?

Hope this clarifies my problem..

Br,
Peter

0 Kudos
Message 9 of 12
(4,073 Views)
Hi Peter,
here is it as a picture.
Hope it helps.
Mike
0 Kudos
Message 10 of 12
(4,057 Views)