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.
|
|
|
|
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 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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|