dynamic function PressMot : UP_DOWN initially udIdle dynamic relation PressLoaded initially false output function PressInBottomPosition : BOOL output function PressInMiddlePosition : BOOL output function PressInTopPosition : BOOL output function ForgingCompleted : BOOL derived relation OpenForUnloading == PressInBottomPosition and PressMot = udIdle derived relation MovingToMiddlePosition == not ( PressLoaded ) and PressMot = Up derived relation OpenForLoading == PressInMiddlePosition and PressMot = udIdle derived relation MovingToTopPosition == PressLoaded and PressMot = Up derived relation ClosedForForging == PressInTopPosition and PressMot = udIdle derived relation MovingToBottomPosition == PressMot = Down transition WAITING_UNLOAD_PRESS == if OpenForUnloading and PressLoaded = false then PressMot := Up endif transition MOVING_TO_MIDDLE == if MovingToMiddlePosition and PressInMiddlePosition then PressMot := udIdle endif transition WAITING_LOAD_PRESS == if OpenForLoading and PressLoaded = true then PressMot := Up endif transition MOVING_TO_UPPER == if MovingToTopPosition and PressInTopPosition then PressMot := udIdle endif transition CLOSED == if ClosedForForging and ForgingCompleted then PressMot := Down endif transition MOVING_TO_LOWER == if MovingToBottomPosition and PressInBottomPosition then PressMot := udIdle endif