修改读取逻辑

This commit is contained in:
gongxh
2022-05-06 15:23:30 +08:00
parent 0e459f231a
commit 64238fee13
8 changed files with 199 additions and 121 deletions

View File

@@ -78,9 +78,9 @@ namespace CleanMachineHMI.FrmUserControl
{
try
{
if (Global.PlcItemMd_X_List != null && Global.PlcItemMd_X_List.Count > 0)
if (PlcOperationHelper.Instance.PlcItemMd_X_List != null && PlcOperationHelper.Instance.PlcItemMd_X_List.Count > 0)
{
List<PlcItem> tempLst = Global.PlcItemMd_X_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_X_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
foreach (PlcItem item in tempLst)
{
BeginInvoke(new Action(() =>
@@ -95,9 +95,9 @@ namespace CleanMachineHMI.FrmUserControl
}
}
if (Global.PlcItemMd_Y_List != null && Global.PlcItemMd_Y_List.Count > 0)
if (PlcOperationHelper.Instance.PlcItemMd_Y_List != null && PlcOperationHelper.Instance.PlcItemMd_Y_List.Count > 0)
{
List<PlcItem> tempLst = Global.PlcItemMd_Y_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_Y_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
foreach (PlcItem item in tempLst)
{
BeginInvoke(new Action(() =>