mirror of
https://gitee.com/iioter/iotgateway.git
synced 2024-11-29 18:28:09 +08:00
16位数据默认用功能码06
This commit is contained in:
parent
1fb8d8fc4a
commit
cd98a2e273
@ -640,12 +640,12 @@ namespace PLC.ModBusMaster
|
||||
case DataTypeEnum.Int16:
|
||||
shortArray[0] = (ushort)short.Parse(ioArg.Value.ToString());
|
||||
toWriteArray = ChangeBuffersOrder(shortArray, ioArg.EndianType);
|
||||
await _master.WriteMultipleRegistersAsync(slaveAddress, address, toWriteArray);
|
||||
await _master.WriteSingleRegisterAsync(slaveAddress, address, toWriteArray[0]);
|
||||
break;
|
||||
case DataTypeEnum.Uint16:
|
||||
shortArray[0] = ushort.Parse(ioArg.Value.ToString());
|
||||
toWriteArray = ChangeBuffersOrder(shortArray, ioArg.EndianType);
|
||||
await _master.WriteMultipleRegistersAsync(slaveAddress, address, toWriteArray);
|
||||
await _master.WriteSingleRegisterAsync(slaveAddress, address, toWriteArray[0]);
|
||||
break;
|
||||
case DataTypeEnum.Int32:
|
||||
var int32Value = int.Parse(ioArg.Value.ToString());
|
||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user