Accessing The Data Of The S7-200 - Siemens SIMATIC S7-200 System Manual

Programmable controller
Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

Processing Any Communications Requests
During the message-processing phase of the scan cycle, the S7-200 processes any messages
that were received from the communications port or intelligent I/O modules.
Executing the CPU Self-test Diagnostics
During this phase of the scan cycle, the S7-200 checks for proper operation of the CPU and for
the status of any expansion modules.
Writing to the Digital Outputs
At the end of every scan cycle, the S7-200 writes the values stored in the process-image output
register to the digital outputs. (Analog outputs are updated immediately, independently from the
scan cycle.)

Accessing the Data of the S7-200

The S7-200 stores information in different memory locations that have unique addresses. You can
explicitly identify the memory address that you want to access. This allows your program to have
direct access to the information. Table 4-1 shows the range of integer values that can be
represented by the different sizes of data.
Table 4-1
Decimal and Hexadecimal Ranges for the Different Sizes of Data
Representation
Unsigned Integer
Signed Integer
Real
IEEE 32-bit
Floating Point
To access a bit in a memory area, you specify the address, which includes the memory area
identifier, the byte address, and the bit number. Figure 4-4 shows an example of accessing a bit
(which is also called "byte.bit" addressing). In this example, the memory area and byte address
(I = input, and 3 = byte 3) are followed by a period (".") to separate the bit address (bit 4).
I 3
Figure 4-4
Byte.Bit Addressing
You can access data in most memory areas (V, I, Q, M, S, L, and SM) as bytes, words, or double
words by using the byte-address format. To access a byte, word, or double word of data in the
memory, you must specify the address in a way similar to specifying the address for a bit. This
includes an area identifier, data size designation, and the starting byte address of the byte, word,
or double-word value, as shown in Figure 4-5.
Byte (B)
Word (W)
0 to 255
0 to 65,535
0 to FF
0 to FFFF
- -128 to +127
- -32,768 to +32,767
80 to 7F
8000 to 7FFF
Not applicable
Not applicable
.
4
Bit of byte, or bit number:
bit 4 of 8 (0 to 7)
Period separates the
byte address from the bit
number
Byte address: byte 3 (the
fourth byte)
Memory area identifier
PLC Concepts
Double Word (D)
0 to 4,294,967,295
0 to FFFF FFFF
- -2,147,483,648 to +2,147,483,647
8000 0000 to 7FFF FFFF
+1.175495E- -38 to +3.402823E+38 (positive)
- -1.175495E- -38 to - -3.402823E+38 (negative)
Process-image Input (I) Memory Area
7 6 5 4 3 2 1 0
Byte 0
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Chapter 4
27

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents