15 modbus.get 参数

概述

下表显示了 modbus.get[] 监控项 参数的详细信息 。

参数

参数描述默认示例
endpoint端点的协议和地址,定义为protocol://connection_string

可能的协议值: rtu, ascii (Agent 2 only), tcp

连接字符串格式:

with tcp - address:port
带串行线: rtu, ascii - port_name:speed:params
where
‘speed’ - 1200, 9600 etc
‘params’ - data bits (5,6,7 or 8), parity (n,e or o for none/even/odd), stop bits (1 or 2)
协议: none

rtu/ascii protocol:
port_name: none
speed: 115200
params: 8n1

tcp protocol:
address: none
port: 502
tcp://192.168.6.1:511
tcp://192.168.6.2
tcp://[::1]:511
tcp://::1
tcp://localhost:511
tcp://localhost
rtu://COM1:9600:8n
ascii://COM2:1200:7o2
rtu://ttyS0:9600
ascii://ttyS1
slave id它打算用于的设备的 Modbus 地址 (1 to 247), 参考 MODBUS Messaging Implementation Guide (page 23)

tcp 设备(不是 GW)将忽略该字段
serial: 1

tcp: 255 (0xFF)
2
function支持的函数的空值或值:

1 - Read Coil,
2 - Read Discrete Input,
3 - Read Holding Registers,
4 - Read Input Registers
empty3
address第一个注册表、线圈或输入的地址。

如果 ‘function’ 为空,则 ‘address’ 应该在以下范围内:
Coil - 00001 - 09999
Discrete input - 10001 - 19999
Input register - 30001 - 39999
Holding register - 40001 - 49999

如果“function”不为空,“address”字段将从 0 到 65535 并且不加修改地使用 (PDU)
empty function: 00001

non-empty function: 0
9999
count将从设备读取的已排序“类型”计数,其中:

for Coil or Discrete input the ‘type’ = 1 bit
for other cases: (count*type)/2 = real count of registers for reading
If ‘offset’ is not 0, the value will be added to ‘real count’
Acceptable range for ‘real count’ is 1:65535
12
type数据类型:

用于读取线圈和读取离散输入 - bit

用于读取保持寄存器和读取输入寄存器:
int8 - 8bit
uint8 - 8bit (unsigned)
int16 - 16bit
uint16 - 16bit (unsigned)
int32 - 32bit
uint32 - 32bit (unsigned)
float - 32bit
uint64 - 64bit (unsigned)
double - 64bit
bit
uint16
uint64
endiannessEndianness type:
be - Big Endian
le - Little Endian
mbe - Mid-Big Endian
mle - Mid-Little Endian

Limitations:
for 1 bit - be
for 8 bits - be,le
for 16 bits - be,le
bele
offset寄存器数量,从’address’开始,其结果将被丢弃。

每个寄存器的大小为16bit(需要支持不支持随机读访问的设备).
04