indirect addressing bits and latch instruction

Mgw1970

Member
Join Date
Jul 2019
Location
Magna
Posts
33
Need some help with a conversion I'm doing from a micrologix 1500 to compact L30E. The program is using indirect addressing with latches and bit function, I'm a little new with indirect direct addressing used in this matter and could use a smart person to help me understand it . What I have is several instructions like this whether it is a bit or a latch instruction -l l- B203:0[N201:0] I need help converting them. The new tags for this illustration I created -l l- AXIS_HOME[MOTOR_OFFSET] . But I get an error invalid array subscript specified. Thanks!

Indirect_Address (2).png
 
There are several threads on this site that explains indirect addressing in good detail. Here's one that may benefit you:
http://www.plctalk.net/qanda/showthread.php?t=127558

Two points I will explain:
1. Indirect addressing is easy once you understand it. Instead of hard coding a reference to memory, like B3/100, you can reference it with another address, this becomes dynamic, like B3/[N7:0]. The value in N7:0 determines where to look. Keep in mind you have to know the bounds of the memory B3, if you go outside those bounds the processor will fault
2. SLC/PLC and CpLX/CLX deal with indirect addressing a little different. As you saw with the conversion, that's how you deal with word and bit locations.
 
Thanks for all the suggestions. This my first RSS. conversion project that uses indirect addressing for the machine setup/status per variety and it's been back to school for me for the most part. I think I'm starting to get more of an understanding of it and how it works with suggestions from here and manuals I've read. So thanks again.
 
One limitation with Studio 5000 is that you can only have one indirect reference per element, so N[N7:0]:[N7:1] would throw an error after conversion requiring you to perform the indirect references differently after the conversion (like rewrite the code to use a 2D array).

It also looks like the conversion took 16 bit addresses and made them into 32 bit tags and added extra stuff to mask off the upper bits that may not be necessary in your converted example.

I would think the conversion of:
B3:202/[N201:0]
should have ended up as:
AXIS_HOME.MOTOR_OFFSET

Note the different bit delimiters between the platforms.

Another thing I ran into way back when, if you write outside the limits of an array tag, you might not get an error but you also might corrupt data in some other unexpected tag location. I saw that with version 12 IIRC, and maybe that has since been corrected, but DO limit check your indirect references before using them in the code.
 
One limitation with Studio 5000 is that you can only have one indirect reference per element, so N[N7:0]:[N7:1] would throw an error after conversion requiring you to perform the indirect references differently after the conversion (like rewrite the code to use a 2D array).

It also looks like the conversion took 16 bit addresses and made them into 32 bit tags and added extra stuff to mask off the upper bits that may not be necessary in your converted_ example.

I would think the conversion of:
B3:202/[N201:0]
should have ended up as:
AXIS_HOME.MOTOR_OFFSET

Note the different bit delimiters between the platforms.

Another thing I ran into way back when, if you write outside the limits of an array tag, you might not get an error but you also might corrupt data in some other unexpected tag location. I saw that with version 12 IIRC, and maybe that has since been corrected, but DO limit check your indirect references before using them in the code.

I changed tag AXIS_HOME to a dint [1] so it reference
AXIS_HOME[0].[MOTOR_OFFSET] with no errors.
But when I start testing I will do limit check.
Thanks for the help!
 

Similar Topics

Hello Friends, I am trying to index M Bits, however GX Works2 is not allowing it with following message. https://ibb.co/zPcqj6M...
Replies
3
Views
1,297
Howdy folks, I am an Allen Bradley guy currently living in an Emerson world. Working with Rx3i on PacSystems Machine Edition v. 9.6? i think...
Replies
3
Views
577
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
649
Hi All, which the best way to do the indirect addressing in an optimize DB? Ccurrently this is my partial code inside an FB...
Replies
7
Views
2,250
Hey everyone, Just used the PLC5/Logix migration utility to convert a program, and while addressing the PCEs, I noticed a lot of errors for "XIC...
Replies
12
Views
1,902
Back
Top Bottom