Generate Generic NMEA 0183 Script


NMEA 0138 sensors not already listed in the X2 sensor script library can be configured to communicate with the X2 by generating a generic NMEA 0138 script.

  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 NMEA0183.
create NMEA 0183 script

Figure 1: Create generic NMEA 0183 script.

 

  1. The Script Utility menu will appear.

Figure 2: Generic NMEA0183 Script Utility menu.

 

NMEA 0183 Script Specifications

The generic NMEA 0183 script must include the following specifications:

  1. Manufacturer – By default, this parameter will be Generic. However, a list of common manufacturers and their respective sensors are also available. Specifying the manufacturer and sensor name has the following effects over generic:
      1. The available parameter list shows only those that typically apply to the selected sensor (select Show All to remove this filter).
      2. The sensor’s default parameter output automatically appears in the Selected Parameters column (although it is still possible to manually edit the list).
      3. The X2 posts the sensor model name to WQData LIVE instead of showing as a Generic sensor type.

Figure 3: Example with Airmar 200WX pre-selected for the manufacturer and model.

 

  1. Port – Specify the X2 sensor port the device will be connected to (P0, P1, or P2).

 

  1. 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. The sensor powers off once the X2 collects data for the reading. 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, a sensor requires a longer warmup period to achieve the 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.
  2. Baud – Choose the baud rate utilized by the sensor.
  3. Frame – Select the communication frame used by the sensor (parity, #data bits, #stop bits).
  4. Timeout – Enter the timeout, in seconds, that the logger will wait for data from each message.
  5. Cmd – Enter the NMEA message command, if necessary, that forces the sensor to begin outputting data.
    1. Wait after command time, in seconds, refers to the time the logger gives the sensor to begin outputting data before it begins to search for NMEA 0183 messages.

 

Add NMEA0183 Messages

  1. Select Add NMEA0183 Msg.
  2. Input the NMEA0183 message and click the folder icon next to the NMEA0183 Parameters section.
    1. The dollar sign ($) represents the beginning of the message.
    2. The NMEA 0183 message in the example is the standard GPS fix for an Airmar 200WX.

Figure 4: Message input example.

 

  1. Choose the parameter that corresponds to the message in the NMEA0183 Parameter selection.
    1. The NMEA 0183 message input in the previous section should display in the space provided.

Figure 5: NMEA0183 Parameter selection.

 

    1. Reference the manufacturer’s manual to identify the Field No for the selected parameter.
      • Example: Figure 6 shows the NMEA 0183 message $GPGGA with Field No. set to 2 for Latitude in accordance with the Airmar manual.

Figure 6: Example showing NMEA 0183 message parameters input into generic NMEA 0183 script parameter list based on sensor manual.

 

    1. [Optional] – Enter an offset and scale. Most often these values should be left at their defaults of 0 and 1, respectively.
      • Scale and offset represent the slope equation y=mx + b, where y is the final measurement, m is the scale, x is the initial measurement, and b is the offset constant from the initial measurement.

 

  1. Once completed, click OK and the NMEA 0183 message with selected parameters will display in the NMEA0183 Messages and Parameters section.
    1. To add more messages and parameters, repeat the process by clicking the Add NMEA0183 Msg and following steps 1-3.

Figure 7: Completed Airmar script with all desired NMEA 0183 messages and corresponding parameters.

 

  1. Once outlining the script settings, click Generate Script in the bottom right corner of the menu, assign a script number, and click OK.
    1. If creating multiple generic scripts for the X2, assign a unique value to each.
    2. If making modifications to an existing generic script, assign the same script number to overwrite the original.
  1. CONNECT saves the generic script in the CONNECT software folder shown in Figure 8.

Figure 8: Successfully generated scripts will be saved in the CONNECT folder.

 

  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).
      • Note: If using a sensor with a pre-configured NexSens script, such as the Airmar 200WX, disable this script in the logger’s script list so that the X2 does not upload duplicate sensors to WQData LIVE.
  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 receiving the detection command, the X2 will run the generic script. As long as the sensor responds according to the script settings, the X2 will identify it, and data collection and posting to WQData LIVE will begin.