Direct input refresh
This FP instruction reads the current value of the direct input memory specified by Slot and Offset independently from any IO refresh.
Input
Slot number
Offset
Output
Value of the direct input
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;
iOffset27: INT:=27;
iSlot1: INT:=1;
iIndex3: INT:=3;
arrValuesBool: ARRAY [0..15] of BOOL:=[3(FALSE),TRUE,12(FALSE)];
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,,iOffset27,23,3,25,5,);
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);
B(B_F,E_FP_DIRECT_INPUT!,,25,0,35,5,,?DEN?DSlot?DOffset?AENO?CValue);
B(B_VAROUT,,arrValuesBool[iIndex3],35,2,37,4,);
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
arrValuesBool[iIndex3]:=FP_DIRECT_INPUT(iSlot1, iOffset27);
END_IF;