发布于 2013-11-16 17:02:37
12楼
//Generate Pointer to Traversing Block Control Bits
LAR1 P##tSingleParmTaskPointer
L B#16#10 // 10 hex = S7 Data Type
T LB [AR1,P#0.0] // Transfer to Source pointer byte 0
L B#16#2 // 2 hex = byte data type
T LB [AR1,P#1.0] // Transfer to Source pointer byte 1
L 12 // How many bytes to move
T LW [AR1,P#2.0] // Transfer to Source pointer bytes 2-3
L #tDriveIntfcDBNum // Load DB Number
T LW [AR1,P#4.0] // Transfer to Source pointer bytes 4-5
L 14 // Load start address of data
SLD 3 // Shift data in AR1 3 bits to the left
T LD [AR1,P#6.0] // Trasfer to Source Pointer bytes 6-9
L B#16#84 // 84 hex = DB memory area
T LB [AR1,P#6.0] // Transfer to Source pointer byte 6
//Transfer Traversing Block Control Bits From Drive Interface DB To Local Copy
CALL SFC 20
SRCBLK :=#tSingleParmTaskPointer
RET_VAL:=#tRet
DSTBLK :=#tDriveIntfc.SingleParmTask
这是老外编的一个处理S120通信报文的程序块的一部分