The Sequeential Function Chart is a novel graphical programming language programmed with a process flow diagram. It is also a universally recommended tool for general purpose controllers in accordance with International Electrotechnical Commission (IEC) standards. Programming languages, now, are widely promoted and applied in the field of application of plc. Trolley Speaker,Bluetooth Trolley Speaker,Portable Speaker Trolley,Trolly Speaker With Mic GUANGZHOU SOWANGNY ELECTRONIC CO.,LTD , https://www.jerry-power.com
The advantages of using SFC for PLC application programming are:
1. The order of actions of the device can be visually seen in the program. Because the SFC program is written according to the action sequence of the device (or process), the program has strong regularity, is easy to read, and has certain visibility.
2. It is easy to find the location of the fault when the equipment fails.
3. It is easier to design and maintain the system without complicated interlocking circuits.
According to the International Electrotechnical Commission (IEC) standards, the standard structure of SFC is:
Step + action or command in this step + directed connection + conversion and conversion condition = SFC, see Figure 1:
figure 1
The running rule of the SFC program is: starting from the initial step, when the transition condition of each step is established, the current step is changed to the next step, and all the steps are ended when the END is encountered.
Most PLC manufacturing companies now provide relevant programming software for their industrial control products in order to use the computer to achieve online programming. The programming software GX Developer (version 8.34) provided by Mitsubishi provides the SFC programming method, but because the related books and learning materials can not keep up, many beginners do not know if using the software for SFC programming, this gives The vast majority of beginners learn PLC application programming brings inconvenience. Here, based on the knowledge we have learned and mastered, we will explain how to use the GX Developer software to program SFC according to the programming manual provided by Mitsubishi. It provides an opportunity for beginners to master the SFC programming method.
I. Single-flow structure programming method Single-flow structure is the most common process structure in sequential control. Its structural characteristics are that the program follows the process step, step by step is performed backwards, and there is no branch in the middle. Mastered the single-process SFC programming method, which is the door to SFC. Here, we take "two-lamp automatic flicker signal generation" as an example to explain the introduction of SFC programming.
Example: Dual-lamp automatic flicker signal generation. Requirement: After the PLC is powered on, its outputs Y0 and Y1 are alternately flashed at intervals of one second. The ladder diagram and instruction list of this example are shown in Figure 2.
In GX Developer, a complete SFC program consists of the initial state, directed segment, transition condition and transfer direction (see Figure 3), so our programming is complete to obtain these components.
According to the PLC's tutorial, the SFC program is mainly composed of several states, such as initial state, general state, and return state. However, in programming, these states are written in different ways, which requires attention. The SFC program starts from the initial state, so the first step in programming is to set the appropriate start conditions for the initial state. In this example, the first line of the ladder diagram shows how to start the initial step. In the SFC program, the initial step is started in ladder mode.
Start the program input in the software below.
Figure 2 flashing signal ladder diagram and instruction list
Figure 3 flashing signal SFC program
1. Start the GX Develop programming software, click the "Project" menu, click the Create New Project menu item or click the New Project button. See Figure 4.
Figure 4 GX Develop programming software window
2. The pop-up dialog box for creating a new project is shown in Figure 5. The CPU and PLC of the Mitsubishi series should be selected to match the programming code of the corresponding series, otherwise it is easy to make mistakes. The main thing described here is the PLC of the Mitsubishi FX2N series. Therefore, you need to select and input the following items:
a. Select FXCPU in the PLC series drop-down list box;
b. Select FX2N(C) in the PLC Type drop-down list box;
c. Select SFC in the program type item;
d. Set the project name and save path in the project settings. After completing the above items, click OK.
Figure 5 new project creation
3. After completing the above work, the block list window shown in Figure 6 will pop up.
Figure 6 Block List Window As shown in the figure, double-click the zeroth block.
4. After double-clicking the zeroth block or other block, the block information setting dialog box will pop up as shown in Figure 7.
Figure 7 Block Information Settings Dialog Here, there is an entry window for selecting the type of block editing. There are two options: SFC block and ladder block.
In programming theory, we learned that the SFC program starts from the initial state, so the initial state must be activated, and the general method of activation is to use a ladder program, and this ladder program must be placed at the beginning of the SFC program. Similarly, in the later SFC programming, the activation of the initial state needs to be performed by a ladder program placed in the first part of the SFC program (ie, the first block), which is a point to note. Therefore, you should click on the ladder block here, fill in the description title of the block in the block title bar, or leave it blank.
5. Click the Execute button to pop up the ladder editing window as shown in Figure 8. In the right ladder editing window, enter the ladder diagram that starts the initial state.
It has been learned in programming theory that the activation of the initial state is usually done by using the auxiliary relay M8002, or by other contact methods, which only needs to be established by establishing a parallel circuit between them. In this example, we use the power-on pulse of the auxiliary relay M8002 of the PLC to make the initial state effective.
In the ladder editing window, click the zeroth line input to initialize the ladder diagram. As shown in Figure 9, enter the completion and click the “Transform†menu to select the “Transform†item or press the F4 shortcut key to complete the ladder diagram transformation.
Figure 8 ladder editing window
Figure 9 ladder editing window
Figure 10: The ladder input completion window needs to be noted. In the process of programming the SFC program, the ladder diagram must be changed after each ladder is completed, so that the next step can be performed. Otherwise, an error message will pop up.
Figure 11 error message
6. After completing the editing of the first block (ladder block) of the program, double-click "Program"\"MAIN" in the project data list window to see Figure 10, and return to the block list window as shown in Figure 6. Double-click the first block, select SFC in the block type column in the pop-up block information setting dialog box as shown in Figure 12. In the block header, you can fill in the corresponding title or fill in nothing. Click the execute button to pop up the SFC program editing window. See Figure 13. The cursor changes to a hollow rectangle in the SFC program editing window.
Figure 12 block information settings
Figure 13 SFC program editing window
7. Editing of conversion conditions.
Each state or transition condition in the SFC program appears in the program in the form of an SFC symbol. Each SFC symbol has an icon and an icon number. Now enter the condition that causes the state to shift.
In the SFC program editing window, move the cursor to the first transition condition symbol (as marked in Figure 13) and click. The ladder editing window will appear on the right side, where you can enter the ladder diagram that shifts the state. The reader can see from Fig. 13 that the T0 contact drives not the coil but the TRAN symbol, which means transfer, which draws attention. In the SFC program, all transitions are represented by TRAN and cannot be represented by the SET+Sâ–¡ statement, otherwise an error will be signaled. ()
The editing of the conversion condition ladder diagram can be completed according to the requirements of PLC programming, according to the above description. It should be noted that after each condition is edited, the F4 shortcut key should be converted. After the conversion, the ladder diagram is changed from the original gray. It turns bright white. After the conversion is completed, the question mark (?) in front of the SFC program editing window will disappear.
8, the editing of the general state.
In the SFC program editing window on the left, move the cursor down to the bottom of the direction line and press the tool button in the toolbar. Or click the F5 shortcut to pop up the step input setting dialog box as shown in Figure 14.
Figure 14 SFC symbol input Enter the step label and click OK. At this time, the cursor will automatically move downward. At this time, you can see that there is a question mark (?) in front of the step icon number. This indicates that this step has not been trapped yet. The image is edited, and the ladder edit window on the right is grayed out and also indicates that it is not editable. See Figure 15.
The following is a ladder programming of the general process steps. Move the cursor to the step number symbol. After clicking on the step symbol, the window on the right will become editable. Now, you can enter the ladder in this ladder editing window. It should be noted that the ladder diagram here refers to which output coils are to be driven when the program runs to this step. In this example, the general-purpose #p# page title #e# to be obtained now.
Figure 15 The state step 20, which has not yet been edited, is to drive the output coil Y0 and the T0 coil. See Figure 2 for the ladder diagram and the instruction list.
In the same way, all the general states of the control system are edited in one cycle. It should be noted that in this editing process, after editing a general step, it is no longer necessary to operate "program"\"MAIN" and return to the block list window (see Fig. 6), and perform block list editing again, but In an initial state, SFC graphics editing is performed directly.
9, system cycle or periodic work editing.
During the execution of the SFC program, there will be an editing problem of returning or jumping without exception, which is necessary to perform periodic loops. To use the jump symbol in the SFC program, you need to use Or (JUMP) instruction plus target number for design.
Now return to the initial state edit as shown in Figure 16. The input method is: move the cursor to the bottom of the direction line, press the F8 shortcut or click Button, fill in the pop-up dialog box with the destination step number to jump to, and then click the OK button.
Figure 16 Jump symbol input description: If there is a selection branch in the program, it should also be represented by JUMP+ "label".
After inputting the jump symbol, we will see in the SFC edit window that there is a small black dot in the block diagram of the step symbol pointed to by the jump return, which means that this step is the target of the jump return. This is also convenient for us to read the SFC program, see Figure 18. (Source of information http://)
10, the program changes.
After all the SFC programs have been edited, we can click the change button to convert (compile) the SFC program. If the block information setting dialog box pops up during the transformation, you can ignore it and click the execute button. If the transformed program is successful, it can be simulated or written to the PLC for debugging.
If you want to view the sequential control ladder diagram corresponding to the SFC program, we can do this by clicking Project\Edit Data\Change Program Type to change the data (see Figure 19).
Figure 18 Complete SFC program
After the data conversion execution change data type is shown in Fig. 19, it can be seen that the ladder program converted by the SFC program is shown in Fig. 20.
Figure 20 Ladder diagram after transformation: The above describes the method of programming a single-sequence SFC program. Through learning, we have basically understood the input method of state symbols in the SFC program. Two points need to be emphasized: (1) Ladder diagram design is still required in the SFC program; (2) All state transitions in the SFC program need to be represented by TRAN.