|
@@ -745,9 +745,10 @@ namespace IMCS.CCS.Services
|
|
|
EnumHelper.GetDescription(ActionTypeEnum.SendQualityCenter), req.taskId, req.taskNodeId);
|
|
|
taskCallbackData = setCallBackValue(CcsActionAddresses, taskCallbackData);
|
|
|
//放入恒轮工位,作为启动 ,传递给后续启动
|
|
|
- if (req.url == "192.168.11.150" && req.data.Location == "127")
|
|
|
+ if (req.url == "192.168.11.150" && (req.data.Location == "127" || req.data.Location == "128"))
|
|
|
{
|
|
|
- taskCallbackData.Description = currentWorkStation;
|
|
|
+ taskCallbackData.Data = currentWorkStation;
|
|
|
+ taskCallbackData.Description = ProtocalTypeEnum.OPCUA.ToString();
|
|
|
}
|
|
|
/*//清洗机启动时更新回调值
|
|
|
if(!string.IsNullOrEmpty(req.data.Location) && req.data.Location == "123")
|
|
@@ -1145,75 +1146,12 @@ namespace IMCS.CCS.Services
|
|
|
List<CcsActionAddress> CcsActionAddresses = _ccsActionAddressService.GetList(actionAddressQuery);
|
|
|
//opcua启动程序
|
|
|
if (actionInfo.ProtocolType == ProtocalTypeEnum.OPCUA.ToString())
|
|
|
- {
|
|
|
- //SiemensS7Net s7 = DevicePlcS7.SiemensS7(actionInfo.PlcIp);
|
|
|
- //OperateResult ConnectionResult = s7.ConnectServer();
|
|
|
- //if (!ConnectionResult.IsSuccess)
|
|
|
- //{
|
|
|
- // s7.ConnectClose();
|
|
|
- // Log.Instance.WriteLogAdd(ActionTypeEnum.StartNCProgram + "启动程序异常===>>" + "PLC连接不上" + JsonConvert.SerializeObject(req),
|
|
|
- // EnumHelper.GetDescription(ActionTypeEnum.StartNCProgram));
|
|
|
- // responseData.result = "false";
|
|
|
- // return responseData;
|
|
|
- //}
|
|
|
-
|
|
|
- ////查询条件
|
|
|
- //List<CcsActionAddress> CcsActionAddressChecks = CcsActionAddresses.Where(o => o.Type == ActionAddressTypeEnum.CHECK.ToString()).ToList();
|
|
|
- //foreach (CcsActionAddress actionAddress in CcsActionAddressChecks)
|
|
|
- //{
|
|
|
- // if (!string.IsNullOrEmpty(actionAddress.Address) && !string.IsNullOrEmpty(actionAddress.Value))
|
|
|
- // {
|
|
|
- // string CheckAddress = ToolUtils.AddressConvertDBW(actionAddress.Address);
|
|
|
- // var operateResult = s7.ReadInt16(CheckAddress).Content.ToString();
|
|
|
- // if (actionAddress.CheckType ? operateResult.ToString().Equals(actionAddress.Value) : operateResult.ToString() != actionAddress.Value)
|
|
|
- // {
|
|
|
- // s7.ConnectClose();
|
|
|
- // Log.Instance.WriteLogAdd(ActionTypeEnum.StartNCProgram + "启动程序异常===>>" + "条件不满足" + JsonConvert.SerializeObject(req),
|
|
|
- // EnumHelper.GetDescription(ActionTypeEnum.StartNCProgram));
|
|
|
- // responseData.result = "false";
|
|
|
- // return responseData;
|
|
|
- // }
|
|
|
- // }
|
|
|
- //}
|
|
|
-
|
|
|
- //string currentWorkStation = s7.ReadInt16("DB200.332").Content.ToString();
|
|
|
- //string writeValue = "128";
|
|
|
- //if (currentWorkStation == "1")//工作台1
|
|
|
- //{
|
|
|
- // writeValue = "128";
|
|
|
- //}
|
|
|
- //else if (currentWorkStation == "2")//工作台2
|
|
|
- //{
|
|
|
- // writeValue = "127";
|
|
|
- //}
|
|
|
-
|
|
|
- ////查询写入地址列表
|
|
|
- //List<CcsActionAddress> CcsActionAddressWrites = CcsActionAddresses.Where(o => o.Type == ActionAddressTypeEnum.WRITE.ToString()).ToList();
|
|
|
- //foreach (CcsActionAddress actionAddress in CcsActionAddressWrites)
|
|
|
- //{
|
|
|
- // if (!string.IsNullOrEmpty(actionAddress.Address))
|
|
|
- // {
|
|
|
- // if (actionAddress.Sort == 1)
|
|
|
- // {
|
|
|
- // string proNo = Path.GetFileNameWithoutExtension(req.data.remotePath);
|
|
|
- // s7.Write(actionAddress.Address, Convert.ToInt16(proNo));
|
|
|
- // } else if (actionAddress.Sort == 2)
|
|
|
- // {
|
|
|
- // string proNo = Path.GetFileNameWithoutExtension(req.data.remotePath);
|
|
|
- // s7.Write(actionAddress.Address, Convert.ToInt16(writeValue));
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // s7.Write(actionAddress.Address, Convert.ToInt16(actionAddress.Value));
|
|
|
- // }
|
|
|
- // Thread.Sleep(SLEEP_TIME);
|
|
|
- // }
|
|
|
- //}
|
|
|
- //s7.ConnectClose();
|
|
|
+ {
|
|
|
//插入回调
|
|
|
//获取启动前放的 工位
|
|
|
TaskCallback queryTaskCallBack = new TaskCallback();
|
|
|
queryTaskCallBack.IP = actionInfo.PlcIp;
|
|
|
+ queryTaskCallBack.Description = ProtocalTypeEnum.OPCUA.ToString();
|
|
|
TaskCallback TaskBean = await _taskCallbackService.GetRobotActionList(queryTaskCallBack);
|
|
|
|
|
|
TaskCallback taskCallbackData = new TaskCallback(actionInfo.PlcIp, ActionTypeEnum.StartNCProgram.ToString(),
|
|
@@ -1222,7 +1160,7 @@ namespace IMCS.CCS.Services
|
|
|
taskCallbackData.Description = ProtocalTypeEnum.OPCUA.ToString();
|
|
|
if(TaskBean != null)
|
|
|
{
|
|
|
- taskCallbackData.Data = TaskBean.Description;
|
|
|
+ taskCallbackData.Data = TaskBean.Data;
|
|
|
}
|
|
|
else
|
|
|
{
|