Siemens PLC learning skills

Siemens PLC classification: Germany Siemens programmable controller is widely used in China, such as in metallurgy, chemical, printing production lines and other fields. Siemens (SIEMENS) PLC products include LOGO, S7-200, S7-1200, S7-300, S7-400 and so on. Siemens S7 series PLC is small in size, fast in speed and standardized, with network communication capability, stronger function and high reliability. S7 series PLC products can be divided into micro PLC (such as S7-200), PLC with small-scale performance requirements (such as S7-300) and PLC with medium and high performance requirements (such as S7-400).

The working principle of Siemens PLC programming: When the PLC is put into operation, its working process is generally divided into three stages, namely, input sampling, user program execution and output refreshing. Completing the above three phases is called a scan cycle. During the entire operation, the CPU of the PLC repeatedly executes the above three stages at a certain scanning speed.

Input sampling

During the input sampling phase, the PLC reads all input states and data in a scan mode and stores them in the corresponding cells in the I/O map area. After the input sampling is finished, it is transferred to the user program execution and output refresh phase. In these two phases, the status and data of the corresponding unit in the I/O map area does not change even if the input status and data change. Therefore, if the input is a pulse signal, the width of the pulse signal must be greater than one scan period to ensure that the input can be read in any case.

User program execution

During the user program execution phase, the PLC always scans the user program (ladder) in order from top to bottom. When scanning each ladder diagram, the control lines formed by the contacts on the left side of the ladder diagram are always scanned first, and the control lines composed of the contacts are logically operated in the order of first left, then right, first up and then down. And then refreshing the state of the corresponding bit of the logic coil in the system RAM storage area according to the result of the logic operation; or refreshing the state of the corresponding bit of the output coil in the I/O map area; or determining whether to execute the ladder diagram The specified special function instructions.

That is, during the execution of the user program, only the state and data of the input point in the I/O map area will not change, while other output points and soft devices are in the I/O map area or the system RAM storage area. The status and data are subject to change, and the ladder diagrams listed above, the program execution results will work on the ladder diagrams that use these coils or data; instead, the ladder diagrams below, The state or data of the refreshed logic coil can only be applied to the program that is listed above in the next scan cycle.

Output refresh

When the scanning user program ends, the PLC enters the output refresh phase. During this time, the CPU refreshes all the output latch circuits according to the corresponding state and data in the I/O map area, and drives the corresponding peripherals through the output circuit. At this time, it is the real output of the PLC.

The same several ladder diagrams are arranged in different order and the results are different. In addition, the results of the operation of the scanning user program are different from the results of the parallel operation of the hard logic of the relay control device. Of course, if the time taken by the scan cycle is negligible for the entire run, there is no difference between the two.

Problems that should be noted in Siemens PLC programming:

1. The subroutine can be called in the interrupt program

The accumulator and the logically stacked memory are shared between the interrupt program and the called subroutine.

2. Interrupt program and main program data can be shared

Although the interrupt program can be shared, we should pay attention to the factor effect of the asynchronous nature of the event in the interrupt event to solve the problem of the consistency of the shared data. Any place where the main program executes in the interrupt event is likely to occur. .

3. Interruption of the communication interface

The serial communication port of the PLC can be controlled by a ladder diagram or statement list program. This mode of operation of the communication port is referred to as the mode of the own port. In the case of freedom, you can use the program to define the baud rate, the number of bits per byte, etc., in the process of executing the main program, to apply for an interrupt, in order to define the free port mode, using the receive and send interrupts can simplify the program Control of communication.

4.I/O interrupt

I/O interrupts include rising or falling edge interrupts, which tell the counter interrupt and the burst output interrupt.

The S7-200 CPU generates an interrupt by the rise or fall of the input I0.0~I0.3, and the event that occurs is captured by the input terminal. Such a rising edge or falling can be used to indicate that an event must be noticed when it occurs. condition.

5. Time base interruption

6. Interrupt priority and queuing

7. Interrupt restrictions

8. Interrupt program programming steps

ZGAR FIT

ZGAR FIT

ZGAR electronic cigarette uses high-tech R&D, food grade disposable pod device and high-quality raw material. All package designs are Original IP. Our designer team is from Hong Kong. We have very high requirements for product quality, flavors taste and packaging design. The E-liquid is imported, materials are food grade, and assembly plant is medical-grade dust-free workshops.

From production to packaging, the whole system of tracking, efficient and orderly process, achieving daily efficient output. We pay attention to the details of each process control. The first class dust-free production workshop has passed the GMP food and drug production standard certification, ensuring quality and safety. We choose the products with a traceability system, which can not only effectively track and trace all kinds of data, but also ensure good product quality.


We offer best price, high quality Vape Device, E-Cigarette Vape Pen, Disposable Device Vape,Vape Pen Atomizer, Electronic cigarette to all over the world.

Much Better Vaping Experience!



E-Cigarette Vape Pen,Disposable Device Vape,Vape Pen Atomizer,Latest Disposable E-Cigarette OEM vape pen,OEM electronic cigarette

ZGAR INTERNATIONAL TRADING CO., LTD. , https://www.zgarette.com

This entry was posted in on