
7-5
Ladder Logic (LAD) for S7-300 and S7-400
C79000-G7076-C504-02
A pointer is a device that identifies the location of a variable. A pointer
contains an address instead of a value. When assigning an actual parameter
for the parameter type “pointer,” you provide the memory address. STEP 7
allows you to enter the pointer in either a pointer format or simply as an
address (such as M 50.0). The following is an example of the pointer format
for accessing data starting at M 50.0:
P#M50.0
If you are working with an instruction whose address identifier indicates a
memory area of your programmable logic controller and a data object that is
either a word or a double word in size, you need to be aware of the fact that
the memory location is always referenced as a byte location. This byte
location is the smallest byte number or the number of the high byte. For
example, the address in the statement shown in Figure 7-2 references four
successive bytes in memory area M, starting at byte 10 (MB10) and going
through byte 13 (MB13).
Statement: L MD10
Address identifier Byte location
Figure 7-2 Example of Memory Location Referenced as Byte Location
Figure 7-3 illustrates data objects of the following sizes:
S Double word: memory double word MD10
S Word: memory words MW10, MW11, and MW12
S Byte: memory bytes MB10, MB11, MB12, and MB13
When you use absolute addresses that are a word or a double word in width,
make sure that you do not create any byte assignments that overlap.
MB10 MB11 MB12 MB13
MW11
MD10
MW10 MW12
Figure 7-3 Referencing a Memory Location as a Byte Location
Pointers
Working with Word
or Double Word as
Data Object
Addressing
Comentários a estes Manuais