Data read from intelligent units
Reads data from the shared memory in an intelligent module.
Input
Specifies the bank/slot number in the shared memory of the intelligent module
Specifies the starting address in the shared memory of the intelligent module (source data address)
Specifies the number of words to be read
Starting address in the CPU for storing data read (destination address)
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.
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).
Name |
Order Number |
|
FP3 expansion data memory unit |
AFP32091 AFP32092 |
|
FPS expansion data memory unit |
AFPG201 |
if s1_BankSlot exceeds the limit of specified range
if the data read exceeds the area of d_Start
if s1_BankSlot exceeds the limit of specified range
if the data read exceeds the area of d_Start
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
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.
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
IF start then
F150_READ( s1_BankSlot:= SlotNo,
s2_Start:= AddrDataToRead,
n_Number:= NoWordsToRead,
d_Start:= DestAddrCPU[0]);
END_IF;