This commit is contained in:
2025-03-21 08:51:20 +08:00
parent 0dedff36fd
commit 9a5d3be528
70 changed files with 4542 additions and 2207 deletions

View File

@ -8,6 +8,7 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Xml.Linq;
using DH.Commons.Base;
using DH.Commons.Enums;
using HslCommunication;
using HslCommunication.Enthernet;
@ -47,7 +48,7 @@ namespace DH.Devices.PLC
OperateResult ret = TcpNet.ConnectServer();
if (ret.IsSuccess)
{
connected = true;
Connected = true;
MonitorPieces();
TurntableOpen(12000,true);
@ -382,13 +383,13 @@ namespace DH.Devices.PLC
public override bool PLCDisConnect()
{
if (connected)
if (Connected)
{
TurntableStop();
var res = TcpNet.ConnectClose();
if (res.IsSuccess)
{
connected = false;
Connected = false;
return true;
}
return false;
@ -442,7 +443,7 @@ namespace DH.Devices.PLC
TimeSpan timeSpan = endTime - startTime;
Thread.CurrentThread.Priority = ThreadPriority.AboveNormal;
//while (CurrentState != DeviceState.DSClose && CurrentState != DeviceState.DSExcept && CurrentState != DeviceState.DSUninit)
while (connected)
while (Connected)
{
Stopwatch sw = new Stopwatch();
uint tmpPieceNumber = 0;