Data record for non-default analog I/O

Getting Started

The purpose of this exercise is to modify the data record XML used by GDK to properly scale analog IO when using non-default settings for AQ and DQ. The following are the required components to perform this exercise.

  1. GDK supported Galil controller with analog ranges settable by AQ or DQ.
  2. A computer running the latest version of GDK software.
  3. A text editor such as gedit on Linux, or Notepad++ on Windows.
  4. The controller's command reference page for AQ and/or DQ

GDK's XML

Setting non-default analog scaling involves editing GDK's data record xml. The following two chapters are helpful before continuing.

  1. GDK's XML Content
  2. Data Record XML Details

Analog Inputs, AQ, Determine the Needed Settings

Note the AQ settings that shall be set for each analog input. From the desired setting, note the <t>, <m>, and <p> element values to be used from the following tables.

12 Bit Analog Inputs, I12B

Voltage RangeData TypeCounts per volt<t> Element<m> Element<p> Element
-5 to +512 bit Word409.62040.002441406253
-10 to +10 (default)12 bit Word204.82040.00488281253
0 to +512 bit Unsigned Word819.22050.0012207031253
0 to +1012 bit Unsigned Word409.62050.002441406253

Example, Default Analog Input 1

<f i="I12B" s="@AN[1]"><d>Analog Input 1</d><o>110</o><t>204</t><m>0.0048828125</m><p>3</p></f>

16 Bit Analog Inputs, I16B

Voltage RangeData TypeCounts per volt<t> Element<m> Element<p> Element
-5 to +5Word6553.62020.0001525878906254
-10 to +10 (default)Word3276.82020.000305175781254
0 to +5Unsigned Word13107.22030.00007629394531255
0 to +10Unsigned Word6553.62030.0001525878906254

Example, Default Analog Input 1

<f i="I16B" s="@AN[1]"><d>Analog Input 1</d><o>110</o><t>202</t><m>0.00030517578125</m><p>4</p></f>

Analog Ouputs, DQ, Determine the Needed Settings

Note the DQ settings that shall be set for each analog output. From the desired setting, note the <t>, <m>, <b>, and <p> element values to be used from the following table.

12 and 16 Bit Analog Outputs, O12B, O16B

Voltage RangeData TypeCounts per volt<t> Element<m> Element<b> Element<p> Element
-5 to +5Unsigned Word6553.62030.000152587890625-5.03
-10 to +10 (default)Unsigned Word3276.82030.00030517578125-10.03
0 to +5Unsigned Word13107.22030.00007629394531250.03
0 to +10Unsigned Word6553.62030.0001525878906250.03

Example, Default Analog Ouput 0

<f s="@AO[0]"><d>Analog output 0</d><o>8</o> <t>203</t><m>0.00030517578125</m><b>-10.0</b><p>4</p><u>volts</u></f>

Make the Changes

Open record.xml in a text editor.

  1. In GDK's main options menu, open the settings directory by clicking Settings... and then click the Files button.
  2. Open the xml subdirectory to view the files.
  3. Open record.xml in a text editor.

Find the analog entry in the data record structure for the analog I/O point(s) using nonstandard AQ and/or DQ. Many editors have a find feature. Searching for @AN for analog inputs or @AO for analog outputs will help to quickly find the analog I/O.

Be sure that the correct entry has been found for the product. See Content Filtering.

Be sure that the correct entry has been found for the resolution of the I/O, e.g. I16B, O16B or I12B, O12B.

Once the correct I/O point has been found, enter the new values for <t>, <m>, <b>, and <p>.

Save the changes, close record.xml, and restart GDK. The analog values should now be scaled in areas where scaled values are used by GDK.

Conclusion

Much of GDK's data formatting is taken care of behind-the-scenes without user interaction. For AQ and DQ, this formatting is not automatic. However, by editing GDK's XML content, the desired scaling can easily be set.