interlock
Member
Hello,
The STL codes are as under for an s7-300 program?
A M 3.0
JC Z1
LAR1 P#3.0
A I [AR1,P#0.0]
= Q [AR1,P#0.0]
T AR1 MD4
S M 3.0
Z1: A M 3.1 "PUSH BUTTON"
FP M 3.2
= M 3.3
A M 3.3
JCN Z2
L AR1 MD4
+AR1 P#0.1
A I [AR1,P#0.0]
= Q [AR1,P#0.0]
T AR1 MD4
Z2: NOP 0
The program intially assigns the value of I3.0 TO Q3.0.
Thereafter, with every press of push button M3.1 , the values of I3.1 , I3.2 , I3.3 ....... are assigned to Q3.1 , Q3.2 , Q3.3 ......
Do we really need those load , transfer , load , transfer commands between AR1 and MD4?
why can't we work around with AR1 alone to do the job?
It is to be noted that indirect addressing is being used only in one network and in one FC only (It is not used anywhere else in the program).
So why those codes are loading and transferring between AR1 and MD4 as if AR1 data will be over-written somewhere else in the program?
or is it poor programming?
Regards
The STL codes are as under for an s7-300 program?
A M 3.0
JC Z1
LAR1 P#3.0
A I [AR1,P#0.0]
= Q [AR1,P#0.0]
T AR1 MD4
S M 3.0
Z1: A M 3.1 "PUSH BUTTON"
FP M 3.2
= M 3.3
A M 3.3
JCN Z2
L AR1 MD4
+AR1 P#0.1
A I [AR1,P#0.0]
= Q [AR1,P#0.0]
T AR1 MD4
Z2: NOP 0
The program intially assigns the value of I3.0 TO Q3.0.
Thereafter, with every press of push button M3.1 , the values of I3.1 , I3.2 , I3.3 ....... are assigned to Q3.1 , Q3.2 , Q3.3 ......
Do we really need those load , transfer , load , transfer commands between AR1 and MD4?
why can't we work around with AR1 alone to do the job?
It is to be noted that indirect addressing is being used only in one network and in one FC only (It is not used anywhere else in the program).
So why those codes are loading and transferring between AR1 and MD4 as if AR1 data will be over-written somewhere else in the program?
or is it poor programming?
Regards