Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
617 B
1
Indexable
Never
FUNCTION_BLOCK Manager
VAR_INPUT
	MyPump: POINTER TO PumpControl;
	FStart:BOOL;
	FStop:BOOL;
END_VAR
VAR_OUTPUT
	Trip:BOOL;
	Available:BOOL;
END_VAR
VAR
	
END_VAR


IF FStart AND NOT MyPump^.PFail THEN
	StartRequest();
END_IF
IF FStart AND FStop THEN 
	StopRequest();
	FStart:=FALSE;
END_IF
IF FStop THEN
	StopRequest();
END_IF


IF MyPump^.PFail THEN 
	Trip := TRUE;
END_IF

IF NOT MyPump^.PRun AND NOT MyPump^.PFail THEN
    Available:=TRUE;
END_IF
IF Available AND Trip THEN 
	Available:=FALSE;
END_IF

# StartRequest
MyPump^.StartPump();

#StopRequest
MyPump^.StopPump();
Leave a Comment