cxy001
级别: 略有小成
精华主题: 0
发帖数量: 60 个
工控威望: 232 点
下载积分: 574 分
在线时间: 173(小时)
注册时间: 2008-03-15
最后登录: 2024-11-16
查看cxy001的 主题 / 回贴
楼主  发表于: 2008-08-27 16:34
谁有样例
cvlsam
富士低压,POD(觸摸屏),PLC专卖
级别: VIP会员

精华主题: 3 篇
发帖数量: 6769 个
工控威望: 38370 点
下载积分: 2955 分
在线时间: 9505(小时)
注册时间: 2006-09-13
最后登录: 2024-11-17
查看cvlsam的 主题 / 回贴
1楼  发表于: 2008-08-27 16:57
富士的SPH系列PLC所使用的ST:
IF ENABLE THEN
    (*如果复位按钮按下,那么系统复位*)
    IF RESET THEN
        LOOP_CASE := 0;
    END_IF;
    
    (*如果运行过程中气压,风压异常,停止*)
    IF (NOT(X4) OR NOT(X5)) AND LOOP_CASE <> 0 THEN
        LOOP_CASE := -10;
    END_IF;
        
    (*步进循环*)
    CASE LOOP_CASE OF
        -10: Y0 := FALSE;
             Y1 := FALSE;
             Y2 := FALSE;
             Y3 := FALSE;
             Y4 := TRUE;
             Y5 := FALSE;
             STEP := LOOP_CASE;
          0:(*如果气压正常,那么程序继续运行*)
              IF X5 THEN
                LOOP_CASE := 10;
                STEP := LOOP_CASE;
            ELSE
                LOOP_CASE :=-10;
                STEP := LOOP_CASE;
            END_IF;
         10:(*开风机,同时检测风压是否正常*)
             Simple_Button_1(Button:=X1);
            Y4:=Simple_Button_1.Out_Coil;
            IF Y4 THEN
                IF  X4 THEN
                    LOOP_CASE := 20;
                ELSE
                    LOOP_CASE := -10;
                END_IF;
            END_IF;
            STEP := LOOP_CASE;
         20:(*燃烧启动,同时启动后延时10S*)
             Simple_Button_2(Button:=X2);
            Y3:=Simple_Button_2.Out_Coil;
            IF Y3 THEN
                IF CLOCK_1S THEN
                    DelayTime := DelayTime + 1;
                END_IF;
                IF DelayTime >= 10 THEN
                    LOOP_CASE := 30;
                    DelayTime := 0;
                END_IF;
            END_IF;
            STEP := LOOP_CASE;
         30:(*Y0输出,延时2S*)
             Y0:=TRUE;
            IF Y0 THEN
                IF CLOCK_1S THEN
                    DelayTime := DelayTime + 1;
                END_IF;
                IF DelayTime >= 2 THEN
                    LOOP_CASE := 40;
                    DelayTime := 0;
                END_IF;
            END_IF;
            STEP := LOOP_CASE;
         40:(*Y2输出,延时1S*)
             Y2:=TRUE;
            IF Y2 THEN
                IF CLOCK_1S THEN
                    DelayTime := DelayTime + 1;
                END_IF;
                IF DelayTime >= 1 THEN
                    LOOP_CASE := 50;
                    DelayTime := 0;
                END_IF;
            END_IF;
            STEP := LOOP_CASE;
         50:(*Y1输出,延时3S*)
             Y1:=TRUE;
            IF Y1 THEN
                IF CLOCK_1S THEN
                    DelayTime := DelayTime + 1;
                END_IF;
                IF DelayTime >= 3 THEN
                    LOOP_CASE := 60;
                    DelayTime := 0;
                END_IF;
            END_IF;
            STEP := LOOP_CASE;
         60:(*点火次数检测*)
             IF COUNT>=3 THEN
                LOOP_CASE := 200;
            ELSE
                LOOP_CASE :=70;
            END_IF;
            STEP := LOOP_CASE;
         70:(*火焰检测*)
             IF X0 THEN
                Y3 := FALSE;
            ELSE
                LOOP_CASE := 80;
            END_IF;
            STEP := LOOP_CASE;
         80:(*点火失败的处理*)
             Y1:=FALSE;
            Y2:=FALSE;
            Y3:=TRUE;
            IF (NOT Y1) AND (NOT Y2) AND Y3 THEN
                IF CLOCK_1S THEN
                    DelayTime := DelayTime + 1;
                END_IF;
                IF DelayTime >= 10 THEN
                    LOOP_CASE := 90;
                    DelayTime := 0;
                END_IF;
            END_IF;
            STEP := LOOP_CASE;
         90:(*Y2输出,延时1S*)
             Y2 := TRUE;
            IF Y2 THEN
                IF CLOCK_1S THEN
                    DelayTime := DelayTime + 1;
                END_IF;
                IF DelayTime >= 1 THEN
                    LOOP_CASE := 100;
                    DelayTime := 0;
                END_IF;
            END_IF;
            STEP := LOOP_CASE;
        100:(*Y1输出,计数器加1*)
            Y1 := TRUE;
            COUNT := COUNT + 1;
            LOOP_CASE := 60;
            STEP := LOOP_CASE;
        200:(*重启动*)
            Y0 := TRUE;
            Y1 := FALSE;
            Y2 := FALSE;
            Y3 := TRUE;
            Y4 := TRUE;
            IF NOT X6 THEN
                IF CLOCK_2S_Out THEN
                    Y5 := TRUE;
                ELSE
                    Y5 := FALSE;
                END_IF;
            END_IF;
            IF X3 THEN
                COUNT := 0;
                LOOP_CASE := 60;
                STEP := LOOP_CASE;
            END_IF;
    END_CASE;
END_IF;

問題是這樣的樣例對您有多大的幫助呢???
cxy001
级别: 略有小成
精华主题: 0
发帖数量: 60 个
工控威望: 232 点
下载积分: 574 分
在线时间: 173(小时)
注册时间: 2008-03-15
最后登录: 2024-11-16
查看cxy001的 主题 / 回贴
2楼  发表于: 2008-11-05 13:26
具有参考价值,谢谢