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: 

Error code 1057

I'm trying to create a SubVI that initiates the front panel objects. As input I have a control reference so that any object can be wired as an input, I also have a variant input, this is where the init. value is wired.
In the SubVI I try to type cast the control reference to the corresponding reference (if user wires a boolean ref. to the control ref. input I type cast that into a boolean ref. again.) using "to more specific class".
 
This doesnt allways work if I select "include data type" of the specific reference. I get an error code 1057.
 
Can someone understand what I'm writing and if so, point me in the right direction.
 
 

Message Edited by Klump on 02-22-2007 08:44 AM

There's three different kinds of people, those who can count, and those who can't.
0 Kudos
Message 1 of 5
(5,162 Views)
When you specify "Include Data Type" you're basically specifying that the "Value" property of the control has a data type. If you don't, it will be of type "Variant". If you set the "Include Data Type" you're basically forcing the user to wire the exact type of data that the control expects, even though your "Value" input is a variant. Otherwise you'll get an error 91 when LabVIEW tries to cast the variant input to the control's basic data type. So, for example if I were to wire a Boolean reference to your VI and wire a double to the "Value" input I'd get an error 91. If you set the Boolean reference on your VI to "Include Data Type" you have to include a "Variant to Data" function in your code to convert the variant to a Boolean. In this case the "Variant to Data" function would generate the error code 91 for the example I just gave.

Whether or this is what you want depends on what you're trying to do. Perhaps if you provided more details on what your overall goal is...

By the way, you don't really need to create control references on your subVI's front panel. You can just use a reference constant on the block diagram. Less objects.
0 Kudos
Message 2 of 5
(5,148 Views)

Thanks for the tip, I'll do that.

My real problem was when I wanted to wire an empty array to History Data for a Waveform Chart. I got a type missmatch, but I think I figured it out, the chart was from an older version of Labview, when I replaced it with a knew everthing worked fine.

Another problem, when I wire an Enum to the Variant input I can't convert it back to an Enum again for wiring it to value property.

 

 

 

There's three different kinds of people, those who can count, and those who can't.
0 Kudos
Message 3 of 5
(5,145 Views)
Not sure why you would need to do this. As you had posted your VI the wiring of an enum reference with a enum constant wired to the "Value" input worked just fine. Unless you tried to change the enum reference on your subVI to "Include Data Type"? In that case, your conversion won't work because each enum control/reference is unique. You have to stick with the "Include Data Type" unchecked for your subVI's enum control reference.
0 Kudos
Message 4 of 5
(5,137 Views)

Hi , 

I am reading the Network Mode from MAX , depend on whether NI NODE is Mesh Router or End Node , radio button will automatically selected , this program is working very good but when I try to use this code in diffent labview Program then at RUN time it show error --

Error.png

I am just copy and paste this program n different VI , please help me how can I remove this error.

 

 

 

 

Regards

Rita

 

0 Kudos
Message 5 of 5
(4,365 Views)