ni.com checkout is currently experiencing issues.
Support teams are actively working on the resolution.
ni.com checkout is currently experiencing issues.
Support teams are actively working on the resolution.
08-06-2017 11:51 PM
So I have two sub panels on the front panel. I also have two buttons that are attached to the sub panels so that if a button is pressed its corresponding sub panel loads an image. This works fine. But then when I try the second button for the second sub panel, nothing happens and the button stays in the TRUE boolean position even though I've told it to go back to FALSE. This predicament seems to work vis-versa either way you choose which button to active which sub panel. Also I get an error at Invoke node sometimes when I try to load the second sub panel.
A VI is attached. To test it just change the VI paths in both Case Structures to whatever picture you want to upload from your own library. So that's it. Thanks.
08-07-2017 06:33 AM
Why do you have loops that run forever inside of case structures? Those are why your VI seems to "freeze". The outer loop cannot iterate until everything in it has completed. Therefore your controls will not get read again until those inner loops complete, which will never happen.
Some recommendations:
1. Use an Event Structure.
2. Do not wait for your called VIs to complete (I assume that is what the loops with the waits are for). As long as that VI's panel is open (in the Event Structure), you should be able to go ahead and close the VI reference and it will stay open.
3. Change your buttons to be Latch When Released. This is the normal configuration for a button. And with it being latched, you do not have to "reset" the button. It will reset itself when the terminal is read. Therefore, assuming you take my advice #1, put the buttons in its Value Change event case.
08-08-2017 04:16 AM
Okay I will try that. I remember now that the event structure helped with a similar problem.
08-10-2017 09:03 AM
So I did as you said and trimmed down my program, but now I'm running into a new problem. Now it gives me Error 1026 at the Sub Panel Invoke Node. I'm looking into it, but no solutions just yet. Here's my code.
08-10-2017 09:19 AM
I think it's likely the reference to the VI is being closed before it is inserted into the subpanel and it probably throws an error when given a closed reference. Right now there is no dataflow enforcing the order of execution between the Insert VI and the Close Reference. Wire the error output of Insert VI into the error input of Close Reference to force them to execute in order.
Also, as a sidenote, I would recommend wiring up all your error terminals and handling them to check for errors in your program and respond appropriately. Automatic error handling is good for helping you catch errors during development if you have forgotten to wire them, but remember that it won't work in a built executable so to have good quality code it's important to deal with errors carefully.
08-10-2017 11:37 AM
@ShogunOrta wrote:
So I did as you said and trimmed down my program, but now I'm running into a new problem. Now it gives me Error 1026 at the Sub Panel Invoke Node. I'm looking into it, but no solutions just yet. Here's my code.
Duplicate thread: https://forums.ni.com/t5/LabVIEW/Sub-Panel-VI-gives-me-Error-1036-at-Invoke-Node/m-p/3673822