XML data is the part of XML file that contains the object configuration of D2000 System or its sections.


Reserved sections

  1. REFERENCES - the section includes the structures representing the object and column references of object
  2. CFGRECORDS - the section includes the structure representing the data of object
  3. MEMBEROFLOGGROUP - the section includes member elements defining the logical group which the given object belongs to
  4. MEMBEROFRESGROUP - the section includes member elements defining the group of object which the given object belongs to
  5. CRC - the section includes the MD5 hash of data
  6. OBJLIFELOGS - the section includes the logs about the object history

The detailed information about the structures defining the objects of D2000 System, the attributes of structures, the value types of attributes and the values the attributes can acquire, can be find by the program to show the actual structure. This listing includes the unsupported objects and enumerated types.

REFERENCES reserved section


The example of section:
(the complete example is here)

<HOBJ_REF>
  <uid>A25DED0E4DA94B4895A119370E3AF4FB</uid>
  <name>SV.Limits</name>
  <objType>D2RECORD</objType>
  <valType>Rec</valType>
</HOBJ_REF>
<COL_REF>
  <col_idx>1</col_idx>
  <col_name>VHL</col_name>
  <col_valType>Int</col_valType>
</COL_REF>
<HOBJ_REF>
  <uid>USER_VAR</uid>
  <name>USER_VAR</name>
  <objType>SYSTEM</objType>
  <valType>NAN</valType>
</HOBJ_REF>

It includes the structures:

  • HOBJ_REF - they represent the object references of object
  • COL_REF - they represent the column references of object (object must be a structure definition or the object refers to it)

Properties of the object references:

  •  minimal attribute name must be set in each object reference
  •  uid, objType and valType attributes are optional
  •  uid attribute has a priority to the name attribute at object references matching

Properties of the column references:

  •  the column reference follows the object reference
  •  minimal attribute col_name must be set in each column reference
  •  col_idx and col_valType attributes in column reference are optional
  •  col_idx attribute has the priority to the col_name attribute at column references matching 

CFGRECORDS reserved section


The example of section:
(the complete example is here)

<TObjItemData>
  <Id>0</Id>
  <Name>U.TimeSlice</Name>
  <Descript>Time Slice</Descript>
  <Typ>USER_VAR</Typ>
  <ParentId>USER_VAR</ParentId>
  <Value_Type>TmR</Value_Type>
  <CreateTime>08.10.2009 08:10:31.366</CreateTime>
  <ModifyTime>08.10.2009 08:18:02.938</ModifyTime>
  ...
  <uuid>5CB809E9342B7A46BD790A8C7D14C69E</uuid>
</TObjItemData>
<tUserVarData_Full>
  <tUserVarData>
    <MANUAL>True</MANUAL>
    <MANUAL_VAL/>
    <FLAGS/>
    <VALUE_TIME>08.10.2009 08:10:31.379</VALUE_TIME>
    <MONITOR>False</MONITOR>
    <SAVE_VALUE>True</SAVE_VALUE>
  </tUserVarData>
  <startVal/>
</tUserVarData_Full>

This section must contain just the one structure TObjItemData at the beginning. It identifies the object uniquely. The configuration of this object is saved in XML file.
This structure is followed by another structures, they count and name depends on a particular type of object. See the example: the object is of USER_VAR type and contains the structure tUserVarData_Full.

Properties of identification structure:

  • Id attribute represents an Id of object (it is important at XML Import)
  • Name attribute need always to be set
  • uuid attribute has a priority to the Name attribute at object matching

MEMBEROFLOGGROUP reserved section


The example of section:
(the complete example is here)

<member>SELT\CD8FD25EF8A690341B111F5274CDB5AB</member>

Properties of member value:

  • it represents the object classification in the logical groups
  • it must contain the name of logical group (before the sign '\')
  • it can also contain uid of logical group (after the sign '\')

Note: This value affects the object membership in the logical groups at XML Import.

MEMBEROFRESGROUP reserved section


The example of section:
(the complete example is here)

<member>Home_s\04CB44144B2CD8E46955D846D30B0F72</member>

Properties of member value:

  • it represents the object classification in the object groups
  • it must contain the name of object group (before the sign '\')
  • it can also contain uid of the object group (after the sign '\')
  • if the name of object group is enclosed in '[' and ']' the object with children was inserted into group

CRC reserved section


The example of section:
(the complete example is here)

a7a8bda021932a3547e6553cb8980273

The CRC value represents MD5 hash formed from the contents of XML file. It includes data from <ROOT> element (<ROOT> element inclusive) to the row before CRC section (the signs CR, LF or both inclusive). The evaluation of CRC value is important for XML Import and XML Repository.

The evaluation of CRC value:

  • the section is included in data
  • :
    • MD5 hash corresponds to this value - data have not been modified
    • MD5 hash differs from this value - data have been modified
  • the section is not included in data - it is not possible to define whether data have been modified

The evaluation of CRC value influences the validity of ModifyTime attribute in TObjItemData structure of <CRGRECORDS> section. It becomes evident at XML Import as follows:

  • if the CRC value is valid the modify time of object is set on the value of ModifyTime attribute from XML file
  • if the CRC value is invalid the modify time of object is set on the time of XML file or on the current time (if the time of XML file was undefined)
  • if the CRC value was invalid or was not in XML file and, before the XML Import, the time to be changed is equal to the primary modify time of object the XML Import will change this modify time to the current time

OBJLIFELOGS reserved section


The example of section:
(the complete example is here)

<tObjLifeLogData>
  <name>U.TimeSlice</name>
  <state>OLA_CREATED</state>
  <modify_time>08.10.2009 08:16:23.761</modify_time>
  <user_name>s</user_name>
  <process_name>WS1JSTF2.CNF</process_name>
  <computer_name>WS1JSTF2</computer_name>
  <log_type>OLT_CONFIG</log_type>
  <comment_text/>
</tObjLifeLogData>

tObjLifeLogData structures represent the logs about the object history.

Properties of log structure:

  • name in logs can differ from name of object (as the object could has been renamed)
  • uid and id are not in log, because they are directly in object
  • only those logs are imported to the target configuration that have not been inserted in it for the given object

Supported value types of structure attributes


A supported value types of the structure attributes are:

Enumerated type Description of value Example of element in XML file
T_RECORD_NAME Internal name of structure. Tag name of structure
T_RECORD Value of structure type. Nested structure <tCalcData> in <tCalcData_Full>.
T_ARRAY Value of structure array type of the same type. Nested structure array <Tprvok_pola_?> v <STRIP_DATA>.
T_HOBJ Object name. <ParentId>DIAGRAMS</ParentId>
T_HOBJ_KEY Object name which is a key item. <ID_RESOURCE>Home_Pjanko</ID_RESOURCE>
T_VOBJ Object name, row and column. <CtrlObject>P.IF500_RS_WatchDog</CtrlObject>
T_BOOLEAN Enumerated type (True or False). <Read_Only>False</Read_Only>
T_BITSET Array of enumerated types (enumerated values). <IsValueDelay>Off</IsValueDelay>
T_ENUM Enumerated type (enumerated values). <Typ>POINT</Typ>
T_SIGNED_INT Integer value <-2147483647 .. 2147483648>. <TransPalIdx>0</TransPalIdx>
T_UNSIGNED_INT Integer value <0 .. 4294967295>. <Id>200449</Id>
T_SIGNED_INT_KEY Integer key value <-2147483647 .. 2147483648>. <grObjectNr>1163</grObjectNr>
T_UNSIGNED_INT_KEY Integer key value <0 .. 4294967295>. <Row>0</Row>
T_FLOAT Floating point. The values greater than 1.0E+38 will be interpreted as the value 1.0E+38 and the values less than -1.0E+38 will be interpreted as the value -1.0E+38. <BaseValue>1.00000000000000E+00</BaseValue>
T_D2TIME Value modifying a time and date. <ModifyTime>18.07.2003 11:52:09.674</ModifyTime>
T_STRING Text with defined length. <PassCode>ROOT_CFGRECORDS_TUserData_PassCode</PassCode>
T_BOUNDED_STRING Text with defined maximal length. <Name>D.PIPA_CHSO2_Mh</Name>
T_UNBOUNDED_STRING Text with unlimited length. <statement>TextTextTextTextText</statement>

Value types can be:

  • structured - T_RECORD and T_ARRAY
  • simple - all the others

The string values T_STRING, T_BOUNDED_STRING or T_UNBOUNDED_STRING can be:

  • SDT_NORMAL - normal string
  • SDT_EXPRESSION - string of expression type
  • SDT_RAW_DATA - string defining the binary data

Properties of SDT_RAW_DATA type:

  • attribute of SDT_RAW_DATA type indicates that XML file has the binary file
  • data of binary file represents the real value of the attribute of SDT_RAW_DATA type
  • the value of attribute of SDT_RAW_DATA file, stated in XML file, contains the nesting of attribute (it is ignored)
  • XML Export saves the binary file with name <object_name>_<attribute_nesting>.bin
  • XML Import searches the binary file with name <xml_file_name>_<attribute_nesting>.bin
  • if the object name in XML file is not renamed (element <Name>), then both XML Export and XML Import works with the binary file of the same name (e.g. U.UserVar_ROOT_CFGRECORDS_TUserData_PassCode.bin) that is placed in the same directory as XML file (it is its necessary part)

Properties of T_ARRAY type:

  • item name is in form ItemName_[X] (instead of [X] is either a value range from 0..N or the values of enumerated type)
  • the items can be of T_RECORD type or single type

Example of XML file representing of object of D2000 System


The following example demonstrates the saving of the object of USER_VAR type with the name U.TimeSlice into XML file:

<?xml version="1.0" encoding="windows-1250"?>
<!--$Date: 2012/07/04 05:05:23 $ $Revision: 1.10 $ $Author: pbrezina $ $ExpSubDir: Common\Planner $-->
<ROOT>
  <REFERENCES>
    <HOBJ_REF>
      <uid>A25DED0E4DA94B4895A119370E3AF4FB</uid>
      <name>SV.Limits</name>
      <objType>D2RECORD</objType>
      <valType>Rec</valType>
    </HOBJ_REF>
    <COL_REF>
      <col_idx>1</col_idx>
      <col_name>VHL</col_name>
      <col_valType>Int</col_valType>
    </COL_REF>
    <HOBJ_REF>
      <uid>USER_VAR</uid>
      <name>USER_VAR</name>
      <objType>SYSTEM</objType>
      <valType>NAN</valType>
    </HOBJ_REF>
  </REFERENCES>
  <CFGRECORDS>
    <TObjItemData>
      <Id>0</Id>
      <Name>U.TimeSlice</Name>
      <Descript>Time Slice</Descript>
      <Typ>USER_VAR</Typ>
      <ParentId>USER_VAR</ParentId>
      <Value_Type>TmR</Value_Type>
      <CreateTime>08.10.2009 08:10:31.366</CreateTime>
      <ModifyTime>08.10.2009 08:18:02.938</ModifyTime>
      <Text_Palette/>
      <Read_Only>False</Read_Only>
      <TECH_UNIT/>
      <UseLimits>False</UseLimits>
      <VHL>1.00000000000000E+38</VHL>
      <HL>1.00000000000000E+38</HL>
      <LL>-1.00000000000000E+38</LL>
      <VLL>-1.00000000000000E+38</VLL>
      <VHL_ID>SV.Limits[1]^VHL</VHL_ID>
      <HL_ID/>
      <LL_ID/>
      <VLL_ID/>
      <Hysterezia>0.00000000000000E+00</Hysterezia>
      <TransPalIdx>0</TransPalIdx>
      <Hidden>False</Hidden>
      <uuid>5CB809E9342B7A46BD790A8C7D14C69E</uuid>
    </TObjItemData>
    <tUserVarData_Full>
      <tUserVarData>
        <MANUAL>True</MANUAL>
        <MANUAL_VAL/>
        <FLAGS/>
        <VALUE_TIME>08.10.2009 08:10:31.379</VALUE_TIME>
        <MONITOR>False</MONITOR>
        <SAVE_VALUE>True</SAVE_VALUE>
      </tUserVarData>
      <startVal/>
    </tUserVarData_Full>
  </CFGRECORDS>
  <MEMBEROFLOGGROUP>
    <member>SELT\CD8FD25EF8A690341B111F5274CDB5AB</member>
  </MEMBEROFLOGGROUP>
  <MEMBEROFRESGROUP>
    <member>Home_s\04CB44144B2CD8E46955D846D30B0F72</member>
  </MEMBEROFRESGROUP>
  <CRC>a7a8bda021932a3547e6553cb8980273</CRC>
  <OBJLIFELOGS>
    <tObjLifeLogData>
      <name>U.TimeSlice</name>
      <state>OLA_CREATED</state>
      <modify_time>08.10.2009 08:16:23.761</modify_time>
      <user_name>s</user_name>
      <process_name>WS1JSTF2.CNF</process_name>
      <computer_name>WS1JSTF2</computer_name>
      <log_type>OLT_CONFIG</log_type>
      <comment_text/>
    </tObjLifeLogData>
  </OBJLIFELOGS>
</ROOT>

0 komentárov

Nie ste prihlásený. Akékoľvek zmeny, ktoré vykonáte, sa označia ako anonymné. Ak už máte svoj účet, pravdepodobne sa budete chcieť prihlásiť .