LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to REGENERATE VALID GUI SubVI Reference

My Block Diagram is attached here:

 

Launching subVI by Reference.png
-- 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

0 Kudos
Message 1 of 7
(450 Views)

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:

  • Why do you need to close an invalid refnum?
  • Why do you need to open the refnum twice when there is an invalid input?

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(415 Views)

@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...

0 Kudos
Message 3 of 7
(385 Views)

Hello:

 

Thanks for suggestion:

 

How does one do that? And maintain it as valid RefNum throughout?

 

Thanks Again

 

Anthony

0 Kudos
Message 4 of 7
(381 Views)

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!

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 7
(379 Views)

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 

 

0 Kudos
Message 6 of 7
(371 Views)

Thanks!

 

Let me try this.

 

Meanwhile if I am really running out of references, i need to address this as well. 

 

Anthony

0 Kudos
Message 7 of 7
(367 Views)