2 Star 1 Fork 0

法马智慧/fmgo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
api.go 3.25 KB
一键复制 编辑 原始数据 按行查看 历史
零海 提交于 2022-04-08 12:27 . first commit
package serial
// Client interface
type Client interface {
ClientProvider
// Bits
// ReadCoils reads from 1 to 2000 contiguous status of coils in a
// remote device_info and returns coil status.
ReadCoils(slaveID byte, address, quantity uint16) (results []byte, err error)
// ReadDiscreteInputs reads from 1 to 2000 contiguous status of
// discrete inputs in a remote device_info and returns input status.
ReadDiscreteInputs(slaveID byte, address, quantity uint16) (results []byte, err error)
// WriteSingleCoil write a single output to either ON or OFF in a
// remote device_info and returns success or failed.
WriteSingleCoil(slaveID byte, address uint16, isOn bool) error
// WriteMultipleCoils forces each coil in a sequence of coils to either
// ON or OFF in a remote device_info and returns success or failed.
WriteMultipleCoils(slaveID byte, address, quantity uint16, value []byte) error
// 16-bits
// ReadInputRegisters reads from 1 to 125 contiguous input registers in
// a remote device_info and returns input registers.
ReadInputRegistersBytes(slaveID byte, address, quantity uint16) (results []byte, err error)
// ReadInputRegisters reads from 1 to 125 contiguous input registers in
// a remote device_info and returns input registers.
ReadInputRegisters(slaveID byte, address, quantity uint16) (results []uint16, err error)
// ReadHoldingRegistersBytes reads the contents of a contiguous block of
// holding registers in a remote device_info and returns register value.
ReadHoldingRegistersBytes(slaveID byte, address, quantity uint16) (results []byte, err error)
// ReadHoldingRegisters reads the contents of a contiguous block of
// holding registers in a remote device_info and returns register value.
ReadHoldingRegisters(slaveID byte, address, quantity uint16) (results []uint16, err error)
// WriteSingleRegister writes a single holding register in a remote
// device_info and returns success or failed.
WriteSingleRegister(slaveID byte, address, value uint16) error
// WriteMultipleRegisters writes a block of contiguous registers
// (1 to 123 registers) in a remote device_info and returns success or failed.
WriteMultipleRegisters(slaveID byte, address, quantity uint16, value []byte) error
// ReadWriteMultipleRegisters performs a combination of one read
// operation and one write operation. It returns read registers value.
ReadWriteMultipleRegistersBytes(slaveID byte, readAddress, readQuantity,
writeAddress, writeQuantity uint16, value []byte) (results []byte, err error)
// ReadWriteMultipleRegisters performs a combination of one read
// operation and one write operation. It returns read registers value.
ReadWriteMultipleRegisters(slaveID byte, readAddress, readQuantity,
writeAddress, writeQuantity uint16, value []byte) (results []uint16, err error)
// MaskWriteRegister modify the contents of a specified holding
// register using a combination of an AND mask, an OR mask, and the
// register's current contents. The function returns success or failed.
MaskWriteRegister(slaveID byte, address, andMask, orMask uint16) error
//ReadFIFOQueue reads the contents of a First-In-First-Out (FIFO) queue
// of register in a remote device_info and returns FIFO value register.
ReadFIFOQueue(slaveID byte, address uint16) (results []byte, err error)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/fmpt/fmgo.git
git@gitee.com:fmpt/fmgo.git
fmpt
fmgo
fmgo
v1.6.8

搜索帮助