Direct output refresh
This FP instruction sets the direct output memory specified by Slot and Offset independently from any IO refresh. Additionally, it sets also the corresponding output flag or flags.
Input
Slot number
Offset
Value of the direct output
All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.
VAR
bTestBool: BOOL:=FALSE;
bTestWord: BOOL:=FALSE;
bTestDWord: BOOL:=FALSE;
iSlot1: INT:=1;
iOffset21: INT:=21;
END_VAR
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 6 ;
NETWORK_BODY
B(B_VARIN,,iSlot1,23,2,25,4,);
B(B_VARIN,,iOffset21,23,3,25,5,);
B(B_VARIN,,TRUE,23,4,25,6,);
B(B_F,E_FP_DIRECT_OUTPUT!,,25,0,36,6,,?DEN?DSlot?DOffset?DValue?AENO);
B(B_CONTACT,,bTestBool,5,1,7,3,);
B(B_CONTACT,,bTestWord,11,1,13,3,N);
B(B_CONTACT,,bTestDWord,17,1,19,3,N);
L(1,2,5,2);
L(7,2,11,2);
L(13,2,17,2);
L(19,2,25,2);
L(1,0,1,6);
END_NETWORK_BODY
END_NET_WORK
END_BODY
IF (bTestBool AND NOT bTestWord AND NOT bTestDWord) then
FP_DIRECT_OUTPUT(Slot := iSlot1, Offset := iOffset21, Value := TRUE);
END_IF;