TIME(9)

πŸ’– time(9) β€” HAL Component πŸ’–

okay bestie, listen up. this is time from the HAL Component section 9 of the manual, and honestly? it's giving clock energy. it counts time in hours, minutes and seconds so your machine can be cute and punctual. let's get into it πŸ•βœ¨


✨ NAME ✨

time β€” Time on in Hours, Minutes, Seconds

like, it's a timer. it times things. the vibes are immaculate. ⏱️


🌸 SYNOPSIS 🌸

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

yes that's the whole thing. load the realtime component, optionally with count=N or names=name1[,name2...]. slay. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Time

okay so here's the whole plot. when either the time.N.start or time.N.pause bit goes true, the cycle timer resets and starts to time β€” and it keeps going until time.N.start AND time.N.pause both go false. πŸŽ€

when the time.N.pause bit goes true, timing is paused until time.N.pause goes false. that's it. that's the pause.

⚠️ but bestie, listen, this next bit matters: if you connect time.N.start to halui.program.is-running and leave time.N.pause unconnected, the timer will reset during a pause. it's giving chaotic. the example connections below explain it better, so keep reading 🫢

Time returns the hours, minutes, and seconds that time.N.start is true.

here's some sample PyVCP code to display the hours:minutes:seconds. it's very cunty actually:

<pyvcp>
  <hbox>
  <label>
    <text>"Cycle Time"</text>
    <font>("Helvetica",14)</font>
  </label>
  <u32>
      <halpin>"time-hours"</halpin>
      <font>("Helvetica",14)</font>
      <format>"2d"</format>
  </u32>
  <label>
    <text>":"</text>
    <font>("Helvetica",14)</font>
  </label>
  <u32>
      <halpin>"time-minutes"</halpin>
      <font>("Helvetica",14)</font>
      <format>"2d"</format>
  </u32>
  <label>
    <text>":"</text>
    <font>("Helvetica",14)</font>
  </label>
  <u32>
      <halpin>"time-seconds"</halpin>
      <font>("Helvetica",14)</font>
      <format>"2d"</format>
  </u32>
  </hbox> </pyvcp>

then, in your post-gui.hal file, you might use one of the following to connect this timer. pick your fighter πŸ₯Š

for a new config:

loadrt time
addf time.0 servo-thread
net cycle-timer        time.0.start <= halui.program.is-running
net cycle-timer-pause  time.0.pause <= halui.program.is-paused
net cycle-seconds pyvcp.time-seconds <= time.0.seconds
net cycle-minutes pyvcp.time-minutes <= time.0.minutes
net cycle-hours pyvcp.time-hours <= time.0.hours

if you're on an older setup β€” pookie, previous to this version, if you wanted the timer to keep running during a pause instead of resetting, you had to use a HAL NOT component to invert the halui.program.is-idle pin and connect it to time.N.start, like this:

loadrt time
loadrt not
addf time.0 servo-thread
addf not.0 servo-thread
net prog-running not.0.in <= halui.program.is-idle
net cycle-timer time.0.start <= not.0.out
net cycle-seconds pyvcp.time-seconds <= time.0.seconds
net cycle-minutes pyvcp.time-minutes <= time.0.minutes
net cycle-hours pyvcp.time-hours <= time.0.hours

and for those of you who already have this setup, you can simply add a net connecting time.N.pause to halui.program.is-paused:

net cycle-timer-pause time.0.pause <= halui.program.is-paused

easy upgrade, no notes. πŸ’–


πŸ”₯ FUNCTIONS πŸ”₯

  • time.N (requires a floating-point thread) β€” yes it needs a float thread, don't fight it. it's a main character with standards. πŸ‘‘

πŸ‘‘ PINS πŸ‘‘

  • time.N.start bit in β€” Timer On
  • time.N.pause bit in (default: 0) β€” Pause
  • time.N.seconds u32 out β€” Seconds
  • time.N.minutes u32 out β€” Minutes
  • time.N.hours u32 out β€” Hours

that's the whole pin lineup, no cap. the bit ones go in, the u32 ones come out, and time.N.pause starts at 0 like a good lil default. ✨


πŸ’œ AUTHOR πŸ’œ

John Thornton, itaib, Moses McKnight

legends, honestly. periodt. πŸ™Œ


🌈 LICENSE 🌈

GPL


so yeah! that's time(9), documented by the LinuxCNC Documentation crew, dated 2026-03-17. go forth and time your cycles, bestie β€” i'm obsessed with you understanding this now. mwah πŸ’‹πŸŒΈβœ¨

πŸ“¦ where this page comes from