LATENCYBINS(9)

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

πŸ’– NAME πŸ’–

latencybins β€” it's a HAL component, and honestly? it's the comp utility for scripts/latency-histogram. That's the whole vibe. ✨


🌸 SYNOPSIS 🌸

okay bestie, here's the whole flow, verbatim, do not skip:

Usage:
  Read availablebins pin for the number of bins available.
  Set the maxbinnumber pin for the number of Β± bins.
    Ensure maxbinnumber <= availablebins
    For maxbinnumber = N, the bins are numbered:
       -N ... 0 ... + N bins
    (the -0 bin is not populated)
    (total effective bins = 2*maxbinnumber +1)
  Set nsbinsize pin for the binsize (ns)
  Iterate:
    Set index pin to a bin number: 0 <= index <= maxbinnumber.
    Read check pin and verify that check pin == index pin.
    Read output pins:
         pbinvalue is count for bin = +index
         nbinvalue is count for bin = -index
         pextra    is count for all bins > maxbinnumber
         nextra    is count for all bins < maxbinnumber
         latency-min is max negative latency
         latency-max is max positive latency

   If index is out of range ( index < 0 or index > maxbinnumber)
   then pbinvalue = nbinvalue = -1.
   The reset pin may be used to restart.
   The latency pin outputs the instantaneous latency.

Maintainers note: hardcoded for MAXBINNUMBER==1000

let me translate that into bestie-speak real quick, because the vibe is: πŸ‘‘

  • peep the availablebins pin first β€” that tells you how many bins you even have to work with
  • then you set maxbinnumber, which decides how many Β± bins you get
  • ⚠️ and fr fr, make sure maxbinnumber <= availablebins β€” that's not a suggestion, that's the rule
  • when maxbinnumber = N, the bins are numbered from -N all the way through 0 to + N
  • the -0 bin is NOT populated (she's empty, she's a myth, don't go looking)
  • total effective bins = 2*maxbinnumber +1, math girlies stay winning πŸ’…
  • next you set nsbinsize for the binsize, in ns
  • then you're in the loop: set index to a bin number where 0 <= index <= maxbinnumber
  • read the check pin and make sure check pin == index pin (trust but verify, always)
  • then read your output pins: pbinvalue is the count for bin +index, nbinvalue is the count for bin -index, pextra is the count for all bins > maxbinnumber, nextra is the count for all bins < maxbinnumber, latency-min is the max negative latency, and latency-max is the max positive latency

and if index is out of range (so index < 0 or index > maxbinnumber)? then pbinvalue = nbinvalue = -1. πŸ’€ iconic fail state, honestly.

the reset pin restarts everything, and the latency pin just outputs the instantaneous latency. easy.

🫢 Maintainers note: hardcoded for MAXBINNUMBER==1000

⭐ FUNCTIONS ⭐

  • latencybins.N

πŸŽ€ PINS πŸŽ€

the whole pin lineup, no skips, no cuts:

  • latencybins.N.maxbinnumber s32 in β€” (default: 1000)
  • latencybins.N.index s32 in
  • latencybins.N.reset bit in
  • latencybins.N.nsbinsize s32 in
  • latencybins.N.check s32 out
  • latencybins.N.latency s32 out
  • latencybins.N.latency-max s32 out
  • latencybins.N.latency-min s32 out
  • latencybins.N.pbinvalue s32 out
  • latencybins.N.nbinvalue s32 out
  • latencybins.N.pextra s32 out
  • latencybins.N.nextra s32 out
  • latencybins.N.variance s32 out
  • latencybins.N.availablebins s32 out β€” (default: 1000)

πŸ’œ AUTHOR πŸ’œ

Dewey Garrett β€” we stan 🫢


🌈 LICENSE 🌈

GPL


and that's the whole page, bestie, you ate it up πŸ’…βœ¨ this was LATENCYBINS(9), from the LinuxCNC Documentation crew, dated 2026-03-17 β€” mwah, go run it, you got this πŸ‘‘πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from