How does plc stop subroutine call _ specific operation parsing

PLC subroutine calling method

1. Enter the subroutine, please use the CALL instruction, that is, the FUN67 instruction. In the subroutine, use the label: LBL instruction is FUN65. After the subroutine is finished, please use the RTS instruction, that is, the FUN68 subroutine returns the instruction.

2, using the interrupt mode, the interrupt mode as long as the corresponding interrupt name, plus "I" as the interrupt subroutine tag, for example, do X rising edge interrupt input, X rising edge interrupt number is ";; X1 +, then the corresponding The interrupt tag is: X1I, so in the subroutine, use the FUN65:LBL instruction to specify: LBL X1I is the X1 input interrupt subroutine from the beginning of this tag. At the end of the interrupt subroutine, use the FUN69:RTI interrupt subroutine return to indicate the end.

The subroutine call instruction CALL is numbered FNC01. The operands are P0~P127, and this instruction occupies 3 program steps.

The subroutine return instruction SRET is numbered FNC02. No operands, taking up 1 program step.

As shown in Fig. 1, if X0 is turned on, it goes to the label P10 to execute the subroutine. When the SRET instruction is executed, it returns to the next execution of the CALL instruction.

How does plc stop subroutine call _ specific operation parsing

Figure 1 Subprogram call and return instruction use Note that when using subroutine call and return instruction:

1) The transfer label cannot be repeated, and it cannot be repeated with the label of the jump instruction; 2) The subroutine can be nested and called, and can be nested at up to 5 levels.

Note:

FEND is the main program end instruction, and END is the end of all programs.

Subprograms and interrupt routines are also executed after FEND, provided that there are subroutines called or interrupted.

Plc stop subroutine

How the PLC 200 pauses the running program until the pause signal is removed, and then runs the next steps.

In fact, there is a little trick to achieve your function, write the program into the subroutine, add a pause condition when calling MAIN, stop the call if you need to pause, resume the call when you want to restore!

Add a bit address that you have not used at the front end. Force 1 or 0. . A V address can be used to maintain power down. If you don't want to use computer forcing, you can use a PLC's DI point, such as the alternate point I5.2, to add it to the front end that needs to be paused, and you can control it externally. Similar to the emergency stop button!

Divide your program into several stages, using the flag M to distinguish

For example, M0.0 - M0.7 can represent 8 stages.

M0.0-M0.7 can be powered off every time it is powered on. So just judge the status of the flag to restore the work before the power is cut off.

If you stop calling a subroutine, the contents of any subroutine are not involved in your main program. The contents of this subroutine are maintained before your next call, or before the PLC is restarted.

Vape Pen 1600 Puffs

Cigfun vape box is a new developed disposable vape pen. The housing used two-color injection mold, blue sky and white, green and white, watermelon and white, purple and white, those are really attractive color design.


The mouthpiece is more comfortable to mouth and tongue, mesh coil vaporizer, 1.2ohm resistance, let you get big vapor and excellent e liquid taste. The innovative vaporizer technology keeps the same flavor from A to Z.


5ml juicy flavor pod capacity, 850mah cobalt battery, giving non-rechargeable feature.

Special made e juice, premium quality, no harmful substance when heating.

Grape Ice/ Energy Ice/ Blueberry Ice/ Watermelon Ice/ Cool Mint/ Banana Ice/ Cherry Ice/ Watermelon ice...more is coming! Customize supported!


Axiswell is the world's leading manufacturer of Vape Pens. Our business covers ENDS (Electronic Nicotine Delivery Systems) and other vaping devices, such as disposable vape, refillable vape pen, pod system, CBD vape pen, cbd pods, etc. We maintain factory price, good quality, providing vapers safe and competitive price vaping products.

Moreover, we're dedicated to establishing a healthy and sustainable environment for the whole vaping industry.

1500 Puffs Disposable Vape,1600 Puffs Vape,E Cigarette 1600 Puffs,Disposable E Cig 1500 Puffs,1500 Puff Bars

Shenzhen Axiswell Technology Co., Ltd , https://www.medhealthycare.com