Generate a Generic GSI Script

Sensors utilizing serial communication that are not already listed in the X2 sensor script library can be configured to communicate with the X2 by generating a Generic General Serial Interface (GSI) script.

Note: The X2 data logger only supports the RS-232 and RS-485 serial communication protocols. This utility requires a CONNECT firmware version of V2.22.7.2 or higher.

GSI Script Utility

  1. Connect the X2 logger to a PC and launch the CONNECT software. Test connection by reading the RTC clock of the logger in the CONFIG tab.
  2. On the CONFIG tab, click the drop down arrow to the right of the Create Script button and select Generic GSI.

Figure 1: Create a generic GSI script.


  1. The GSI Script Utility menu will appear.


Sensor-Specific GSI Script

The manufacturer and model of common sensors using GSI communication are available within the GSI script utility. By selecting the manufacturer and model of the sensor, the utility will automatically generate a list of known parameters measured by the device. If the manufacturer and model for the sensor are available, skip to the GSI Script Specifications section to begin creating a GSI script.

Figure 2: Turner Designs C3 Submerisble Fluorometer selection.


Generic GSI Script (Requires CONNECT software version of V3.23.3.23 or higher)

If the sensor is not available within the script utility, contact NexSens Technology at (888)-426-2151 or at to request the sensor addition or review the process below to create a Generic GSI script.

Sensors communicating via GSI can be separated into different categories based on their serial output. The first category is defined by the delimitation for the sensor output:

  1. Comma delimited (CSV)
  2. Space/tab delimited

The second category is whether the sensor requires a command to start outputting data or gathering a reading. Sensors can be separated into the following categories:

  1. No command: as soon as power is applied, the sensor begins to output data 1 line at a time continuously.
  2. Single command: the sensor is in an idle state when power is applied.  A single command is required for the sensor to start outputting data continuously.
  3. Multiple commands: the sensor is in an idle state when power is applied.  A command is required to be sent for each data line.

The generic GSI script only works with sensors that output uniform data in table format as defined below:

  • Each line contains 1 or more parameters.
  • Each column contains exactly 1 parameter.
  • The same column holds data from the same parameter.
  • Multiple parameters on the same line are separated by a comma, space, or tab.

Below are examples of uniform and non-uniform data output. Only the uniform data output is compatible with the GSI script utility.

  • Uniform csv output
    • 03/12/2023 13:22:00,21.2,8.5,97.4
    • 03/12/2003 13:22:01,21.3,8.55,98.0
    • 03/12/2003 13:22:02,21.5,8.59,98.1
  • Non-uniform output
    • Temperature=21.2 C
    • DO=8.5 mg/L
    • DO%=97.4%

The Generic option in the GSI script utility allows the user to interface with any GSI sensor as long as they understand the data output from the sensor. Refer to the sensor manual or view the output in a terminal emulator to determine the categories to which the sensor belongs. If the sensor requires a “Start Measurement” or “Get Data” command, enter the command in the Start Meas Cmd and/or Get Data Cmd boxes within the script utility, respectively. Before generating the script, review the additional script requirements in the Sensor-Specific GSI Script Specifications section below.

Figure 3: Generic GSI script generation.



GSI Script Specifications

  1. Manufacturer and Model – Choose the appropriate manufacturer and model of the sensor to automatically generate a list of known parameters measured by the device.
  2. Port – Specify the X2 sensor port the device will be connected to (P0, P1, or P2).
  3. Baud – Choose the baud rate utilized by the sensor. CONNECT will automatically display the manufacturer’s default baud rate.
  4. Power – Select the power type required for the sensor.
    1. Switch – turns on power to the listed sensor port at a specified period of time ahead of each scheduled reading. Power is turned off once the data for the reading has been collected by the X2. The Warmup field determines how long the sensor will be powered in advance of each reading.
      • For most sensors, 30 seconds will be sufficient, but check with the manufacturer specifications. Occasionally, longer warmup periods are required for sensors to reach their peak accuracy rating.
      • In general, sensors deployed with internal batteries should not use switch power. In between readings, when the X2 port power is off, the internal sensor batteries will drain and this can lead to communication issues once they are exhausted. Either remove batteries or select the Continuous power option.
    2. Continuous – the specified X2 sensor port will have power applied constantly. This is typically less power efficient, but depending on the sensor type can be a requirement (ex. weather sensors running continuous rain/wind averaging calculations).
    3. None – the listed X2 sensor port will not receive power and internal batteries will power the sensor.
  5. Timeout – Select the timeout time recommended by the manufacturer.
  6. Connection – Choose the type of serial communication (RS-232 or RS-485) utilized by the sensor.
  7. Frame – Select the communication frame used by the sensor (parity, #data bits, #stop bits). CONNECT will automatically display the manufacturer’s default frame.
  8. Warmup – Input the warmup recommended by the manufacturer. CONNECT will automatically display the manufacturer’s default warmup time.
  9. Average Duration – The CONNECT script will average measurements over a certain duration of time. Since many sensors communicating through serial communication output at 1Hz, a 10-second average duration would provide an average of 10 overall measurements.
  10. Available Parameters – Construct the appropriate parameter output list for the sensor by assigning parameters to the Selected Parameters column using the Add/Remove/Move Up/Move Down buttons.
    1. The total number and ordering of parameters for the script must match the parameter output for the sensor.
    2. If the sensor outputs a diagnostic or undesirable parameter as a part of its measurement command, it can be omitted from logging to the X2. Substitute the _None parameter into its position on the Selected Parameters list.


Sensor Detection

  1. Once the script settings have been outlined, click Generate Script in the bottom right corner of the menu, assign a script number and click OK.
    1. If multiple generic scripts will be created for the X2, assign a unique value to each.
    2. If modifications need to be made to an existing generic script, assign the same script number to overwrite the original.
  1. The generic script will be saved in the CONNECT software folder.

Figure 4: Successfully generated script.


  1. Follow the Configure Sensor Scripts document to:
    1. Transfer the new script to the X2 (demonstrated in the Add/Update Sensor Scripts section).
    2. Read the existing X2 script list (shown in the Show Enabled Sensors section).
    3. Enable the custom script to run during sensor detection (demonstrated in the Modify Sensor Detection List section).
  2. Connect all sensors, apply 12V power, and run sensor detection in CONNECT (alternatively, by queuing the Sensor (Auto)Detection command from WQData LIVE or through the X2 embedded web).
  3. Once the detection command is received, the generic script will be run. As long as the sensor responds to the X2 according to the script settings, it will be identified, and data collection and posting to WQData LIVE will begin.