Terry Woods
Member
- Join Date
- Apr 2002
- Posts
- 3,170
Phillip...
The difference between Indexed Addressing and Indirect Addressing is NOT the final location; the end-result is the same in either case. The difference is in the manner in which the final location is obtained.
As has been indicated, several times, Indexed Addressing, as practiced by AB, is "bound" to the range of the particular array, and can be "checked". I can't argue about that being a good thing... in some cases. However, because it is "bound" to that particular array, it is also a restriction. Gaining access to data outside of the "particular" array becomes more difficult; un-neccessarily so.
Can you pass an Array Identity as a variable? As in... Array_[X], where "X" is a variable, indicating any particular array?
Indexed Addressing, as practiced by other PLCs, is "unbounded". Their scheme consists of a Base-Address and an Offset. As scary as it sounds... that scheme allows access to ANY memory location in the memory-map. Yes... it requires discipline... as in, self-control, just like driving a beer-truck (or any other vehicle).
Indirect Addressing is also "unbounded". And yes, this too requires discipline. Indirect Addressing is NOT bound to any array in any case... short of that fundamental array which defines the entire memory structure.
As such, you can gain access to ANY table (any memory location) that your heart desires!
In human terms... being restricted in the AB manner puts you in a position where you might have to tell your boss... "Uuuuhhh, sorry boss, I can't get the answer... because I don't have access to those records."
If you are the programmer... then as far as the program is concerned... you are god (even if only a minor-god). As that program-god, you should have access to whatever you might want! However, even minor-gods, such as yourself, have to exercise discipline and self-control! At the same time, after fetching and manipulating the Indirect Address, you can impose your own "checking" to see that the Indirect Address is reasonable before you, in fact, use it!
Being the programmer is... Absolute Power!
Now, some might say that... "Absolute Power... Corrupts... Absolutely!"
But then... Aren't you really watch-dogging yourself, for your own sake?
This PLC stuff is one business where "performance" is everything! And that "performance" is a direct reflection of YOU!
Why in the world would anyone abuse that power in a manner that reflects badly on himself???
The difference between Indexed Addressing and Indirect Addressing is NOT the final location; the end-result is the same in either case. The difference is in the manner in which the final location is obtained.
As has been indicated, several times, Indexed Addressing, as practiced by AB, is "bound" to the range of the particular array, and can be "checked". I can't argue about that being a good thing... in some cases. However, because it is "bound" to that particular array, it is also a restriction. Gaining access to data outside of the "particular" array becomes more difficult; un-neccessarily so.
Can you pass an Array Identity as a variable? As in... Array_[X], where "X" is a variable, indicating any particular array?
Indexed Addressing, as practiced by other PLCs, is "unbounded". Their scheme consists of a Base-Address and an Offset. As scary as it sounds... that scheme allows access to ANY memory location in the memory-map. Yes... it requires discipline... as in, self-control, just like driving a beer-truck (or any other vehicle).
Indirect Addressing is also "unbounded". And yes, this too requires discipline. Indirect Addressing is NOT bound to any array in any case... short of that fundamental array which defines the entire memory structure.
As such, you can gain access to ANY table (any memory location) that your heart desires!
In human terms... being restricted in the AB manner puts you in a position where you might have to tell your boss... "Uuuuhhh, sorry boss, I can't get the answer... because I don't have access to those records."
If you are the programmer... then as far as the program is concerned... you are god (even if only a minor-god). As that program-god, you should have access to whatever you might want! However, even minor-gods, such as yourself, have to exercise discipline and self-control! At the same time, after fetching and manipulating the Indirect Address, you can impose your own "checking" to see that the Indirect Address is reasonable before you, in fact, use it!
Being the programmer is... Absolute Power!
Now, some might say that... "Absolute Power... Corrupts... Absolutely!"
But then... Aren't you really watch-dogging yourself, for your own sake?
This PLC stuff is one business where "performance" is everything! And that "performance" is a direct reflection of YOU!
Why in the world would anyone abuse that power in a manner that reflects badly on himself???