25111801 添加PLC屏蔽交互

This commit is contained in:
moxiliang
2025-11-18 09:09:30 +08:00
parent 220a794a5b
commit 9f04271ae9
23 changed files with 259 additions and 133 deletions

View File

@@ -201,6 +201,7 @@ namespace SLC1_N
bool[] coil1100 = new bool[14];
bool[] coil1032 = new bool[8];
public bool[] coilSaoma = new bool[4];
public bool[] coilBlock = new bool[5];
// PLC警报
void PLC_Alarm()
@@ -430,7 +431,7 @@ namespace SLC1_N
}
else
{
HCPLC_client.ReadHoldingRegisters(1, 1); // 如果失败,会抛异常
coilBlock = HCPLC_client.ReadCoils(1040, 5); // 如果失败,会抛异常
Thread.Sleep(100);
Signal_PLCStatus?.Invoke(0, true); // 更新PLC连接状态UI