Jump to content

Unflatten from XML Working Incorrectly


Recommended Posts

Hi All-

I have run into a roadblock while trying to write a general program to read/write VI controls.

The finished program would use the VI control references, read the value of each control as a variant, convert it to XML, change the value in the XML, convert it back to a variant, and replace the original control's value.

I was getting an error (#91, Property Node (arg 1)) that I have narrowed down to this:

LabVIEW does not allow you to convert XML to a populated variant; it creates only a blank variant.

The attached file shows this problem. I am not modifying the XML data, and I am using the original variant as the Unflatten prototype, but the error occurs. In effect, the reciprocal XML function does not work on variants.

Is there any way around this problem? Is there a method to create a deterministic non-blank variant? I am planning to investigate importing and exporting variants to a non-LabVIEW DLL, but haven't had a chance yet.

And, yes I know, I can use strict type definitions, and that will work fine until you get to clusters. I am just trying to make it universal, and avoid the complexities of unknown clusters!

Thanks-

-Randy

Download File:post-1393-1106171617.vi

Link to comment
Hi All-

I have run into a roadblock while trying to write a general program to read/write VI controls.

The finished program would use the VI control references, read the value of each control as a variant, convert it to XML, change the value in the XML, convert it back to a variant, and replace the original control's value.

I was getting an error (#91, Property Node (arg 1)) that I have narrowed down to this:

LabVIEW does not allow you to convert XML to a populated variant; it creates only a blank variant.

The attached file shows this problem. I am not modifying the XML data, and I am using the original variant as the Unflatten prototype, but the error occurs. In effect, the reciprocal XML function does not work on variants.

Is there any way around this problem? Is there a method to create a deterministic non-blank variant? I am planning to investigate importing and exporting variants to a non-LabVIEW DLL, but haven't had a chance yet.

And, yes I know, I can use strict type definitions, and that will work fine until you get to clusters. I am just trying to make it universal, and avoid the complexities of unknown clusters!

Thanks-

-Randy

3596[/snapback]

This is a known limitation of LabVIEW. It has to do with the fact that they use the strict data type as the definition of the data, rather than using the XML as the definition of the data.

The OpenG version of "Flatten(Unflatten) to(from) XML" does not have this limitation. You can obtain it from here:

OpenG Flatten to XML

You will also need to install OpenG Commander and the lvdata package (and its dependencies).

If you have any questions about the installation of the OpenG tools, please feel free to ask them in the OpenG Discussion Forums.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.