01-08-2016 10:48 AM
I have an interesting little problem, that is likely related to me not knowing how to "Properly" do things in Labview. I have created a simple Main VI and SubVI (greatly simplified from my current version).
Basically, I have incoming data (from the Dial on the Main VI), that the end user needs to click the "TEST" button to view. Once the End user has viewed the Data in the SubVI, I would like a button within the SubVI that they can press which would toggle-off the "TEST" button on the Main VI, and close the SubVI front panel.
As this currently stands, you have to manually click-off the "TEST" button on the Main VI (which disables the SubVI), then close the SubVI with the top-right "X". This is not practical in my end application, because the SubVI front panel consumes nearly the entire PC display when activated.
Any thoughts?
01-08-2016 11:43 AM
Since the VI in the subpanel is running as a separate process from the GUI, you will need to utilize some sort of signalling to pass data back and forth between the two. Given a simplicity of what you need to do, I would simply pass a reference to the "TEST" button on the Main VI to the subpanel VI when you launch it. Then the subpanel VI will be able to control the state of the button as needed. In addition, if you also pass the VI a reference to the subpanel that it is in, it will be able to remove itself also.
Mike...
01-08-2016 11:46 AM
Use an event structure to launch your SubVI and set the "TEST" control to latch when released. Set the the SubVI to open when called.
01-08-2016 01:09 PM
Ok, I added a reference from the SubVI, and added a button....but the new button does not appear to be responding on the SubVI.
Modified files attached:
01-08-2016 02:41 PM
No you didn't, you added an input. To create a reference you have to Right Click >> Create >> Reference, and then you can create a property node from that reference.
01-08-2016 02:58 PM
test this I think this is what you want
01-08-2016 03:02 PM
You don't need a while loop to take up the CPU just to keep a SubVI running, use an event structure instead.
Do you want the SubVI to keep updating the data or just to show a snapshot of it?
01-08-2016 03:09 PM
yes you are right test this subvi instead
01-08-2016 03:11 PM
The timeout is unwired, so the timeout case will not run.
01-08-2016 03:21 PM
thank you agian for point this time i think It is end and subvi will work well