Sunday, September 13, 2020

PLC time to counter converter Tcont ladder diagram instruction in LDMicro

Ladder diagram time to counter converter (Tconst) instruction converts the timer value and converts it to a counter value, that will be store in its Tcont constant. 

Tconst Symbol

This instruction has two important parameters- name and delay.

Property setting of Tconst

With a specific PLC cycle time, we can find the counter value as follow,

Tcont Counter = (Tconst delay)/(PLC cycle time)

For example, 

  • PLC cycle time = 10 mS
  • Tconst delay = 10 ms
Then the Tconst counter = (10 mS)/(10 mS) = 1
Similarly, if we set the Tconst delay = 50 mS then the Tconst counter = 5.

With a typical example, we use a count up counter (CTU) instruction to count an input from a contact. This counter is set to output true whenever it's greater than Tconst. Tconst delay is set to 50 mS, then its counter value is 5 constant.

PLC time to counter converter Tcont ladder diagram instruction in LDMicro
Timer to counter converter instruction example

With a one shot rising OSR, Tconst run only once at beginning of PLC starting up. X0 is a user input to increase the value of CTU. The CTU will output true whenever it is greater than or equal to Tconst (that is 5).

Xreset is a user input to reset CTU. Click here to download this 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)