编程编辑器的比较

选择编程编辑器的可能标准可能为:

布尔运算:[LD/FBD编辑器] 推荐

LD/FBD(推荐)

ST

IL

(* 2 of 3 *)
Y1:=NOT X1 AND X2 AND X3 OR
    X1 AND NOT X2 AND X3 OR
    X1 AND X2 AND NOT X3;

(* Handle error case *)
if (Error1 OR Error2 OR Error3) then
    Alarm:=TRUE;
    Horn :=TRUE;
end_if;

(* Confirm alarm *)
if (ConfirmAlarm) then
    Horn:=FALSE;
end_if;

(* Reset alarm *)
if (ResetAlarm AND NOT Error1 AND NOT Error2 AND
NOT Error3) then
    Alarm:=FALSE;
    Horn :=FALSE;
end_if;

42

35

35

函数调用:[LD/FBD编辑器] 推荐

LD/FBD(推荐)

ST

IL

(* Calculate statistical parameters *)
if (bCalculateStatistics) then
   	StatisticalCalculations(CalculateSum := bCalcSum,
                            CalculateMean := bCalcMean,
                            CalculateDeviation := bCalcDeviation,
                            Number := 3,
                            Input1 := Integer1,
                            Input2 := Integer2,
                            Input3 := Integer3,
                            Sum => Sum,
                            Mean => Mean,
                            Deviation => Deviation);
end_if;

32

35

35

无条件计算:[ST编辑器] 推荐

LD/FBD

ST (推荐)

IL

(* Linear interpolation: *)
y:=y1+(x-x1)*(y2-y1)/(x2-x1);

108

108

108

条件计算:[ST编辑器] 推荐

LD/FBD

ST (推荐)

IL

(* Conditional linear interpolation *)
if (NOT(XLtX1) AND NOT(XGtX2) AND
    NOT(X1EqualX2)) then
    y:=y1+(x-x1)*(y2-y1)/(x2-x1);
end_if;

111

109

109

if-else条件计算:[ST编辑器] 推荐

LD/FBD

ST (推荐)

IL

注释

当从无条件更改为条件操作时,整个网络必须重绘!

if (x > x1) then
    y:=y1;
elsif (x < x2) then
    y:=y2;
elsif (x1 = x2) then
    y:=(y1 + y2)/2;
else	(* Linear interpolation *)
    y:=y1+(x - x1)*(y2 - y1)/(x2 - x1);
end_if;

194

190

194

循环操作:[ST编辑器] 推荐

LD/FBD

ST(推荐)

IL

Sum:=0;
for i := 1 to 10 do
    Sum:=Sum+Array1[i];
end_for;
Mean:=Sum/10;

结论:

最后更新日期: 2022-04-05此页面上的反馈松下热线