02-19-2024 10:16 PM
My Block Diagram is attached here:
-- I make sure that before I restart the VI, I abort the existing instance,
-- I then reCreate the GUI SubVI reference,
-- I can confirm that the GUI SubVI is infact a new reference (different ref number)
-- I then:
(a) Assign values to Front Panel Controls
(b) Open the front panel,
(c) RUN the subVI.
The issue is this:
After this GUI SubVI has run for about three days in an owning VI SubPanel. I am no longer able to OPEN the VI independently because I get the VI Ref INVALID error.
Question:
Is there a way to generate a VALID VI reference of a LabVIEW VI window? When I run this LabVIEW code and find that the VI ref number changes as I reStart the VI, my question is how can I ensure that the new VI Ref is VALID.
Anthony
02-20-2024 12:47 AM
Hi Anthony,
@Anthony_L wrote:
Is there a way to generate a VALID VI reference of a LabVIEW VI window? When I run this LabVIEW code and find that the VI ref number changes as I reStart the VI, my question is how can I ensure that the new VI Ref is VALID.
I see no error handling in your image.
I don't understand that FOR loop with sequence inside:
How often do you need to open the VI refnum?
Do you close all refnums correctly?
How many other refnums do you need to handle?
@Anthony_L wrote:
After this GUI SubVI has run for about three days in an owning VI SubPanel. I am no longer able to OPEN the VI independently because I get the VI Ref INVALID error.
Did the subVI run 3 days without closing/re-opening its reference?
I suspect there is a problem of "too many open refnums" that let's you run into the "not able to open any new refnum anymore" error…
02-20-2024 03:38 AM
@Anthony_L wrote:Question:
Is there a way to generate a VALID VI reference of a LabVIEW VI window? When I run this LabVIEW code and find that the VI ref number changes as I reStart the VI, my question is how can I ensure that the new VI Ref is VALID.
A static VI Reference would be a lot easier...
02-20-2024 04:09 AM
Hello:
Thanks for suggestion:
How does one do that? And maintain it as valid RefNum throughout?
Thanks Again
Anthony
02-20-2024 04:13 AM
Hi Anthony,
@Anthony_L wrote:
How does one do that? And maintain it as valid RefNum throughout?
You create a static VI reference by placing the StaticVIReference on your block diagram and drop the VI onto it...
Because such a VI is (kind of) "embedded" inside the StaticVIReference it will be always valid!
02-20-2024 04:23 AM
Hello Gerd:
Thank you for considering my question.
That FOR LOOP ensures that I am able to grab a valid reference to the VI and ABORT the VI. Before relaunching the VI.
When it runs for the first time, the feedback node sends an INVALID REFERENCE. So I need to grab a fresh reference to be able to Abort the VI BEFORE ReLaunching the VI.
The reLaunching of the VI is because the VI MUST be removed from a subPANEL CONTAINER and made to run as an independent window. .
In Those 3-Days that the VI stays running it is never opened or reOpened. Infact it is not even touched. The VI just acquires and plots points via a LV 2Style global and will keep scrolling.
However, once the Vi is accessed and command issued to relaunch as separate window, a VI Reference can no longer be acquired.
Anthony
02-20-2024 04:26 AM
Thanks!
Let me try this.
Meanwhile if I am really running out of references, i need to address this as well.
Anthony