The S900 / S930 network system is based on industrial protocol RS485. This command protocol is specified by Aeroqual Limited. Copyright reserved 2004.
The network communication is in master-slave mode, which means that a PC or other device will be the network master. All information is requested by the network master. Otherwise no information is sent out by the S900 / S930 network units.
Communication commands
For data format and representations (see the section Protocol commands value and descriptions for details).
Information request command to S900 / S930
The basic format is a 5 bytes data stream:
BASE, COMMAND, NETWORK_ID, OTHERS, CHECKSUM
- BASE - information request data stream header
- COMMAND - 1 byte network unit action command
- NETWORK_ID - 1 byte S900 / S930 network ID.
- OTHERS - may used to extend functions later, it can be left as empty for now
- CHECKSUM - makes the data stream total sum byte value to zero.
That's tow's complement of the total sum of the data stream, except CHECKSUM byte.
S900 / S930 unit basic reply command
The format will be a 15 bytes stream (see section S900 / S930 network ID specified commands for details).
Index 0 1 2 3-6 7-10 11 12 13 14
SENSOR, COMMAND, NETWORK_ID, DATA1(4 bytes), DATA2(4 bytes), RESERVED, STATUS1, STATUS2, CHECKSUM
S900 / S930 network ID specified commands
These commands generate a response by a specified S900 / S930 unit.
Every command needs a corresponding reply.
Gas data request command
The command asks for the gas data that a specific S900 / S930 unit currently holds.
The S900 / S930 unit responds with an gas value. The gas data validity depends on the DATA_UNVALID bit of STATUS1 flag (see the section Protocol commands value and descriptions).
Command: BASE, GAS_CONC_DATA, NETWORK_ID, EMPTY, CHECKSUM
Reply: SENSOR, GAS_CONC_DATA, NETWORK_ID, DATA1, TEMP, RH, RESERVED, STATUS1, STATUS2, CHECKSUM
- DATA1 - 4 bytes IEEE754 floating point data, measured gas value, if DATA_UNVALID bit of STATUS1 flag is 1 then it will be last measured value, otherwise it's new measured value.
- TEMP - 2 bytes unsigned int value, its actual value equals the int value divided by 10 (TEMP/10) for its real temperature value of S900 / S930 unit
- RH - 2 bytes unsigned int value, its actual value equals the int value divided by 10 (RH/10) for its real relative humidity value of S900 / S930 unit.
- For S900 / S930 the field TEMP and RH will be always zero for Version 1.5 and later.
- However, for S900 / S930 version 1.4 and earlier can't use this command to request temperature and humidity.
Standby command
The S900 / S930unit will set its sensor head to standby state.
The S900 / S930 will set STANDBY bit of STATUS2 to 1 indicating it is in standby mode.
When the standby state has been terminated, it will reset STANDBY bit of STATUS2 to 0.
Command: BASE, STANDBY, NETWORK_ID, EMPTY, CHECKSUM
Reply: SENSOR, STANDBY, NETWORK_ID, DATA1, DATA2, RESERVED, STATUS1, STATUS2, CHECKSUM
- DATA1 and DATA2 - no meanings.
- The reply just confirms that it performed action, to find it check status bit.
Specific S900 / S930 reset command
The command will reset the S900 / S930 at any time.
Command: BASE, RESET, NETWORK_ID, EMPTY, CHECKSUM
Reply: SENSOR, RESET, NETWORK_ID, DATA1, DATA2, RESERVED, STATUS1, STATUS2, CHECKSUM
- DATA1 and DATA2 - no meanings.
- RESET - 1 byte reset command, see section 4 for details.
Specific S900 / S930 unit connected sensor head version number request command
PC or other devices can request sensor head version information through S900 / S930 unit.
Command: BASE, SENSOR_VERSION, NETWORK_ID, EMPTY, CHECKSUM
Reply: SENSOR, SENSOR_VERSION, NETWORK_ID, VERSION_NUM, DISPLAY_TYPE, NAME_LENGTH, SENSOR_NAME, RESERVED, CHECKSUM
- VERSION_NUM - 1 byte, the version number of sensor head plugged in the S900 / S930 unit
- DISPLAY_TYPE - 1 byte, the decimal value display type, different gas sensor head are different, see section 3 for details
- NAME_LENGTH - 1 byte, the sensor head name length.
- SENSOR_NAME - 7 bytes max, valid length depends on NAME_LENGTH value, the sensor head name ASCII code that connected to S900 / S930 unit.
Modify S900 / S930 unit network ID command
This command can change current S900 / S930 unit network ID.
Command: BASE, CHANGE_NETWORK_ID, OLD_ID, NEW_ID, CHECKSUM
Reply: SENSOR, CHANGE_NETWORK_ID, NEW_ID, DATA1, DATA2, RESERVED, STATUS1, STATUS2, CHECKSUM
- CHANGE_NETWORK_ID - 1 byte command, see section 3 for details.
- OLD_ID - the S900 / S930 unit old network ID.
- NEW_ID - the S900 / S930 unit new network ID
Specific S900 / S930 connected sensor gas unit ppm to mg/m3 convert factor and analog current max output scale factor value request command
Command: BASE, FACTOR_REQUEST, NETWORK_ID, EMPTY, CHECKSUM
Reply: SENSOR, FACTOR_REQUEST, NETWORK_ID, DATA1, DATA2, RESERVED, STATUS1, STATUS2, CHECKSUM
- DATA1 - 4 bytes, gas unit ppm to mg/m3 convert factor floating point value
- DATA2 - 4 bytes, default S900 / S930 current output max scale factor floating point value
S900 / S930 unit configuration settings upload command
This sets the S900 / S930 unit alarm 1, alarm 2, defined output scale and alarm enable settings. Total 25 bytes data stream.
Command: BASE, PARAMETERS_UPLOAD, NETWORK_ID, EMPTY, CHECKSUM
Parameters: BASE, PARAMETERS_UPLOAD, NETWORK_ID, ALARM1, ALARM2, DEFINED_SCALE, CONTROL_HIGH, CONTROL_LOW, ALARM_STATUS, CHECKSUM
Reply: SENSOR, PARAMETERS_UPLOAD, DATA1, DATA2, RESERVED, STATUS1, STATUS2, CHECKSUM
- ALARM1 - 4 bytes alarm level 1 set point value, see section 4 for its data representation.
- ALARM2 - 4 bytes alarm level 2 set point value, see section 4 for its data representation.
- DEFINED_SCALE - 4 bytes user defined max output scale value.
- CONTROL_HIGH - 4 bytes control high set point value see section 4 for its data representation.
- CONTROL_LOW - 4 bytes control low set point value see section 4 for its data representation.
- ALARM_STATUS - 1 byte alarm state settings, see section 3 for details.
- Reply just used for confirm uploading successfully, DATA1 and DATA2 no real meanings.
S900 / S930 unit configure settings download command
Total 25 bytes stream
Command: BASE, PARAMETERS_DOWNLOAD, NETWORK_ID, EMPTY, CHECKSUM
Reply: SENSOR, PARAMETERS_DOWNLOAD, NETWORK_ID, ALARM1, ALARM2, DEFINED_SCALE, CONTROL_HIGH, CONTROL_LOW, ALARM_STATUS, CHECKSUM
- ALARM1 - 4 bytes alarm 1 set point value, see section 4 for its data representation
- ALARM2 - 4 bytes alarm 2 set point value, see section 4 for its data representation
- DEFINED_SCALE - 4 bytes user defined max output current output value
- CONTROL_HIGH - 4 bytes control high set point value see section 4 for its data representation
- CONTROL_LOW - 4 bytes control low set point value see section 4 for its data representation
- ALARM_STATUS - 1 byte alarm state settings, see section 4 for details
Specific S900 / S930 base unit version number request command
PC or other devices can request the base unit version information.
Command: BASE, BASE_VERSION, NETWORK_ID, EMPTY, CHECKSUM
Reply: SENSOR, BASE_VERSION, NETWORK_ID, VERSION_NUM, SENSOR_COUNT, RESERVED, RESERVED, RESERVED, RESERVED, RESERVED, RESERVED, RESERVED, RESERVED, RESERVED, CHECKSUM
- VERSION_NUM - 1 byte, the version number of the S900 / S930 unit
- SENSOR_COUNT - 1 byte, actually used to specify its S900 / S930
- if it's 0x01, that is S900 / S930 no temperature and humidity sensor connected,
- if it's 0x03, that is S900 / S930 there is a temperature and humidity sensor connected.
Temperature and relative humidity data request command
The command asks for the temperature and humidity data that a specific S900 / S930 unit currently holds. The S900 unit responds with two values respectively.
Command: BASE, TEMP_RH_DATA, NETWORK_ID, EMPTY, CHECKSUM
Reply: SENSOR, TEMP_RH_DATA, NETWORK_ID, TEMP, RH, RESERVED, STATUS1, STATUS2, CHECKSUM
- TEMP - 4 bytes IEEE754 floating point data, measured temperature value of S900 / S930 unit,
- RH - 4 bytes IEEE754 floating point data, measured relative humidity value of S900 / S930 unit
- For S900 / S930 the command will be no reply at all.
Broadcast commands
Broadcast commands are a set of special commands of the network system. Every unit that receives the commands on the network performs the action. They are not ID specific, BROADCAST command indicator can be considered as NETWORK_ID. These commands send out by network master and that don't need reply at all.
- BROADCAST is a 1 byte special S900 / S930 ID that is zero *
Broadcast S900 / S930 standing by command
This command will set all sensor head that connected to the network go to stand by state. The command generates no reply. To check whether a 900 unit has performed the command, the network master should check STATUS2's STAND_BY bit.
BASE, STANDBY, BROADCAST, EMPTY, CHECKSUM
- BROADCAST - 1 byte broad cast indicator, see section 3 for its value
Broadcast S900 / S930 reset command
This command will reset whole network sensor heads that connected to.
The command generates no reply. To check whether a 900 unit has performed the command, the network master should check STATUS2's STAND_BY bit.
BASE, RESET, BROADCAST, EMPTY, CHECKSUM
- BROADCAST - 1 byte broad cast indicator, see section 3 for its value
Protocol commands value and descriptions
BASE = 0x55 command header used for network master to S900 / S930
SENSOR = 0xAA reply header used for S900 / S930 to network master
STANDBY = 0xFD command used to set sensor head standing by mode
RESET = 0x07 command to reset sensor head to normal working state
GAS_CONC_DATA = 0x10 command to request/report measured gas concentration value
TEMP_RH_DATA = 0x20 command to request temperature and humidity values
BASE_VERSION = 0xF9 command to request/report S900 / S930 base unit version number
SENSOR_VERSION = 0xFB command to request/report sensor head version number
FACTOR_REQUEST = 0x2A command to request/report sensor head concentration ppm to mg/m3 conversion factor and max current output scale factor
BROADCAST = 0x00 broadcast command indicator, like a special S900 / S930 ID reserved for information broadcast
PARAMETERS_UPLOAD = 0x19 command to upload configure settings to S900 / S930
PARAMETERS_DOWNLOAD = 0x18 command to download configure settings from S900 / S930
EMPTY= 0x00 no meanings at all, reserved space
RESERVED can be any value, not any meanings at all
CHECKSUM data stream check sum used to verify the command data stream information lost or noise. It makes the data stream total sum to zero.
NETWORK_ID range: 0x00 -- 0xFF, 0x00 is reserved for broadcast command. 0x01 will be the default ID when S900 / S930 has been programmed.
STATUS1 (1 Byte)
- SensorStatus0 b0 \ b1=0, b0=0, sensor is normal
- SensorStatus1
- b1 / b1=0, b0=1, sensor failure no gas reporting
- b1=1, b0=0, means sensor aging
- FAN_STATUS b2 reserved
- UNIT_UNSTABLE_FLAG b3 sensor head is at setting up stage not stable yet
- RESERVED b4 reserved
- RESERVED b5 reserved
- SensorResetFlag b6 sensor head is doing reset
- DATA_UNVALID b7 the data is not valid data, maybe last reported reading
STATUS2 (1 Byte) not used now, reserved for further developing
- RESERVED b0 reserved
- RESERVED b1 reserved
- RESERVED b2 reserved
- RESERVED b3 reserved
- STANDBY
- b4 = 1, sensor head in stand by mode
- b4 = 0, sensor head in normal working mode
- RESERVED b5 reserved
- RESERVED b6 reserved
- RESERVED b7 reserved
ALARM_STATUS (1 Byte) used for alarm status setting
- Alarm_Enable
- b0 = 0, S900 / S930 alarm enabled, b0 = 1, S900 alarm disabled
- Alarm2_Triger b1 = 0, S900 / S930 alarm 2 triggered when reading exceed alarm 2
- b1 = 1, S900 / S930 alarm 2 rigged when reading below alarm 2
- Define_Ouput_Scale
** b2 = 0, use sensor head default current output value
- b2 = 1, user defined current output value
- RESERVED b3 reserved
- RESERVED b4 reserved
- RESERVED b5 reserved
- RESERVED b6 reserved
- RESERVED b7 reserved
The following data values use IEEE754 32 bits floating point little endian representation.
These data are: DATA1, DATA2, ALARM1, ALARM2, DEFINED_SCALE, CONTROL_HIGH, CONTROL_LOW
Data transfer mechanism
Floating point data (4 bytes) send sequence is low byte first, high byte last, such as section 4's data DATA1, ALARM1, ALARM2 etc.
Broadcast command - when network master broadcast a command to RS485 bus, every unit connected to the bus has to perform the action immediately without reply. Whether the command has been performed or not can be tested using a specific sensor command to poll an individual unit. If some sensor heads do not perform the action the network master needs to rebroadcast the command again.
Specific unit sensor measured gas concentration request. Once a sensor head measures a new concentration it will set STATUS1 b7 to zero indicating the value is valid. However, when the new data has been sent out the STATUS1 b7 DATA_UNVALID bit will set to 1 indicating the data not valid.
Timing issue (VERY IMPORTANT): The master request command frequency can't be less than 1 second per command; otherwise, the network will be unstable.
Communication settings
RS485 communication port settings:
- Baud rate: 4800
- Data bits: 8
- Stop bits: 1
- Parity: none
- Flow control: none