Hikvision MODBUS TCP Developer Guide - en-US - 20221230
Hikvision MODBUS TCP Developer Guide - en-US - 20221230
(2022-12-30)
Format of MODBUS Protocol
The MODBUS protocol defines a simple Protocol Data Unit (PDU) independent of the basic
communication layer. The MODBUS protocol mapping on a specific bus or network can introduce
some additional fields on the Application Data Unit (ADU). That is, the PDU part of the MODBUS
protocol on different types of buses or networks is the same, and the main difference lies in the
address field and the error checking part.
The format of each MODBUS command is consistent with the MODBUS standard format.
Please refer to Appendix A: MODBUS Standard Protocol Reference.
ADU
Additional
Function code Data Error Check
address
PDU
ADU
MBAP Header Function Code Data
PDU
Field Description
It can be regarded as the serial number of the message. Generally,
1 is increased on every query to make the response uniquely
Transaction Identifier
assigned to the query. The server (the controller) copies the value
from the client's request in the response.
Note: In the example, "[ ]" is used to mark the header of MBAP, but this symbol is not included
Data Specification
1. The temperature data is an integer, and the measured temperature is equal to the register
value/10.0. For example, if the register value is 257, the measured temperature should be
25.7 ℃. The unit of temperature is always ℃.
2. In Normal mode, register addresses 0x00, 0x01, and 0x02 are used for Maximum,
Minimum, and average temperatures of the image.
3. In Expert mode, more (from the second) measurement tools are available to measure
temperatures.
4. The range of positive numbers is 0x0000 - 0x7FFF in hexadecimal. The range of negative
numbers is transmitted in the complement of positive numbers, and the range is 0x8000-
0xFFFF in hexadecimal. For example, a temperature is uploaded as 0xFF9B in hexadecimal,
corresponding to 100 in decimal (0xFFFF - 0xFF9B = 0x64). It actually means - 10.0 ℃.
5. When a measurement tool is not enabled, the transmitted value is -273.1 °C and the
register value is 0xF554.
Illustrations
1. To request the maximum temperature, minimum temperature, and average temperature
of the 1st measurement tool, the three request messages are as follows:
Error Message
Standard Error Message
The standard error messages are subject to the MODBUS standard protocol, but some are
slightly different. For details, please refer to Appendix A: MODBUS Standard Protocol Reference.
Appendix
MODBUS standard protocol can be reached at the MODBUS organization website in link below.
https://MODBUS.org/docs/MODBUS_Application_Protocol_V1_1b3.pdf
For more MODBUS protocols, refer to the official MODBUS website: https://MODBUS.org/
Revision Notes
Date Revision Note
July 1, 2022 Created the document Hikvision MODBUSTCP Developer Guide
December 30, 2022 Removed a section get protocol type state.
Added illustration about Normal mode.
Remarks:
Hikvision reserves the right to change, alter or withdraw the above notification without prior
notice.
Product design and specifications are subject to change without prior notice.
The Hikvision firmware may contain errors known as errata which may cause the product to
deviate from published specifications. Current characterized errata are available on request.