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