From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generic Ref != Generic Ref ?

Solved!
Go to solution

I wrote a little utility to find the first VI in a call chain that has an open front panel.  To test it, I tried to add Reference-To-Path and got a strange result.  Note the error message.  Upon more research, it turns out the difference is between a VI Server reference and a VI reference, but the error message could be a bit more clear.

 

Steve

 

odd error 8.6.1.PNG 

0 Kudos
Message 1 of 2
(2,096 Views)
Solution
Accepted by topic author Steve Vetter

No the difference is between a generic file refnum and a VI reference. The Refnum to Path function only works on a file refnum and nothing else. The problem here is that the Refnum to Path function is an auto adapt function. It adapts to the wired input but then sees that it can not use that datatype and therefore flags the wire bad.

 

Technically the error message is right, since the input of the Refnum To Path function already has adapted to the wired up refnum. But I agree that it is not to user friendly.

 

Your problem is that you assumed that the LabVIEW refnum datatype is simply one type and all refnum functions are compatible with all refnum types. But that is far from the truth. Each refnum type is in fact it's own class, some are decendent from other classes much like in OOP but others are completely independant to each other with no common ancestor at all.

 

The Refnum to Path function is a relict from a time when there were no property and method nodes in LabVIEW. It could retrieve the path that is used to open a specific file refnum but it can not deal with any other LabVIEW refnums.

 

To get the path of the VI that a VI refnum corresponds to, you have to drop a property node and select the according property.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 2
(2,086 Views)