Tag Archives: PLC programming

To simplify and write PLC ladder command statement table ladder program

After simplifying the ladder

Instruction Statement List
a) LD        01600
AND       00002
LD-NOT    00001
AND       00000
OUT       10000
b)LD-NOT    00004
AND       00005
LD         10000
AND       00006
AND       00003
LD         00002
AND       00004
AND       00001
OUT       10000
c)LD         10000
AND       00003
AND       00004
OR         00001
AND       00000
LD         10000
AND       00001
LD         00003
AND       00004
AND       00002
OUT       10000

Art lantern shape PLC Ladder programming and wiring experiment

This article describes an artistic lantern shape PLC ladder programming and wiring experiment described, as follows:

1. Project the necessary equipment, tools, materials


2, the training content:
1, project description
The shape of an art lantern demonstration board as shown in Figure 6, A, B, C, D, E, F, G, H for the eight lights, a ring distribution. The control requirements are as follows:
Will start switch K1 close, eight lighting light at the same time, namely abcdefgh light at the same time a second, then eight lighting according to counter clockwise rotate the light seconds, a bright 1s > b 1s > C bright bright 1s > d 1s > e bright bright 1s > f light 1 second g > bright 1s > h light 1 second; next eight lighting and light at the same time 1: abcdefgh and light 1 second; and eight lighting according to clockwise rotate the light 1 second, namely h bright 1 g > light 1 second > f light 1 second, e light in the 1s > d 1s > C bright bright 1s > B bright second, a bright light for 1 second. Then repeat the execution in this order. Press the stop switch K1, all the lights off.

2.2 PLC wiring diagram
According to figure 7 to meet the good line. Note that the COM1 and COM2 are connected, as the same as the rated voltage of the indicator light. Input and then start switch and stop switch.
2.3 program design
Figure 8, PLC operation, the program 9 to 19 step, M11 conduction, due to the step program of 50 to 120, M11 dynamic contact closure, respectively control the Y0 Y7 conduction and lantern abcdefgh lit up at the same time, the due t0 delay 1 seconds, so the abcdefgh lit up at the same time 1 seconds. To 1 seconds, the program step 40 t0 dynamic contact closure, shift instruction execution, implementation turns light, namely abcdefgh turns light, because a second clock t0 closed once, so abcdefgh turns light interval for a second. Step 20 to 29, when the M20 pass, the M101 set, the M101 moving contact with MI2 ~ M19 moving contact with the contact, respectively, turns lit H ~ A, that is, G, F, H, E, D, C, B, A turns lit every second. Step 30 to 39, when the M20 pass, the M101 reset, M101 dynamic break contacts with MI2 ~ M19 dynamic contact contact, respectively, in series lit A ~ H, that is, A, B, C, D, E, F, H, G turns lit every second. At any time will stop the switch K2 closed, in the 114th step, the interval reset command so that M19 ~ M12 all reset, all the lights are not bright.
2.4 run and debug program
(1) the ladder diagram program is entered into the computer, check the power supply is correct.
(2) to debug the program.
A. connected to the PLC power supply, the PLC will be RUN state, the K1 closed, observation of A, B, C, D, E, F, G, H, the light show.
K2 will be closed, A, B, B., C, D, E, F,, G, H, the light show.
(3) debug running record.

Application and characteristics of PLC in control system

What is the meaning of the programmable controller:

Acronym PLC programmable controller or PC, is evolved from the early relay logic control system, which constantly absorbing function of the microcomputer technology to growing gradually for complex control tasks.

Since 1836 relay came, people began to use it skillfully wire connected with the switching device, constitute use different logic control or sequential control. So far, the PLC Ladder programming language can also see the shadow of these wires. Until the late 1960s and early 1970s, the advent of programmable controllers, with the rapid development of microelectronics technology, computer technology and data communications technology, as well as the emergence of the microprocessor, PLC products towards small and ultra-small aspects of a leap , and finally to the early PLC from the initial logic control, sequential control, it has developed into a modern PLC logic, timing, counting, memory and arithmetic operations, data processing, communications and networking functions such as PID loop controller.

PLC viable reason is that it is more suitable for industrial field and the requirements of the market: high reliability and easy ability against various disturbances, programming installation, low price and long life. Than the microcontroller, its input and output closer to the field devices, without adding too many intermediate member or need more interfaces, which saves users time and money. PLC lower end (input) for the relay, transistor and thyristor control means and the upper end is generally user-oriented microcomputer. When people use it, you can not carry out specialized training in computers, programmable controllers can be operated and programmed. Used to perform a variety of different complexity industrial control tasks.
First, the main function of the programmable controller

PLC application is very broad, very rapid development of industrial automation equipment, factory automation (FA) and computer integrated manufacturing system (CIMS) in the important role. Today’s PLC function, far not only replace the traditional relay logic.
PLC system is generally constituted by the following basic functions: a variety of control functions. Data collection, storage and processing capabilities. Communications networking. Input / output interface conditioning. HMI function.

Programming, debugging features:
1, the control function logic control: PLC has the AND, OR, NOT, XOR logical operations and other functions, and triggers can replace relay switch control.
Time control: It provides users with a number of electronic timer, users can set their own: on-delay, off delay and timing pulses and other means.
Count Control: pulse control can add, subtract counting mode, you can connect encoder for position detection.
Sequence control: the first after the procedure is completed, it is transferred to the next process, so that a PLC can use as a multi-step controller.
Data collection, storage and processing math functions:
Basic arithmetic: add, subtract, multiply and divide.
Extended arithmetic: square roots, trigonometric functions and floating point arithmetic.
Compare: greater than, less than and equal to.
Data processing: Select, organize, normalize, move, and first in first out.
Analog data processing: PID, integral and filtering.
2, the input / output interface conditioning functions having A / D, D / A conversion, complete analogue control and regulation through the I / O modules. Median and accuracy can be selected according to user requirements.
3. Has the temperature measurement interface, direct connection to a variety of resistance or galvanic.
4, communications, networking have adopted most modern PLC communication, network technology, RS232 or RS485 interface for remote I / O control, more than one PLC to one another networking, communications, external devices and one or more between the programmable controller signal processing unit, program memory and data exchange, such as the transfer of the program, data file transfer, monitoring and diagnostics.

The communication interface or communication processor hardware interface standard or proprietary communication protocols and data transfer process is completed. Such as the Siemens S7-200 Profibus fieldbus port, the communication speed may reach 12Mbps.
When the system is constituted by a computer with multiple PLC constitute centralized management, decentralized control of distributed control network to complete large-scale complex control. Commonly referred to as SCADA systems, on-site and remote terminal PLC terminal can also be used for live machine. 5, man-machine interface function provides the operator to monitor machine / process work necessary information. Allows the operator and PC systems interacting with their applications, in order to make decisions and adjustments.

Means to achieve human-machine interface functions: from the grassroots operator screen text display, the stand-alone CRT display and keyboard operation and decentralized communication processor, a dedicated processor, a personal computer, industrial computers, and centralized operation and monitoring system. Use 6 different complexity, programming, debugging and other hand-held, portable and desktop programmer, and operator workstation screen, programming, debugging, monitoring, testing and records, and printing out the program files.

Second, the main features of the programmable controller
1, high reliability PLC’s MTBF is generally 40000 ~ 50000h above, Siemens, ABB, Panasonic and other micro PLC of up to 100,000 h or more, and have a sound self-diagnostic function to determine the fault quickly and easy to maintain. 2, the modular combination of flexible programmable controller series products, the module structure commonly used to accomplish different tasks combinations. I / O from 8 to 8192 points, there are a variety of models, a variety of function modules can be flexibly combined, structure is also diverse. 3, powerful PLC application of microelectronics and micro-computer, simply type have logic, timing, counting sequence control. The basic types plus analog I / O, the basic arithmetic operations, communications and so on. In addition to the basic types of complex types of functions, but also has a scalable computing power, multi-level terminal mechanism, intelligent I / O, PID regulation, process monitoring, network communications, remote I / O, multiple processors and high-speed data processing capability . 4, convenient programming PLC control suitable for industrial ladder, function block diagram, instruction list and sequential function chart (SFC) programming, without much knowledge of computer programming. The new programming workstation with a comprehensive software toolkit, and on any PC-compatible programming. 5, to adapt to the technical conditions of the industrial environment PLC can work under the general high temperature, vibration, shock and dust and other harsh environment, can work reliably under strong electromagnetic interference environment. This is the market value of existence PLC products. 6, installation and maintenance is simple compared with the computer system, PLC installation does not require special rooms and rigorous screening. When you use as long as connectivity to various devices is correct, the system can work with operating and fault indication means on each module, easy to find fault, most of the modules can be hot plug, the module can be replaced, so that users can in the shortest isolated time fault, and exclude, to maximize compression downtime, rapid recovery of production. Then repair fault module, which is particularly suitable for large-scale production situations.
Some PLC housing is made of an alloy that can operate under poor working conditions, with the simple structure, with a heat sink above, at high temperatures, unlike the housing plastic deformation, as also anti-radio frequency (RF high frequency) electromagnetic interference, fire and so on. 7, fast with microprocessor applications, so that the speed of the PLC faster, make it more in line with the processing speed of complex control tasks, the difference between it and the microcomputer is not very obvious. 8, the low weight of the total price of the PLC, volume, power, and hardware prices have been reduced, although the proportion of total software price has increased, but the manufacturers to compete also a corresponding reduction in prices. In addition, the use of PLC can also greatly shorten the design, programming and commissioning period, bringing the total price is further reduced.
PLC systems and industrial computer bus and DCS system of mutual penetration, mutual learn, compete and development. Promoting the progress of industry.
PLC fieldbus products face development, innovation will once again meet the higher needs of the industrial and civilian control. Third, communications and networking PLC communication between the PLC, including PLC, the communication between PLC and host computer and PLC and other intelligent devices. PLC system can be a general purpose computer or via the communication processing unit, a communication adapter connected directly to form a network to achieve the exchange of information and may constitute centralized management, decentralized control of distributed control system to meet factory automation (FA) systems development needs of each PLC or remote I / O module according to the functions of each place at the production site decentralized control, then using a distributed network system connected to form a network of centralized management.
Siemens company SIMATICNET example, in the Totally Integrated Automation (TIA) system concept proposed in its core content which includes integration and integrated communication configuration and programming of integrated data management. Communication networks are important, the key components of this system to provide inter-network components and improve the industrial communication.

SIMATICNET contains three main levels:
International standard AS-I network sensors and actuators communication scan time 5ms, the transmission medium is twisted pair, unshielded line length of 300m, a maximum of 31 slaves.
PROFIBUS industrial field bus, the international standard for the workshop and field level, the maximum transmission rate of 12m / s, the transmission medium is shielded two-wire cable (up to 9.6km) or cable (up to 90km), can connect up to 127 from station.
International standard industrial Ethernet networking for regional and unit, the network size of up to 1024 stations 1.5km (electrical network) or 200km (optical network).

In this network system, it is particularly worth mentioning is the PROFIBUS fieldbus, PROFIBUS field bus is one of the most successful, have been widely used. It is not dependent on the manufacturer, open field bus, a wide range of automation devices can exchange information through the same interface. A large number of manufacturers to provide high-quality products PROFIBUS, the user can freely choose the most suitable product. PROFIBUS has become the national standard DIN19245 German and European standards prEN50170, and in the world has the largest number of users. Four, PLC and industrial control computer (IPC) to compare and distributed control systems (DCS) 1, the origin of their computer technology to meet the rapid development of large amounts of data processing equipment required. Hardware structure, high degree of standardization of the bus, compatibility, rich software resources, especially the support of real-time operating system, so the requirements of fast, real-time control and computation model complex workload industrial objects advantage.

Distributed system development from the industrial automation instrumentation control systems to industrial control computer as the center of the distribution system, so its processing in the analog loop adjustment has certain advantages, mainly used in the initial stage continuous process control, focusing loop control functions.
PLC is evolved by the relay logic system, mainly used in discrete manufacturing, process control, instead of the initial main relay control system, switch the order of emphasis on control.

With the development of microelectronics technology, large scale integrated circuit technology, computer technology and communication technology, etc., PLC happened leap in technology and functionality. On the basis of the initial logic operation, an increase of numerical computation, loop adjustment and other functions, and adds analog PID control function modules; computing speed, CPU capacity to catch up with industrial control computer; enhance communications capabilities developed more species and local bus network (LAN), and thus can also be configured as a distributed system. Especially personal computer can also be absorbed into the PLC system.

PLC ladder programming rules

Although the ladder and relay circuit is similar in structure, elements, symbols and logic control functions and other aspects of phase, but they have many differences, the ladder program has its own rules.

1) Each logical line is always to the left from the bus, and then the contact is connected, the final termination of the coil or the right bus (right bus can not draw). Note: The bus between the left and the coil must be contacts between the coil and the right bus but you can not have any contact.

2) The ladder can contact any series or in parallel, but only in parallel to the relay coil and not in series.

3) the use of contacts unlimited number of times.

4) In general, the same coil can appear only once in the ladder. If in the program, the same coil is used twice or more times, known as “dual-coil output.” For the “dual-coil output”, some PLC treats it as a syntax error, and definitely not; some will be in front of the PLC output as invalid, only the last valid output; and some PLC, containing a jump or step ladder instruction allowed dual coil output.

5) For non-programmable ladder must be equivalent transformation into programmable ladder.
6) when there are several series circuit in parallel, the circuit with many serial contacts should be on the top, as shown in Figure 5-2a. There are several in parallel circuit in series, the circuit should be parallel contacts on the left, as shown in Figure 5-2b. Such a program compiled concise, less statements.

In addition, the input of the relay contacts in the design of the ladder according to the best state of all the input device is normally open to design more appropriate, less error-prone. Is recommended as an input device open with a constant contact with the PLC input terminal, the signal can only be used if some normally closed input, press input device is normally open to design, and then the ladder corresponding input relay contacts point negated (normally open into a normally closed, normally open normally closed change).

PLC ladder programming principles and programming methods

(1) Input / output relay, internal auxiliary relays, timers, counters and other devices of the contact can be used repeatedly, without complex program structure to reduce the use of contacts. (2) Each line ladder left the bus started, the coil terminates at the right bus. Contacts are not on the right side of the coil, as shown below

(3) In addition to stepping procedure, any coils, timers, counters, and other advanced instruction can not be directly connected to the left bus bar.
(4) In the process, does not allow the same number twice coil output (dual coil output). The following ladder is not allowed.

(5) does not allow the bridge circuit.

(6)Shall be prepared by the sequential program from top to bottom, from left to right to prepare the way. To reduce the number of steps in the implementation of the program, the program should be to the left and right big small big small.

(7) as an input device with a normally open contact

(8) PLC programming experience commonly Design
In the traditional relay – contactor control diagram and typical PLC based control circuit, based on the experience accumulated translation, revised and improved to give final control procedures.

How to read the S7-1500 CPU running time

Read S7-1500 CPU running time There are many ways, are described below in several ways.

1 reads out the running time by the startup parameters OB1 OB1 start in non-optimized run-time information with the OB1

The startup information passed to the global variable parameters can be read out of the CPU the last scan, minimum, maximum scan time, programming is very convenient.

2 Call RD_SINFO function reads the running time
If you are using an optimized OB1, simplified startup information without running the information shown in Figure 2, you must call the function reads

For example in OB1 RD_SINFO function reads the run time, the program shown in Figure 3. TOP_SI parameters for the current OB1 start information,
Data type SI_classic, need to manually type, ZI1 for the last scan time, ZI2_3 contains the minimum, maximum scan time, low-word minimum scan time,
The high word is the maximum scan time, the examples are transferred to MW10 and MW12. START_UP_SI start to warm start information of the OB,
Example, no reference.

3 Call RT_INFO function reads the running time
By function RT_INFO to be read out of the CPU running time

1,2,3 pattern can be read out by the CPU last scan, minimum, maximum scan time, in these three modes, the data type of the parameter INFO LTIME, can be read directly. You can also read out the percentage of uptime through other modes.

4 Call RUNTIME instruction read operation time
RUNTIME can be read out by CPU instructions directly from the parameter RET_Val running time, in seconds, MEM to save the program to run intermediate memory, two parameters are the type LREAL, in addition you can also read out a program run time

Siemens PLC S7 300/400 master relays orders

Main control relay (Master Control Relay), abbreviated as MCR. MCR Master relay command is used to control whether normal execution of the instruction in the region, equivalent to a connect and disconnect the flow of the main switch. MCR instruction is not much used, S7-200 is no MCR instruction.

MCRA to activate the master relay instructions, MCRD to deactivate the master relays orders.

Open the master relays orders MCR< in the MCR before you save the results of logical operations on the stack RLO (MCR), close the master relays orders MCR> MCR saved out of the stack in the RLO. MCR< and MCR> used to indicate controlled temporary power cord formation and termination.

MCR instructions can be nested, MCR the MCR can be another zone. MCR stack is a LIFO stack, allowing the maximum nesting depth of 8 levels.

MCRI0.2 control, I0.2 and MCR MCR in the stack level of the same State. MCR bit is 1 when will perform Q4.0 coil MCR control area and MOVE instructions. MCR bit is 0 when Q4.0 is 0.

Siemens plc S7 300/400 ladder logic blocks in calling instructions

CALL in the ladder diagram coil can call functions (FC) or system functions (SFC), the call cannot be passed parameters. Calls can be unconditional, CALL directly connected to the vertical line on the left side of the coil, equivalent to UC in the statement table orders; can also be conditional, condition provided by the control CALL contact circuits of coils, equivalent to CC in the statement table instructions.

Logical block is called if you need to pass parameters, you can use the command to invoke the function block in the box. FB 3-70 box in Figure 10 is the function that is being invoked, DB3 is called FB 10 o’clock block of background data.

Conditions for return instructions (Return,RET) appears as a coil, left logic for conditional block conditions provided by the contact circuit to control it, RET coil cannot be connected directly on the left of the vertical power cord. If you call it is the unconditional return, at the end of the block does not require the use of RET instruction.

FX2N series PLC analog I/O modules

(1) analog input module FX2N-2AD. The module is a 2channel voltage input (DC 0~10V,DC 0~5V) or current input (DC 4~20mA), 12-bit high accuracy resolution conversion speed for the 2.5ms/channel. This module occupies 8 I/O point applies FX1N and FX2N, FX2NC series.

(2) analog input module FX2N-4AD. The module has 4 input channel, 12-bit resolution. Select a current or voltage input, choose user wiring is to be achieved. Optional analog value from DC ± 10V (resolution of 5mV) or 4~20mA, and -20~20mA (resolution of 20 μA). Convert at a speed of up to 6ms/channel. FX2N-4AD using 8 I/O point.

(3) analog output module FX2NP2DA. This module is used to convert the 12-bit digital 2 analog outputs. Output can be in the form of voltage or current. Their choice depends on the wiring. Voltage output, two analog output channels of the output signal is a DC 0~10V,DC 0~5V current output for the DC 4~20mA, resolution of 2.5mV (DC 0~10V) and 4 μA (4~20mA). Digital to analog conversion characteristics can be adjusted, conversion speed for the 4ms/channel. This module requires 8 I/O points for FX1N and FX2N, FX2N series.

(4) analog output module FX2N-4DA~ which has 4 output channels, providing precision 12-bit high resolution digital inputs. Conversion speed is 2. 1ms/channel, the channel number will not change conversion speed. Other properties of the module is similar to FX2N-2DA.

(5) analog input module FX2N-4AD-PT. This module matches the PT100 temperature sensor, will come from the 4 foil temperature sensors (PT100,3 line, 100 ω) input signal amplification, and convert it into 12readable data that is stored in the main unit. Celsius and Fahrenheit data can be read. Internal temperature transducers and analog input circuit, can rectify the sensor‘s nonlinear. Read a resolution of 0.2~0.3 degrees Celsius. Conversion speed: 15 Ms/channel. All the data and parameter settings can be done through the FX2N-4AD-PT software configuration, realized by FX2N TO/FROM application instructions. FX2N-4AD-PT using 8 I/O points can be used for FX1N and FX2N, FX2NC subsystem.

(6) analog input module FX2N-4AD-TC. The module match the thermocouple type temperature sensor, from 4 thermocouple sensor input signal is amplified and converted to 12-bit data can be read, stored in the main unit. Celsius and Fahrenheit data can be read. Reading of the resolution type k is 0.2 deg c; type j for 0.3 c, can be used with k(100~1200℃) and j (100~600℃) supporting the use of thermocouples, 4 channel using k/j type, conversion speed for the 240ms/channel. All the data and parameter settings can be done through the FX2N-4AD-TC software configuration. This module takes up 8 I/O point.

FX2N series PLC position control module

In machine operation, speed and accuracy are often contradictory, in order to improve machine efficiency and increase speed, parking control there is a problem. So it is necessary to control. As a simple example, motor driven mechanical home by starting location, such as at top speed to return, due to the high speed stop inertia, the deviation in the home has to be large, slow down to ensure the accuracy of positioning.

Position control systems, often adopt servo motor and stepping motor driven device. Openloop control and closedloop control can be used. For stepper motors, we can adjust the send speed to change the machine‘s working speed of the pulse. With the FX series PLC, navigate through the pulse output of the unit or module, you can achieve the position of one or more points. FX2N series are described belowpulse output module and the control module.

(1) pulse output module FX2N-1PG. FX2N-1PG pulse generator unit can complete a separate axis of orientation, this is achieved through servo or stepper motor drive amplifier provides a specified number of pulses to achieve. FX2N-1PG is only used for FX2N series, with TO/FROM instruction set various parameters, and speed read out position value. The modules take up to 8 I/O point. Output up to 100kHz the pulse train.

(2) the controller FX2N-10GM. FX2N-10GM for pulse output unit, whether it is a singleaxis positioning unit, not only can handle single-speed, and interrupts location, and can handle complicated control, multi-speed operation. FX2N-10GM can have up to 8 connections on the FX2N series PLC. Maximum output is 200kHz.

(3) positioning controller FX2N-20GM. A FX2N-20GM controlled twoaxis, performs linear interpolation, circular interpolation or independent twoaxis positioning control. Maximum output pulse trains of up to 200kHz (interpolation period, a maximum of 100kHz).

(4) the programmable cam switch FX2N-1RM-E-SET. In the mechanical drive control, often to diagonal position detection, different at different position in terms of conduction, shutdown signal. Used mechanical cam switches, mechanical cam switches and high precision, but easy to wear. FX2N-1RM-E-SET programmable cam switches can be used to replace mechanical cam switches for high precision angle position detection. Complementary angle sensor cable length of up to 100m. Application and other programmable cam switches, brushless resolver high accuracy angle setting and monitoring its internal EEP-ROM, no batteries, can hold up to 8 different programs. FX2N-1RM-E-SET on the FX2N, can also be used independently. FX2N maximum 3. It takes 8 I/O point.

FX2N Series PLC data communication module

PLC communication module is used to complete with other PLC intelligent control, other communication between devices or computers. Following brief introduction to FX serial communication function expansion board, adapter and communication modules.

(1) communication expansion board FX2N-232-BD. FX2N-232-BD is to connect standard PLC and other RS-232C transport device interface board, such as personal computers, bar code reader, or printer. The panels can be installed inside the FX2N extension. The maximum transmission distance is 15m, the maximum baud rate for 19200bit/s. PLC using special software for the extension plate can be running monitoring, can also be transmitted from the PC to the PLC program.

(2) communication interface module FX2N-2321F. FX2N-2321F on connect FX2N series PLC can realize RS-232C with the other fullduplex serial communications interface devices, such as personal computers, printers, bar-code reading device and so on. FX2N series FX2N-2321F modules can connect up to 8 blocks. The module using FROM/TO command to send and receive data. Maximum transmission distance is 15m, the maximum baud rate for 19200bit/s. The modules take up to 8 I/O point. Data length and serial communication baud rate can be set by a special data register.

(3) communication expansion board FX2N-485-BD. FX2N-485-BD for RS-485 communication. It can be applied to no agreement on data transfer, FX2N-485-BD at the time of the original agreement, as a way, using RS instruction in personal computers, barcode reader, printer, data transfer between. Transmitting maximum transmission distance is 50m, the maximum baud rate for 19200bit/s. Each of the FX2N series PLC expansion boards can be fitted with a FX2N-485-BD communication. In addition to using this communication expansion boards and computer communications, it can also be used to achieve two parallel between FX2N series PLC.

(4) communication expansion board FX2N-422-BD. FX2N-422-BD to RS-422 communications, can be connected on the FX2N series PLC, and as a tool for programming or control a port. This interface is available outside of the PLC connected to PLC devices, data storage unit, and human-machine interface. FX2N-422-BD can be used to connect two data storage unit (DU) or DUseries unit and a programming tool, but one can only connect a programming tool. Every basic unit can be connected to a FX2N-422-BD and cannot be used with FX2N-485-BD or FX2N-232-BD.

(5) the interface module MSLSECNET/MINI

Use MSLSECNET/MINI interface module, series PLC of FX series PLC can be used as a local control station, constitute a distributed control system.

Above on the FXseries only gives a brief introduction to the communication module, specific application again in detail in later chapters.

Siemens S7-200 PLC programming examples – Belt conveyor control

To look many PLC Ladder Diagram is better for learn plc programming. you can learn the plc programming Thoughts and ideas. here is siemens s7200 plc rpgramming examples.
(1) control requirements
Motors M1, M2, M3 three drive belt conveyor.Press the start button SB1, start the order of M1, M2, M3, the interval of 3s.Press the stop button SB2, the order of the parking for M3, M2, M1, the interval of time is 3s. Three motors M1, M2, M3 respectively through the contactor KM1, KM2, KM3 connected three-phase AC power supply, with PLC control of the coil of the contactor.

(2)Address allocation table for programming elements
 Programming element
I/O terminals
(program address)
Circuit devices
(PT timer value)
 input relay
start button
Stop button
 output relay
M1 Contactor
M2 Contactor
M3 Contactor
Start first period of time
Start second period of time
Parking first period of time
Parking second period of time
Auxiliary relay
Parking holding first
period of time
Parking holding second period

(3)Ladder Diagram

PLC ladder programming

Siemens S7-300 Ladder Diagram PLC Programming Example-Control Belt

This PLC programming example is plc control belt

(1) Control requirements

Electric start belt,At the beginning of the belt has two push button switches: S1 for START and S2 for STOP;At the end of the belt also has two buttons switches: the S3 for START and STOP for the S4. You can start or stop the belt from either end. In addition, when an object on the belt reaches the end, the sensor S5 make  belt stop.

(2)Programming element symbolic address

Symbol Address
Absolute address
class type
Start button
Stop start button
Tail start button
Tail stop button

(3)Ladder diagram

PLC programming ladder diagram

Siemens PLC S7-300 Ladder Diagram Programming Example-pulse generator

Siemens plc S7-300 programming the timer can also be   a pulse generator.

(1) Control Requirements

The PLC program using a timer constitute a pulse generator,With two timers generate a pulse signal frequency of the duty cycle can be set

Timing diagram of the pulse generator

(2) Ladder Diagram

PLC Ladder Diagram

When the input I0.0 is 1, the output Q0.0 is 0 or 1 alternately, a periodic pulse signal for 3s, the pulse width is 1s.

STEP 7 hardware configuration tool HW Config

Select the SIMATIC manager on the left side of the station, double-click the right window of the “hardware” icon, open the hardware configuration tool HW Config

(1) hardware directory

You can use the menu command to “view”, “directory” or the button on the toolbar to open or close the hardware directory window on the right. Select a hardware directory in a hardware object, the hardware directory below the small window to see its brief information, such as the main function of the order number and module, etc..
CP hardware directory is a communication processor, FM is a function module, IM is the interface module, PS is the power module, RACK is the rack or guide rail. SM is a signal module, in which the DO, AI respectively is the digital quantity input module and the digital quantity output module, AO, DI respectively is the analog quantity input module and the analog quantity output module.

(2) hardware configuration window

Figure 2-20 the upper left window is the hardware configuration window, the window is placed in the host frame and the expansion of the rack, and use the interface module to connect them. PROFIBUS-DP network can also be generated in the window, and placed DP from the station on the network.

(3) hardware information display window

Select the hardware configuration window in a rack or DP slave station, the following hardware information display window will display the detailed information of the selected object, such as module order numbers, CPU firmware version number and in the MPI Network station address, and I / O module address and annotations. The upper left corner of the window button is used to switch the rack or DP slave station in the hardware configuration window.

how to get a signal PLC ladder program

PLC programming often need to use different commands to obtain different information on the switch
this is plc programming examples

1. Get information on the rising edge

To obtain information on the rising edge of the input signal by the transition instruction, contacts and trigger rising edge pulse

2. Get information falling edge

To obtain information on falling edge the input signal drops by contact and falling edge pulse trigger

3. Get level information

     If the button corresponding to the input port is normally open, the program can be obtained through a high level of information normally open contact, normally closed contact information to obtain Low level

PLC ladder programming Instruction control bits

        ① set and reset. When the condition becomes ON”, the set will be put in operation ON”, but not as output (OUT), when the condition becomes OFF”, the reset will not reset on the operation of OFF”. When the condition becomes ON”, the reduction in operation position reset OFF”, but does not output non-directive (OUT NOT), when the condition becomes OFF”, the reset will not reset on the operation ON”. In the following example, no matter how IR00100, IR00100 reset ON” IR20000 will reset when ON”, and can remain ON” until the IR00101 reset ON”. When IR00101 set ON”, the reset IR20000 reset OFF”. Set and

No function code set and reset. From the handheld programmer to enter them as FUN and SET key or FUN and RSET button, followed by the address.

       ② rise differential differential and the falling edge. Rise differential and the falling edge of the so-called differential refers to the input signal front porch and back operations. Rise differential differential command is used to enable and falling in a cycle time of the built-in ON”. In implementing the conditions OFF” to ON”, the rising differential instruction makes a cycle of operation ON”, in the implementation of conditions ON” to OFF”, the falling differential instruction makes a cycle of operation ON”. Both of these instructions requires only one line mnemonics.

Here, in IR00000 to ON”, IR20001 in a cycle will reset ON”. Then perform DIFU (13) 20001, no matter how IR00000, IR20001 will be OFF”. Falling edge differential instruction IR00001 to OFF” after (IR20002 OFF” until this time), the IR20002 will be built in a cycle ON”, and will be implemented in the next DIFD (14) 20002 post OFF”.
Rise differential and the falling edge of differential

       ③ maintain. Use directives to keep based on two perform conditional operations. Doing so will keep the instructions attached to two on the command line. When the first command line execution at the end of the condition for ON”, keep instructions operating position ON”. When the end of the second command line execution as ON”, keep instructions operating position OFF”. Even if it is located in the internal interlocking parts of the program, keeping the operation of the directive will save it to the ON” or OFF” State.
In the example shown in Figure 1-33, when IR00002 is ON” and IR00003 to OFF”, the HR0000 will be set ON”. HR0000 remain ON” until another IR00004 or IR00005 reset ON”. Keep instructions as the others, need more than one command line, the command line in the instruction encoding before they control.