TON(9)
π 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.Nis the instance number, okay? so if you loadedcount=3you getton.0,ton.1,ton.2. multiple timers, multiple vibes, no cap.
π PINS π
ton.N.inbit 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.qbit out β the output signal. this is the glow-up of the input, just... later. delayed by the delay. time is a construct andtonis the construct's manager. β°ton.N.etfloat 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.ptfloat 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: theNin all those pin and function names is the instance, so every timer you spin up gets its ownin,q,et,pt, and its ownton.Nfunction 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
- ubuntu resolute: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- ubuntu stonking: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms