Siemens PLC Programming Skills Sharing

Publisher:DelightfulGazeLatest update time:2024-01-31 Source: elecfansKeywords:Siemens Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Unified program structure

OB1: main program;

OB100: Initialization program (no need to call the main program);

OB35: 100ms (modifiable) interrupt (no need to call the main program), can call the PID module;

OB80, OB82, OB85, OB86, OB87, OB121, OB122: fault diagnosis module (no need to call the main program, no need to program);

FC1: system mode;

FC2: input processing;

FC3: output processing;

FC4: Run processing;

FC5: stop processing;

FC6: manual-automatic switching;

FC100: Later used to create some subroutines that can be called cyclically;

FC105: system built-in, analog input subroutine (can be called cyclically);

FC106: System built-in, analog output subroutine (can be called cyclically);

Modbus communication (CP341): FB7: P_RCV_RK, FB8: P_SND_RK;

Communication CP340: FB2: P_RCV, FB3: P_SND;

General PID: use FB41;

Temperature and humidity PID: use FB58;

If the program block overlaps with the system block, avoid it.

2. Data Block

DB1: AI data, type: REAL, interface with host computer;

DB2: AO data, type: REAL, interface with host computer;

DB3: DI data, type: BOOL, interface with host computer;

DB4: DO data, type: BOOL, interface with host computer;

DB5: Equipment running time and flow accumulation, type: REAL, interface with host computer;

DB6: alarm message, type: BOOL, interface with host computer;

DB7: Type: REAL, intermediate register;

DB8: Type: INT, intermediate register;

DB9: Type: WORD, middle register;

DB10: Type: BOOL, intermediate register;

DB11: used for communication with the device, such as MODBUS communication, etc.

DB100: Later used as background data block when calling FB block;

M area: also serves as an intermediate variable.

3. DP slave fault diagnosis

The DP slave station must perform fault diagnosis and fault alarm, which can be done using FB125.

1. Control mode

1. System settings remote/local/manual buttons

1.1. Remote control: The system can only be started/stopped automatically through the host computer. Local control of a single device is preferred. When program control is in progress, the device can be switched between manual and automatic operation and started/stopped manually through the host computer.

1.2. Local: The system can only be automatically started/stopped through the touch screen. Local control of a single device is given priority. When program-controlled, the device can be switched between manual and automatic operation and started/stopped through the touch screen.

1.3. Manual: During manual control, the host computer/touch screen is invalid and the device can only be started/stopped manually.

2. Single device control

A single device must have the function of soft manual/automatic switching and start/stop during soft manual operation. When switching from automatic to soft manual operation, the device cannot be shut down; when switching from soft manual operation to automatic, the start/stop of the device depends on the automatic program.

3. Single device

(Pumps, fans and other large equipment) must be rotated after running for 24 hours, and the running time must be accumulated, unless the start/stop sequence is set by the host computer, which is set by the operator;

2. Programming skills

1. Make the program blocks as detailed as possible for easy reading, and put the same type of device controls in one program block;

2. If language programming is used under special circumstances, in most cases, ladder diagram programming should be used to facilitate reading by others;

3. For frequently called subroutines, they can be made into submodules and called frequently, for example: finding the average of several numbers or the maximum of several numbers;

4. The program must be annotated, and the variables and intermediate variables must be described to facilitate others to read or refer to it later;

5. Back up the program regularly, preferably with project name + system name + today's date;

6. The program is encrypted to prevent others from stealing.

Siemens PLCs are classified according to the control scale: they can be divided into large, medium and small machines.

Minicomputer: The control points of a minicomputer are generally within 256 points, which is suitable for single-machine control or small system control.

Siemens minicomputers include S7-200: processing speed 0.8~1.2ms; memory 2k; digital quantity 248 points; analog quantity 35 channels.

Medium-sized machine: The control points of a medium-sized machine are generally no more than 2048 points. It can be used to directly control the equipment and monitor multiple next-level programmable controllers. It is suitable for medium or large control systems.

Siemens mid-range computers include S7-300: processing speed 0.8~1.2ms; memory 2k; digital quantity 1024 points; analog quantity 128 channels; network PROFIBUS; industrial Ethernet; MPI.

Mainframe: The control points of a mainframe are generally greater than 2048 points. It can not only complete more complex arithmetic operations but also perform complex matrix operations. It can not only be used to directly control the equipment, but also monitor multiple next-level programmable controllers.

Siemens mainframes include S7-400: processing speed 0.3ms/1k words;

Storage: 512k; I/O points: 12672.


Keywords:Siemens Reference address:Siemens PLC Programming Skills Sharing

Previous article:Application of AI/AO Cards in PLC System
Next article:Siemens S7-300 PLC wiring diagram

Recommended ReadingLatest update time:2024-11-16 09:18

What is a cold start and a hot start? What is the difference between a hot start and a cold start of a Siemens PLC?
Siemens' OB100, OB101, and OB102 represent warm start, hot start, and cold start respectively. Let us explain these methods. 01 Warm start (complete restart) Complete restart startup type, when starting, the process image and non-retentive flag memory, timer and counter are cleared, the retentive flag
[Embedded]
Introduction to Siemens PLC programming language
PLC currently has 5 standard programming languages, including graphical programming languages ​​and textual programming languages. Graphical programming languages ​​include: Ladder Diagram (LD), Function Block Diagram (FBD), Sequential Function Chart (SFC). Textual programming languages
[Embedded]
Introduction to Siemens PLC programming language
Siemens TIA Portal: How to record signal status in LAD interlocking
The same defined sequence must be followed for the recording of actual or initial values ​​as well as for the operand lists of the symbol table in the PLC code view. The following example shows how to record signal states in LAD interlocking and how to list operands on the HMI device. Record all sign
[Embedded]
Siemens TIA Portal: How to record signal status in LAD interlocking
Siemens TIA Portal PLC: Implementation of GRAPH sequence controller call
Calling the GRAPH FB The following figure shows the call of the GRAPH FB: ① The status information of the sequence controller and each parameter as well as the status information of each step and transition condition are stored in the "GRAPH_Sequence_DB". ② You can switch off
[Embedded]
Siemens TIA Portal PLC: Implementation of GRAPH sequence controller call
Siemens PLC serial communication method
1. RS485 serial communication Most third-party devices support it. Siemens S7 PLC can control serial port communication by selecting free port communication mode. In the simplest case, only send command (XMT) to send information to third-party devices such as printers or inverters. No matter what the situation,
[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号