using DataBlockHelper; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Mesnac.Action.ChemicalWeighing.RgvPlc { public class RGVEntity { public RGVEntity() { } public bool Error { get; set; } } public class RgvPlcUtil { static string Db = "DB2118"; public static List GetRGVAllError() { List ls = new List(); //第一台 330.2 倒序 // 330.2 308.2 286.2 264.2 242.2 220.2 198.2 176.2 List strings = new List() { "330.2", "308.2", "286.2", "264.2", "242.2", "220.2", "198.2", "176.2", }; foreach (string s in strings) { ls.Add(new RGVEntity() { Error = Read(s) }); } return ls; } private static bool Read(string dian) { return PlcConnect.Instance.ReadBool($"{Db}.{dian}").Content; } } }