Detailed explanation of S7-200SMART series PLC bit logic operation instructions and bit read and write operations

Publisher:科技创新实践者Latest update time:2022-09-21 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Siemens S7-200 SIMATIC PLC instruction list

896cdcd0-3817-11ed-ba43-dac502259ad0.jpg

Detailed explanation of S7-200SMART series PLC bit logic operation instructions and bit read and write operations

The bit logic instructions of Siemens s7-200SAMRT are the most frequently used in PLC. Except for some very special program segments, it can be said that every ladder diagram program segment cannot do without bit logic instructions. As the name implies, the object of the bit logic instruction operation is the binary bit in the register storage unit. The essence of the bit logic operation instruction is to find the specified bit through bit addressing, read or change the state of the bit (0 or 1). The logical operations between bits are mainly AND, OR, and NOT operations.

1. Reading and writing bits. In the ladder diagram, reading bits means placing contacts, and writing bits means placing coils. As shown in the figure below, in the first program segment, we first read the binary bit I0.0 (that is, the 0th bit of every 0th byte of our process image input register) by placing contact I0.0. The corresponding object is input I0.0, and its state is written to M0.1 of the flag register. The second program segment is to copy the current value of M0.1 to Q0.0. So we have to remember which contact to place to read the bit, and which coil to place to write a bit.

899e8f96-3817-11ed-ba43-dac502259ad0.jpg

Programming Examples

In the STL instruction, place the contact, use the LD instruction, LOAD means, LD I0.0 means to read the value of I0.0 and load it into the stack. = M0.1 means to make the value of M0.1 equal to the value at the top of the current stack.

89c0c2a0-3817-11ed-ba43-dac502259ad0.jpg

STL directives

2. AND operation, series connection is AND operation. A and B, when AB are both 1, the operation result is 1, otherwise it is 0. As shown in the figure below: SM0.0 and M0.1 are connected in series for AND operation, and the operation result is written into Q0.0. If SM0.0 and M0.1 are both 1, Q0.0=1, if either SM0.0 or M0.1 is 0, Q0.0=0.

89e1da3a-3817-11ed-ba43-dac502259ad0.jpg

3. OR operation, parallel connection is OR operation. A or B, the operation result is 0 only when A and B are both 0, otherwise it is 1. As shown in the figure below: I0.0 and I0.1 are connected in parallel to do AND operation, and the operation result is written into Q0.1. If the values ​​of I0.0 and I0.1 are both 0, then Q0.1=0, if any bit state of I0.0 and I0.1 is 1, then Q0.1=1.

8a02d2c6-3817-11ed-ba43-dac502259ad0.jpg

AND operation

In STL instructions, A XX.X is an AND operation, and O XX.X is an OR operation.

8a1abfe4-3817-11ed-ba43-dac502259ad0.jpg

4. Negation operation, which is negation, turns 1 into 0 and 0 into 1. The program in the figure below is to perform the OR operation first and then negate it.

8a29c520-3817-11ed-ba43-dac502259ad0.jpg

5. Rising and falling edge instructions, positive jump contact instructions (rising edge) allow energy to flow for one scan cycle after each disconnection to connection transition. Negative jump contact instructions (falling edge) allow energy to flow for one scan cycle after each connection to disconnection transition.

8a409a70-3817-11ed-ba43-dac502259ad0.jpg

8a598012-3817-11ed-ba43-dac502259ad0.jpg

6. Set and reset instructions, Set (S) and Reset (R) instructions are used to set (turn on) or reset (turn off) a group of bits (N) starting from a specified address (bit). You can set or reset 1 to 255 bits. If the reset instruction specifies a timer bit (T address) or a counter bit (C address), the instruction will reset the timer or counter bit and clear the current value of the timer or counter.


Reference address:Detailed explanation of S7-200SMART series PLC bit logic operation instructions and bit read and write operations

Previous article:Winding design and skin effect of flat wire motor
Next article:A brief discussion on the low-level errors in start-stop and self-locking circuits when programming PLC

Recommended ReadingLatest update time:2024-11-16 14:26

A brief discussion on the importance and significance of operations in PLC
Mathematical operations (that is, the addition, subtraction, multiplication, division, etc. that we are familiar with) are often used in PLC programming. Today we use a small case to reflect the importance of operations in PLC. Our case is also a question that an elementary school teacher asked angrily a long time a
[Embedded]
A brief discussion on the importance and significance of operations in PLC
Methods for reducing counting errors of PLC high-speed counters
When applying PLC high-speed counters, we often encounter the following series of problems: the pulse level of the counter does not match the input counting pulse signal. For example, the data output of the rotary encoder and grating ruler is TTL level, but the PLC high-speed counter requires to receive 0-24V transm
[Embedded]
Analysis of the characteristics of Siemens SIMATIC S7-200 series PLC
1. Features of S7-200 series PLC: It is a small PLC launched by SIEMENS. (1) It has a compact structure (2) Good scalability (3) Powerful command functions (4) Low price It has become an ideal controller for various small control projects in contemporary times. 2. S7-200PLC product
[Embedded]
Application design of PLC in constant pressure water supply system
The system uses PLC as the control center to complete PID closed-loop operation, multi-pump up and down switching, display, fault diagnosis and other functions. The frequency converter speed regulation method automatically adjusts the water pump motor speed to achieve the purpose of constant pressure water supply.
[Industrial Control]
Application of NA200 PLC in ultrafiltration water purifier
1. Overview Ultrafiltration water purifier can be applied to industrial purification, water purification for food and beverage industry, rural drinking water safety and other projects. It adopts ultrafiltration membrane filtration technology, combined with a carefully designed fully automatic filtration
[Industrial Control]
How the Siemens S7-1500PLC OPC UA method works
OPC UA Overview OPC UA is an open standard for horizontal communication from machine to machine (M2M) and vertical communication from machine to the cloud. The standard is vendor and platform independent, supports a wide range of security mechanisms, and can share the same industrial Ethernet network with PROFI
[Embedded]
How the Siemens S7-1500PLC OPC UA method works
Interference types and sources of PLC operation and its anti-interference design
Among the various types of PLCs used in automation systems, some are centrally installed in the control room, and some are installed in the production site and various motor equipment. Most of them are in a harsh electromagnetic environment formed by strong electric circuits and strong electric equipment. To improve
[Embedded]
PLC programming principles and scientific programming steps
Everyone has his or her own ideas when programming PLCs. Even if the same control logic is written by different engineers, different results will be obtained. Even the same engineer may have different ideas at different times. So when writing programs, two different sets of programs can achieve the same functio
[Embedded]
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号