LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling an Event after another is finished

Hello Community, 

 

New LabView. For the GUI of my VI, I have three radio buttons that will enable and disable two comboboxes according to the user's choice. In order to do it, I created an event that is called in my event structure when the selected value of the radio button changes (It's called "Comboboxes"). However, after the user is done with the task I will like to call my INIT event, where I initialize everything. I tried calling the event after the event that executes the task is called (which is "start") but is not working. Any help from you to solve this will be appreciated. I'm attaching a screen capture of my VI. 

0 Kudos
Message 1 of 8
(3,264 Views)

I interpret your pictures to mean you use a queued message handler to have the event loop trigger different tasks in a consuming loop? If that is the case:

 

Trigger all three tasks in the radio button event: 1 - radiobutton task, 2 - start task, 3 - init task.

Alternatively: use a property node placed in the radio button event to trigger the "OK button" using the "value (signaling)" property.

Best regards,

Jarle Ekanger, MSc, PhD, CLD
Flow Design Bureau AS

- "The resistance of wires in LabVIEW is not dependent on their length."
Message 2 of 8
(3,239 Views)
You didn't post code and it is difficult to analyze without code.
-Is this Producer Consumer (Events) template which you are using?
-Events cannot be created by queuing. I think you meant state?
-If you really want to have Event to be triggered programmatically look for User Events.
Thanks
uday
0 Kudos
Message 3 of 8
(3,237 Views)

Should I still leave the event of the "OK Button" calling the event "Start" even if I am calling it again in the RadioButton event "Comboboxes"? Thank you very much for your answer

0 Kudos
Message 4 of 8
(3,226 Views)

Hi. AnaZerpa,

Please attach your program with backward compatibility such as can be used in Labivew 2014, Labview 2013 etc to see your program, if you are using latest version of labview. Logically, Control should go to 'init' state after the 'start'. By seeing your program, we can rectify it.

Best Regards,
Dhans 😉
Kudos are welcome 😉
Aspirant Labview Programmer (Labview 14) 😉
0 Kudos
Message 5 of 8
(3,221 Views)

@AnaZerpa wrote:

Hello Community, 

 

New LabView. For the GUI of my VI, I have three radio buttons that will enable and disable two comboboxes according to the user's choice. In order to do it, I created an event that is called in my event structure when the selected value of the radio button changes (It's called "Comboboxes"). However, after the user is done with the task I will like to call my INIT event, where I initialize everything. I tried calling the event after the event that executes the task is called (which is "start") but is not working. Any help from you to solve this will be appreciated. I'm attaching a screen capture of my VI. 


I strongly recommend to go through some learning material, if you have access to it, the new Core 1-2 online training is very useful!

The problem with what you try to do, you try to "squeeze" all functionality into a single Event structure.

 

There are different design templates which are able to do what you want, one of the most simple is an Event driven State Machine. In such design, we have an outer While loop together with a Typedef Enum (or you can simply use strings too) stored in a Shift Register. Inside the While loop, we have a Case structure holding your states as Cases. Inside a single case, lets call it "Idle" or "Wait for GUI actions" we have our Event Structure.

 

So I recommend to take some tutorials/online trainings, plus google for LabVIEW state machine templates. There are many other variations, like Queued State Machine, Queued Message Handlers, etc...

0 Kudos
Message 6 of 8
(3,201 Views)

Leave it only if that is an event you want to enable; if you want to be able to reinitialize by pressing a button.

Best regards,

Jarle Ekanger, MSc, PhD, CLD
Flow Design Bureau AS

- "The resistance of wires in LabVIEW is not dependent on their length."
0 Kudos
Message 7 of 8
(3,185 Views)

Thank you very much for your help, guys. I already solve the issue with my program. It wasn't actually anything of what I thought it was but something else.

0 Kudos
Message 8 of 8
(3,168 Views)