TON(9)

πŸ“¦
version 2.9.4 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’… TON(9) β€” the IEC TON timer, bestie edition

okay so this is a HAL component called ton (short for the IEC TON timer, not the other ton, we don't talk about the other ton 🌸). what does it do? it delays the rising edge on a signal. that's it. that's the whole job. and it does it beautifully. ✨

it lives in section 9 of the manual, and it's a HAL Component, so you already know it's giving real-time electronics girlie energy. πŸ‘‘


✨ NAME ✨

ton β€” IEC TON timer β€” delay rising edge on a signal πŸ’–

like. the signal goes up, and ton is like "hold on babe, not yet" and then after the delay it goes up too. lowkey iconic behaviour honestly.


πŸŽ€ SYNOPSIS πŸŽ€

loadrt ton [count=N|names=name1[,name2...]]

so you load it with loadrt, and then you either say count=N (gimme N of these please, don't care what they're called) or names=name1[,name2...] (gimme these exact ones, i have a naming vision πŸ’…). you can't do both β€” pick a lane bestie 🫢


πŸ¦‹ FUNCTIONS πŸ¦‹

  • ton.N β€” Update the timer. that's the function, that's what it does. heads up though: this one requires a floating-point thread β€” it will NOT run in an integer thread, so don't even try it, it's not that kind of party. 😭
the .N is the instance number, okay? so if you loaded count=3 you get ton.0, ton.1, ton.2. multiple timers, multiple vibes, no cap.

🌈 PINS 🌈

  • ton.N.in bit in β€” the input signal. this is the thing you're watching. when it rises, the timer starts, and the whole countdown drama begins. πŸ‘€
  • ton.N.q bit out β€” the output signal. this is the glow-up of the input, just... later. delayed by the delay. time is a construct and ton is the construct's manager. ⏰
  • ton.N.et float out β€” elapsed time since rising edge, in seconds. so you can literally watch the seconds tick by. main character countdown energy. it's giving suspense. πŸ“

🌸 PARAMETERS 🌸

  • ton.N.pt float rw β€” delay time in seconds. read-write, so you can change your mind mid-run, we support that here. πŸ’œ this is the "how long are we waiting" dial and you are the DJ. 🎧

🌟 AUTHOR 🌟

Chad Woitas. yes, an actual real person wrote this, go give them their flowers πŸ’


πŸ‘‘ LICENSE πŸ‘‘

GPL. the good one. the free one. use it, share it, keep it free. periodt. πŸ’–


little reminder bestie: the N in all those pin and function names is the instance, so every timer you spin up gets its own in, q, et, pt, and its own ton.N function to update it. no shared state, no drama, no cross-talk. we love a clean boundary. 🧚

anyway that's the whole page, you understood all of it, you're literally a HAL girlie now, i'm so proud of you πŸ₯Ή


with love, from the LinuxCNC Documentation, dated 2026-03-17 β€” that's the LinuxCNC Documentation gals, version date and all, signing off πŸŽ€βœ¨ bye bestie!! 🫢

πŸ“¦ where this page comes from