Skip to content

Commit 4889381

Browse files
author
王海东
committed
fix Modbus驱动功能码01、02、04存在的问题
1 parent 2cf5672 commit 4889381

23 files changed

+4
-2
lines changed

Diff for: .vs/IoTGateway/DesignTimeBuild/.dtbcache.v2

0 Bytes
Binary file not shown.

Diff for: .vs/IoTGateway/v17/.futdcache.v1

0 Bytes
Binary file not shown.

Diff for: .vs/IoTGateway/v17/.suo

1 KB
Binary file not shown.

Diff for: .vs/IoTGateway/v17/fileList.bin

4.58 KB
Binary file not shown.

Diff for: IoTGateway/iotgateway.db

0 Bytes
Binary file not shown.

Diff for: Plugins/Drivers/DriverModbusMaster/ModbusMaster.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public bool IsConnected
8383
case Master_TYPE.Udp:
8484
case Master_TYPE.RtuOnUdp:
8585
case Master_TYPE.AsciiOnUdp:
86-
return clientUdp != null && master != null && clientUdp.Client.Connected ;
86+
return clientUdp != null && master != null && clientUdp.Client.Connected;
8787
case Master_TYPE.Rtu:
8888
case Master_TYPE.Ascii:
8989
return port != null && master != null && port.IsOpen;
@@ -261,6 +261,7 @@ public DriverReturnValueModel ReadCoil(DriverAddressIoArgModel ioarg)
261261
}
262262
else
263263
ret.Value = retBool;
264+
ret.StatusType = VaribaleStatusTypeEnum.Good;
264265
}
265266
else
266267
{
@@ -295,6 +296,7 @@ public DriverReturnValueModel ReadInput(DriverAddressIoArgModel ioarg)
295296
}
296297
else
297298
ret.Value = retBool;
299+
ret.StatusType = VaribaleStatusTypeEnum.Good;
298300
}
299301
else
300302
{
@@ -344,7 +346,7 @@ private DriverReturnValueModel ReadRegistersBuffers(byte FunCode, DriverAddressI
344346
if (FunCode == 3)
345347
rawBuffers = master.ReadHoldingRegisters(SlaveAddress, startAddress, count);
346348
else if (FunCode == 4)
347-
rawBuffers = master.ReadHoldingRegisters(SlaveAddress, startAddress, count);
349+
rawBuffers = master.ReadInputRegisters(SlaveAddress, startAddress, count);
348350

349351
var retBuffers = ChangeBuffersOrder(rawBuffers, ioarg.ValueType);
350352
if (ioarg.ValueType.ToString().Contains("Uint16"))

Diff for: drivers/net6.0/DriverAllenBradley.dll

0 Bytes
Binary file not shown.

Diff for: drivers/net6.0/DriverAllenBradley.pdb

8 Bytes
Binary file not shown.

Diff for: drivers/net6.0/DriverMTConnect.dll

0 Bytes
Binary file not shown.

Diff for: drivers/net6.0/DriverMTConnect.pdb

8 Bytes
Binary file not shown.

Diff for: drivers/net6.0/DriverMitsubishi.dll

0 Bytes
Binary file not shown.

Diff for: drivers/net6.0/DriverMitsubishi.pdb

4 Bytes
Binary file not shown.

Diff for: drivers/net6.0/DriverModbusMaster.dll

0 Bytes
Binary file not shown.

Diff for: drivers/net6.0/DriverModbusMaster.pdb

16 Bytes
Binary file not shown.

Diff for: drivers/net6.0/DriverOPCUaClient.dll

0 Bytes
Binary file not shown.

Diff for: drivers/net6.0/DriverOPCUaClient.pdb

4 Bytes
Binary file not shown.

Diff for: drivers/net6.0/DriverOmronFins.dll

0 Bytes
Binary file not shown.

Diff for: drivers/net6.0/DriverOmronFins.pdb

4 Bytes
Binary file not shown.

Diff for: drivers/net6.0/DriverSiemensS7.dll

0 Bytes
Binary file not shown.

Diff for: drivers/net6.0/DriverSiemensS7.pdb

4 Bytes
Binary file not shown.

Diff for: drivers/net6.0/PluginInterface.dll

0 Bytes
Binary file not shown.

Diff for: drivers/net6.0/PluginInterface.pdb

92 Bytes
Binary file not shown.

Diff for: iotgateway.db

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)