Smart Pyranometer - Communications Manual V01-0324
Smart Pyranometer - Communications Manual V01-0324
Smart Pyranometer - Communications Manual V01-0324
This document describes the interfacing of Kipp & Zonen Smart Pyranometers (SMP series).
The commands are all according to the Modbus RTU protocols described in the document: ‘Modbus®
over serial line V1.02’ and ‘Modbus application protocol V1.1b’ available from the Modbus® organization
(www.modbus.org). The commands can be tested using software tools, such as the program ‘Modbus Poll’ from
www.modbustools.com.
The following commands are implemented:
FUNCTION SUB FUNCTION DESCRIPTION
0X01 N/A Read Coils
0X02 N/A Read Discrete Inputs
0X03 N/A Read Holding Registers
0X04 N/A Read Input Register
0X05 N/A Write Single Coil
0X06 N/A Write Holding Register
0X10 N/A Write Multiple Registers
The SMP series devices do not make a difference between a “coil” and a “discrete input”. The only
difference is that a discrete input is read only. The SMP series devices do not make a difference between a
holding register and an input register. The only difference is that an input register is read only.
R = Read only | U16 = 16-bit unsigned integer | S16 = 16-bit signed integer | N = available in normal mode | S = available in service mode
R = Read only | S32 = 32-bit signed integer | All = available in normal and service mode
Error Reports
PDU
PARAMETER R/W(2) TYPE MODE DESCRIPTION
ADDRESS
26 IO_ERROR_CODE R U16 All Most recent/ actual error code
27 IO_PROTOCOL_ERROR R U16 All Protocol error/communication error
28 IO_ERROR_COUNT_PRIO1 R U16 All Priority 1 error count
29 IO_ERROR_COUNT_PRIO2 R U16 All Priority 2 error count
30 IO_RESTART_COUNT R U16 All Number of controlled restarts
31 IO_FALSE_START_COUNT R U16 All Number of uncontrolled restarts
32 IO_SENSOR_ON_TIMEH R U16 All On time in seconds (MSB word)
33 IO_SENSOR_ON_TIMEL R U16 All On time in seconds (LSB word)
41 IO_BATCH_NUMBER R U16 All Production batch number = year in YY
42 IO_SERIAL_NUMBER R U16 All Serial number
43 IO_SOFTWARE_VERSION R U16 All Software version
44 IO_HARDWARE_VERSION R U16 All Hardware version
45 IO_NODE_ID R U16 All (Modbus®) device address RS-485
(2)
Writing any value to input registers 26-33 will reset the contents of the registers
R = Read only | U16 = 16-bit unsigned integer | All = available in normal and service mode
R = Read only | U16 = 16-bit unsigned integer | F32 = 32-bit floating point | All = available in normal and service mode
Legend
PDU Address PDU Address + 1 = Modbus® register number
Parameter Name Name of the register
R/W Read Write R Read only
R/W Read/write
Type Type and size U16 16-bit unsigned integer
S16 16-bit signed integer
S32 32-bit signed integer
F32 32-bit floating point
Mode Operation mode N Available in normal mode
S Available in service mode
ALL Available in all modes
R/W = Read/Write | S16 = 16-bit signed integer | All = available in normal and service mode
A discrete input can be true or false. A discrete input is read only and can be read in all modes.
(2)
Set if an error occurred at power on, otherwise cleared.
Device Control
COIL PARAMETER R/W DEFAULT MODE DESCRIPTION
10 IO_CLEAR_ERROR R/W 0 All Select normal operation and clear error (1=clear error)
11 TO 17 Factory use only
18 IO_RESTART_MODBUS R/W 0 All Restart the device with Modbus® protocol
19 Factory use only
20 IO_ROUND R/W 1 S, N Enable rounding of sensor data
21 IO_AUTO_RANGE R/W 0 S, N Enable auto range mode (0=no auto range)
22 IO_FASTRESPONSE R/W 0 S, N Enable fast response filter (0=no filter)
23 IO_TRACKING_FILTER R/W 1 S, N Enable tracking filter (0=no filter)
R/W = Read/Write | N = available in normal mode | S = available in service mode | All = available in normal and service mode
A coil can be read, but some can’t be written in normal mode or service mode.
Note: The default values of the device options are stored in non-volatile memory. The default values can be overruled during operation. However, at power-on
the default values are restored and the smart sensor will start up with the default values stored in the non-volatile memory.
Legend
Input PDU Address + 1 = Modbus® register number
Input Discrete input Modbus® discrete input 0 is the first discrete input
Coil Modbus coil A coil can be read or written
Parameter Name Name of register
R/W Read Write R Read only
R/W Read/write
Def Default Value Default value at power on (0,1, or undefined)
Mode Operation mode N Available in normal mode
S Available in service mode
ALL Available in all modes
Inputs can be read in all modes but some coils cannot be written to in normal or service mode
Many of the registers and controls are for remote diagnostics. In this chapter only the most relevant
registers and controls are described.
REGISTER PARAMETER DESCRIPTION
0 IO_DEVICE_TYPE The device type defines which device is connected. This register can be used to check the type of
the connected device. IO_datamodel_version 107 supports the following type of sensors:
1 IO_DATAMODEL_VERSION The data-model describes the functions supported by the smart sensor. This document is valid for
data-model version: 107. A different implementation of the Modbus® protocol (with new features)
could result in a different data model ‘that is’ or ‘that is not’ compatible with the older version.
The value of this register must be >=107. If you receive another value, then you should read an
older or newer version of this document and check the differences.
2 IO_OPERATIONAL_MODE The operation mode defines the state of the smart sensor. The operational modes are:
1 Normal Mode
2 Service Mode
3 Calibration Mode
4 Factory Mode
5 Error mode
After power on the Normal Mode (1) is set. When the IO_CLEAR_ERROR is set then the smart
sensor always returns to the Normal Mode (1). When the Error Mode (5) is set, then there is a fatal
error.
3 IO_STATUS_FLAGS This register defines the status of the smart sensor and the validity of the data. Each bit has a
special meaning. Bit 0 is the first (least significant) bit.
4 IO_SCALE_FACTOR The scale factor defines the number of fractional digits, the range and the position of the decimal
point for the following registers: IO_SENSOR1_DATA, IO_SENSOR2_DATA, IO_RAW_SENSOR1_DATA
and IO_RAW_SENSOR2_DATA. The scale factor is read only. The default value of the scale factor is
a copy of register 34 IO_DEF_SCALE_FACTOR, made during power up.
If the register IO_SCALE_FACTOR is not set to 0 then you must multiply or divide the data of the
above mentioned four IO_SENSOR registers.
The default value of register IO_SCALE_FACTOR is 0. However, this value can be set to a different
value if the coil IO_AUTO_RANGE is set or a different value is written to the register
IO_DEF_SCALE_FACTOR (set default scale factor).
5 IO_SENSOR1_DATA This register holds the actual data (solar radiation) measured by the sensor. The solar radiation is
measured in W/m².
If the register IO_SCALE_FACTOR is not set to 0 then you must multiply or divide the data as
described under register 4. The raw data from the sensor is calibrated, linearized; temperature
compensated and filtered.
6 IO_RAW_SENSOR1_DATA The raw sensor data is calibrated but not linearized and temperature compensated.
If the register IO_SCALE_FACTOR is not set to 0 then you must multiply or divide the data as
described under register 4, IO_SCALE_FACTOR.
8 IO_BODY_TEMPERATURE The body temperature sensor measures the temperature of the body in 0.1°C. To convert the data
to a floating-point number, make the following calculation:
floating point result = integer register (IO_BODY_TEMPERATURE) / 10
9 IO_EXT_POWER_SENSOR The external power sensor measures the external voltage applied to the chassis socket in 0.1 Volt.
To convert the data to a floating-point number, make the following calculation:
floating point result = integer register (IO_EXT_POWER_SENSOR) / 10
15 IO_TILT The tilt sensor measures the tilt of the sensor in the horizontal plane in 0.1°. To convert the data to
a floating-point number, make the following calculation:
floating point result = integer register (IO_TILT) / 10
16 IO_RH The RH sensor measures the Internal relative humidity of the sensor in 0.1%. To convert the data to
a floating-point number, make the following calculation:
floating point result = integer register (IO_RH) / 10
2 IO_VOID_DATA_FLAG The void data flag is raised when the data in register IO_SENSOR1_DATA or
IO_RAW_SENSOR1_DATA is not valid, because the body temperature of the sensor is too low or too
high, when there is an internal overflow condition, because a calculation is out of range or a
division by zero occurred, the reference voltage of the ADC is not stable, or the digital filter is not
stable.
When the IO_VOID_DATA_FLAG is set, bit 0 in the IO_STATUS_FLAGS is also set.
The IO_VOID_DATA_FLAG and bit 0 of the IO_STATUS_FLAGS are cleared when the
IO_VOID_DATA_FLAG is read by the computer.
3 IO_OVERFLOW_ERROR This discrete input is raised when an out-of-range condition occurs and the sensor data (see
IO_SENSOR1_DATA) is above the maximum value specified by the calibration program or above
29,999. The typical maximum value is 4000 W/m².
When the IO_OVERFLOW_ERROR is set, bit 1 in the IO_STATUS_FLAGS is also set.
The IO_OVERFLOW_ERROR and bit 1 of the IO_STATUS_FLAGS are cleared when the
IO_OVERFLOW_ERROR is read by the computer.
4 IO_UNDERFLOW_ERROR This discrete input is raised when an underflow condition occurs and the sensor data (see
IO_SENSOR1_DATA) is below the minimum value specified by the calibration program or below -
29,999. The typical minimum value is -400 W/m².
When the IO_UNDERFLOW_ERROR is set, bit 2 in the IO_STATUS_FLAGS is also set.
The IO_UNDERFLOW_ERROR and bit 2 of the IO_STATUS_FLAGS are cleared when the
IO_UNDERFLOW_ERROR is read by the computer.
5 IO_ERROR_FLAG The error flag is raised when there is a (fatal or correctable) hardware error or software error such
as: ADC error, DAC error, calibration error or when the update of the calibration data failed. When
6 IO_ADC_ERROR This flag is raised when the A/D converter responsible for the conversion of the analogue signals to
digital signals detected a failure (hard or software).
The ADC error flag is cleared when a true condition is written to the coil: ‘IO_CLEAR_ERROR’ and
the error produced by the ADC, is not fatal.
7 IO_DAC_ERROR This flag is raised when the D/A converter responsible for the conversion of the digital signal to the
analogue output signal detected a failure (hard or software).
The DAC error flag is cleared when a true condition is written to the coil: ‘IO_CLEAR_ERROR’ and
the error produced by the DAC, is not fatal.
8 IO_CALIBRATION_ERROR The calibration error flag is raised when the sensor was not calibrated, or a checksum error was
detected in the calibration data. This flag can’t be cleared unless the sensor is sent back to the
manufacturer or dealer for a re-calibration.
9 IO_UPDATE_FAILED The update failed is raised when data is written to the non-volatile memory and the update failed.
This can happen in calibration mode when calibration data in written to non-volatile memory or in
the service mode when device options are written to the non-volatile memory.
If this error is set, you should retry the last update action. If the error does not disappear then there
could be a hardware problem with the non-volatile memory (EEPROM).
18 IO_RESTART_MODBUS
20 IO_ROUNDOFF Setting this coil enables rounding of the data presented in IO_SENSOR1_DATA and
IO_RAW_SENSOR1_DATA. If not set, then the customer should round off the received data before
processing the data.
The default value after power on is ON.
If IO_ROUNDOFF is cleared, then the sensor is not calibrated and could produce more digits, than
there are significant digits.
21 IO_AUTO_RANGE Setting this coil enables the auto-range feature. The auto-range feature increases the number of
digits for small signals.
The default value after power on is OFF.
If IO_AUTO_RANGE is set then the sensor is not calibrated and could produce more digits, than
there are significant digits.
22 IO_FASTRESPONSE Setting this coil enables the fast response filter. This filter increases the step response of the sensor.
Disabling the fast response give the SMP pyranometers the same response time as the CMP
equivalents.
The default value after power on is ON.
23 IO_TRACKING_FILTER Setting to this coil enables the tracking filter. The tracking filter reduces the noise of the signal.
However, when the filter is on, the step response on a sudden signal change is decreased. The
smart sensor uses variable filter constants to minimize the effect on the step response.
The default value after power on is OFF
42 IO_SERIAL_NUMBER Register 42 defines the 4 digits serial number of the smart sensor. Only the combination of the
batch number and serial number is unique.
The simple ‘C’ program below will show how to read the sensor data and how to deal with errors. The
program will read the registers: ‘operational mode, status flags, scale factor, and sensor data’ from Modbus®
device with address 2 into registers uOperationMode, uStatusFlags, iScaleFactor and iSensorData. Then the
program will check the operation mode (must be ‘normal’) and if there are no errors flags set in iStatusFlags. If
there is an error, then set the IO_ERROR_FLAG.
UInt16 uOperationalMode = 0;
UInt16 uStatusFlags = 0;
Int16 iScaleFactor = 0;
Int16 iSensorData = 0;
float fSensorData = 0;
If (uOperationalMode != 1)
{
// Send MODBUS request 0x05 write single coil to slave 2
SendModbusRequest (0x05, 2, IO_CLEAR_ERRROR, true);
WaitModbusReply ();
}
else if (uStatusFlags != 0)
{
SendModbusRequest (0x05, 2, IO_CLEAR_ERRROR, true);
WaitModbusReply ();
}
switch (iScaleFactor)
{
case 2: fSensorData = (float)(iSensorData) / 100.0;
case 1: fSensorData = (float)(iSensorData) / 10.0;
case 0: fSensorData = (float)(iSensorData);
case -1: fSensorData = (float)(iSensorData) * 10.0;
default: fSensorData = 0.0;
}
// wait 1 second
Delay (1000);
}
}
Find the extended product manuals for all our Smart Pyranometers on OTTHydromet.com.