Siemens S7-200 or Smart200 programming instruction explanation - clock and network

In the previous lecture, we talked about bit logic instructions, which are the basic entry instructions. In this section, we will explain all Siemens 200 instructions .

1. Clock instruction

The clock instructions are read real-time clock and set real-time clock respectively, as shown in Figure 1-1

1. EN is command enable, and the command is valid only when it is 1;

2. T is the time buffer, and its format is as shown in Figure 1-2

3. The ENO command can be output, generally connected directly: the error condition that makes ENO = 0

0006 indirect addressing

0007TOD data error

000C Clock module does not exist

4. The read command stores the clock data into T, and the set command sets the data of T to the real-time clock.

                                                                   Figure 1-1 Instruction diagram 

                                                                 Figure 1-2 Format of T

2.Communication command

There are 6 communication instructions of 200, which are network read and network write ; send data and receive data ; set port address and obtain port address .

(1). Network read and network write

The network read command NETWR and the network write command NETW are commands for exchanging data between PLCs.

NETR initiates a communication operation, according to the definition of TBL, collects data from the remote device on the specified port;

NETW is to write data to the remote port device;

As shown in Figure 2-1 below: it is a schematic diagram of two instructions, TBL is a table for exchanging data, and PORT is a port number, generally 0 or 1

TBL is defined as shown in Figure 2-2

 

                                                                       Figure 2-1 Instruction diagram

 

                                                                                           Figure 2-2 TBL description diagram

(2). Case of network read and write instructions

As shown in Figure 3-1 below, a production line is filling butter barrels and sending them to one of four packaging machines. The packing machine packs 8 butter barrels into a cardboard box, and a diverter controls the butter barrels. Flow to each baler, 4 CPU221 modules are used to control the baler, and a CPU222 module is installed with a TD200 operator interface, which is used to control the shunt.

 

                                                                        Figure 3-1 Example of reading and writing network commands 

(3). Example of network reading and writing program

The sample program is as shown in the figure below. Note: TBL must be filled with data.

 

 

 

 See the next lecture for the follow-up content.

 

 

 

 

Guess you like

Origin blog.csdn.net/xipengbozai/article/details/125364823