Problem to understand Stl code

Berra

Member
Join Date
Mar 2007
Location
Sweden
Posts
137
Hi
I have problem to understand this code?
can anyone explain this code for me?



L B#16#3
L #OBJ_NR
SLW
LAR1
L #OBJ_NR
L 4
*I
T #OBJ_NR4
L B#16#3
TAK
SLW
T MD 3000

AN #DS
A #TID_UTLOPT
S #LARM_DS

OPN "Objekt - Kvittens"
A DBX [AR1,P#0.1]
R #LARM_DS
R DBX [AR1,P#0.1]

A #LARM_DS
AN DBX [AR1,P#0.1]
= #OKVITT_LARM
 
Here's the code with comments added. If you need any more specifics, then please ask.

L B#16#3 //accu1=3 accu2=don't care
L #OBJ_NR //accu1=OBJ_NR, accu2=3
SLW //accu1=(OBJ_NR * 8) or OBJ_NR shifted left 3 bits
LAR1 //AR1 = (OBJ_NR * 8)
//The implication here is that each object has associated with it
// 1 byte (8 bits) of information. The address register now
// points to the base of the 8 bits associated with the
// particular object.

L #OBJ_NR
L 4
*I
T #OBJ_NR4 //OBJ_NR4 = OBJ_NR * 4
L B#16#3 //accu1=3 accu2=OBJ_NR4
TAK //accu1=OBJ_NR4 accu2=3
SLW //accu1=(OBJ_NR4 * 8) or (OBJ_NR * 32)
T MD 3000 //used for debugging ? anyones guess

AN #DS
A #TID_UTLOPT
S #LARM_DS

OPN "Objekt - Kvittens"
A DBX [AR1,P#0.1] //This tests bit 1 of byte OBJ_NR in the DB
R #LARM_DS
R DBX [AR1,P#0.1] //This resets bit 1 of byte OBJ_NR if RLO=1

A #LARM_DS
AN DBX [AR1,P#0.1] //This tests bit 1 of byte OBJ_NR in the DB
= #OKVITT_LARM
 

Similar Topics

I have a problem trying to track bottles that come down two conveyors in series and are running at different speeds. Also inline, there is a...
Replies
0
Views
1,503
Hi, I am newly joined member working as an electronic engineer in a process plant. I have a problem in a m/c equipped with Mitsubishi PLC...
Replies
32
Views
20,107
Hey all, i was making edits to a program the other day and i had a Timer with two conditions set to it, but only one of the conditions would start...
Replies
15
Views
3,188
Hi all. I´ve got a little problem with my FT View SE alarm window. On my PLC program, I have 200 SINT for alarms, in which every bit is for one...
Replies
2
Views
97
Hi all, Im stuck trying to support a client with Motorola ACE.. I was able to upload all of the other sites to STS but one. Im working remotely...
Replies
0
Views
58
Back
Top Bottom