Sign in to follow this  
Followers 0
WireGuy1950

Syntax problems with Indexed / Indirect variables

6 posts in this topic

I am having a really tough time getting this program working. I have been through the AB programming manual and tried their examples but I keep getting errors when I compile (offline). I am using RSLogix 500 v.7.2, and a 1747-L542C CPU (5/04) OS 401. I would really like this to work as I am running out of memory due to the recipe functions. The structure is: N13:0 through N13:255 is the working recipe data, words and bits. When a recipe is saved or loaded the index value is sent from the panel view to the subroutine and the appropriate action is taken, all 256 words are transferred in two stages. This works but I have up to 100 separate lines of code depending on which recipe is being saved or which is being loaded (another 100 lines). If this indirect addressing is possible then I could cut the lines way down. Any help would be appreciated. Save Recipie Error.pdf Save Record Indexing Problem.pdf

Share this post


Link to post
Share on other sites
we'd be able to offer more detailed help if you can post your ENTIRE program file ... (RSS) ...

Share this post


Link to post
Share on other sites
I will post it, it's rather long but ok. The pertinent subroutines are 30-33. Thanks, 0500-179-0604.RSS

Share this post


Link to post
Share on other sites
see if this syntax will get you closer to where you need to be ... let us know if you need more help than this ... I'm kind of tied up right now but I hope that this will get you on track ... TIP: your original method of using an MOV (Move) command to put a value into S:24 is a LOT more tricky than you need ... basically that technique (Indexed Addressing) is mostly used for older SLC processors that don't support the newer Indirect Addressing method ... basic idea: # is for Indexed Addressing and uses S:24 as the "pointer" ... [] is for Indirect Addressing and you use your own "home brew" pointer ... I used N18:0 in my example ... helpful trick: from the RSLogix500 main menu, look under View > Properties > Address Display ... check ON the box for "Display Value for Indirect Address" ... that might help you see how the system is interpreting the "pointer" [N18:0] as part of the target addresses ... also ... just for your information, you don't need the SBR and the RET instructions at the top and bottom of your subroutines ... most programmers don't include those when working with RSLogix500 ... good luck with your project ... Edited by Ron Beaufort

Share this post


Link to post
Share on other sites
Thanks alot Ron, I'm not sure exactly why that worked that time but it did. I tried that same syntax for the COP commands but it did'nt work. Must be something about the calculation for the offset. Thanks again. Statistics: Before: Memory Used 6598 Instructions 4822 Instruction Words Left After: Memory Used 5415 Instructions 6005 Instruction Words Left Save Record Indexing Fixed.pdf

Share this post


Link to post
Share on other sites
In the top COP in the error rung, you have a period ('.') in the address rather than a colon (':').

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