Friday, September 25, 2020

PLC circular shift ladder diagram instruction

A shift instruction commonly found in the high level programming language such as C. Here in the PLC ladder diagram they include a circular shift instruction that support a carry bit. 

Circular shift left and right

The shift operation works in two directions - right and left. After the shift operation the data just change its position but all bits will not lost their value.

The operation of these two instructions

When the input to these instruction is true it start its circular shift operations with any specific position. The position is set in the operand2 of instruction property.

The circular shift left ROL instruction property

The circular shift right ROR instruction property

For a simple example I use these two instruction to chase the LEDs.



PLC circular shift ladder diagram instruction
Ladder diagram example

PIC16F876 uses most of its I/O pins to output the LED chasing.



PLC circular shift ladder diagram instruction
Schematic Diagram

Click here to see the folder of this working ladder diagram 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)