Serial line output and communication - GMP251

GMP251 User Guide

Document code
Document type
User guide
Table 1. addr command
Syntax Description
addr<cr> Show current device address. Addresses are required for POLL mode.
addr [aaa]<cr> Set new device address. aaa = address, 0 ... 254 (default = 240)
Example (shows 0 as current address, enter 5 as the new address):
Address : 0
addr 5
Address : 5
Table 2. close command
Syntax Description
close<cr> Close the connection that was opened with the open command.
line closed
Table 3. form command
Syntax Description
form<cr> Show the currently used measurement format.
form /<cr> Reset measurement format to default.
form [sss]<cr> Set a new measurement format.

sss = String consisting of modifiers and abbreviations for measured parameters.

See Table 19 and Table 20.

Maximum length is 150 characters. Maximum length may be shorter when text strings are used.

Example (show currently used measurement format (default format shown here)):
6.0 "CO2=" CO2 " " U3 #r #n

Output example (continuous output from RUN mode):

CO2= 452 ppm
Example (set output format as %CO2):
form 3.1 "CO2=" CO2% " " U4 #r #n

Output example (continuous output from RUN mode):

CO2= 5.1 %CO2
CO2= 5.1 %CO2
CO2= 5.0 %CO2
Example (set output format as CO2 ppm with Modulus-65536 checksum):
form 6.0 "CO2=" CO2 " " U3 " " CS4 #r #n

Output example (continuous output from RUN mode):

CO2= 3563 ppm 9F
CO2= 3562 ppm 9E
CO2= 3559 ppm A4
Example (set output format as CO2 ppm, with start of text (ASCII character 002) and end of text (003) ASCII codes, and without line feed and carriage return at the end):
form #002 6.0 "CO2=" CO2 " " U3 #003

Output example (continuous output from RUN mode, ASCII codes not visible here):

CO2= 866 ppm CO2= 866 ppm CO2= 867 ppm CO2= 867 ppm
CO2= 867 ppm CO2= 868 ppm CO2= 868 ppm CO2= 869 ppm
Table 4. Output parameters for form command
Output parameter Abbreviation in form command
Carbon dioxide in ppm co2
Carbon dioxide in percent co2%
Currently used temperature compensation value tcomp
Currently used pressure compensation value pcomp
Currently used oxygen concentration compensation value o2comp
Currently used relative humidity compensation value rhcomp
Table 5. Modifiers for form command
Modifier Description
x.y Length modifier (number of digits and decimal places).
#t Tabulator.
#r Carriage return.
#n Line feed.
"" String constant, length 1 ... 15 characters.
#xxx ASCII code value (decimal) of a special character; for example, #027 for ESC.
addr Probe address (0 ... 254).
sn Probe serial number.
time Cumulative operating hours of the probe.
ux Name of the measurement unit using x number of characters. For example, u3 shows the name of the measurement unit with three characters.
cs4 Modulus-65536 checksum of message sent so far, ASCII encoded hexadecimal notation.
csx NMEA xor-checksum of message sent so far, ASCII encoded hexadecimal notation.
You can also use the backslash character \ instead of the hash character #.
Table 6. intv command
Syntax Description
intv<cr> Show the output interval of the automatically repeating measurement messages (r command and run mode).
intv [iii uuu]<cr> Set the output interval.
  • iii = interval, range 0 ... 255
  • u = unit for interval setting:
    • s = seconds
    • min = minutes
    • h = hours
If you set the interval to 0, the output messages are output as quickly as they are generated, without additional delay.
intv 5 s
Output interval: 5 S
Table 7. open command
Syntax Description
open [aaa]<cr> Open a connection to a device at the specified address. Required when device is in poll mode.

aaa = address, range 0 ... 254.

Example (target probe in POLL mode, with address 52):
open 52
GMP251: 52 Opened for operator commands
Table 8. r command
Syntax Description
r<cr> Start the continuous outputting of measurement values as an ASCII text string to the serial line. The probe keeps outputting measurement messages at the interval that has been set with the intv command until stopped with the s command.
CO2= 5.1 %CO2
CO2= 5.1 %CO2
CO2= 5.1 %CO2
CO2= 5.0 %CO2
CO2= 5.0 %CO2
Table 9. s command
Syntax Description
s<cr> Stop the continuous outputting that was started with the r command.
CO2= 5.1 %CO2
CO2= 5.0 %CO2
CO2= 5.0 %CO2
Table 10. sdelay command
Syntax Description
sdelay<cr> Show serial line transmission delay (1 … 255, 1 unit = 4 milliseconds).
sdelay [delay]<cr> Set a new serial line transmission delay.

delay = Serial line delay, range 1 … 255 (1 unit = 4 milliseconds).

Example (set delay to 0.1 seconds = 25 units):
sdelay 25
COM transmit delay : 25
Table 11. send command
Syntax Description
send<cr> Output a single measurement message.
send [aaa]<cr> Output a single measurement message from a device in poll mode.

aaa = address of the probe, range 0 ... 254

CO2= 5.0 %CO2
Example (target probe in POLL mode, with address 52):
send 52
CO2= 5.0 %CO2
Table 12. seri command
Syntax Description
seri<cr> Show current serial line settings.
seri [b p d s]<cr> Set new serial line settings. The new settings will be taken into use when the probe is reset or powered up.

b = baud rate (9600, 19200, or 38400)

p = parity
  • n = none
  • e = even
  • o = odd

d = data bits (7 or 8)

s = stop bits (1 or 2)

For Modbus, baud rate must be 9600 ... 38400 and parity must be none.

Example (show current settings):
Com1 Baud rate : 19200
Com1 Parity : N
Com1 Data bits : 8
Com1 Stop bits : 1
Example (set serial line to 9600 baud, even, 7 data bits, and 1 stop bit, and reset the probe to take the new settings in use):
seri 9600 e 7 1
Com1 Baud rate : 9600
Com1 Parity : E
Com1 Data bits : 7
Com1 Stop bits : 1
GMP251 1.0.0
Table 13. smode command
Syntax Description
smode<cr> Show current start-up operating mode of the serial line, and prompt to enter new mode.
smode [mode]<cr> Set serial line start-up operating mode. New mode is taken into use when the device is reset or powered up.

Available modes:

stop = No automatic output. All commands available. Default mode.

run = Automatic output of measurement messages. You can stop the output with the s command, and recontinue with the r command.

poll = No automatic output. Will respond to addressed send command and ?? command. You can use other commands after opening a connection using an addressed open command. Use with RS- 485 buses where multiple probes can share the same line.

modbus = Serial line communication uses the Modbus protocol (see Modbus on page 54). Serial line commands (Vaisala Industrial Protocol) are not accessible in the Modbus mode. For instructions on returning to serial mode, see Accessing Serial Commands from Modbus or Analog Mode on page 25.

analog = Switches the probe from digital output to analog output (active after probe reset). Serial line commands are not accessible in the analog mode: for instructions on returning to serial mode, see Accessing Serial Commands from Modbus or Analog Mode on page 25.

Example (set serial mode to "poll"):
smode poll
Serial mode : POLL