Wow Thim
Thanks for bringing this into notice. I think this has got key to puzzle 3.Great.
You get full information on ANY in STEP7 help if you type:
"Format of the Parameter Type ANY"
From this page ANY is composed of 2 bytes, 2 words, 1 double word.
1st byte of Any denotes Synatx ID (Dont know what is this)
2nd Byte of Any denotes Data Type
1st word consist of repetition factor
2nd word consist of DB number
Double word can be devided into Memory Area ID, Byte and Bit.
In the example you mentioned our goal is :
Copy 10 Bytes of data from db22.dbx11.0 is to DB33.DBX202.0 onwards by SFC20.
So first
byte of
ANY pointer SOURCE is Syntax ID (DOnt know what syntax ID is)
Following code do this:
LAR1 P#Source
L B#16#10
T LB[AR1,P#0.0]
2nd step is to tell the data type and since we want to move bytes (10 Numbers) so our data type is B#16#02
L b#16#02
T LB[AR1,P#1.0]
3rd step is how many bytes we want to move (repetition factor)
We want 10 bytes
L 10
T LW[AR1,P#2.0]
4th step is from which DB number (In our case DB22) This becomes 2nd word of ANY
L22
T LW[AR1,P#4.0]
5th step is to mention Memory Area, Byte number and Bit number in refered memory area.In our case memory area is DB, Byte number is 11, and bit is 0 so
L P#DBX11.0 //here acc1 will have 84000058, 84 for db area and
1011(byte no:11)
000 (bit No.0) hence1011000(58)
T LD[AR1,P#6.0]
Similarly for destination and then call SFC 20 which will do its job for you and you are done!!