Sunday, September 13, 2020

PLC counter ladder diagram instruction in LDMicro

In ladder diagram of LDMicro a counter instruction increases is value up on the input change from false to true. LDMicro classifies a counter into two categories - counter and circular counter. Here, we discuss about a counter only. 

A counter divides into two instructions - Counter Up (CTU) and Counter Down (CTD) instruction.

CTU and CTD instruction

Counter Up (CTU) instruction

A CTU increases its content by one whenever its input changes from false to true. This instruction output true when ever its content rolls over the preset value.
A property setting of CTU
  • Name - CTU identifier
  • Start value - CTU initial value
  • True if - set the value of output true condition from CTU
  • Input kind - '\' for true to false and '/' for false to true.

Counter Down (CTD) instruction

Similarly, a CTD decrease its content whenever its input change state. It output true whenever its content drop below the preset value.

CTD instruction property

A simple ladder diagram example shows a CTD that output true when its decrement content is less than -3.
CTD ladder diagram example

Here MCU selection is not important. It could be any target up ton the user. Click here if you wish to download the ladder diagram 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)