|
@@ -9,7 +9,6 @@ using IMCS.CCS.DeviceProtocol;
|
|
|
using System;
|
|
|
using S7.Net;
|
|
|
using IMCS_CCS.Utils;
|
|
|
-using Newtonsoft.Json;
|
|
|
using IMCS_CCS.Utils.DeviceProtocol;
|
|
|
using HslCommunication.Profinet.Siemens;
|
|
|
using Microsoft.Extensions.Configuration;
|
|
@@ -20,6 +19,7 @@ using HslCommunication;
|
|
|
using System.Text.RegularExpressions;
|
|
|
using System.IO;
|
|
|
using System.Reflection;
|
|
|
+using Newtonsoft.Json;
|
|
|
|
|
|
namespace IMCS.CCS.Services
|
|
|
{
|
|
@@ -224,6 +224,29 @@ namespace IMCS.CCS.Services
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ //二次写入地址列表
|
|
|
+ List<CcsActionAddress> CcsActionAddressWriteSeconds = CcsActionAddresses.Where(o => o.Type == ActionAddressTypeEnum.WRITE_SECOND.ToString()).ToList();
|
|
|
+ foreach (CcsActionAddress actionAddress in CcsActionAddressWriteSeconds)
|
|
|
+ {
|
|
|
+ if (!string.IsNullOrEmpty(actionAddress.Address))
|
|
|
+ {
|
|
|
+ if (string.IsNullOrEmpty(actionAddress.Value))
|
|
|
+ {
|
|
|
+ //取参数传参值
|
|
|
+ string dataValue = getProperties(req.data, actionAddress.Description);
|
|
|
+ if (!string.IsNullOrEmpty(dataValue))
|
|
|
+ {
|
|
|
+ s7.Write(actionAddress.Address, Convert.ToInt16(dataValue));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ s7.Write(actionAddress.Address, Convert.ToInt16(actionAddress.Value));
|
|
|
+ }
|
|
|
+
|
|
|
+ Thread.Sleep(SLEEP_TIME);
|
|
|
+ }
|
|
|
+ }
|
|
|
s7.ConnectClose();
|
|
|
|
|
|
//插入回调
|