Browse Source

fix bugs in shortgroup

pull/13/merge
Gavin 8 years ago
parent
commit
5c4481b96c
  1. BIN
      SCADA/Example/BatchCoreTest.exe
  2. BIN
      SCADA/Example/ClientDriver.dll
  3. BIN
      SCADA/Example/DataService.dll
  4. BIN
      SCADA/Program/.vs/DataExchange/v15/.suo
  5. BIN
      SCADA/Program/.vs/DataExchange/v15/Server/sqlite3/storage.ide
  6. BIN
      SCADA/Program/.vs/DataExchange/v15/sqlite3/storage.ide
  7. 2
      SCADA/Program/DataService/PLCGroup.cs
  8. 15
      SCADA/Program/ModbusDriver/ModbusRTUDriver.cs
  9. BIN
      SCADA/dll/DataService.dll
  10. BIN
      SCADA/dll/ModbusDriver.dll
  11. BIN
      SCADA/dll/OPCDriver.dll
  12. BIN
      SCADA/dll/SiemensPLCDriver.dll

BIN
SCADA/Example/BatchCoreTest.exe

Binary file not shown.

BIN
SCADA/Example/ClientDriver.dll

Binary file not shown.

BIN
SCADA/Example/DataService.dll

Binary file not shown.

BIN
SCADA/Program/.vs/DataExchange/v15/.suo

Binary file not shown.

BIN
SCADA/Program/.vs/DataExchange/v15/Server/sqlite3/storage.ide

Binary file not shown.

BIN
SCADA/Program/.vs/DataExchange/v15/sqlite3/storage.ide

Binary file not shown.

2
SCADA/Program/DataService/PLCGroup.cs

@ -983,7 +983,7 @@ namespace DataService
{
for (int i = 0; i < addr.DataSize / 2; i++)
{
prcv[iShort1] = IPAddress.HostToNetworkOrder(prcv[iShort1]);
prcv[iShort1 + i] = IPAddress.HostToNetworkOrder(prcv[iShort1 + i]);
}
}
if (addr.DataSize <= 2)

15
SCADA/Program/ModbusDriver/ModbusRTUDriver.cs

@ -478,7 +478,7 @@ namespace ModbusDriver
CreateReadHeader(address.Area, address.Start, size, func);
lock (_async)
{
byte[] frameBytes = new byte[size * 2 + 3];//size * 2 +
byte[] frameBytes = new byte[size * 2 + 5];//size * 2 +
byte[] data = new byte[size * 2];
_serialPort.Write(header, 0, header.Length);
int numBytesRead = 0;
@ -486,12 +486,15 @@ namespace ModbusDriver
numBytesRead += _serialPort.Read(frameBytes, numBytesRead, 2 - numBytesRead);
if (frameBytes[1] == address.DBNumber)
{
numBytesRead = 0;
while (numBytesRead != frameBytes.Length)
while (numBytesRead < frameBytes.Length)
numBytesRead += _serialPort.Read(frameBytes, numBytesRead, frameBytes.Length - numBytesRead);
Array.Copy(frameBytes, 1, data, 0, data.Length);
Thread.Sleep(20);
return data;
if (Utility.CheckSumCRC(frameBytes))
{
Array.Copy(frameBytes, 3, data, 0, data.Length);
Thread.Sleep(20);
return data;
}
else Thread.Sleep(10);
}
else
{

BIN
SCADA/dll/DataService.dll

Binary file not shown.

BIN
SCADA/dll/ModbusDriver.dll

Binary file not shown.

BIN
SCADA/dll/OPCDriver.dll

Binary file not shown.

BIN
SCADA/dll/SiemensPLCDriver.dll

Binary file not shown.
Loading…
Cancel
Save