Skip to content

C.2 XML representation of SDT instances.

ModuleClasses, SubDevice models and DeviceClass models written in clause 5 are expressed another way with using each class names as the tag. This clause introduces this way.

Normative work for defining the mapping rules from SDT to XML/ JSON instance are defined by SDT4.0.

C.2.1 Mapping Rules of XML representation

Mapping from SDT instance into XML representation is following. Inclusion relationship of SDT instances are directly expressed as inclusion relationship of XML tags. Tag name is the same as each classes.

<DeviceClass Class Name>
    <SubDevice Class Name>
        <ModuleClass Class Name>
             <DataPoint Class Name>value</DataPoint Class Name>
             <Property Class Name>value</Property Class Name>
        </ModuleClass Class Name>
    </SubDevice Class Name>
</DeviceClass Class Name>

Action Class can not have any value and it only lengthen the message so it is omitted.

When a certain device does not have any SubDevice, the tags about SubDevices don't appear and tags about ModuleClass are placed under the DeviceClass directly.

C.2.2 Example of XML representation

Below is the example for deviceThreeDPrinter:

<deviceThreeDPrinter>
    <binarySwitch>
        <powerState>True</powerState>
        <toggle></toggle>
    </binarySwitch>
    <faultDetection>
        <status>False</status>
        <code></code>
        <description></description>
    </faultDetection>
    <3Dprinter>
        <printType>2</printType>
        <printSizeX>70</printSizeX>
        <printSizeY>80</printSizeY>
        <printSizeZ>90</printSizeZ>
        <network>True</network>
        <memorySize>100</memorySize>
    </3Dprinter>
    <runState>
        <currentMachineState>1</currentMachineState>
        <machineStates>1,2,3</machineStates>
        <currentJobState>1</currentJobState>
        <jobStates>1,2,3</jobStates>
        <progressPercentage>60</progressPercentage>
    </runState>
    <temperature>
            <currentTemperature>20</currentTemperature>
            <targetTemperature>23</targetTemperature>
            <unit>celsius</unit>
            <minValue>15</minValue>
            <maxValue>28</maxValue>
            <stepValue>0.1</stepValue>
    </temperature>
    <printQueue>
            <uri> file://www.example.com/file.extension</uri>
            <printingState>1</printingState>
    </printQueue>
</deviceThreeDPrinter>