程序如下:通過(guò)程序調(diào)用次功能塊,實(shí)現(xiàn)+1,-1操作,但為甚只有減2才能實(shí)現(xiàn)效果呢?
IF 輸入1=TRUE AND 輸入2=FALSE AND 繼電輔助=FALSE OR 計(jì)數(shù)1>=0 THEN
繼電輔助:=TRUE ;計(jì)數(shù)1:=計(jì)數(shù)1+1;
END_IF;
IF 輸入1=FALSE AND 輸入2=TRUE AND 繼電輔助=TRUE AND 計(jì)數(shù)1>=0 THEN
計(jì)數(shù)1:= 計(jì)數(shù)1-2;
END_IF;