
A sequence control process can be divided into several stages, also called steps or states, and each state has different actions. When the transition conditions between two adjacent states are met, the transition will be realized, that is, the transition from the previous state to the next state will be executed.




We often use the state transition diagram (menu diagram) to describe this sequential control process. Record each state with state meter S, and X is the transition condition. If X1 is ON, the system changes from S20 state to S21 state.
Each step in the state transition diagram contains three contents: the content driven by this step, the transition conditions and the transition target of instructions.
Step drive Y0. When X1 is effectively ON, the system changes from S20 state to S21 state. X1 is the conversion condition, and the conversion target is S21 step.
3. Instructions for step command
1) STL contact is a normally open contact connected to the left bus. If a STL contact is connected, the corresponding state is dynamic step;
2) The contact connected with STL contact shall apply LD or LDI command and return to the left bus only after executing RET
3) STL contact can directly drive or drive the coil of Y, M, S, T and other components through other contacts;
4) Since PLC only executes the circuit block corresponding to the active step, double coil output is allowed when STL command is used (sequence control program can drive the same coil multiple times in different steps);
5) MC and MCR commands cannot be used in circuit blocks driven by STL contacts, but CJ commands can be used;
A function is a collection of functional code blocks. For example, we can calculate two numbers and write them into a function, so a function is a functional code block with a certain meaning. In our daily work, we habitually write the reused code block into a function, which is convenient for reading and understanding, and also simplifies the code amount.
Functions actually use scopes. Generally, functions can be used globally by default. We can also limit functions to only work in a fixed task or a module. This involves the scope of functions, which I will discuss with you in the next chapter.
All functions must have a function name. The function name and variable name have the same rules, that is, the arrangement and combination of letters and arrays. Of course, the first character must be a letter. We can't name functions too long or too short. I remember that there was an old professor in school who taught us the microcontroller, He likes to name programs with handwritten letters in Chinese Pinyin. For example, the name of the function "JQRDD" below is "machine machine human power off". You will find it very difficult to look at his programs, especially the functions without comments are a disaster. The funny thing is that the old man bought a number of "80C51" for his car. There is hardly anyone else. I suggest you name "Robot_Power_Off" this way, or you can directly name "RobotPowerOff" without underlining. Roast about that old man. The main advantage of the function is that it can be executed any number of times at the place where it is needed. If the code function cannot be written, our project will be written in the Main function, which will be a huge daily account. As a saying goes, it will take a while to rewrite the crematorium. Everyone should do what they want.
Another advantage of the function is that it is convenient for development, testing and maintenance. For example, if you add some functions to a function or modify a bug that was missed before, as long as the input and output of the function do not change and the logic is correct, the part of the previous program that calls the code will not be affected. Of course, you can add a "V2" or "New" after the name of the modified function. The problem is, how to name the modified function next time? "V3" or "New_New". I have seen many colleagues write this before, but later they found it wrong. They directly thanked "Year Month Day" after the function. At that time, I saw that just like Nezha, "eyes were in the sand".
Of course, if you are too lazy to follow the above principles, in order that you can still see the code you wrote in the past, you can make a note at the beginning of another function and write the following lines: When we write the first robot code in ABB RAPID, most people start from the Main function. "Mian" is the function name, that is, the function header of the function, followed by the function body, Our function.
If ABB RAPID has no returned function, it will write "PROC" and "ENDPROC" directly, and the style is similar to that of VB.
When we can add parameters to the function header, we can also let the function return results. "PROC" function is a function format that does not return results, and the function format that returns is "FUNC". I will share it with you later in this chapter. The discussion in the previous two sections is actually enough to deal with most of the situations, even 99% of the situations, in our work. However, there are always some situations that are difficult for us. For example, we have written a function to send data to the upper computer. Previously, it was sent through the serial port. Now, the customer wants to send data through the network cable, but my program framework has been written. Just modify the function to send data separately, As a result, the next customer requires both functions and can switch freely. This time, you may feel that you can write two programs and use them. But if you master the following programming skills, you will find that your life has changed. Your boss appreciates you, your colleagues respect you, and the aunt who cooks in the canteen will not shake her hand.
The following is our interesting programming syntax sugar, "Swith" keyword, optional parameters.
We still use the previous example, the addition of two data. Now we need to change it to the same function, which can achieve addition and also can calculate the subtraction of two data. Although subtraction is a special addition, we still need to tell the robot how to operate when programming. Without much to say, code directly:
6) The STL instruction cannot be used in interrupt programs and subprograms.
As a digital transformation expert in the field of global energy management and automation, Schneider Electric has always been paying attention to the growth and sound development of small and medium-sized enterprises, and opened the first quarter of the "Green Intelligent Manufacturing Win Plan" in 2020.英维思(3008, 3625, 3508E.3721, 3700A 4351B)
本特利(3500/42M, 3500/ 22M, 3500/ 95.3500/05)
黑马(F3330, F3236, F6217, F7126, F8621A)
福克斯波罗(FBM203, FBM204, FBM217, FMB231)
AB: (1746 1747 1756 1770 1771 1785触摸屏2711系列CPU PLC)
普罗索芙特PROSOFT MVI46/56/69, AB旗下,跟AB模块
瑞恩RELIANCE模块,卡件
飞利浦EPRO MMS6210/ 621…. PR6423/003-031
美尔托Meltal MT1102-02-00, MS3101-00-00, MS3102-01-00
横河YOKOGAWA AAI, ADV, ADI, ANB, AMM, SB, PW(型号开头),卡件模块(CPU,电源,输出,PLC)
摩尔MOORE Q开头, 3开头模块,像电视显示器
你的满意是我们不懈的追求;
你的口碑相传是对我们好的回报;
我们赚合理利润,做长久生意,交真心朋友;
现货+优势+正 品,价道,保证。GE CP238TA
GE IS200EPSMG2ADC
GE IS215ACLEH1A
GE VMIVME-4140
GE IC698CMX016
GE VMIVME-2510B
GE SM128V
GE V7768-320001 350-9301007768-320001 A2
GE IS220UCSAH1A
GE IS230TNPAH2A
GE 2214-30SLQTA
GE SR469-P5-HI-A20-E
GE IC697BEM731
GE IC698CPE020
GE IC695CRU320
GE IS420UCSBH4A
GE D20ME-VME
GE DS200FGPAG1A
GE IS200EPSMG1AEC
GE IS420UCSBH4A
GE IS220YDIAS1A
GE IC698CPE020
GE VMIVME-2510B
GE SR469-P5-HI-A20
GE IC697CPX928-FE
GE DS200SDCCG1AGD
GE IS200EGDMH1ADF
GE IC670CHS002底座
GE IC660BBD110
GE DS200LDCCH1AGA
GE HYDRAN M2
GE IS200SDIIH1ADB MRP683026
GE DS200DSPCH1ADA
GE IS200STCIH2A
GE ACC-5595-208
GE DS200KLDBG1ABC
GE IC695ALG616
GE 531X307LTBAJG1
GE DS215DMCBG1AZZ03A
GE DS200TCQCG1BKG
GE DS200ADPBG1ABB
GE DS200DCFBG1BGB
GE IC660ELB912G
GE DS200SDCCG5AHD
GE DS215TCQAG1BZZ01A
GE IS200JPDDG1AAA
GE IS230TDBTH6A
GE DS200SDCIG2AHB
GE IS200TDBTH6ABC
GE IS210AEDBH4AGD
GE IS220PAOCH1A
GE IS200STAOH2AAA
GE IS210AEBIH1BED
GE IS230STAOH2A
GE DS200SDCIG2AHB
GE IC670MDL930J
GE DS200TCTGG1AFF
GE VMIVME-5565-110000
GE IS200VTCCH1CBB
GE 369-HI-R-M-0-0-0-0
GE DS200SDCIG1ABA
GE DS200RTBAG2AFB
GE DS200DPCBG1AAA
GE DS215KLDCG1AZZ03A
GE UR6AH
GE 369-HI-0-M-F-E-0
GE DS200TCQAG1BHF
GE IC697MDL653
GE VMIPMC-5565
GE UR8GH
KOLLMORGEN PRD-P320260Z-C2
GE SR469-P5-HI-A20-E
GE IS200VAICH1DAB
BERGER LAHR WPM311.03401
GE IC693MDL753
GE DS200ADGIH1AAA
GE IS220PDIAH1B
GE VMIVME-4140
GE V7768-322001
GE IS230SNIDH1A MRP689579
GE DS200IIBDG1A
GE R-TPD3
GE VMIVME-7700
GE DS215DMCBG1AZZ03A
GE UR8HH
GE 369-HI-0-0-0-0
GE IC697ALG320
GE IC698RMX016-ED
GE IC698CPE010
GE 05701-A-0511
GE UR8CH
GE WESDAC D20ME
GE DS200LDCCH1ANA
GE IC660BBD101
GE SR469-P5-HI-A20
GE IC754VSI12CTD
GE DS200LDCCH1AGA
GE SR469-P5-HI-A20-H
GE IS220PPRFH1B
GE IC690RFH008
GE UR9KH
GE DS200SDCCG1AFD
GE VMIVME-7807
GE IC697MDL750
GE IS200ISBBG2AAB
GE IC670MDL740
Kollmorgen BJRL-20012-110001
ABB PFTL201C 10KN 3BSE007913R10
ABB PFTL201C 10KN 3BSE007913R0010
ABB 5SHY3545L0009
ABB PPD113B03-26-100110
ABB PPD113-B03-10-150000
ABB 5SHY4045L0006
ABB PPD113-B03-23-111615
ABB PFCL201C 10KN
ABB PM645B
ABB 5SHY3545L0014
ABB DSDP140B 57160001-ACX
ABB PM630
ABB 07AC91D
ABB 5SHX2645L0004
ABB SPHSS13
ABB PPD113B01-10-150000
ABB PFTL101B 2.0KN
ABB SC520M 3BSE016237R1
ABB PPD113B01-10-150000
ABB CCI541V1 3BSE014666R1
ABB DSPC172H
ABB 800PP846A
ABB DSDI303 57160001-CX
ABB DSDI304 57160001-DB
ABB DSDI306 57160001-CM
ABB DSDI451 57160075A
ABB DSDI452 57160075E
ABB DSDI453 57160075-AB
ABB DSDI454 57160075-Y
ABB DSDO110 57160001-K
ABB DSDO115 57160001-NF
ABB DSDO120 57160001-AX
ABB DSDO131 57160001-KX
ABB DSDO140 57160001-DO
ABB DSDO301 57160001-CC
ABB DSDO303 57160001-CS
ABB DSDO304 57160001-U
ABB DSDO305 57160001-CG
ABB DSDO308 57160001-LV
ABB DSDP110