DMC Language XML Details

Introduction

GDK provides DMC language parsing. This is used, for example, by the Editor tool to provide syntax highlighting.

GDK uses dmc.xml to define the command set used by the hardware.

The folowing commands are automatically recognized by the parser and should not be documented in the xml.

  • NO no operation comment.
  • REM comment.
  • TIME operand.
  • ELSE control statement.
  • ENDIF control statement.

The Element Tags

<dmc version="2.0">

This is the XML root element. It contains the version of the xml syntax.


<subset>

<!-- ******************************************************************** -->
<!-- **** EtherCAT ****************************************************** -->
<!-- ******************************************************************** -->
<subset key="DMC50_0, DMC52_0">

Provides a convenience tag for organizing commands under a group. There should be an XML comment above the <subset> tag to describe its group.


<s>

<s><m>+</m><d>Addition Operator</d><t>14</t></s>

<s> is the symbol element defining one symbol of DMC code. All the following elements are sub-elements of <s>.

The optional attribute context informs the parser that the symbol should be evaluated in a special context. The valid values for this attribute are the following.

  • "handle" Indicates that the symbol refers to an Ethernet handle, not an axis or process control loop. This changes the meaning of the characters A,B,C,D,E,F,G, and H.

<m>

<m>_TP</m>

Mandatory sub-element of <s>. <m> is the match element defining the substring that is matched to indicate that a length of the parsed code is this symbol.


<d>

<d>Linear Interpolation Mode</d>

Mandatory sub-element of <s>. <d> is the description element defining a human-readable description of this symbol.


<t>

<t>24</t>

Mandatory sub-element of <s>. <t> is the type element defining the syntax type of this symbol. The type is defined by a numeric code as shown in the following table.

Syntax TypeExample<t></t> Type Tag Value
Two LetterBN2
ExplicitIHA=192,168,0,423
ImplicitCN -1,-1,-1,0,0 4
Explicit or ImplicitKPA=6
KP 6,42
5
Accepts multi-axis maskST ABC6
Operator or Comparator+
=
14
Automatic Subroutine#AUTO15
@ Function@FRAC[3.14]22
Operand_TPA24
Control StatementJS#sub25

<p>

<p>m</p>

Optional sub-element(s) of <s>. Used in operands, <p> is the postfix element defining the patern(s) that can make up a suffix for a symbol.

The most common postfix is m which indicates that a symbol can end in an axis designator, as in A in _TPA.

<s><m>_TP</m><d>Tell Position Operand</d><t>24</t><p>m</p></s>

Some operands have numbered postfix values, as in 4 in _ED4.

<s><m>_ED</m><d>Edit Operand</d><t>24</t><p>0</p><p>1</p><p>2</p><p>3</p><p>4</p></s>

m and a number may be mixed in a postfix, as in A1 in _IHA1

<s context="handle"><m>_IH</m><d>Open IP Handle Operand</d><t>24</t><p>m0</p><p>m1</p><p>m2</p><p>m3</p><p>m4</p></s>