You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.0 KiB
C#

10 months ago
namespace WorkerSynReport.Plc;
public class RGVEntity
{
public RGVEntity() { }
public bool RequestFeed { get; set; }
public bool Error { get; set; }
}
public class RgvPlcUtil
{
static string Db = "DB2118";
public static List<RGVEntity> GetRGVAllError()
{
List<RGVEntity> ls = new List<RGVEntity>();
//第一台 330.2 倒序
// 330.2 308.2 286.2 264.2 242.2 220.2 198.2 176.2
List<string> strings = new List<string>()
{
"330",
"308",
"286",
"264",
"242",
"220",
"198",
"176",
};
foreach (string s in strings)
{
ls.Add(new RGVEntity()
{
RequestFeed = Read(s + ".0"),
Error = Read(s + ".2")
}); ;
}
return ls;
}
private static bool Read(string dian)
{
return PlcConnect.Instance.ReadBool($"{Db}.{dian}").Content;
}
}