A(
L #INDEX_OUT
L #AXIS
==I
)
A(
L #INDEX_IN
L #AXIS
<>I
)
A(
L #INDEX_IN
L 0
<>I
)
JCN A002
OPN #Db_AXIS
L #WRITING_ADDRESS
T DBD 360
L DBD 360
SLD 3
T DBD 360
L DBD 0
T PQD [DBD 360]
OPN #Db_AXIS
L #WRITING_ADDRESS
L 4
+I
T #Temp_writing_address
LAR1 P##Writing
L B#16#10
T LB [AR1,P#0.0]
L B#16#2
T LB [AR1,P#1.0]
L 28
T LW [AR1,P#2.0]
L DBNO
T LW [AR1,P#4.0]
L P#DBX 4.0
T LD [AR1,P#6.0]
CALL "DPWR_DAT"
LADDR :=#Temp_writing_address
RECORD :=#Writing
RET_VAL:=#DPWR_ret_val
L #WRITING_ADDRESS
L 32
+I
T #Temp_writing_address
LAR1 P##Writing
L B#16#10
T LB [AR1,P#0.0]
L B#16#2
T LB [AR1,P#1.0]
L 32
T LW [AR1,P#2.0]
L DBNO
T LW [AR1,P#4.0]
L P#DBX 32.0
T LD [AR1,P#6.0]
CALL "DPWR_DAT"
LADDR :=#Temp_writing_address
RECORD :=#Writing
RET_VAL:=#DPWR_ret_val
L #WRITING_ADDRESS
L 64
+I
T #Temp_writing_address
LAR1 P##Writing
L B#16#10
T LB [AR1,P#0.0]
L B#16#2
T LB [AR1,P#1.0]
L 32
T LW [AR1,P#2.0]
L DBNO
T LW [AR1,P#4.0]
L P#DBX 64.0
T LD [AR1,P#6.0]
CALL "DPWR_DAT"
LADDR :=#Temp_writing_address
RECORD :=#Writing
RET_VAL:=#DPWR_ret_val
L #WRITING_ADDRESS
L 96
+I
T #Temp_writing_address
LAR1 P##Writing
L B#16#10
T LB [AR1,P#0.0]
L B#16#2
T LB [AR1,P#1.0]
L 32
T LW [AR1,P#2.0]
L DBNO
T LW [AR1,P#4.0]
L P#DBX 96.0
T LD [AR1,P#6.0]
CALL "DPWR_DAT"
LADDR :=#Temp_writing_address
RECORD :=#Writing
RET_VAL:=#DPWR_ret_val
A002: NOP 0
在上面这段程序中,从LAR1 P##Writing开始就看不懂了,请各路高手帮忙分析一下.
最佳答案
LAR1 P##writting.......CAll之间的所有语句都是为了初始化writting这个指针变量的或称之为构建指针,其地址指向一个DBNO数据块的某字节起始地址,用于记录数据的字节长度为28字节。初始化的过程严格按照这个ANY类型的指针格式进行赋值的。查看手册里ANY类型指针格式将指针指向的字节和位计算出来,起始地址就找到了。这段程序看懂了,整个程序就迎刃而解。
提问者对于答案的评价:
大概知道了
原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc131601.html