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: 

Problem with LabVIEW 8.2: when passing data to a variant control of a sub-VI, the wrong name sometimes appears

I am converting a large application from LabVIEW 7.1 to 8.2 and I have noticed that when you pass a data element into a variant control of a sub-VI, under certain circumstances the name is incorrect.  The data value and type are OK but the wrong name appears.  I have done some experimentation and found that it occurs when the sub-VI is contained in a case structure and there is a constant or variable connected to an output tunnel.  The name that appears in the variant is taken from this constant or variable, even if it is not connected to the sub-VI!  The application is trying to save device configurations in a general way and, therefore, counts on getting the correct name.
 
Has anyone else seen this happen?
0 Kudos
Message 1 of 6
(2,873 Views)

I am attaching some sample VI's which illustrate the problem discussed above.  Open both VI's.  Run "Tester 2" then look at the front panel of "Test sub-VI".  You will see that the name is "wrong name" when it should be "Investigator id".  Then check the block diagram of "Tester 2" and you'll see that the "wrong name" constant is not even connected to the sub-VI.  How does this information get into the sub-VI?

Download All
0 Kudos
Message 2 of 6
(2,860 Views)
I agree this looks like a bug, especially if it worked in previous versions.
 
Everything works fine if you insert a "To Variant" between control and subVI, avoiding the automatic coercion.
 

Message Edited by altenbach on 10-28-2006 11:00 AM

Message 3 of 6
(2,854 Views)

Yes, I had noticed that inserting a "To Variant" fixed the problem.  However, it is not a robust solution because it is too easy to forget the "To Variant" on future calls.

I also noticed that the problem appears even if the loop structure does not enclose the sub-VI:

0 Kudos
Message 4 of 6
(2,837 Views)


@jimbamber wrote:
I also noticed that the problem appears even if the loop structure does not enclose the sub-VI.

Actually, in your example, I can run it once, delete the case structure, the case selector, AND the "wrong name" diagram constant (!) and "wrong name still appears in the subVI when I run it. (However, if I now save the toplevel VI under a new name, the problem clears up.)

Very strange!

Message 5 of 6
(2,823 Views)
Sorry for the inconvenience, I agree this looks like a bug.  This was reported to R&D (42T7HT1W) for further investigation.  As far as a workaround goes, I believe the use of the To Variant function like altenbach mentioned is going to be your best bet.
Message 6 of 6
(2,792 Views)