S7-1200 PLC jump and the use of label instructions

PLC jump and label instructions
PLC jump and label instructions

Some of the PLC instructions are program control instructions. The program control instructions include jump instructions used to change the order of program execution, and instructions used for control during program operation.
This article first introduces jump and label instructions.
For S7-200/200 SMART PLC, the only jump instruction is JMP, but for S7-1200 PLC, some new instructions are added, such as the jump instruction JMP_LIST that defines the jump list, and the jump branch Instruction SWITCH and so on, we will introduce the different places of the instruction. Let’s start now~

Learn complete physical and online PLC Training by the Best Technical Training Institute

Ask a question first?
What is a jump, and what function can be achieved by using a jump instruction?
The so-called jump is to skip a certain section of the program without executing it. The function of changing the execution order of the program can be realized by using the jump instruction. If we do not execute the jump instruction, each program segment is executed in order from top to bottom. When the jump instruction is executed, the jump instruction will stop the sequence execution of the program and jump to the program at the specified location. Start to execute down.

So how do we specify this location?

At this time we need to use label instructions!
Therefore, the jump instruction and the label instruction are used in pairs. When jumping, the CPU will no longer scan and execute the program between the jump instruction and the label instruction. This is what we need to pay attention to.
The jump instructions of S7-1200 PLC include logic structure jump instruction, jump instruction JMP_LIST that defines jump list and jump branch instruction SWITCH.
Let’s take a look at the functions of these commands respectively.

Jump instruction of logic result

When the logic operation result is 1, the jump instruction JMP is executed, and when the logic operation result is 0, the jump instruction JMPN is executed. The matching label command is LABLE, and the label number needs to be marked on the label command, which can be numbers, letters or Chinese characters. The jump instruction for S7-200/200 SMART PLC only has JMP and the matching LBL instruction, it is not a jump instruction based on the logic result, so there is no JMPN instruction, and for the label LBL instruction, S7-200/200 SMART PLC The label number can only be numbers, not letters and Chinese characters.

Define the jump instruction JMP_LIST of the jump list

The JMP_LIST instruction can define multiple conditional jumps, jump to the program of the label segment specified by the value of the K pin to continue execution, and the jump label number is specified at the output of the instruction box. We can increase the output pins by clicking the button on the command to increase the output pins, up to 32 pins, that is, DEST0~DEST31, so the value of K should also be in the range of 0~31. If it is not for these numbers, no jump is performed.
when the EN driving condition of the JMP_LIST instruction is met, it will jump to the corresponding label to start execution according to the value of K. The value of K is 1, which means that it jumps to the label _002 linked to the DEST1 pin. Start execution.

Jump branch instruction SWITCH

The SWITCH instruction is based on the results of one or more comparison instructions to define the jump to multiple program labels to be executed. The value to be compared is specified in pin K, and this value is compared with the value provided by each input pin. Compare, if the comparison condition is met, jump to the corresponding label and start executing the program.
when the value of K is equal to 47.0, it jumps to the 001 tag corresponding to the DEST0 pin to start execution, and when the value of K is equal to 24.6, it jumps to the 002 tag corresponding to the DEST1 pin to start execution, When the value of K is less than or equal to 14.9, it jumps to the 003 labels corresponding to the DEST2 pin to start execution. If the value of K does not meet the comparison results of the above three comparison conditions, it jumps to the ELSE tube Start execution at the 004 labels corresponding to the foot.
When we use jump instructions, there are some precautions that need to be paid attention to.

  1. The jump instruction can jump forward or backwards.
  2. You can only jump in the same code block, and cannot jump from one code block to another code block.
  3. The name of the jump label can only be used once in a block.
  4. Only one jump label can be set in a program break.

In the process of executing the jump, there is another problem. If the program after the jump execution hopes to be executed to the specified place, it can automatically return, and no longer execute it. What should I do at this time?
In fact, in this case, we can use another instruction-the return instruction RET to achieve. The return instruction RET can be used to control the execution of the program. When the RET instruction is executed, the execution of the code block is exited, that is, the RET instruction The following blocks will no longer be executed by the CPU.
Therefore, the jump instruction and the return instruction RET are used together to realize the selection and execution of the program segment.
For example, if you add this RET instruction to each label segment, after executing the program from this label to the RET instruction, you can automatically return without executing subsequent programs.
The above is the related content of the jump instruction of S7-1200 PLC. This instruction can be used for functions such as automatic hand switching. There are still many applications. You still need to master the use of this instruction!
In the next article, I will continue to introduce you to the control instructions at runtime. You can continue to pay attention to it~
(Original from Training Network, the author.

Leave a Comment

Your email address will not be published. Required fields are marked *

Our New Initiative alhumdulillah. Hostel Facility for Trainees.
This is default text for notification bar

of escort çukurova escort kozan escort seyhan escort yüreğir escort adana mutlu son masaj besni escort kahta escort gölbaşı escort adıyaman mutlu son masaj bolvadin escort dinar escort sandıklı escort emirdağ escort afyon mutlu son masaj diyadin escort doğubayazıt escort patnos escort ağrı mutlu son masaj ortaköy escort aksaray mutlu son masaj merzifon escort suluova escort taşova escort amasya mutlu son masaj çankaya escort keçiören escort yenimahalle escort mamak escort etimesgut escort sincan escort altındağ escort pursaklar escort gölbaşı escort polatlı escort çubuk escort kahramankazan escort beypazari escort ankara mutlu son masaj alanya escort manavgat escort serik escort antalya mutlu son masaj şehitkamil escort nizip escort ıslahiye escort antep mutlu son masaj ardahan mutlu son masaj artvin mutlu son masaj hopa escort borçka escort aydın mutlu son masaj efeler escort nazilli escort kuşadası escort söke escort didim escort incirliova escort çine escort germencik escort balıkesir mutlu son masaj karesi escort altıeylül escort edremit escort bandırma escort gönen escort ayvalık escort burhaniye escort bigadiç escort susurluk escort bartın mutlu son masaj batman mutlu son masaj kozluk escort sason escort beşiri escort bayburt mutlu son masaj bilecik mutlu son masaj bozuyuk escort bingöl mutlu son masaj solhan escort genç escort karlıova escort bitlis mutlu son masaj tatvan escort güroaymak escort ahlat escort bolu mutlu son masaj gerede escort burdur mutlu son masaj bucak escort bursa mutlu son masaj osmangazi escort yıldırım escort nilüfer escort inegöl escort gemlik escort mudanya escort mustafakemalpaşa escort gürsu escort karacabey escort orhangazi escort kestel escort iznik escort çanakkale mutlu son masaj biga escort can escort gelibolu escort ayvacık escort çankırı mutlu son masaj çerkes escort çorum mutlu son masaj sungurlu escort osmancık escort alaca escort iskilip escort denizli mutlu son masaj pamukkale escort merkezefendi escort çivril escort acıpayam escort tavas escort diyarbakır mutlu son masaj kayapınar escort bağlar escort yenişehir escort ergani escort bismil escort sur escort silvan escort çermik escort dicle escort düzce mutlu son masaj akçakoca escort kaynaşlı escort edirne mutlu son masaj keşan escort uzunköprü escort ipsala escort elazığ mutlu son masaj kovancılar escort karakoçan escort erzincan mutlu son masaj erzurum mutlu son masaj yakutiye escort palandöken escort aziziye escort horasan escort oltu escort pasinler escort odunpazarı escort tepebaşı escort eskişehir mutlu son masaj bulancak escort espiye escort tirebolu escort görele escort giresun mutlu son masaj gümüşhane mutlu son masaj kelkit escort hakkari mutlu son masaj yüksekova escort şemdinli escort hatay mutlu son masaj antakya escort iskenderun escort defne escort dörtyol escort samandağ escort kırıkhan escort reyhanlı escort arsuz escort altınözü escort hassa escort payas escort erzin escort yayladağı escort ığdır mutlu son masaj yalvaç escort eğirdir escort sarkıkaraağaç escort ısparta mutlu son masaj istanbul mutlu son masaj izmir mutlu son masaj buca escort karabağlar escort bornova escort karşıyaka escort konak escort bayraklı escort çiğli escort torbalı escort menemen escort gaziemir escort ödemiş escort kemalpaşa escort bergama escort menderes escort aliağa escort tire escort