Indirect addressing in a UDT - RS Logix 5000

Join Date
May 2011
Location
South Carolina
Posts
87
I am sure everyone is saying not this again. I have looked and could not find an answer to this. I created a UDT with elements DW0, DW4, DW8, DW12, etc. all the way through DW60. All of these are of the type DINT. Then i created a new tag named DB16 of this UDT type, so now I have DB16.DW0, DB16.DW4, etc.

Now I want to use indirect to pull the value out of a different DINT depending on a previous add function. I tried to address it like DB16.DW[M34] and I keep getting an error saying "Invalid member specifier". M34 is also a DINT used as the location of the result in the previous add function.

It is apparent that for some reason you can not indirect address like this, but how would I do it then?
 
Can't do it like that....don't create individual members in your UDT.....create a Dint array in the UDT called DW of length 60...or 61 if you need an address at DW [60]. Then you can use the syntax you're trying to do.
 

Similar Topics

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
620
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
668
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,380
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,273
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,977
Back
Top Bottom