Lecture
Many LAD commands work with one or several addresses (operands). This operand defines a constant or a place where a command finds a variable with which it performs a logical operation. This place can be a bit, byte, word or double word. Possible operands, for example, are:
You can apply direct addressing (setting a constant as an operand) or direct addressing (setting a variable as an operand).
IN1- is direct addressing. IN2- direct addressing |
Constant formats for direct addressing can be found here.
The address of the LAD command can point to one of the following objects:
Variables used as addresses consist of an address identifier and an address within the memory area specified in the address identifier. The address identifier can belong to one of the following two types:
A pointer is an element that recognizes the location of the ariable variable. The pointer contains an address instead of a value. When assigning an actual parameter to the parametric type “pointer”, you specify an address in memory. STEP 7 allows you to enter a pointer either in pointer format or simply as an address (for example, M 50.0). The following is an example of a pointer format for accessing data starting with M 50.0: P # M50.0
If you work with a command whose address identifier defines the memory area of your programmable logic controller, and with a data object that is either a word or a double word in size, then you should take into account that the memory address is always referred to as a byte address. This byte address is the smallest byte number or the highest byte number. For example, the address in the statement shown in the figure below refers to four consecutive bytes in the memory area M, starting with byte 10 (MB10) and up to byte 13 (MB13).
Here are the objects of the following sizes. Double word: double word memory MD10 Word: words of memory MW10, MW11 and MW12 Byte: MB10, MB11, MB12 and MB13 memory bytes |
If you are using absolute word size or double word addresses, then make sure that you avoid such byte assignments that they overlap.
Comments
To leave a comment
Industrial programming. programming of controllers
Terms: Industrial programming. programming of controllers