You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old June 18th, 2012, 12:03 PM   #1
hein123
Member
South Africa

hein123 is offline
 
Join Date: Aug 2010
Location: Uitenhage
Posts: 87
Indirect Addressing Question

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?
  Reply With Quote
Old June 18th, 2012, 06:36 PM   #2
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 6,241
Access to elements of UDT parameters uses AR1 and also modifies the DB register:

See simple example code:
Attached Images
File Type: jpg pop.jpg (44.4 KB, 120 views)

Last edited by L D[AR2,P#0.0]; June 18th, 2012 at 06:46 PM.
  Reply With Quote
Old June 19th, 2012, 01:53 AM   #3
hein123
Member
South Africa

hein123 is offline
 
Join Date: Aug 2010
Location: Uitenhage
Posts: 87
Thanks a lot, I haven't picked that up

So there is no easy way to use UDTs inside FB without changing the status of AR1?
  Reply With Quote
Old June 19th, 2012, 02:06 AM   #4
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 6,241
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.
  Reply With Quote
Old June 19th, 2012, 02:23 AM   #5
hein123
Member
South Africa

hein123 is offline
 
Join Date: Aug 2010
Location: Uitenhage
Posts: 87
Thanks, that is what I am currently doing.
Just thought there was an easier way
  Reply With Quote
Old June 19th, 2012, 08:24 AM   #6
passwordg
Member
United States

passwordg is offline
 
passwordg's Avatar
 
Join Date: Aug 2011
Location: South Carolina
Posts: 205
Quote:
Originally Posted by hein123 View Post
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 ?
  Reply With Quote
Old June 19th, 2012, 08:42 AM   #7
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 6,241
Siemens Step 7 (300/400 series) STL (statement list)
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
factorytalk addressing syntax question argobamafan LIVE PLC Questions And Answers 22 March 4th, 2010 12:37 PM
How to: indirect addressing with Step7? Gromit LIVE PLC Questions And Answers 5 July 14th, 2008 06:15 AM
Rslogix500 SLC500 indirect addressing sdhiraj LIVE PLC Questions And Answers 2 August 17th, 2007 07:09 PM
PLC5 addressing question omars LIVE PLC Questions And Answers 3 January 29th, 2007 01:24 PM
SLC Indirect Addressing gluca LIVE PLC Questions And Answers 7 July 23rd, 2002 07:49 PM


All times are GMT -4. The time now is 10:05 PM.


.