|
|
@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
using HighWayIot.Plc.PlcEntity;
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace HighWayIot.Plc.PlcHelper
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
public class WorkStationHelper
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// RFID10小车工位识别点位写入
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="rgvStation"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
public bool WriteStationSingal(RgvStationEnum rgvStation, int deviceNo)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int point = 0x600;
|
|
|
|
|
|
|
|
point += deviceNo * 32;
|
|
|
|
|
|
|
|
point += (int)rgvStation;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool result = PlcConnect.PlcWrite($"B{point.ToString("X")}", true, DataTypeEnum.Bool).IsSuccess;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// RFID固定工位识别点位读取
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="rgvStation"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
public bool[] ReadStationSingal()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bool[] result = new bool[17];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0x230; i <= 0x240; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int j = 0;
|
|
|
|
|
|
|
|
result[j] = PlcConnect.ReadBool($"B{i.ToString("X")}");
|
|
|
|
|
|
|
|
j++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|