![]() |
||
|
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
| ||
New Here? Please read this important info!!!
|
|||||||
![]() |
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!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
![]() 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 |
|
|
|
#2 |
|
Member
|
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) |
|
|
|
#3 |
|
Member
|
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. |
|
|
|
#4 |
|
Member
![]() 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 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.
__________________
©¿©¬ |
|
|
|
#5 |
|
Member
![]() 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. |
|
|
|
#6 |
|
Member
|
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 |
|
|
|
#7 |
|
Member
|
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. |
|
|
|
#8 |
|
Member
![]() 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.
__________________
©¿©¬ |
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |