Todd
We love to make life difficult for ourselves, don't we!
We've got four terms here : absolute, symbolic, direct, indirect. My use of these means :
Absolute : a reference to a memory location within the PLC made using the manufacture's own designation for that memory. In S7 this could be IW200, M23.2, DB49.DBD16 etc. These addresses identify the location and size (bit, byte, word etc) of the the memory being referenced, but nothing more.
Symbolic : a reference to a memory location within the PLC using an alias or synonym assigned by the user. Examples here could be "WaterLevel", "DirnIndicator", "AV1037" etc. Somewhere in the PLC programming software there will have to be a table of some sort relating each of these symbolic names to an absolute address.
Direct : a reference to a memory location within the PLC where it is explictly identified during editing and will not change dynamically at runtime. For example -
Every time this section of code is executed it will read the same two inputs and control the same output. The example I've shown is direct absolute addressing. I could equally have shown a direct symbolic example.
Indirect : a reference to a memory location in the PLC which is not itself used in the code, but acts as a pointer or holder for the 'true' address to be used at runtime. This can be changed under control of the program at runtime. For example -
Code:
A I[AR1,P#0.0]
A I[AR1,P#2.4]
= Q[AR1, P#20.6]
Here the actual inputs and output used could vary each cycle according to the contents of Address Register 1 (AR1). The user can control this through the program. Although the example shows a fixed offset between the addresses used (the P#...) these could also be variable at runtime.
Finally, one type of addressing that hasn't been mentioned previously is -
Indexed : a reference to a memory location in the PLC where the memory area is fixed at editing, but the address within that area can be modified at runtime. It is usually applied to arrays of data but is not (IMO) well supported in standard STEP7 languages STL, LAD or FBD. It really comes in to its own in Structured Text (SCL). For example, let's say we have an array of product codes in a warehouse stacking system where there are three things that identify the location of the product: the aisle, the column and the shelf. You can define an array symbolically named "Location" with these 3 as indices and then address it as -
Code:
PCode := Location[Aisle, Column, Shelf];
You can manipulate the contents of the symbolic indices to read/write the product code required. Unfortunately STL etc only permits the use of literal values as indices. In other words -
Code:
L Location[3,12,6]
T "PCode"
.. which is no earthly use!
The vast majority of PLC programs I've seen use direct addressing for most tasks, with indirect used where necessary for specific tasks. S7Guy's approach, while perfectly valid and obviously giving him plenty of benefits he values, is not the norm. You can only weigh up the pros and cons of all these methods and decide for yourself. What effect do they have at the design stage, the coding stage, the testing, commissioning, maintenance stages, the eventual upgrade or modifications which will be made etc?
Well, just a handful more beans thrown in to the cooking pot!
Ken.