Industrial plc, about the timer ton,tof, a little new cognition, or wake up!

Source: Internet
Author: User

The timers in the PLC are placed in a specific PRG task unit, and the PRG unit needs to be placed in a specific periodic cycle task in order to be executed, and this cycle cycle task cycle T; The timing time of the timer T0; T and T0 The order of magnitude, or size determines the accuracy of the timer.

Ttest:ton;

Uicount:uint;

TTest (in: = Not ttest.q, PT: = t#2s);

IF TTEST.Q Then

Uicount: = uicount+10;

End_if

Situation one: T0 > > t (Timer T0 (seconds) time, greater than the task cycle time T (millisecond level)).

Because the task cycle is much smaller than the timer timing, the impact of the task cycle can be negligible for the timer.

Scenario Two: T0 < = T

Each of the 3 task cycles, the timer output once Q: = TRUE; it is not allowed to use timers to perform periodic tasks. The cause of this is that the timer is refreshed when the task is executed.

 

This is necessary to use the timer service is clear, so the short-term periodic task, or directly with the task cycle time interval is relatively accurate.

Industrial plc, about the timer ton,tof, a little new cognition, or wake up!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.