F150_READ

Data read from intelligent units

Reads data from the shared memory in an intelligent module.

Parameters

Input

s1_BankSlot (WORD, INT, UINT)

Specifies the bank/slot number in the shared memory of the intelligent module

s2_Start (WORD, INT, UINT)

Specifies the starting address in the shared memory of the intelligent module (source data address)

n_Number (INT)

Specifies the number of words to be read

d_Start (WORD, INT, UINT)

Starting address in the CPU for storing data read (destination address)

Remarks

The n_Number words of the data stored in the shared memory of the intelligent unit/board specified by s1_BankSlot are read from the address specified by s2_Start, and are stored in the area specified by d_Start of the CPU.

The number of variable arguments at the inputs is limited by the available index registers of the PLC.

Specifying s1_BankSlot

  • Intelligent unit without bank

    Specify the slot number in which the target intelligent unit has been installed.

    1.  (1) Upper byte
    2.  (2) Lower byte
  • Intelligent unit with bank

    Specify the slot number (hex. constant) in which the target intelligent unit has been installed, and the bank number (hex. constant).

    1.  (1) Upper byte
    2.  (2) Lower byte
   
 

Name

Order Number

 

FP3 expansion data memory unit

AFP32091

AFP32092

 

FPS expansion data memory unit

AFPG201

Error flags

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)
  • if s1_BankSlot exceeds the limit of specified range

  • if the data read exceeds the area of d_Start

sys_bIsOperationErrorNonHold (turns to TRUE for one scan)
  • if s1_BankSlot exceeds the limit of specified range

  • if the data read exceeds the area of d_Start

Example

POU headerCopy code to clipboard

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;
			(*activates the function*)
		SlotNo: WORD:=16#03;
			(*if start is TRUE, this value
gets 2 words from the address
1 from the unit-slot 0*)
		AddrDataToRead: INT:=19;
		NoWordsToRead: INT:=4;
		DestAddrCPU: ARRAY [0..3] OF INT:=[4(0)];
			(*Starting address in CPU to store data read*)
	END_VAR

POU body

Reads 4 words of data stored in the addresses starting from 19, specified in AddrDataToRead, of the intelligent unit's shared memory (located in slot 3). Then it stores them in the array DestAddrCPU, when Start turns on.

  1.  (1) Slot Number
  2.  (2) Intelligent unit
  3.  (3) CPU
  4.  (4) 4 words

LD bodyCopy code to clipboard

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_F,F150_READ!,Instance,13,1,21,8,,?DEN?Ds1_BankSlot?Ds2_Start?Dn_Number?Dd_Start?AENO);
B(B_VARIN,,SlotNo,11,3,13,5,);
B(B_VARIN,,NoWordsToRead,11,4,13,6,);
B(B_VARIN,,NoWordsToRead,11,5,13,7,);
B(B_VARIN,,DestAddrCPU[0],11,6,13,8,);
B(B_CONTACT,,Start,7,2,9,4,);
L(9,3,13,3);
L(1,3,7,3);
L(1,0,1,8);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST bodyCopy code to clipboard

IF start then
    F150_READ( s1_BankSlot:= SlotNo,
         s2_Start:= AddrDataToRead,
         n_Number:= NoWordsToRead,
         d_Start:= DestAddrCPU[0]);
END_IF;

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