TON Timer — Sysmac Studio Timer Functions

Görkem Güray
4 min readSep 29, 2022

--

TON Timer is one of the Timer function in Sysmac Studio. Timer functions in Sysmac Studio are used to control time dependent operations. For example, if we want an output to be activated 2 seconds after certain conditions are met, we can easily do this with a Timer function.

There are 5 types of Timer Functions in Sysmac Studio. These;

TON Timer (On-Delay Timer)

Ladder Diagram :

Structured Text (ST) :

TON_instance (In, PT, Q,ET);

After the In input is activated, the Q output becomes active as much as the value written to the PT input. The duration of the timer can be followed from the ET output.

A 5-second TON is used in the GIF above. 5 seconds after the A contact is triggered, the abc output has become active. After the TON Timer is active, how much time has passed can be followed from the def variable. After A contact became FALSE, abc output also became FALSE.

But what if contact A had gone FALSE before 5 seconds had elapsed?

As can be seen from the variable def, A contact has switched to FALSE state at about 4 seconds of TON Timer. In this case, the abc output was never active and the def variable was reset and the TON Timer was reset.

The TON Timer outputs TRUE when the set time elapses after the timer starts. The time is set in nanoseconds.

The timer starts when timer input In changes to TRUE. Elapsed time ET is incremented as time elapses.

When ET reaches set time PT, timer output Q changes to TRUE. ET is not incremented after that.

The timer is reset when In changes to FALSE. ET changes to 0, and Q changes to FALSE.

If In changes to FALSE after the timer is started, the timer is reset even before ET reaches PT.

The following figure shows a programming example and timing chart for a PT of T#10 ms. Variable abc will change to TRUE 10 ms after variable A changes to TRUE.

Things to Pay Attention

  • The timing error for which Q is TRUE for PT is -100 ns to (100 ns + 1 task period). The above range includes the following:
  • The ±100 ns is the timing error of ET.
  • Time ET is judged to check if it reaches PT every task period. If time ET reaches PT immediately after the judgment is completed, there is a delay of one task period.
  • Time ET is judged to check if it reaches PT every task period. If time ET reaches PT immediately after the judgment is completed, there is a delay of one task period.
  • The time is displayed in increments of 0.001 ms on the Sysmac Studio, but the timing accuracy is 1 ns.
  • The timer starts as soon as operation starts if In is already TRUE.
  • If T#0 ms or a negative number is set for PT, Q will change to TRUE as soon as the value of In changes to TRUE.
  • You can change the value of PT while the value of In is TRUE. Operation is as follows:
  • If this instruction is in a master control region and the master control region is reset, the timer is reset. The value of ET changes to 0, and the value of Q changes to FALSE.
  • If this instruction is used in a ladder diagram, the value of Q changes to FALSE when an error occurs in the previous instruction on the rung.

You can also read this article in Turkish.
Bu yazıyı Türkçe olarak da okuyabilirsiniz.

Originally published at https://gorkem.co on September 29, 2022.

--

--