LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reference bug

I have two VI. Main.vi and RefController.vi. I'm trying to control a cluster contained in the Main.VI. To achieve this I'm initializing a Reference in the RefController VI, see attachment.

The problem! I'm able to initialize a Boolean with this method. But I got an error when I try to initialize a Reference.

Any idea why?

Nitrof
0 Kudos
Message 1 of 2
(2,470 Views)
You're trying to pass a refnum thru the VARIANT process - there is no variation for that.

A REFNUM is more than an integer, it's an integer that carries a TYPE associated with it - there are control refnums, datalog file refnums, connection refnums, all kinds of refnums.

This TYPE information is maintained by LabVIEW behind the scenes. But you can't strain it thru a VARIANT-passing mechanism (like your example tries to do) without error.

I'm not sure what you want to accommplish, but you could:

1... Post the refnum to a global variable, and read it in your dynamic subVI.

or

2... Use CALL BY REFERENCE instead of INVOKE NODE and pass the refnum directly

or

3... Typecast the refnum to an I32, pass it thru the variant mechanism,
and typecast it back to the appropriate type on the other end.


Hope that helps
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 2 of 2
(2,470 Views)