From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating Event with Subvi Control on Main Vi

We are creating a code in which on pressing set up button( present on main vi front panel ) we are calling one subvi as pop up window which further contains some boolean controls and every boolean control has further one subvi associated with it, when we press on that button a window comes that has several numeric and string control, what we want is after entering all values on numeric and string control and after pressing ok button, these val;ues should get updated to the sequence list present on main vi front panel, i have tried to do this using queue but what we want is that on pressing ok button( present inside subvi) we need to generate a event on main vi that it should dequeue elements to the list only when that ok button is pressed, i have tried to do it using value signalling property node but this is not working, i am not getting how to do this or there if there is any other better way to do this

 

I have attached the code for reference.

0 Kudos
Message 1 of 12
(2,817 Views)

I am sorry tthe project file i attached is emtpy.

 

Attached Belw is the Zip file which contains the code.

0 Kudos
Message 2 of 12
(2,813 Views)

waiting for reply....

0 Kudos
Message 3 of 12
(2,793 Views)

your constanly generating the signal value from the global,which caused an error.... write a false to the global once it generates...

Main.png

 

then put the ok inside the e3646 loop wired to the stop...and as you can see, i was able to generate the elements on the front panel

E3646a_01_BD.png

 

Message 4 of 12
(2,780 Views)

Thanks apok

 

it's working this way, but one problem is still coming once after pressing ok button if i again want to update the values i need to stop the main vi and then run it again i know this is happening because we are using ok button to stop while loop, but after closing subvi window when we open again the sindow it's still not updating it.

 

one query here, why we are using this ok button to stop that while loop and when we are not wiring this ok button to stop the while loop, it's not updating the cluster, what is the reason for this.

 

one more thing is there any other way with which we can generate event on main vi using subvi control other than global variable approach.

0 Kudos
Message 5 of 12
(2,762 Views)

A better way to do this would be to enqueue the state that the event case is calling from the instrument state.  Then you don't have to poll the global variable and worry about signaling the event.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 12
(2,754 Views)

Yes this is working fine

 

 

Thanks crossrulz

 

but one problem that is still there is that it is updating value only for once when ok is pressed , now again if i want to enter the values i need to stop the main vi and then run it again to enter the value again, what is happening is after entering all the values when i am  pressing the ok buttpn values are updated and the subvi stops and then we close the subvi now if again i want to upadet values for that subvi i need to stop the main vi and then run it again.i dont know why this is happening.

0 Kudos
Message 7 of 12
(2,740 Views)
Try the dynamic events example as a roadmap then you can pass extra flag data back to the main vi registered events cases.
Thanks
Sacha
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 8 of 12
(2,729 Views)

Ritu wrote:

but one problem that is still there is that it is updating value only for once when ok is pressed , now again if i want to enter the values i need to stop the main vi and then run it again to enter the value again, what is happening is after entering all the values when i am  pressing the ok buttpn values are updated and the subvi stops and then we close the subvi now if again i want to upadet values for that subvi i need to stop the main vi and then run it again.i dont know why this is happening.


That is probably because you are constantly reading a TRUE from the global and the event is piling up.  I'm actually surprised you can cleanly exit your program.  If you go back to my advice above and delete the global variable, it should work fine.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 12
(2,725 Views)

i have deleted the global variable but still the same problem is coming and one more issue that is coming is it is updating the subvi values to tha main vi in next cycle means ehen i am calling the subvi and entering values logically it should update those values to the main vi as soon as we press the ok button in subvi but what is happening is it is updating those values when after stopping the main vi i am running it again it updates the list with the previous values.

 

Below i am attaching the new program with all those changes as you told.

0 Kudos
Message 10 of 12
(2,706 Views)