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

27 lines
749 B

6 months ago
using HybirdFrameworkDriver.ModbusTcpMaster;
using HybirdFrameworkServices.Plc;
namespace Service.Plc;
public abstract class PlcMgr
{
public static ModbusTcpMaster ModbusTcpMaster;
public static readonly HostToPlc HostToPlcData = new HostToPlc();
public static readonly PlcToHost PlcToHostData = new PlcToHost();
public static readonly PlcFault PlcFaultData = new PlcFault();
/// <summary>
/// 写入口灯
/// 红灯1020
/// 绿灯1000
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public static bool WriteEntranceLamp(byte value)
{
HostToPlcData.LightIn.Value = value;
return ModbusTcpMaster.WriteValue(HostToPlcData.LightIn);
}
}