Dear friends,
The attached picture contains the part of a sample program that confuses me. Input parameter RECV_BUF is an ANY TYPE pointer, and in its called block it has value "DB222 DBX 0.0 BYTE 50
1. As we all know, if area register(AR1) stores 8 bytes of information only, then how can we store 10 bytes of information in it?(LAR1 P##RECV_BUF)
2. If my understanding is true, byte 8 and byte 9 are dropped when PLC loads RECV_BUF to AR1, then why it still has this command: L W[AR1,P#8.0]? Byte 8 and byte 9 shouldn't exist at all.
3.B_OFFSET comes from a previous command #count*8. Suppose that byte 8 and byte 9 are dropped when loading the RECV_BUF, how can we add the byte address directly to byte 8 and byte 9?
According to my understanding, I come up with the following program:
L D[AR1,P#0.0]
T LD 0
L D[AR1,P#4.0]
T LD 4
L B_OFFSET
SLW 3
T LW 8
......
One more thing to mention, http://www.plctalk.net/qanda/showpost.php?p=169442&postcount=6 suggests that I need to change the memory area pointer(byte 6) to 87HEX before calling SFC20, because once I am in SFC20, the memory area I am reffering to is from the previous temp area, the called block. If this is true, then why we don't see anything in this sample program? Or is it just not applicable to this case?
I tried this modified program but it does not work.
Any suggestions? Thanks
The attached picture contains the part of a sample program that confuses me. Input parameter RECV_BUF is an ANY TYPE pointer, and in its called block it has value "DB222 DBX 0.0 BYTE 50
1. As we all know, if area register(AR1) stores 8 bytes of information only, then how can we store 10 bytes of information in it?(LAR1 P##RECV_BUF)
2. If my understanding is true, byte 8 and byte 9 are dropped when PLC loads RECV_BUF to AR1, then why it still has this command: L W[AR1,P#8.0]? Byte 8 and byte 9 shouldn't exist at all.
3.B_OFFSET comes from a previous command #count*8. Suppose that byte 8 and byte 9 are dropped when loading the RECV_BUF, how can we add the byte address directly to byte 8 and byte 9?
According to my understanding, I come up with the following program:
L D[AR1,P#0.0]
T LD 0
L D[AR1,P#4.0]
T LD 4
L B_OFFSET
SLW 3
T LW 8
......
One more thing to mention, http://www.plctalk.net/qanda/showpost.php?p=169442&postcount=6 suggests that I need to change the memory area pointer(byte 6) to 87HEX before calling SFC20, because once I am in SFC20, the memory area I am reffering to is from the previous temp area, the called block. If this is true, then why we don't see anything in this sample program? Or is it just not applicable to this case?
I tried this modified program but it does not work.
Any suggestions? Thanks