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.

57 lines
1.8 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using HslCommunication;
using HslCommunication.Profinet.Delta;
using Module.Common;
using Module.DB.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Module.Plc.Profinet.Tool
{
public class PlcCpRecipeFunc
{
/// <summary>
/// 冷板配方下发
/// </summary>
/// <returns></returns>
public static bool CpRecipe(MJsonRpCpInfo param)
{
bool result = false;
OperateResult connect01 = PlcCommon.DeltaTcpNetClient01.Write("D290", (short)param.f_cp_plc_no);
OperateResult connect02 = PlcCommon.DeltaTcpNetClient01.Write("D900", Convert.ToInt16(param.f_cp_time_num * 10));
result = connect01.IsSuccess && connect02.IsSuccess;
return result;
}
/// <summary>
/// 冷板配方下发
/// </summary>
/// <param name="trackNo">通道号。1:通道12:通道2</param>
/// <param name="param">冷板信息</param>
/// <returns></returns>
public static bool CpRecipe(int trackNo, MRPCpInfo param)
{
bool result = false;
DeltaTcpNet client = null;
if (trackNo == 1)
{
client = PlcCommon.DeltaTcpNetClient01;
}
else if (trackNo == 2)
{
client = PlcCommon.DeltaTcpNetClient02;
}
if (client != null)
{
OperateResult connect01 = client.Write("D290", (short)param.f_cp_plc_no);
OperateResult connect02 = client.Write("D900", Convert.ToInt16(param.f_cp_time_num * 10));
result = connect01.IsSuccess && connect02.IsSuccess;
}
return result;
}
}
}