3/13/2009 5:34 AM | |
Joined: 10/7/2005 Last visit: 5/30/2023 Posts: 2966 Rating:
|
Dear How come put simple, the logic isconstructing an ANY pointer (which ispresumably declared as type ANY in the TEMP area of the FC/FB and then used for a call to "SEND" function which uses the ANY pointer information to determine what data to send). ANY Pointer are 10 Bytes long and contain all the required information about adata area (e.g. start address, memory area (DB, I, Q, M etc.) what type of data (BYTE, WORD, REAL etc.) and how many of them etc.). Search the S7 inbuilt help for "ANY" and have a look at the format of the ANY pointer to find out more. While ANY pointers and usage of them generallybelongs into the "advanced" S7 programming category (and is not all that easily explained in a short post)I nonetheless added some hopefully useful explanations behind your logic: LAR1 P##SEND // Point AR1 to the start address of #SEND variable L B#16#10 T LB [AR1,P#0.0] // Write 10hex into byte 0 of the SEND ANYpointer L B#16#2 T LB [AR1,P#1.0] // Write2 into byte1 of the SEND ANYpointer (=nominate the DATA TYPE asBYTE) L 40 T LW [AR1,P#2.0]// Write 40 into byte 2 of the SEND ANY pointer (= nonimate the REPETITION FACTOR as40 (40 Bytes in this case since theDATA TYPE is declared as BYTE) L #DATABLOCK // I presume this variable has an INT number in it T LW [AR1,P#4.0]// Write the DB numberintoBytes4&5 of the SEND ANY pointer L P#DBX 0.0 T LD [AR1,P#6.0] // Write the memory area (DB) and start address(DBX0.0) intoBytes6->9 of the SEND ANY pointer I hope this helps at least a little bit Cheers Fritz |
Cheers |
|
This contribution was helpful to
1 thankful Users |
3/13/2009 6:58 AM | |
Posts: 382 Rating:
|
Dear fritz and viveks, Thank you very much for the explaination. I am really appreciate the time you spend trying to explain the logic. There is one portion which i don't quite understand. What is the syntax ID for? Is it always must be 10 bytes? L 10; T LB[AR1,P#0.0] load the syntax ID and transfer it to the ANY pointer with regards, how come? |
3/13/2009 7:27 AM | |
Joined: 10/7/2005 Last visit: 5/30/2023 Posts: 2966 Rating:
|
you aremost welcome how come? it is also a very good question indeed and the answer why the first byte of an ANY pointer must always have the valueof 10hex (for S7) is probably only known to Siemens themselves. Having said that, I'd like to stand corrected here, if anybodyelse knows the reasons for the 10hex please let us all know. Cheers fritz |
Cheers |
|
3/13/2009 7:34 AM | |
Posts: 557 Rating:
|
hi thank you very much for appreciate. yes it isa standard of siemens. ![]() in above figure in BYTE 0 IS 10h for S7. IT is a standard of siemens. for example pointer data type concept isglobally same, but representation is different in various system. |
3/13/2009 8:48 AM | |
Posts: 382 Rating:
|
O! i see. Thank youboth of you for clearing my doubt. and have a nice weekends! with regards, how come? |
Follow us on