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.
Type | Width (Bits) | Minimum Value | Maximum Value | <t></t> Type Tag Value |
---|---|---|---|---|
Byte | 8 | -128 | 127 | 200 |
Unsigned Byte | 8 | 0 | 255 | 201 |
Single Bit, Bit 0 | 1 | 0 | 1 | 1 |
Single Bit, Bit 1 | 1 | 0 | 1 | 2 |
Single Bit, Bit 2 | 1 | 0 | 1 | 4 |
Single Bit, Bit 3 | 1 | 0 | 1 | 8 |
Single Bit, Bit 4 | 1 | 0 | 1 | 16 |
Single Bit, Bit 5 | 1 | 0 | 1 | 32 |
Single Bit, Bit 6 | 1 | 0 | 1 | 64 |
Single Bit, Bit 7 | 1 | 0 | 1 | 128 |
12 Bit Value * | 16 | -2048 | 2047 | 204 |
Unsigned 12 Bit Value * | 16 | 0 | 4095 | 205 |
Word | 16 | -32768 | 32767 | 202 |
Unsigned Word | 16 | 0 | 65535 | 203 |
Long | 32 | -2147483648 | 2147483647 | 206 |
* 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.