ModbusTcpNetReadFromCoreServer 方法 (Byte) |
将Modbus报文数据发送到当前的通道中,并从通道中接收Modbus的报文,通道将根据当前连接自动获取,本方法是线程安全的。
Send Modbus message data to the current channel, and receive Modbus messages from the channel. The channel will automatically obtain it according to the current connection. This method is thread-safe.
命名空间:
HslCommunication.ModBus
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public override OperateResult<byte[]> ReadFromCoreServer(
byte[] send
)
Public Overrides Function ReadFromCoreServer (
send As Byte()
) As OperateResult(Of Byte())
public:
virtual OperateResult<array<unsigned char>^>^ ReadFromCoreServer(
array<unsigned char>^ send
) override
abstract ReadFromCoreServer :
send : byte[] -> OperateResult<byte[]>
override ReadFromCoreServer :
send : byte[] -> OperateResult<byte[]>
参数
- send
- 类型:SystemByte
发送的完整的报文信息
返回值
类型:
OperateResultByte接收到的Modbus报文信息
实现
IReadWriteDeviceReadFromCoreServer(Byte)备注
需要注意的是,本方法的发送和接收都只需要输入Modbus核心报文,例如读取寄存器0的字数据 01 03 00 00 00 01,最前面的6个字节是自动添加的,收到的数据也是只有modbus核心报文,例如:01 03 02 00 00 , 所以在解析的时候需要注意。
It should be noted that the sending and receiving of this method only need to input the Modbus core message, for example, read the word data 01 03 00 00 00 01 of register 0,
the first 6 bytes are automatically added, and the received The data is also only modbus core messages, for example: 01 03 02 00 00, so you need to pay attention when parsing.
参见