Maze Posted June 29, 2009 Report Share Posted June 29, 2009 I can't convert the following XML string to an LabVIEW data type: <CommunicationMessage> <CommandMsg> <MsgID>1298983-123321-29932</MsgID> <Command>MyStatus</Command> <Parameter ParamName="Status">Waiting</Parameter> <Parameter ParamName="onlineStatus">online</Parameter> </CommandMsg> </CommunicationMessage> See attachment "NOT ok.jpg" for my test code. The "Variant To Data.vi" report error 91 (LabVIEW: The data type of the variant is not compatible with the data type wired to the type input.). The "Easy Parse XML.vi" do not report any error. The strange thing is that it works the other way around. The are no problem to create an XML string from the same LabVIEW data type as in my first example. The result string is exactly the same as the XML string above. See attachment "Ok.jpg" for the test code. I am using your "EasyXML" trial version, LabVIEW 8.5 and Vista Business with SP1. Link to comment Share on other sites More sharing options...
TonP Posted June 29, 2009 Report Share Posted June 29, 2009 I can't convert the following XML string to an LabVIEW data type:The strange thing is that it works the other way around. The are no problem to create an XML string from the same LabVIEW data type as in my first example. The result string is exactly the same as the XML string above. See attachment "Ok.jpg" for the test code. The cluster element inside the array needs to be named 'Parameter' as well, so right click on the cluster border and select 'Visible->label' Ton Link to comment Share on other sites More sharing options...
Maze Posted July 1, 2009 Author Report Share Posted July 1, 2009 Sorry to say but it did't help. The parser don't care about that Label. But I found the problem It was the element order in the array cluster that was wrong. My "Parameter" had order 0 while "#attributes" had order 1. I just switched the order and now it's working. And you can see that I changed the Label in cluster element inside the array to "Foo" and it works just fine. Link to comment Share on other sites More sharing options...
Jim Kring Posted July 1, 2009 Report Share Posted July 1, 2009 Sorry to say but it did't help. The parser don't care about that Label. But I found the problem It was the element order in the array cluster that was wrong. My "Parameter" had order 0 while "#attributes" had order 1. I just switched the order and now it's working. And you can see that I changed the Label in cluster element inside the array to "Foo" and it works just fine. I'm glad to hear that you found the issue and that it was a simple fix. I'm not sure if this relates to your issue, but I usually always set cluster Autosizing to Arrange Vertically (or Horizontally), so that the cluster element order is obvious. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.