LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

typedef update creates error in call by reference: a success story

Dear all,

i was riddled by the following problem, and i found the solution while writing this post! let me share it:

typedef update.PNG

 

I have a VI that plots data, and the involved clusters (input, input2) are of same typedefs.
In my project I ise the call by reference to open multiple independant instances of the plot VI. Tis worked well until i recently updated the typedef (i added some array).

now the input wire is broken.

 

The reason is that the VI reference of the "tye specifier VI Refnum" was not updated, i had to manually do that.

best,

OPCer

0 Kudos
Message 1 of 3
(2,567 Views)

You can also drop a Static VI Reference node from the Application Control palette, drag your VI into it and right click it to make the reference strict, which will preserve the connector pane information. Then you don't have to update it at all.

 

This also has the advantage that you can use the static reference to get the VI Name property and wire that into the property node, so that you're not depending on the VI name staying the same and, because the reference to the VI is static, it will also cause the VI to be automatically included in the build when you build an EXE.


___________________
Try to take over the world!
0 Kudos
Message 2 of 3
(2,561 Views)

@tst wrote:

You can also drop a Static VI Reference node from the Application Control palette, drag your VI into it and right click it to make the reference strict, which will preserve the connector pane information. Then you don't have to update it at all.

 

This also has the advantage that you can use the static reference to get the VI Name property and wire that into the property node, so that you're not depending on the VI name staying the same and, because the reference to the VI is static, it will also cause the VI to be automatically included in the build when you build an EXE.


I've also been using this method for Asynchronous Calls as well, for precisely the reasons mentioned by tst.  Here's a concrete example:

Async Call.png

One (minor) difference is the Strict Static Reference makes the Property Node change if the connector pane of the referenced VI changes.  Note also the virtue of making Icons for your sub-VIs -- it makes code like this more-or-less self-documenting.

 

Bob Schor

0 Kudos
Message 3 of 3
(2,550 Views)