Define the LIFO buffer area
This FP instruction specifies the starting area d1_Start for the LIFO (Last-In-First-Out) buffer and the memory size n_Words of the LIFO buffer.
Input
Specifies the memory size of the buffer
Values: 1–4096
Output
Starting data area of the buffer
Format of data buffer
if a value specified for a parameter is outside the permissible range.
if a value specified for a parameter is outside the permissible range.
Corresponding F instructions: F116_FIFR
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
bDefineBuffer: BOOL:=FALSE;
dutTestError: BOOL32_OVERLAPPING_DUT;
iWords: INT:=8;
arrLifo: ARRAY [0..11] OF INT:=[12(0)];
END_VAR
When the variable bDefineBuffer is set to TRUE, the function is carried out.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
B(B_CONTACT,,bDefineBuffer,5,1,7,3,);
B(B_F,E_NE!,,12,0,18,5,,?DEN?D?D?AENO?C);
B(B_VARIN,,arrLifo[0],10,3,12,5,);
B(B_VAROUT,,dutTestError.b8,18,2,20,4,);
B(B_VARIN,,iWords,10,2,12,4,);
L(1,2,5,2);
L(7,2,12,2);
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
B(B_F,FP_LIFO_DEFINE!,,12,1,21,5,,?DEN?Dn_Words?AENO?Cd_Start);
B(B_CONTACT,,bDefineBuffer,5,2,7,4,);
B(B_VARIN,,iWords,10,3,12,5,);
B(B_VAROUT,,arrLifo[0],21,3,23,5,);
L(1,3,5,3);
L(7,3,12,3);
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
END_BODY
if (bDefineBuffer) then
FP_LIFO_DEFINE(n_Words := iWords, d_Start => arrLifo[0]);
(* Check the Buffer size *)
dutTestError.b8 := arrLifo[0] <> iWords;
end_if;