程序

//点动陈序
IF “点动启动” = 1 THEN
    “KM1点动” := 1;
ELSE
    “KM1点动” := 0;
END_IF;

// 起保停电路
IF “自锁启动” = 1 THEN
    “kM2输出” := 1;
END_IF;
IF “自锁停止” = 1 THEN
    “kM2输出” := 0;
END_IF;

//双重连锁正反转
IF “正转启动” = 1 AND “反转启动” = 0 THEN
    “km3反转” := 0;
    “KM3正转” := 1;
END_IF;
IF “反转启动” = 1 AND “正转启动” = 0 THEN
    “KM3正转” := 0;
    “km3反转” := 1;
END_IF;
IF “停止正反转” = 1 THEN
    “km3反转” := 0;
    “KM3正转” := 0;
END_IF;

//星角降压启动
IF “星角启动”=1 AND “星角停止”=0 THEN
    “KM1” := 1;
    “KM2(星)”:=1 ;
END_IF;
“T1”.TON(IN:=”KM1″,//延时接通 T1,KM1得电是T1开始计时 ,5秒
         PT:=t#5S);
IF “T1”.Q = 1 AND “星角停止”=0 THEN
    “KM2(星)” := 0;
    “KM3(角)”:=1;
END_IF;
IF “星角停止” = 1 THEN//停止
    “KM1” := 0;
    “KM2(星)” := 0;
    “KM3(角)” := 0;
   
END_IF;

//双速电机低速启动5秒后高速运行
IF “双速启” = 1 THEN //低速运行
    “双速km1” := 1;
END_IF;
“T2”.TON(IN:=”双速km1″, //计时5秒
         PT:=T#5S);
IF “T2”.Q = 1 THEN   //T2得电时,高速运行
    “双速km1” := 0;
    “双速km2” := 1;
    “双速km3” := 1;
END_IF;
IF “双速停” = 1 THEN  // 停止
    “双速km1” := 0;
    “双速km2” := 0;
    “双速km3” := 0;
END_IF;

SCL语言(入门初级笔记)「建议收藏」-冯金伟博客园SCL语言(入门初级笔记)「建议收藏」-冯金伟博客园

SCL语言(入门初级笔记)「建议收藏」-冯金伟博客园SCL语言(入门初级笔记)「建议收藏」-冯金伟博客园