LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read/Write Front Panel control from subvi

I created a Strict TypeDef to use in a main VI that I want a subVI to read/write values from. As of now, values in the front panel control are not updated by the subVI. I tried to use refnums, but couldn't quite figure it out. Any assistance for that and suggestions for the way the subvi is implemented would be helpful. 

 

Download All
0 Kudos
Message 1 of 5
(3,321 Views)

Could you convert your code back to 2014 or earlier, cant see it otherwise.

 

Have you tried it without using your typdef, what if you just used something simple like a numeric indicator or control? Its essentially identical, so if you can do it with them then you can do it with your typdef.

0 Kudos
Message 2 of 5
(3,314 Views)

Yeah I mean, the reason for that is because your property node is only run once. The outer while loop in the subvi never iterates because the inner while loops never terminate. The outer while loop looks pretty pointless as a result. Is the SubVI intended to be viewable? In the SubVI, you modify the properties of the control that is visible in the subvi. It seems like it is mean to modify the values in the top level VI? It would have worked a bit better if you had wired the reference to those nodes and also instead of having a local variable just using the Value in the property node instead. But really you need to think about your architecture and also really learn how to debug your programs using execution highlighting and probes.

0 Kudos
Message 3 of 5
(3,302 Views)

Instead of updating a GUI item in a subVI, you really should be either passing the value through the connector pane or use a User Event to send the data to the main GUI loop.


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 4 of 5
(3,259 Views)

It's easiest to start from your main VI.  right click on the front panel control in your main VI and click on create reference.  Place a property node on your VI and wire it to the reference.

Click on the property node and then select value.  Right click on the property node and select change to write.  Select the property node and then click on Edit>create subVI.  Now you can add whatever code you want to the sub VI to control the main VI control.

0 Kudos
Message 5 of 5
(3,219 Views)