Documentation
¶
Index ¶
Constants ¶
View Source
const ( Coil primaryTable = "COIL" // 线圈 DiscreteInput primaryTable = "DISCRETE_INPUT" // 离散输入 InputRegister primaryTable = "INPUT_REGISTER" // 离散寄存器 HoldingRegister primaryTable = "HOLDING_REGISTER" // 保持寄存器 )
View Source
const BatchReadMode plugin.EncodeMode = "batchRead"
View Source
const ProtocolName = "modbus"
Variables ¶
This section is empty.
Functions ¶
func InitRestAPI ¶ added in v0.8.0
func InitRestAPI()
Types ¶
type ConnectionConfig ¶ added in v0.8.0
type ConnectionConfig struct {
plugin.BaseConnection
Address string `json:"address"` // 地址:例如:127.0.0.1:502
Mode string `json:"mode"` // 连接模式:rtuovertcp、rtu
BaudRate uint `json:"baudRate"` // 波特率(仅串口模式)
DataBits uint `json:"dataBits"` // 数据位(仅串口模式)
StopBits uint `json:"stopBits"` // 停止位(仅串口模式)
Parity uint `json:"parity"` // 奇偶性校验(仅串口模式)
BatchReadLen uint16 `json:"batchReadLen"` // 最长连续读个数
BatchWriteLen uint16 `json:"batchWriteLen"` // 支持连续写的最大长度
MinInterval uint16 `json:"minInterval"` // 最小读取间隔
Timeout uint16 `json:"timeout"` // 请求超时
Retry int `json:"retry"` // 重试次数
}
ConnectionConfig 连接器配置
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin 驱动插件
type Point ¶ added in v0.8.0
type Point struct {
config.Point
//冗余设备相关信息
DeviceId string
//点位采集周期
Duration string `json:"duration"`
Address uint16
RegisterType primaryTable `json:"primaryTable"`
//该配置无需设置
Quantity uint16 `json:"-"`
Bit uint8 `json:"bit"`
BitLen uint8 `json:"bitLen"`
RawType string `json:"rawType"`
ByteSwap bool `json:"byteSwap"`
WordSwap bool `json:"wordSwap"`
//写操作是否强制要求多寄存器写接口。某些设备点位虽然只占据一个寄存器地址,但要求采用多寄存器写接口
MultiWrite bool `json:"multiWrite"`
}
Point modbus点位
Click to show internal directories.
Click to hide internal directories.