NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Unflatten from TestStand XML

Solved!
Go to solution

I am looking for an efficient solution to convert an XML string created by the GetXML() method of the TestStand API into LabVIEW datatypes.

The TestStand datatype (parameter for the GetXML() method) is an array of a Custom Data Type.

I just cannot get the conversion done with LabVIEW's Unflatten From XML VI when attempting to recreate the Custom Data Type as an input for the Unflatten From XML VI.

 

Now I have also tried with a simple number as TestStand variable but also could not unflatten the resulting XML string.

I guess the XML schemas for TestStand and LabVIEW just dont match.

 

Is this generally possible?

What would be the best solution to retrieve the data from the TestStand generated XML string?

0 Kudos
Message 1 of 2
(868 Views)
Solution
Accepted by stefanha

So yeah LabVIEW and TestStand XML are not the same thing.  You can't use one to write it and the other to read it.

 

You need to use SetXML:

 

SetXML Method

Syntax

PropertyObject.SetXML ( xmlStream, reserved1, reserved2 = ConflictHandler_Error)

Purpose

Reads the contents of a stream of XML string data and stores the contents in the PropertyObject to which the method applies.

Remarks

You can use the PropertyObject.GetXML method to generate the corresponding XML this method requires.

You cannot unserialize a stream that contains a container type into a property object that is a value type, or vice versa. This method does not return an error. Instead, it sets the PropertyObject on which this method operates to the default value.

If you attempt to unserialize a stream that contains a value type into a property object of a different value type, TestStand attempts to coerce the value. If the coercion is unsuccessful, TestStand only resets the PropertyObject on which this method operates to the default value.

TestStand does not assign the name and some flags associated with the top-level PropertyObject in the stream to the PropertyObject on which this method operates.

Refer to the World Wide Web Consortium-compliant XML schema file, PropertyObject.xsd, located in the <TestStand>\Components\Models\TestStandModels directory, for more information about the output of the PropertyObject.GetXML method and the required format for the input stream to this method.

The <TestStand>\Components\Models\TestStandModels\Report.xsd file defines the XSD schema definition for XML reports.

Parameters

xmlStream As String

[In] Specifies an XML stream.

reserved1 As Long

[In] Pass 0.

reserved2 As TypeConflictHandlerTypes

[In] This parameter is reserved for when the PropertyObject.GetXML method supports storing type information in an XML stream. This parameter specifies how to handle type conflicts in the stream.

This parameter has a default value of ConflictHandler_Error.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 2
(801 Views)