16位数据默认用功能码06

This commit is contained in:
iioter 2024-08-12 15:06:56 +08:00
parent 1fb8d8fc4a
commit cd98a2e273
3 changed files with 2 additions and 2 deletions

View File

@ -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.