Thursday, September 24, 2020

PLC equal comparison ladder diagram instruction

Just like other programming language, math comparison instruction is always existed. In ladder diagram these kinds of instruction built in symbols rather than a text.

A list of ladder diagram instruction symbols

We have six comparison instructions list above,
  1. if equal
  2. if not equal
  3. if greater than
  4. if less than
  5. if greater than or equal
  6. if less than or equal
When the input to the instruction is true, it make a comparison between two operands as set in its property. This instruction will output true whenever the result of the comparison returns true.

For a simple example to test this instruction, I use the if equal ladder diagram instruction to compare between the preset characters and the received characters from UART. If the comparison is true the program will turn on/off the output coil.



PLC equal comparison ladder diagram instruction
Ladder diagram example

In this example we use internal set and reset output coils to control an external output coil.



PLC equal comparison ladder diagram instruction
Schematic diagram

Click here to download the zip file of this working 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)