【正文】
END IF。 END IF。 WHEN up=position=position+1。 pos:=pos+1。 IF pos4 AND(stoplight(pos)=39。139。 OR fdnlight(pos)=39。139。) THEN mylift=stop。 ELSIF pos=4 AND (stoplight(pos)=39。139。 OR fdnlight(pos)=39。139。) THEN mylift=stop。 ELSE mylift=doorclose。 END IF。 WHEN down=position=position1。 pos:=pos1。 IF pos1 AND(stoplight(pos)=39。139。 OR fuplight(pos)=39。139。) THEN mylift=stop。 ELSIF pos=1 AND (stoplight(pos)=39。139。 OR fdnlight(pos)=39。139。) THEN mylift=stop。 ELSE mylift=doorclose。 END IF。 WHEN stop=mylift=dooropen。 WHEN dooropen=doorlight=39。139。 IF udsig=39。039。 THEN IF position=3 AND(stoplight(position)=39。139。 OR fuplight(position)=39。139。)THEN clearup=39。139。 ELSE clearup=39。139。cleardn=39。139。 END IF。 ELSIF udsig=39。139。 THEN IF position=2 AND(stoplight(position)=39。139。 OR fdnlight(position)=39。139。)THEN cleardn=39。139。 ELSE clearup=39。139。cleardn=39。139。 END IF。 END IF。 mylift=doorwait1。 END CASE。 END IF。 END IF。END process ctrlift。ctrlight:PROCESS(reset,buttonclk)BEGINIF reset=39。139。 THEN stoplight=0000。fuplight=0000。fdnlight=0000。ELSE IF buttonclk39。EVENT AND buttonclk=39。139。 THEN IF clearup=39。139。 THEN stoplight(position)=39。039。fuplight(position)=39。039。 ELSE IF f1upbutton=39。139。 THEN fuplight(1)=39。139。 ELSIF f2upbutton=39。139。 THEN fuplight(2)=39。139。 ELSIF f3upbutton=39。139。 THEN fuplight(3)=39。139。 END IF。 END IF。 IF cleardn=39。139。 THEN stoplight(position)=39。039。fdnlight(position)=39。039。 ELSE IF f2dnbutton=39。139。 THEN fdnlight(2)=39。139。 ELSIF f3dnbutton=39。139。 THEN fdnlight(3)=39。139。 ELSIF f4dnbutton=39。139。 THEN fdnlight(4)=39。139。 END IF。 END IF。 IF stop1button=39。139。 THEN stoplight(1)=39。139。 ELSIF stop2button=39。139。 THEN stoplight(2)=39。139。 ELSIF stop3button=39。139。 THEN stoplight(3)=39。139。 ELSIF stop4button=39。139。 THEN stoplight(4)=39。139。 END IF。 END IF。END IF。END process ctrlight。END art。12