04-19-2017 03:14 PM - edited 04-19-2017 03:41 PM
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.
04-19-2017 03:24 PM
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.
04-19-2017 03:37 PM
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.
04-19-2017 06:26 PM
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.
04-20-2017 03:36 PM
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.