11-15-2022 02:41 AM
I need to load a display window continuously.
In development environment, the display window was not closed by FP.close method and stop the monitoring of while-loop.
(Maybe, application mode is not a problem.)
Therefore, I can meet the famous message,"LabVIEW: (Hex 0x3E8) The VI is not in a state compatible with this operation."
How can I close the display window in development environment (under LabVIEW)?
labmaster.
Solved! Go to Solution.
11-15-2022 03:42 AM
It seems the error happen when you run the subvi twice, try to "abort vi "before close reference.
11-15-2022 08:01 AM
Hi labmaster,
you can achieve the same result using state machine instead of your current approach.
your subvi is not stopped immediately after you set the exit control value to 'true' (300ms delay you added), and the main loop is trying to run the subvi which is already in run state hence throwing error, add a little delay after you close the reference or set a Boolean indicator to true after while loop finishes execution and read this control value to get the completion state of subvi.
11-15-2022 10:05 AM
You are "doing it the hard way" (which, as you've seen, doesn't work very well). What you want to do is to run your sub-VI ("Display Clock") in a sub-panel of your main VI. A sub-panel is an area on the main VI's Front Panel where you can "run" a sub-VI, see its Front Panel, interact with its Controls (i.e. push the "Exit" button), etc.
Here's what you do:
Give that a try.
Bob Schor
11-15-2022 10:28 AM
@labmaster wrote:
I need to load a display window continuously.
Can you give a more realistic example? This is just glaringly convoluted Rube Goldberg code!
Why do you have an outer FOR loop with 5 iterations that creates new references and opens/closes the same VI over and over (While you say continuously). Then you have an inner FOR loop that updates time every 300ms even though the value only changes once per second. Why can't the subVI calculate time locally instead? Why does the subVI even need to run if you are updating an indicator remotely? (Yes, you can set the same time format for a plain numeric indicator! No need for formatting operations!)
See if the attached can give you some ideas.
11-15-2022 10:38 AM
I can't look at your code, but FP.close doesn't stop a VI, it only closes the front panel. Could that be the issue?
11-15-2022 08:13 PM
Thank you all.
I fixed the trouble by using exec.state method and terminating the display window surely.
I remember all familiar experts in this forum, so I am very happy with you.
labmaster.