Sign in to follow this  
Followers 0
lostcontrol

Index Registers

5 posts in this topic

Hello Experts, What happens in the Omron world when an Index register tries to address a location that does not exist? ie. If I have a offset of 10000 from D25000, then the theoretical location is D35000, which as far as I know, does not exist in any of the Omron PLC's. In the AB world, this sort of thing faults the processor from memory. I have tried this, and I do not get any errors whatsoever, and of course, proper technique and error checking should be installed to prevent this from ever happening as well!! Just wandering, that is all....

Share this post


Link to post
Share on other sites
If you try to access a non existing address, you will get Illegal Access Error (Symbol Name P_AER in CX-Programmer). The Operation Manual says about P_AER "Turned ON when an Illegal Access Error occurs. The Illegal Access Error indicates that an instruction attempted to access an area of memory that should not be accessed. When the PLC Setup is set to stop operation for an instruction error (Instruction Error Operation), program execution will be stopped and the Instruction Processing Error Flag (A429510) will be turned ON when the Access Error Flag is turned ON." Normally the PLC is not set to stop on Instruction Errors, so it could go unnoticed. In your example, depending on what CPU you are using, its pointing to EM E0_02233 if I calculated correctly. See attached Memory Map

Share this post


Link to post
Share on other sites
Lostcontrol The DM area will flow directly into the EM0 bank, if it exists in the PLC. So, if you are pointing at D32767, and go 1 higher, you end up at E0_0. There have been several applications where I have used this to make large 1 contiguious memory area out of several EM banks. Proper bounds checking with IRs is very important, as you noted. This can be done with simple Long Binary comparisons. (>=(325) for example). The problems that you can cause with improper bounds checking on IRs are numerous. You can overwrite Special IO card setup, CPU bus unit setup (done both of those), as well as possibly the PLC setup (never done that one). If you use the IR method of addressing inside a for / next loop, and always load the pointer (MOVR) before you enter the loop, you should not have any problems. This is one way that I use IRs frequently. There are some neat addressing tricks that you can use as well. You cannot do a MOVR D50.07 IR0 (except CJ2), but you can do a MOVL #00100327 IR0. DM 50 = #0010032. DM 50.07 = #00100327. To point to any bit in any channel, you simply tack a '0' - 'F' onto the right hand side of the constant for bit 00 - 15. You may or may not have found my IR / DR monitor and calculator. This has saved me much work over the years. http://forums.mrplc.com/index.php?autocom=...mp;showfile=565

Share this post


Link to post
Share on other sites
I havn;t seen that either. Thanks mate.

Share this post


Link to post
Share on other sites
Have you been able to use this with Windows 7?? I got an error message that FinsMsgCtl.dll (or something like that) did not install. I have found a few other programs with VB6 code that won't run on Windows 7.

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