Topic: DMD0147

GOTO - Go To Label


The Go To Label (GOTO) instruction causes an immediate branch to the Label specified in the instruction and continues the PLC scan at that point in the ladder logic program.

 

The Go To Label (GOTO) instruction can only reference Labels that exist in the same Program or Task as the GOTO instruction.

 

The Go To Label (GOTO) instruction can target a Label that is located before the GOTO instruction in the program which effectively creates a repeating loop. The target Label can also be located after the GOTO instruction in the program which will skip over all of the intervening ladder logic.

 

A Go To Label (GOTO) instruction that is within a FOR/NEXT, WHILE/WEND, or REPEAT/UNTIL loop cannot target a label that is outside of that loop. This means that a Go To Label (GOTO) instruction cannot be used to prematurely break out of a loop; use a BREAK or CONTINUE instruction to do this.

 

A Go To Label (GOTO) instruction cannot target a label that is in a different stage.

 

Placing the Label BEFORE the GOTO in the code-block this will make the Go To Label (GOTO) a looping construct, which will make this a Yielding instruction

 

Note: This instruction is a 'power-rail' instructions. Even though the instruction is displayed in the left-most column of the ladder diagram (the power rail), it is created in the right-most column of the ladder logic diagram (the output column). Creating these instructions in Do-more Designer is a bit counter-intuitive because the first step is to position the edit cursor in the output column of the ladder logic diagram (the far right) instead of positioning it against the power rail (the far left).

 

Parameters:

Note: Use the F9 key (Element Browser) or Down-Arrow key (Auto-Complete) at any time to see a complete list of the memory locations that are valid in the current field of the instruction.

 

Label - the number of the target Label to immediately branch to. This can be any constant value between 0 and 65535.

 


See Also:

 


Rung Example: