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.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


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

Get the book!

If you're really looking to learn about PLCs, you NEED our book...

"Your Personal PLC Tutor - A Guide to Understanding PLCs"

Easy to read and uses 'plain' language!
Get $$FREE$$ priority mail shipping too!!!
You WILL be glad you did!!

Click Here now to order

Reply
 
Thread Tools Display Modes
Old July 23rd, 2002, 06:05 AM   #1
gluca
Member
Italy

gluca is offline
 
Join Date: Jun 2002
Location: Italy
Posts: 42
SLC Indirect Addressing

I'm trying to develop a program using indirect addressing to use a standard subroutine to control multiple identical pumps.
All right, until the moment I tried to indirect-address a timer: RSLogix 500 show me ERROR: Indirect address not allowed!

Have you ever experienced this problem, and do you know how to bypass it?

Thanks, Luca
  Reply With Quote
Old July 23rd, 2002, 06:47 AM   #2
garryt1
Member
United Kingdom

garryt1 is offline
 
garryt1's Avatar
 
Join Date: Jun 2002
Location: n.ireland
Posts: 114
Arrow

Hi,

As far as i am aware you can indirectly address a timer but i would
need more information on this as indirect addressing can cause a lot
of problems.

Below are 2 formats of using a timer

"T4:[N7:0]pre" (move N7:0 into timer preset)

"B33/[T4:0.ACC] bit level"(used for mainly bitshift)
  Reply With Quote
Old July 23rd, 2002, 06:50 AM   #3
john paley
Member
United States

john paley is offline
 
john paley's Avatar
 
Join Date: Apr 2002
Location: Tennessee
Posts: 304
It won't work. The SLC won't let you indirect ir index address multi word elements like timers, counters, control elements (R's).

I can't imagine why you'd want different timer addresses unless the presets were the only difference. Could you use the same timer addresses in the routine and alter the presets?? If so, use indirect addressing to move the various preset values into the timer's /pre word.

MOVE N[N7:0]:0 to T4:0.PRE

It may be possible to get the same results from this different angle.
__________________
The Big Cheese

Last edited by john paley; July 23rd, 2002 at 06:53 AM.
  Reply With Quote
Old July 23rd, 2002, 08:38 AM   #4
Allen Nelson
Member
United States

Allen Nelson is offline
 
Join Date: Apr 2002
Location: West Chester, PA
Posts: 1,368
There IS a technique to indirect address a timer in a SLC.

What you do is COPY the 3 timer words (status bits, .PRE and .ACC) from an indirect timer, do the TON, and then transfer them back to
Code:
COP #T14:[N7:0] #T4:0 1

TON T4:0

COP #T4:0 #T14:[N7:0] 1
Code fragment courtesy of The Boolean Embassy.
Caveat Emptor. I've never used this one, but thought it useful.

But this brings up all sorts of questions. Like - just exactly how does a TON keep track of time?

If you use a time base of 1 second, then it will take many scans before the TON will update the ACC by one. How the PLC track how many scans/real-time have elapsed? I don't think it's in the "unused" status bits, but I'm not sure.

But if it's not there, then will this code fragment work in a For-Next loop and different addresses?

For that matter, if the same TON is called multiple times in a scan (say it's in a SUBroutine that's JSR'ed twice in a scan, will it "update" twice as fast (add "last scan time to TON internal timer)?

What if the JSR is called every other scan? Will the PLC keep track? I've never had the time to play with this code fragment, and these questions to really explore the answer.
__________________
©¿©¬
  Reply With Quote
Old July 23rd, 2002, 10:02 AM   #5
gluca
Member
Italy

gluca is offline
 
Join Date: Jun 2002
Location: Italy
Posts: 42
Hello Allen, I too wrote a similar code with an auxiliary indirect address some hours ago and it didn't work. This night I will try to study about it. I am wondering too about how the timer will work if repeatedly called in a subroutine.
If I will find something intersting I will put in the forum.
  Reply With Quote
Old July 23rd, 2002, 05:41 PM   #6
dennisb
Member
Canada

dennisb is offline
 
dennisb's Avatar
 
Join Date: Jun 2002
Location: Edmonton Alberta
Posts: 10
You must be using a 5/03 OS301 or less. Indirect addressing is not allowed in these processors. If you change to OS302, or change the processor to 5/04 or 5/05, you can use indirect addressing no problem. I use indirect addressing all the time in my programs; it allows me to use a single timer (say for a step sequencer) and loads the presets from an integer file based on the current sequencer step. If you can't upgrade the processor, maybe some of the methods described in prevoius posts will help. I have not tried them.

Dennis B
  Reply With Quote
Old July 23rd, 2002, 05:55 PM   #7
dennisb
Member
Canada

dennisb is offline
 
dennisb's Avatar
 
Join Date: Jun 2002
Location: Edmonton Alberta
Posts: 10
I may have misunderstood your question.

What I do is MOV a value from an integer file to a timer preset. The integer address is either indirect (offset) or indexed, depending on the application. I recommend using indirect rather than indexed addressing. Unless you are very familiar with indexed addressing, you can cause some problems, because several instructions all use the same index register in the program.

I agree with a previous post - why would you want to point to different timers when you can just move a different preset to the SAME timer?

All the same, the lower processors will not allow even integer files to be indirectly addressed.
  Reply With Quote
Old July 23rd, 2002, 06:49 PM   #8
Allen Nelson
Member
United States

Allen Nelson is offline
 
Join Date: Apr 2002
Location: West Chester, PA
Posts: 1,368
Just to clear things up:

Allowed:
Indirectly addressing a timer element in a Move:
MOV 5 T4:[N7:0].PRE

NOT Allowed:
Indirectly addressing a timer in a TON block:
TON T4:[N7:0]

And, yes, Dennis is correct - indirect addressing is only allowed in SLC 5/03 and above.

The code fragment I posted might allow one to indirectly TON a timer. It would probably work best if the time base is 0.01 sec. That may be the key. As I said, I've never tried it, but perhaps someone here can/has/will, and will post the results.

Dennis:

As to why someone would want to indirectly address TONs:

Imagine a large PLC system with 50 valves, each valve having OPEN and CLOSED feedback. The alarm logic for each valve is the same, just with different addresses.

Now lets say you've written your program using internal registers, rather than real I/O addresses (because you're developing on a bench SLC which doesn't have any I/O modules - the 'real' SLC and I/O are in the panelshop being wired).

You could write 50 rungs of fairly identical logic.

Or, you could write the logic once, and indirectly address everything. Put the code in a FOR-NEXT loop and you're done in 1/50th the time, with no typos, and more processor memory.

But you need to be able to indirectly address in a TON. You can do this is a PLC-5, but not a SLC. Unless that code above works.
__________________
©¿©¬
  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
Indirect Addressing: Can Enough be Said about this Powerful Tool? Lancie1 LIVE PLC Questions And Answers 33 January 1st, 2006 12:11 PM
I/O Indirect Addressing - PLC 5/80E relms LIVE PLC Questions And Answers 8 February 23rd, 2005 04:10 PM
A/B Control Logix / indirect file addressing Pat Leach LIVE PLC Questions And Answers 6 November 22nd, 2004 04:25 PM
PLC5 Indirect addressing chavak LIVE PLC Questions And Answers 4 April 15th, 2004 12:10 AM
Indirect addressing with S7-300 devittjl LIVE PLC Questions And Answers 1 March 5th, 2004 04:19 PM


All times are GMT -5. The time now is 12:06 AM.


.