Indirect addressing - RSLogix 500 doesn't always work

wildcatherder

Member
Join Date
May 2009
Location
Morro Bay
Posts
168
After figuring out that "Indirect addressing" is basically what the rest of the world would call indexed addressing (as in C language array indexing) I tried to use the following as a destination address for a MOV instruction,

N7:[R6:0.POS]

which uses the step number of an SQO instruction to describe which word of the file N7 should be used.

I found that it simply did not work.

However, if I used a MOV command to put the value of R6:0.POS into an integer word location - N7:0, I was then able to use

N7:[N7:0]

as the destination and it worked successfully.

I would be interested in knowing, if there other file types, besides Control, which would exhibit this problem. Or is it simply that there is .xxx description at the end?

The Indirect addressing syntax is shown on page 98 of Publication 1766-RM001A-EN-P Micrologix 1400 Programmable Controllers - Instruction Set Reference Manual.
 
After figuring out that "Indirect addressing" is basically what the rest of the world would call indexed addressing (as in C language array indexing) I tried to use the following as a destination address for a MOV instruction,

N7:[R6:0.POS]

which uses the step number of an SQO instruction to describe which word of the file N7 should be used.

I found that it simply did not work.

I tested this and it work perfectly. Here is the screen shot of my logic running online.

Please make sure that the value of the position value .POS in your program control tag is changing and not always stay at 0.

50679-01.gif
 
I tested this and it work perfectly. Here is the screen shot of my logic running online.
In the interest of accuracy the OP stated that he used N7:[R6:0.POS] as the destination of the MOV instruction. It should still work tho'.
 
I found that it simply did not work.
Just covering a base here - does the number of N7 words equal the size of the sequencer file? That is, if R6:0.LEN = 19, does N7:19 exist? You should get an error if trying to move data to a nonexistent address, ie. MOV 4 N7:[R6:0.POS], where R6:0.POS = 25 and the max N7 address is N7:19.
 
I use this N7:[R6:0.POS] addressing all the time and can vouch that it works perfectly in PLC5, SLC500, and (with substitution of tag-names) in ControlLogix.

But wildcatherder is using MicroLogix 1400.

Has anyone got the ability to test on that platform....?

Perhaps there is something strange about it.

Failing that, I concur that the value of R6:0.POS must be going outside the boundaries of the N7 file.
 
Not a 1400.but on a 1100 there where things that I couln't do with it that I can do in a SLC. I don't remember what it was.

OP Indirect is not the same as indexed. These will do both indexed and indirect. hint look at # sign
 
From the RSLogix Help - "Indirect Addressing"

"Indirect addressing is valid with SLC 5/03 OS302, 5/04 OS401, and SLC 5/05 OS500 and OS501, and Micrologix 1100, 1200, and 1500 processors only"
 
But that was from RSL500 CPR7 which didn't have the 1400 in its armoury....
 
From the RSLogix Help - "Indirect Addressing"

"Indirect addressing is valid with SLC 5/03 OS302, 5/04 OS401, and SLC 5/05 OS500 and OS501, and Micrologix 1100, 1200, and 1500 processors only"


With ver. 8.10 you get.

Indirect AddressingIndirect Addressing

Indirect addressing is valid with SLC 5/03 OS302, 5/04 OS401, and SLC 5/05 OS500 and OS501 and MicroLogix 1100, 1200, 1400 and 1500 processors only.
 
With ver. 8.10 you get.

Indirect AddressingIndirect Addressing

Indirect addressing is valid with SLC 5/03 OS302, 5/04 OS401, and SLC 5/05 OS500 and OS501 and MicroLogix 1100, 1200, 1400 and 1500 processors only.

Guessed it would, I only had CPR7 to check
 
The only thing I changed was replacing N7:[R6:0.POS] with N7:[N7:0] and adding the MOV to get the information into that integer first.

So, there is data where is it is supposed to be.

My question was not whether it works. It does not work for RSLogix 500 with Micrologix 1400. I was concerned about why.
 
I find this statement in the RSLogix 500 under "Indexed Addressing"

"Indexed addressing does not work in Timers, Counters, or Control files. "

This refers to RSLogix's definition of "indexed addressing", i.e. indexed using status file S:24.

However, it does indicate there is something different about Control files and may explain why "indirect addressing" doesn't work with a Control file label as the index.
 
What they are referring to is that you should not index one of those types of files. For example:

Suggest that you don't do
=========================
#T4:0

Ok, to do
=========
N7:[T4:0.ACC]

So your pointer (the part in brackets) can be pretty much anything.

OG
 

Similar Topics

Hello, I'm very new to programming with absolutely zero schooling in this field and pretty hands off training in my new role, it's been fun...
Replies
4
Views
666
Hi there I'm currently converting an RSLogix500 program that I wrote 20 years ago into RSLogix5000 for an SLC to CompactLogix upgrade. The...
Replies
3
Views
2,201
I’m working with indirect addressing and trying to make an HMI where each Rectangle Object has a tag of “A[0-127]” with a correlating Push Button...
Replies
15
Views
4,203
Hello, I'm trying to create IO tags that will allow I/O to be changed via the HMI once the system is deployed, and without needing to connect via...
Replies
3
Views
2,797
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,466
Back
Top Bottom