更改了CAN和LIN的标志着色问题
保存图片触发两次 CANLIN的一些数据回读到PLC
This commit is contained in:
@@ -90,20 +90,56 @@ namespace CapMachine.Wpf.ProPars
|
||||
//装载ListPlcParsData的结构数据
|
||||
//for (int i = 0; i < Cycle; i++)//Proge 大循环 未启用,默认执行一次
|
||||
//{
|
||||
foreach (ProStep proStep in proSteps)//ProStep 小循环
|
||||
{
|
||||
//每个ProStep步骤里面包含多个参数的设置
|
||||
ListPlcParsData = LoadPlcParsData(proStep, ListPlcParsData);//内部循环
|
||||
}
|
||||
foreach (ProStep proStep in proSteps)//ProStep 小循环
|
||||
{
|
||||
//每个ProStep步骤里面包含多个参数的设置
|
||||
ListPlcParsData = LoadPlcParsData(proStep, ListPlcParsData);//内部循环
|
||||
}
|
||||
//}
|
||||
|
||||
//装载地址 VW1000
|
||||
ListPlcParsData = LoadPlcCellAddress(ListPlcParsData);
|
||||
////防止上一次下载的程序多余当前的步骤,为了清空多余的步骤数据,增加一行的数据
|
||||
|
||||
////装载地址 VW1000
|
||||
//ListPlcParsData = LoadPlcCellAddress(ListPlcParsData);
|
||||
//var datga = LoadPlcBlockAddress(ListPlcParsData, 1000);
|
||||
|
||||
return ListPlcParsData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加一行空的数据,作为终止的执行
|
||||
/// </summary>
|
||||
public static List<PlcParsData> AddNullData(List<PlcParsData> plcParsDatas)
|
||||
{
|
||||
var NewStep = new ProStep()
|
||||
{
|
||||
MeterCond1Temps = new List<MeterCond1Temp>() { new MeterCond1Temp() { ValueType=ConfigValueType.Constant,} },
|
||||
MeterCond2Presss=new List<MeterCond2Press>() { new MeterCond2Press() { ValueType = ConfigValueType.Constant, } },
|
||||
MeterCond2Temps= new List<MeterCond2Temp>() { new MeterCond2Temp() { ValueType = ConfigValueType.Constant, } },
|
||||
MeterEnvRHs = new List<MeterEnvRH>() { new MeterEnvRH() { ValueType = ConfigValueType.Constant, } },
|
||||
MeterEnvTemps = new List<MeterEnvTemp>() { new MeterEnvTemp() { ValueType = ConfigValueType.Constant, } },
|
||||
MeterEVAPExpTemps = new List<MeterEVAPExpTemp>() { new MeterEVAPExpTemp() { ValueType = ConfigValueType.Constant, } },
|
||||
MeterExPresss = new List<MeterExPress>() { new MeterExPress() { ValueType = ConfigValueType.Constant, } },
|
||||
MeterHVVols = new List<MeterHVVol>() { new MeterHVVol() { ValueType = ConfigValueType.Constant, } },
|
||||
MeterInhPresss = new List<MeterInhPress>() { new MeterInhPress() { ValueType = ConfigValueType.Constant, } },
|
||||
MeterInhTemps = new List<MeterInhTemp>() { new MeterInhTemp() { ValueType = ConfigValueType.Constant, } },
|
||||
MeterLubePresss = new List<MeterLubePress>() { new MeterLubePress() { ValueType = ConfigValueType.Constant, } },
|
||||
MeterLVVols = new List<MeterLVVol>() { new MeterLVVol() { ValueType = ConfigValueType.Constant, } },
|
||||
MeterOCRs = new List<MeterOCR>() { new MeterOCR() { ValueType = ConfigValueType.Constant, } },
|
||||
MeterOS1Temps = new List<MeterOS1Temp>() { new MeterOS1Temp() { ValueType = ConfigValueType.Constant, } },
|
||||
MeterOS2Temps = new List<MeterOS2Temp>() { new MeterOS2Temp() { ValueType = ConfigValueType.Constant, } },
|
||||
MeterPTCEntTemps = new List<MeterPTCEntTemp>() { new MeterPTCEntTemp() { ValueType = ConfigValueType.Constant, } },
|
||||
MeterPTCFlows = new List<MeterPTCFlow>() { new MeterPTCFlow() { ValueType = ConfigValueType.Constant, } },
|
||||
MeterPTCPws = new List<MeterPTCPw>() { new MeterPTCPw() { ValueType = ConfigValueType.Constant, } },
|
||||
MeterSpeeds = new List<MeterSpeed>() { new MeterSpeed() { ValueType = ConfigValueType.Constant, } },
|
||||
StepNo = 0,
|
||||
SpeedCycle = 0,
|
||||
Remark = "结束",
|
||||
};
|
||||
|
||||
return LoadPlcParsData(NewStep, plcParsDatas);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载数据到PLC
|
||||
@@ -1640,7 +1676,7 @@ namespace CapMachine.Wpf.ProPars
|
||||
/// <returns></returns>
|
||||
private static int GetCycleCount(int Cycle, int Index, int ListCount)
|
||||
{
|
||||
if (Cycle==1)
|
||||
if (Cycle == 1)
|
||||
{
|
||||
//只有一次,也就是没有循环,就是直接的步骤,统一返回没有循环固定值
|
||||
return 0;
|
||||
@@ -1675,7 +1711,7 @@ namespace CapMachine.Wpf.ProPars
|
||||
/// 单元分割
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static List<PlcParsData> LoadPlcCellAddress(List<PlcParsData> plcParsDatas)
|
||||
public static List<PlcParsData> LoadPlcCellAddress(List<PlcParsData> plcParsDatas)
|
||||
{
|
||||
//单步长度
|
||||
int StepLengh = 150;
|
||||
@@ -1721,6 +1757,8 @@ namespace CapMachine.Wpf.ProPars
|
||||
return plcParsDatas;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 加载PLC块地址信息
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user