ReadDataFromFileRegisterBank

Read data from file register bank 1 or 2

This instruction reads the number of words specified by DataNumberOfWords from File Register Bank 1 or 2, as specified by BankNumber beginning with BankOffset, and writes it to DataStartAddress.

Parameters

Input

BankNumber (INT)

Specifies the bank number

BankOffset (INT)

Specifies the bank number offset

DataNumberOfWords (INT)

Number of word units to be read from the file register bank

Output

DataStartAddress (WORD, INT, UINT)

Specifies the start address of data which is read from the file register bank

Remarks

With this function you cannot read data in the FL area (File Register Bank 0), i.e., the variable applied at DataStartAddress must not be located in the FL area.

Example

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
	VAR_OUTPUT
		p32ActualPosition: POINTER32;
			(*shows the area, offset and size where the data of the IC card is stored*)
	END_VAR
	VAR
	END_VAR
	VAR_INPUT
		p32Pointer: POINTER32;
			(*area, offset and size of data values*)
		diPosition: DINT:=0;
			(*beginning position from which the data should be read from the IC card*)
	END_VAR
	VAR_OUTPUT
		p32ActualPosition: POINTER32;
			(*shows the area, offset and size where the data of the IC card is stored*)
	END_VAR
	VAR
	END_VAR

LD body

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 9 ;
        NETWORK_BODY
B(B_VARIN,,2,20,3,22,5,);
B(B_VARIN,,1000,20,4,22,6,);
B(B_VARIN,,awProcessDataToGet[0],10,5,12,7,);
B(B_CONTACT,,bGetData,5,2,7,4,R);
B(B_F,Size_Of_Var!,Instance,12,5,19,7,,?D?C);
B(B_F,E_ReadFromIcCard!,Instance,22,1,37,7,,?DEN?DBankNumber?DBankOffset?DDataNumberOfWords?AENO?CDataStartAddress);
B(B_F,Adr_Of_Var_O!,Instance,37,3,45,5,,?D?C);
B(B_VAROUT,,awProcessDataToGet,45,3,47,5,);
L(1,3,5,3);
L(19,6,22,6);
L(1,0,1,9);
L(7,3,22,3);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

if (DF(bGetData)) then
    ReadDataFromFileRegisterBank(BankNumber := 2, 
    BankOffset := 1000, 
    DataNumberOfWords := Size_Of_Var(awProcessDataToGet), 
    DataStartAddress => Adr_Of_Var(awProcessDataToGet));
end_if;

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