10-18-2023 11:37 AM - edited 10-18-2023 12:17 PM
I'm trying to do the following: when user presses a button, a new window pops up, user types in numeric value, that value is passed to main vi.
When user either user closes second window or depresses a button, I want code to be in the initial condition (numeric value passed to main and button is reset). If user presses a button again, the window pups up again, etc.
I've tried all combinations of SubVI Node Setup and Call options but can't achieve what I want. My code is only able to read by setting Boolean button to "Switch when pressed" mechanical action. This makes me unable to use "Close afterwards if originally closed" Subvi node setup because my main vi keeps constantly trying to open and then close the subvi. If I use any other Boolean mechanical actions, it opens the subvi just once and then doesn't pass any data back to main vi because the Boolean is reset to 0.
There must a trivial solution to this, no?
Solved! Go to Solution.
10-18-2023 01:19 PM
Apologies, found the solution:
https://forums.ni.com/t5/Example-Code/How-to-Open-a-SubVI-as-a-Separate-Window/ta-p/3531906
Please mark as resolved.
10-18-2023 03:20 PM - edited 10-18-2023 03:23 PM
You really don't need any of that code:
Here's a quick draft but I would recommend to make the UI a bit more as expected (not shown!), e.g. the dialog should have a OK and cancel button and [x] should act as cancel, you should have an input to define the default value which will be retained if the dialog in canceled, etc., etc.