DI _ status :球//需要檢測的di
last _ status :球//di之前的狀態
positive _ edge :球//上升沿輸出
negative _ edge :球//下降沿輸出
positive _ edge 3360=di _狀態和NOtlast _狀態; //上升沿判斷
negative _ edge 3360=not di _ statusandlast _ status; //下降沿判斷
//狀態代入
最後狀態:=第二狀態; 雖然程序中經常使用上升沿和下降沿,但梯形圖容易設定,ST需要多個Last_Status變量。 通過該變量的組合,實現變量的上升沿、下降沿的檢測
很簡單。 直接訪問程序