rgrunwell Posted January 19, 2005 Report Share Posted January 19, 2005 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 Quote Link to comment
Jim Kring Posted January 19, 2005 Report Share Posted January 19, 2005 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. Quote Link to comment
rgrunwell Posted January 20, 2005 Author Report Share Posted January 20, 2005 Thanks, Jim! -Randy Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.