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

44 lines
1.1 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", 30).Content;
}
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;
}
}
}