Data Record XML Details

Introduction

Most Galil controllers have a data record. The data record is a binary representation of much of the hardware's current state. By analyzing this controller snapshot, much information can be obtained about the machine.

GDK uses record.xml to determine how to dissect the binary data record.

The Element Tags

<records version="2.0">

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


<vmap>

<vmap name="SC">

Provides a value map used to map a data record value to a human-readable string. This is useful for data such as stop code. Value maps must be defined prior to any use in a field element.

The <vmap> element has one mandatory attribute, name. This is the name used to reference the value map.


<map>

<map in="31" out="PVT completed normally" />

<map> is a sub-element of <vmap>. It represents a value-string mapping for the value map.

The mandatory attribute in defines the input to the mapping, namely the value.

The mandatory attribute out defines the output from the mapping, namely the string.


<record>

<record key="DMC40_0, DMC41_3, DMC42_0, DMC50_0, DMC52_0, DMC18_6">

Defines the beginning of a data record definition. All the following elements are sub-elements of <record>.


<shift>

<shift key="DMC18_6">-4</shift>

Defines a value to add to all data record offsets in the <o> element that occur after this element.


<f>

<f s="_TC" vmap="TC"><d>Error Code</d><o>50</o><t>201</t></f>

Defines a data record field. A field is a single piece of information extracted from a data record.

The mandatory attribute s must be a unique string that serves as the key for identifying the field. This source key is used by both the Viewer and the Scope to reference the field.

The optional attribute vmap contains the name of the value map associated with this field.


<d>

<d>Thread 7 Running</d>

Mandatory sub-element of <f>. Defines the human-readable description of the field.


<o>

<o>148</o>

Mandatory sub-element of <f>. Defines the offset, in bytes, from the beginning of the data record to the beginning of the data referenced in the field. The offset value is modified by the <shift> element.


<t>

<t>200</t>

Mandatory sub-element of <f>. Defines the data type of the data referenced in the field. The type is defined by a numeric code as shown in the following table.

TypeWidth (Bits)Minimum ValueMaximum Value<t></t> Type Tag Value
Byte8-128127200
Unsigned Byte80255201
Single Bit, Bit 01011
Single Bit, Bit 11012
Single Bit, Bit 21014
Single Bit, Bit 31018
Single Bit, Bit 410116
Single Bit, Bit 510132
Single Bit, Bit 610164
Single Bit, Bit 7101128
12 Bit Value *16-20482047204
Unsigned 12 Bit Value *1604095205
Word16-3276832767202
Unsigned Word16065535203
Long32-21474836482147483647206

* The 12 Bit Value type is specially designed for 12 bit Analog I/O. The storage width is 16 bits, but the lower 4 bits are shifted out when determining the value.


<m>

<m>0.00030517578125</m>

Optional sub-element of <f>. Defines the slope of the linear equation, y = mx + b. In some contexts, GDK will apply the linear transform to scale the field's value for the user. This is useful for scaling DAC and ADC counts to volts, and scaling values to user units. If omitted, the default value is 1.0.


<b>

<b>-32767.0</b>

Optional sub-element of <f>. Defines the y-intercept of the linear equation, y = mx + b. In some contexts, GDK will apply the linear transform to scale the field's value for the user. This is useful for scaling DAC and ADC counts to volts, and scaling values to user units. If omitted, the default value is 0.0.


<p>

<p>4</p>

Optional sub-element of <f>. Sets the precision of the number produced from the linear transform. If omitted, the default value is 0, indicating the value should have no fractional digits. Used in Viewer displays and Scope cursors.


<u>

<u>counts</u>

Optional sub-element of <f>. Sets the units of the field. If omitted, the units are unspecified, i.e. an empty string.