Write into memory of intelligent units
Writes data into the shared memory of an intelligent unit.
Input
Specifies the bank/slot number in the shared memory of the intelligent module
Starting address for data in the shared memory of the CPU
Specifies the number of words to be written to the shared memory
Specifies the starting address in the intelligent unit for storing data written (destination address)
Writes n_Number words of the initial data from the area specified by s2_Start of the CPU to the address specified by d_Start of the shared memory of the intelligent unit specified by s1_BankSlot.
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
if s1_BankSlot exceeds the limit of specified range
if the data read exceeds the area of d
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#0D;
(*if start is TRUE, this value
will be written to the address
1 from the unit-slot 0*)
CPUDataToWrt: ARRAY [0..4] OF INT:=[5,10,15,20,25];
NoWordsToWrite: INT:=5;
DestinationAddr: INT:=0;
END_VAR
Five words of data defined in CPUDataToWrt are written into the addresses starting from 0 to 4 of the intelligent unit's shared memory (located in slot 0) 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_VARIN,,SlotNo,11,3,13,5,);
B(B_VARIN,,CPUDataToWrt[0],11,4,13,6,);
B(B_VARIN,,NoWordsToWrite,11,5,13,7,);
B(B_VARIN,,DestinationAddr,11,6,13,8,);
B(B_CONTACT,,Start,7,2,9,4,);
B(B_F,F151_WRT!,Instance,13,1,21,8,,?DEN?Ds1_BankSlot?Ds2_Start?Dn_Number?Dd_Start?AENO);
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
F151_WRT( s1_BankSlot:= SlotNo,
s2_Start:= CPUDataToWrt[0],
n_Number:= NoWordsToWrite,
d_Start:= DestinationAddr);
END_IF;