Returns the FL address of the input or output with 32-bit offset
From the value at input/output Offs, the function generates a 32-bit address in the FL area at input/output AdrFL. This input/output has to be directly attached to a 16-bit input/output of a basic function. The value at input/output Offs represents the address offset within the FL data area. Using GetPointer32 it can be transferred along with a value for the memory area to a user function or function block.
Input
Yields 16-bit FL offset address
This pin must be connected to the input/output of a basic function for which the data type INT, WORD is allowed
Output
32-bit offset for address FL0
Remember, the execution of the basic function that uses the address created in the FL area is determined by assigning the function Is_AreaFL with the value for the memory area of the variable at EN-input.
This function internally accesses one of the index registers that is also used for array calculations. If the FL area is not available for a given controller, the address DT0 is generated automatically instead of the FL address.
The function Is_AreaFL always returns FALSE and thus hinders executing a command with a meaningless address. Hence, the user-defined functions and function blocks written with this function can be run on controllers that do not support the FL area.
Only for LD and FBD Editors: Use “Input instruction” or “Output instruction” from the “Instructions” pane to insert the instruction required into the programming window.
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
bStart: BOOL:=FALSE;
(*Activation of the function*)
DutNonBoolean: DUT_NonBoolean;
(*structured data type*)
diActualPosition: DINT:=0;
(*Beginning position from which data should be read from the IC card*)
END_VAR
Here the variable DutNonBoolean of the data type assigned in the above DUT is declared. Assigning elements of the variable DutNonBoolean with values was not done in the POU header or body, since the values of the variable DutNonBoolean are overwritten after the function ReadFromIcCard is executed.When the variable bStart changes from FALSE to TRUE, the function ReadFromIcCard is carried out. The function reads values on the IC card beginning with address diActualPosition and writes the information to the variable DutNonBoolean. Do not forget that the IC card has to be appropriately formatted via the menu and that, if necessary, values beginning at address diActualPosition should be present on the IC card.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 8 ;
NETWORK_BODY
B(B_CONTACT,,start,6,1,8,3,R);
B(B_F,ReadFromIcCard!,,18,1,27,8,,?DEN?DArea?DOffset?DSize?DPosition?AENO?C);
B(B_VARIN,,ActualPosition,16,6,18,8,);
B(B_VAROUT,,ActualPosition,27,3,29,5,);
B(B_VARIN,,Dut_NonBoolean,7,3,9,5,);
B(B_F,Size_Of_Var!,,9,5,16,7,,?D?C);
B(B_F,GetPointer!,,11,3,18,5,,?D?C);
B(B_VARIN,,2,16,4,18,6,);
L(18,2,18,3);
L(8,2,18,2);
L(1,2,6,2);
L(9,4,11,4);
L(9,4,9,6);
L(16,6,18,6);
L(1,0,1,8);
END_NETWORK_BODY
END_NET_WORK
END_BODY