Adr_Of_Var

Returns the input or output address

This function returns the address of a variable at the input or output of a non-overloaded system instruction.

Parameters

Input

Unnamed input (ANY)

This pin must be connected to the input/output of a basic function for which the data type INT, WORD is allowed

Yields the 16-bit starting address of the input/output variables

Output

Unnamed output (ANY_IN_UNITS_OF_WORDS)

Input/output variable for which the 16-bit starting address is needed

Remarks

  • The 16-bit starting address is yielded at input/output Adr based on the variables at input/output Var. This input/output has to be directly attached to the 16-bit input or output of a non-overloaded system instruction.

  • 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.

Example

DUT

Under “DUTs” a structured data type is assigned in which the structure’s various, non-boolean variables are declared.

POU header

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
		start: BOOL:=FALSE;
		DutNonBoolean: @'Dut_NonBoolean';
	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 because the values of the variable DutNonBoolean are overwritten after the function F12_ICRD is executed.

When the variable start is set to TRUE, the function F12_ICRD is carried out. The function reads values on the IC card beginning with address 100 and writes the information to the variable DutNonBoolean. Do not forget that the IC card has to be appropriately formatted via the menu “Online” > “IC memory card manager...” and that, if necessary, values beginning at address 100 should be available on the IC card.

LD body

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 12 ;
        NETWORK_BODY
B(B_COMMENT,,It reads the values on the IC card from address 100 and writes theø^information to the variable DutNonBoolean,2,0,27,2,);
B(B_F,P12_ICRD!,Instance,9,2,17,7,,?DEN?Ds1_Start?Ds2_Number?AENO?Cd_Start);
B(B_VARIN,,start,7,3,9,5,);
B(B_VARIN,,100,7,4,9,6,);
B(B_VAROUT,,DutNonBoolean,26,4,28,6,);
B(B_F,Adr_Of_Var_O!,Instance,18,4,26,6,,?D?C);
B(B_F,Size_Of_Var!,Instance,10,10,17,12,,?D?C);
B(B_VARIN,,DutNonBoolean,8,10,10,12,);
B(B_F,INT_TO_DINT!,Instance,17,10,25,12,,?D?C);
L(17,5,18,5);
L(1,0,1,12);
L(7,6,9,6);
L(7,6,7,9);
L(7,9,26,9);
L(26,9,26,11);
L(25,11,26,11);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

Further example projects (directory "Samples" of FPWIN Pro installation):

  • Read, write IC card

  • Read, write shared memory

Modified on: 2019-01-24Feedback on this pagePanasonic hotline