Sign in to follow this  
Followers 0
Guest John Miller

rs500-5000 program conversion/indirect addressing

5 posts in this topic

I ran the program conversion to convert a rs500 program to a rs5000 program and am having trouble with indirect addressing statements. in rs500: I am indirect addressing N70[c5[0].acc] and am not able to figure out how to make an array of n70[] indirect address using the acc of a counter C5 any suggestions?

Share this post


Link to post
Share on other sites
I don't think you can use nested indirect addressing. Make sure the counter is not an array. Try something like N70[cX.acc]. Look up Indirect Addressing Support in RSLogix5000 help. It has a lot of info on what is supported and how the translation from the 5/500 to 5000 works.

Share this post


Link to post
Share on other sites
Thanks Firetubes, I've read as much as I can find from support/knowledge base etc. I'm still not sure why my original code causes "invalid array subscript" errors. I did find a solution that seems to work (at least the code passes validation) I am assigning a word, the value of the counter accumulator mov c5[0].acc c5_0_acc then use the word as the indirect address index N64[c5_0_acc]

Share this post


Link to post
Share on other sites
Basically, you can't have "[]" inside another "[]". It would have been ok too if you created a non-array counter tag like MyCounter.ACC.

Share this post


Link to post
Share on other sites
If this the only indirect addressing or if there is only a few like this, MOV the timer acc to a "regular" INT or DINT and use that as a the indirect pointer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0