Posted 14 Aug 2012 This XIC is used in several places in an RSS program I have. XIC I:[N15:3].[N15:4]/[N15:5] How is this interpreted? It shows as 'on' for values: N15:3 = 0 N15:4 = 0 N15:5 = 16 Sorry if this is a lame question. Mike Share this post Link to post Share on other sites
Posted 14 Aug 2012 (edited) Welcome to the forum ! The only "lame" questions here are the ones expressed in SMS-speak: "Plzzzz help with PLC okthkzbye". This is an (extreme) example of Indirect Addressing in the SLC platform. The value stored in each address in square brackets is substituted when the expression (the XIC) is evaluated. In your example, N15:3 is the Slot Number, N15:4 is the Word Number, and N15:5 is the Bit Number. So in this case, you're looking at the value of I:0.0/16 I'm not totally sure that's a valid set of numbers, either; Bit 15 is the highest bit in an SLC-500 Word. So either this will refer to I:0.1/0 or it's invalid. I try to limit my use of Indirect Addressing to situations where it's the most effective thing to do. This is both because it's hard to troubleshoot and because there's often the risk of placing an out-of-bounds value into an index and faulting the CPU. Edited 14 Aug 2012 by Ken Roach Share this post Link to post Share on other sites
Posted 14 Aug 2012 Ken, Yikes. It sure is indirect! This same addressing is used several times in the same way with resulting addresses: I:0.0/15, I:0.0/16, I:0.0/17, I:0.0/18, & I:0.0/19, which if I understand your answer result in: I:0.0/15, I:0.1/0, I:0.1/1 and so forth. all of whose values are set to 1. This result is consistent with what the ladder logic shows. All are 'green'. Thanks for the quick answer. I had a recent ladder logic class which covered indirect addressing very briefly. I will review. Cheers, Mike Share this post Link to post Share on other sites
Posted 14 Aug 2012 (edited) I don't know how many worry about this but each indirect reference adds to the execution time. Use it a lot and you'll have a dog-slow scan. If it's needed, it's needed but avoid if possible. In the case of this XIC, if the indirect values will be the same all the way through 1 scan then assign the result to a 'B' bit at the start then use that the rest of the way through. Edited 14 Aug 2012 by b_carlton Share this post Link to post Share on other sites
Posted 14 Aug 2012 I like that idea a lot. I can initialize all the bits using the indirect addressing on a first time only basis and reference the bits directly. And i can assign the bits useful names so the poor guy who reads it after me will have a clue what was going on. Thanks, Mike Share this post Link to post Share on other sites