SLC Indirect Addressing

gluca

Member
Join Date
Jun 2002
Location
Italy
Posts
42
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
 
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)
 
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.
 
Last edited:
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.
 
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.
 
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
 
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.
 
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.
 

Similar Topics

I recently did a conversion from an SLC to a CompactLogix and I am having trouble with a specific piece of code where the SLC used indirect...
Replies
6
Views
2,835
I would appreciate some help understanding some code from the RSLogix 500 days. I'm trying to convert a Studio and I get a PCE for the following...
Replies
9
Views
2,227
I'm trying to set up a 1746-HSCE2 high speed counter module in a SLC500 with a SLC 5/03 processor. The manual -...
Replies
2
Views
2,876
tough one to get my head around but here goes: N27 is a file that stores whether the recipe stored was valid. N12 is a file that holds recipe...
Replies
2
Views
1,538
I have a whole bunch of analog inputs that I need to scale to process values. Using JMP and LBL can I use indirect addressing to cycle through all...
Replies
14
Views
6,096
Back
Top Bottom