Monday, September 21, 2020

PLC look-up table instruction ladder diagram

A look-up table is commonly found in the low level programming language - assembly. Likewise, in the high level programming language such as C, it's called an array.

In the PLC ladder diagram instruction, a look-up table is combined in only one instruction.

Look-up table instruction

  • A dest (destination) is any variable to copy the content to.
  • LUT[i] is a table with its index i.
The look-up table must have a name, a specific size i with its index i-1. When the input to this instruction true, it sends an element with a specific index to the destination. The overall parameters list below.


Parameters of look-up table instruction

In a simple ladder diagram below, I use this instruction to store a set of ASCII character. It's five in size. The element content of initial index 0 is 65 denotes the ASCII character 'A' and vice versa.

PLC look-up table instruction ladder diagram
Look-up table ladder diagram example


Every one second the PLC send the letter from A to E to the host PC over UART repeatedly. 

PLC look-up table instruction ladder diagram
Schematic Diagram

Click here to download this ladder diagram programming 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)