fix Modbus驱动功能码01、02、04存在的问题

This commit is contained in:
王海东 2022-03-19 22:07:45 +08:00
parent 2cf56720a6
commit 4889381a0d
23 changed files with 4 additions and 2 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -261,6 +261,7 @@ namespace DriverModbusMaster
} }
else else
ret.Value = retBool; ret.Value = retBool;
ret.StatusType = VaribaleStatusTypeEnum.Good;
} }
else else
{ {
@ -295,6 +296,7 @@ namespace DriverModbusMaster
} }
else else
ret.Value = retBool; ret.Value = retBool;
ret.StatusType = VaribaleStatusTypeEnum.Good;
} }
else else
{ {
@ -344,7 +346,7 @@ namespace DriverModbusMaster
if (FunCode == 3) if (FunCode == 3)
rawBuffers = master.ReadHoldingRegisters(SlaveAddress, startAddress, count); rawBuffers = master.ReadHoldingRegisters(SlaveAddress, startAddress, count);
else if (FunCode == 4) else if (FunCode == 4)
rawBuffers = master.ReadHoldingRegisters(SlaveAddress, startAddress, count); rawBuffers = master.ReadInputRegisters(SlaveAddress, startAddress, count);
var retBuffers = ChangeBuffersOrder(rawBuffers, ioarg.ValueType); var retBuffers = ChangeBuffersOrder(rawBuffers, ioarg.ValueType);
if (ioarg.ValueType.ToString().Contains("Uint16")) if (ioarg.ValueType.ToString().Contains("Uint16"))

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.