Mitsubishi PLC programming to realize the reading time timer

Publisher:SereneMelodyLatest update time:2024-10-21 Source: elecfansKeywords:Mitsubishi Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Mitsubishi PLC (Programmable Logic Controller) is a device widely used in the field of industrial automation. It controls machines or production processes through programming. In many applications, time control is an important function, and the timer is a key component to achieve time control. This article will introduce in detail how to use Mitsubishi PLC programming to read out the time timer.


1. Basic concepts of timers

A timer is a device used to measure time intervals. It can implement functions such as delay and timing in PLC programs. In Mitsubishi PLC, timers are generally divided into two categories: T (basic timer) and D (data block timer).


1.1 Basic Timer (T)

The basic timer is the simplest type of timer, which uses a 16-bit counter to implement the timing function. The main features of the basic timer are as follows:

  • Timing range: 0.1ms to 3276.7ms (for T0~T199).

  • Timing accuracy: 0.1ms.

  • Timer type: T0~T199.

1.2 Data Block Timer (D)

The block timer is a more advanced timer type that uses data blocks (such as D0, D1, etc.) to store timing values. The main features of the block timer are as follows:

  • Timing range: 0.1ms to 3276.7s.

  • Timing accuracy: 0.1ms.

  • Timer type: D0~D7999.

2. Timer programming instructions

In Mitsubishi PLC, timer programming mainly uses the following instructions:

2.1 ST (Start Timing)

The ST instruction is used to start the timer. Its basic format is as follows:

ST T#time{ DPL}
  • T#time: timer number and timing time.

  • DPL: Data block timer number.

2.2 DT (Stop Timing)

The DT instruction is used to stop the timer. Its basic format is as follows:

DT T{ DPL}
  • T: timer number.

  • DPL: Data block timer number.

2.3 PLS (Pulse Output)

The PLS instruction is used to output a pulse signal. Its basic format is as follows:

PLS T#time Y
  • T#time: timer number and pulse width.

  • Y: Output relay.

3. Timer Programming Example

The following is a simple timer programming example to implement a delay control function.

3.1 Example Requirements

Suppose we need to control a motor so that it stops after a delay of 5 seconds after starting.

3.2 Programming steps

  1. Define input and output: Assume the start button is X0, the stop button is X1, and the motor control relay is Y0.

  2. Write startup logic:

// When the start button is pressed, start the timer
IF X0 THEN
ST T#5000
END_IF
END_IF

END_IF

  1. Write the stop logic:

// When the stop button is pressed, stop the timer and turn off the motor
IF X1 THEN
DT T
Y0 := OFF
END_IF
END_IF

END_IF

  1. Write delay control logic:

// When the timer reaches the set time, turn off the motor
IF T0 THEN
Y0 := OFF
END_IF
END_IF

END_IF

4. Advanced Application of Timer

In addition to basic delay control, timers can also be used for more complex applications, such as periodic control, time accumulation, etc.

4.1 Periodic Control

Periodic control is the repetition of an action at a certain time interval. This can be achieved by using two timers: one to control the execution of the action and the other to control the interval between the actions.

4.2 Time Accumulation

Time accumulation is the process of adding up time over multiple time periods. This can be achieved by using multiple timers and accumulators.

5. Notes

  1. Timer number: Make sure timer numbers are not repeated.

  2. Timer Type: Select the appropriate timer type according to your needs.

  3. Timer accuracy: Be aware of the timer's accuracy limitations.

  4. Timer overflow: For basic timers, pay attention to the overflow problem of the 16-bit counter.


Keywords:Mitsubishi Reference address:Mitsubishi PLC programming to realize the reading time timer

Previous article:How to use Mitsubishi PLC time to control
Next article:How to display timer time in Mitsubishi PLC

Recommended ReadingLatest update time:2024-11-15 15:58

What is a hard PLC? Characteristics of a hard PLC
What is a hard PLC? Strictly speaking, a hard PLC is a hardware or a dedicated ASIC chip that implements the execution of PLC instructions. A soft PLC uses some general-purpose CPUs or MCUs to implement the interpretation or compilation of PLC instructions. PLCs like Mitsubishi (FX) and Omron are mostly hard P
[Embedded]
What is the Siemens PLC variable table? Introduction to the structure of the PLC variable table
Introduction Each PLC tag table contains a tags tab and a user constants tab. The default tag table and the "All tags" table also include a "System constants" tab. Structure of the "PLC tags" tab In the "Tags" tab, you declare the global PLC tags required in your program. The following f
[Embedded]
What is the Siemens PLC variable table? Introduction to the structure of the PLC variable table
Functions of Mitsubishi PLC special soft components
What are the special functions of the M8000 and M8013 bits of Mitsubishi PLC? Both are special soft components. M8000 is the PLC operation monitoring, which means that the PLC is turned on and is set in the RUN state. It can be used as a driving condition for instructions, and can also be used in the external displa
[Embedded]
Functions of Mitsubishi PLC special soft components
Understanding of PIC watchdog timer WDT (watch dog timer)
The Watch Dog Timer of the PIC microcontroller is an on-chip self-oscillating RC oscillator timer that does not require any external components. This means that even if the oscillation on the chip OSC1/OSC2 stops (for example, after executing the SLEEP instruction), the WDT will still keep timing. A WDT timing overflo
[Microcontroller]
STC15 series MCU timer components
/**  * File name: timer.h  */   #ifndef _TIMER_H #define _TIMER_H   #define SYS_MCLK 11059200 //System main clock #define FOSC 11059200 //Crystal oscillator frequency       #define USING_T0 #define USING_STC15_T2       #ifdef USING_T0 extern uint8_t tmr0LowByte, tmr0HighByte; void tmr0_init(uint8_t ms); #endif      
[Microcontroller]
Development of PLC Program for Converting 64-bit Floating Point Numbers to 32-bit Floating Point Numbers
Our S7-200SMART PLC does not support the doublefloat data type and needs to be converted into a float type before it can be used for calculations. Definition of floating point numbers Before writing the conversion program, we need to understand the definition of IEEE floating point numbers:
[Embedded]
Development of PLC Program for Converting 64-bit Floating Point Numbers to 32-bit Floating Point Numbers
SIMATIC S7-1500 PLC startup organization block and its application
Startup Organization Block and Its Application The startup organization block (Startup) is executed once when the PLC's operating mode switches from STOP to RUN. After the startup organization block scan is completed, the main program cycle organization block (such as OB1) will be executed. The following exampl
[Embedded]
SIMATIC S7-1500 PLC startup organization block and its application
A brief discussion on Modbus communication between S7-1200PLC and V20 inverter
1. Find an S7-1200PLC with RS485 communication module and a V20 inverter. 2. Connect the RS485 module to the V20 inverter. The wiring method is to connect the red wire to P+ and the green wire to N-. 3. Set the inverter parameters of V20. 4. Create a TIA Portal project and upload the hardware co
[Embedded]
A brief discussion on Modbus communication between S7-1200PLC and V20 inverter
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号