Untitled

mail@pastecode.io avatar
unknown
plain_text
24 days ago
540 B
0
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 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

#StartRequest
MyPump^.StartPump();

#StopRequest'
MyPump^.StopPump();

Leave a Comment