Indirect Addressing Question

hein123

Member
Join Date
Aug 2010
Location
Uitenhage
Posts
93
Hi, I have an indirect addressing question that I just can't understand.

L #DB_Conn
T #iDB
OPN DB [ #iDB]
L #DB_Start_Addr

SLD 3
LAR1
A DBX [ AR1 , P#0.0 ]
= #Advance_INT

A DBX [ AR1 , P#0.1 ]
= #Retract_INT

A DBX [ AR1 , P#0.6 ]
= #Advance_IND

A DBX [ AR1 , P#0.7 ]
= #Retract_IND

A DBX [ AR1 , P#1.0 ]
= #Valve.Error

A DBX [ AR1 , P#1.1 ]
= #Valve.Both_M

A DBX [ AR1 , P#1.2 ]
= #Valve.Both_NM

A DBX [ AR1 , P#1.3 ]
= #Valve.Adv

A DBX [ AR1 , P#1.4 ]
= #Valve.Ret

A #Valve.Advance_PB
= DBX [ AR1 , P#0.2 ]

A #Valve.Retract_PB
= DBX [ AR1 , P#0.3 ]

DB_Conn is the datablock address and DB_Start_Addr is the starting address.
I also pass a In/Out #Valve UDT datatype because there is inputs as well.

When I use the Valve datatype, the indirect addressing does not work, but when I link the results direct to outputs (Advance_INT, ...) it does get results.
I am using TIA Portal.

Any ideas or what am I doing wrong?
 
Access to elements of UDT parameters uses AR1 and also modifies the DB register:

See simple example code:

pop.jpg
 
Last edited:
Assign/read your UDT variables to named variables in the temp area then you can use AR1 to access your DB indirectly using the named temp variables.
 
Hi, I have an indirect addressing question that I just can't understand.

L #DB_Conn
T #iDB
OPN DB [ #iDB]
L #DB_Start_Addr

SLD 3
LAR1
A DBX [ AR1 , P#0.0 ]
= #Advance_INT

A DBX [ AR1 , P#0.1 ]
= #Retract_INT

A DBX [ AR1 , P#0.6 ]
= #Advance_IND

A DBX [ AR1 , P#0.7 ]
= #Retract_IND

A DBX [ AR1 , P#1.0 ]
= #Valve.Error

A DBX [ AR1 , P#1.1 ]
= #Valve.Both_M

A DBX [ AR1 , P#1.2 ]
= #Valve.Both_NM

A DBX [ AR1 , P#1.3 ]
= #Valve.Adv

A DBX [ AR1 , P#1.4 ]
= #Valve.Ret

A #Valve.Advance_PB
= DBX [ AR1 , P#0.2 ]

A #Valve.Retract_PB
= DBX [ AR1 , P#0.3 ]

Not to detract from your thread, but what is this language ?
 

Similar Topics

when your pointer gets indexed, if your previous reference is true, and your current reference is true before getting indexed, will the...
Replies
13
Views
5,444
Guys, I currently have an RSLogix 5000 program that uses indirect addressing for timing points for pressrolls. I am trying to understand how it...
Replies
13
Views
4,978
Good day all, I would like to know if it is possible to use a counter' accumulator value as an indirect address. So it would look something like...
Replies
8
Views
4,178
Yes, I did search for information first. Yes I looked through the limited help files that came with my Step 7. No I do not have any other books...
Replies
77
Views
20,978
I've got a rung that uses the first pass bit to initiate a For argument. In the Routine named 'Alarm' I have something like this...
Replies
15
Views
9,940
Back
Top Bottom