Wednesday, September 23, 2020

PLC GOTO and LABEL ladder diagram instruction

The GOTO instruction command the PLC program to jump to a specific rung. Rung may have a LABEL or may not.

When the input goes to this rung is true, it causes the program to rung N or any rung with the label.

For example GOTO(N),

  1. When N==0, the program jumps to the beginning to the PLC cycle. It clear the watch dog timer, then it continuous to rung 1.
  2. When N==0, the program jumps to the address 0. It's a soft reset of the PLC program.
  3. When N is any label, the program jumps the the rung with that label.
For more information, click here to see the original post from GitHub.

For an introductory example, I use the GOTO instruction to jump to rung 4 of PLC ladder diagram.

PLC GOTO and LABEL ladder diagram instruction
GOTO LABEL ladder diagram example

In the ladder diagram example above, 

  • At rung 1, the program is commanded to skip the two remanding rungs 2 and 3. 
  • It jumps to rung 4 and stay there until the next reset.
This ladder program could be considered as non-sense. However, we can make a circuit just of leisure.



PLC GOTO and LABEL ladder diagram instruction
Ladder Diagram Example



The result of this program shown below.

PLC GOTO and LABEL ladder diagram instruction
Ladder diagram program simulation result

Since rung 2 and 3 are skipped, these rungs are not active. The program jumps to rung 4, activating the output coil that connect to RC2 of PIC16F876A.


Click here to download the zip file of this example.

No comments:

Post a Comment

Labels

ADC (10) Analog (14) Arduino (12) Atmega16 (19) Audio (2) AVR (20) Charger (1) Cortex-M0 (1) Counter (10) CPLD (25) Digital I/O (22) Display (34) EEPROM (2) Environment Sensor (1) esp8266 (2) Experiment Board (10) I2C (4) Interrupt (7) LCD (1) LDmicro (29) measurement and instrumentation (7) Microchip Studio (3) MikroC (1) One-Shot (3) OpAmp (1) PCB (31) PIC16 Microcontrollers (16) PIC16F877A (2) PIC16F887 MikroC (22) PLC (35) PWM (11) Regulator (1) RTC (2) Sensor (8) Shift Registers (5) SPI (5) Timer (34) UART (2) ultra-sonic sensor (1) USB (1) VHDL (21) xc8 (1) XC95108 (9) XC9536 (15) XC9572 (1) Xilinx (23) Xilinx ISE (22)