LabVIEW Public Beta Program in 2024

cancel
Showing results for 
Search instead for 
Did you mean: 

New Open VI Reference Functionality

Per LabVIEW 2024 Q1 Features and Changes, Open VI Reference can now accept a VI reference for the vi path input.  I took a vim I use for calling reentrant VIs and started to play with this new feature.  With this new feature, I was able to eliminate a property node from my vim (getting the VI's name).  I wired a strict typed static reference straight to the vi name input and left the type specifier unwired.  I saw my VI type properly propagate, even allowing me to wire up a Start Asynchronous Call.  But I got error code 1026 when I ran the code at the Start Asynchronous Call.  The Open VI Reference just returns a Not A Reference and no error.  The fix was to wire up the type specifier as well.  But this just seemed strange that if I am giving Open VI Reference a strict typed static reference for the path, why do I also need to tell it the type in order to get a runtime reference?  And if this is by design, why am I not getting a compile time error?

 

Attached is my code for reference.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 1 of 16
(2,218 Views)

It's a bug. The type propagation is intending for this to work. Unfortunately the execution code is creating a non-strict reference so we end up with a non-strict reference on a strict reference wire.

 

Workaround is to wire the input reference to the type input as well, like you did.

0 Kudos
Message 2 of 16
(2,181 Views)

To get a strict type from Open VI Reference, type has always been required. So I guess this behavior would be a nice to have. Of course if it compiles it should run.

 

So what if you don't want a strict type from the strict reference?

 

Is it harmless to simply ignore the strictness....?

 

Is there any penalty (e.g. performance) for getting a strict type when you want a normal reference? Because AFAIK it's impossible to go from a normal reference to strict type...

0 Kudos
Message 3 of 16
(1,949 Views)

wiebe@CARYA wrote:

So what if you don't want a strict type from the strict reference?


1. Use a non-strict constant to the type specifier.

OR

2. Just use a non-strict from the beginning

 

It just makes sense to me that if you wire a reference to the VI Path, the output should match the reference type (string or non-strict) by default.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 16
(1,942 Views)

@GregR wrote:

It's a bug. The type propagation is intending for this to work. Unfortunately the execution code is creating a non-strict reference so we end up with a non-strict reference on a strict reference wire.


I just saw that 2024Q1 Patch 1 dropped on Friday.  This bug (2643576) is on the list of bug fixes.  I'm installing it now and anxious to test it out.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 16
(1,863 Views)

Attached is my updated example with 2024Q1 Patch1 installed.  It works perfectly.  This update is going into my reuse library.

 

I know this is a small, possibly niche, feature, but it is one of the small things that does make things a lot simpler.  Good job on this, NI.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 16
(1,858 Views)

The strict type seems to work for me.

 

More importantly, if the type isn't wired, Open VI Reference does not wait for a free root loop!

 

In <24Q1 this hangs when a menu is activated:

wiebeCARYA_0-1711637545218.png

It's the only way to get a strict type reference.

 

This doesn't wait for the root loop, but it's not a strict type (e.g. no Call By Ref, Call And Collect\Forget), the alternative, Run VI method, also needs a free root loop...)

wiebeCARYA_1-1711637583576.png

 

In 24Q1, this still needs a free root loop:

wiebeCARYA_2-1711637686476.png

But this doesn't!!

wiebeCARYA_3-1711637707215.png

 

This is a HUGE win!

 

Also see Re: What am I doing wrong with asynchronous call and forget? - NI Community

Message 7 of 16
(1,726 Views)

wiebe@CARYA wrote:

The strict type seems to work for me.

 

More importantly, if the type isn't wired, Open VI Reference does not wait for a free root loop!

 

In <24Q1 this hangs when a menu is activated:

wiebeCARYA_0-1711637545218.png

It's the only way to get a strict type reference.

 

This doesn't wait for the root loop, but it's not a strict type (e.g. no Call By Ref, Call And Collect\Forget), the alternative, Run VI method, also needs a free root loop...)

wiebeCARYA_1-1711637583576.png

 

In 24Q1, this still needs a free root loop:

wiebeCARYA_2-1711637686476.png

But this doesn't!!

wiebeCARYA_3-1711637707215.png

 

This is a HUGE win!

 

Also see Re: What am I doing wrong with asynchronous call and forget? - NI Community


Now try it with an option flag wired up to the Open VI Reference.  I'm seeing the "freeze" at the Open VI Reference if I have a menu open.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 16
(1,719 Views)

@crossrulz wrote:

wiebe@CARYA wrote:

The strict type seems to work for me.

 

More importantly, if the type isn't wired, Open VI Reference does not wait for a free root loop!

 

In <24Q1 this hangs when a menu is activated:

wiebeCARYA_0-1711637545218.png

It's the only way to get a strict type reference.

 

This doesn't wait for the root loop, but it's not a strict type (e.g. no Call By Ref, Call And Collect\Forget), the alternative, Run VI method, also needs a free root loop...)

wiebeCARYA_1-1711637583576.png

 

In 24Q1, this still needs a free root loop:

wiebeCARYA_2-1711637686476.png

But this doesn't!!

wiebeCARYA_3-1711637707215.png

 

This is a HUGE win!

 

Also see Re: What am I doing wrong with asynchronous call and forget? - NI Community


Now try it with an option flag wired up to the Open VI Reference.  I'm seeing the "freeze" at the Open VI Reference if I have a menu open.


Ah, I see, so that's the bug they are going to fix!

 

Hopefully we end up with this bug fixed and no free root loop requirement. 👍

 

For NI:

This free root loop dependency is simply programmer's hell. There's really no way to win. Strict type: can't open, no strict type: run method hangs. This should be easy...

 

Once this new Open VI Reference functionality works, please have a look at fixing this for the Open VI Reference by name\path.

Message 9 of 16
(1,717 Views)

wiebe@CARYA wrote:
Ah, I see, so that's the bug they are going to fix!

The bug mentioned above was fixed with the patch:  the strict type reference works at run-time now.  So what you are seeing with the root loop is likely an artifact of the strict type reference not being passed properly at run-time before the patch.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 16
(1,715 Views)