添加门体发泡PLC采集

dev
liulb@mesnac.com 1 year ago
parent e1892194c9
commit 6df66e4932

@ -0,0 +1,48 @@
using Admin.Core.IService;
using Admin.Core.IService.ISys;
using Admin.Core.Model;
using Aucma.Core.PLc;
using log4net;
using NetTaste;
using NPOI.SS.Formula.Functions;
using Quartz;
using System;
using System.Linq;
using System.Threading.Tasks;
/// <summary>
///门体发泡数据采集
/// </summary>
namespace Admin.Core.Tasks
{
public class Job_DoorFoam_Quartz : JobBase, IJob
{
protected readonly IBaseOrderInfoServices _baseOrderInfoServices;
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(Job_DoorFoam_Quartz));
public Job_DoorFoam_Quartz(ISysTasksQzService SysTasksQzService, ISysJobLogService sysJobLogService)
{
_SysTasksQzService = SysTasksQzService;
_sysJobLogService = sysJobLogService;
}
public async Task Execute(IJobExecutionContext context)
{
await ExecuteJob(context, async () => await Run());
}
#region 门体发泡数据采集
public Task Run()
{
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("DoorPlc"));
if (obj.plc.IsConnected)
{
var endSignal = obj.plc.ReadInt16("DB4.DBW0");
}
return Task.FromResult(0);
}
#endregion
}
}

@ -11,7 +11,7 @@ using System.Linq;
using System.Threading.Tasks;
/// <summary>
/// 这里要注意下,命名空间和程序集是一样的,不然反射不到
/// 灌注数据采集
/// </summary>
namespace Admin.Core.Tasks
{
@ -62,7 +62,7 @@ namespace Admin.Core.Tasks
public async Task SaveDbRun()
{
string alarmName = string.Empty;
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("后板Plc"));
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("PerfusionPlc"));
if (obj.plc.IsConnected)
{
var endSignal = obj.plc.ReadInt16("DB55.44.0");//任务结束信号存盘

Loading…
Cancel
Save