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.
lj_plc/DataBlockHelper/DBHelpers/DB191Helper.cs

64 lines
1.7 KiB
C#

using DataBlockHelper.Entity.DB191Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataBlockHelper.DBHelpers
{
public class DB191Helper : DBHelper
{
public DB191Helper()
{
bytes = PlcConnect.Instance.Read("DB191.0.0", 32).Content;
}
public ControlPanelEntity ControlPanel_A => new ControlPanelEntity(0, bytes);
public ControlPanelEntity ControlPanel_B => new ControlPanelEntity(4, bytes);
public ControlPanelEntity ControlPanel_C => new ControlPanelEntity(8, bytes);
public ForConveyorStep ConveyStep_A => new ForConveyorStep(12, bytes);
public ForConveyorStep ConveyStep_B => new ForConveyorStep(16, bytes);
public ForConveyorStep ConveyStep_C => new ForConveyorStep(20, bytes);
public bool[] GetVesselMode()
{
var content = bytes.Skip(24).Take(6).ToArray();
bool[] bools = new bool[6];
byte byt = content[0];
bools[0] = byt.GetBit(0);
bools[1] = byt.GetBit(1);
byt = content[2];
bools[2] = byt.GetBit(0);
bools[3] = byt.GetBit(1);
byt = content[4];
bools[4] = byt.GetBit(0);
bools[5] = byt.GetBit(1);
return bools;
}
public bool[] GetPanelOnOff()
{
var content = bytes.Skip(30).Take(1).ToArray();
byte byt = content[0];
bool[] bools = new bool[3];
bools[0] = byt.GetBit(0);
bools[1] = byt.GetBit(1);
bools[2] = byt.GetBit(2);
return bools;
}
}
}