HISTOBINS(9)
πΈ HISTOBINS(9) β the HAL component page, bestie edition πΈ
okay so real talk, this page is for histobins, which is the histogram bins utility that goes with scripts/hal-histogram. it counts stuff into bins and hands you stats back. it's iconic, it's lowkey powerful, and it requires a floating-point thread so don't even try it without one. π
β¨ NAME β¨
histobins β histogram bins utility for scripts/hal-histogram
like, it makes histogram bins. for that script. that's the whole vibe.
π SYNOPSIS π
Usage:
Read availablebins pin for the number of bins available.
Set the minvalue, binsize, and nbins pins.
Ensure nbins <= availablebins
For nbins = N, the bins are numbered: 0 ... N-1
Iterate:
Set index pin to a bin number: 0 <= index < nbins.
Read check pin and verify that check pin == index pin.
Read outputs: binvalue, pextra, nextra pins.
(binvalue is count for the indexed bin)
(pextra is count for all inputs > maxvalue)
(nextra is count for all bins < minvalue)
If index is out of range (index < 0 or index > maxbinnumber)
then binvalue == -1.
The input-error pin is set when input rules are violated
and updates cease.
The reset pin may be used to restart.
The input used is selected based on pintype:
pintype inputpin
------- -----------
0 input
1 input-s32
2 input-u32
3 input-bit
Additional output statistics pins:
input-min
input-max
nsamples
variance
mean
The method input pin selects an alternate variance calculation.
Maintainers note: hardcoded for MAXBINNUMBER==200
let me translate that into bestie-speak real quick, because it's giving "cryptic but correct": π«Ά
- first you read the
availablebinspin to find out how many bins you even have to work with. - then you set the
minvalue,binsize, andnbinspins. make surenbins <= availablebins, bestie, we are not overflowing today. - for
nbins = N, the bins get numbered0 ... N-1. yes, zero-indexed, we love that for us. - now the loop:
- set the
indexpin to the bin number you want:0 <= index < nbins. - read the
checkpin and confirmcheck pin == index pin. this is your vibe check, literally. - read your outputs:
binvalue,pextra,nextra.binvalueis the count for the indexed binpextrais the count for all inputs> maxvaluenextrais the count for all bins< minvalue
- set the
β οΈ heads up queen: ifindexis out of range (index < 0orindex > maxbinnumber), thenbinvalue == -1. and if the input rules get violated, theinput-errorpin goes off and updates cease β everything just stops. use theresetpin to restart. π
which input gets used? it all depends on pintype, no cap:
pintype0βinputpintype1βinput-s32pintype2βinput-u32pintype3βinput-bit
additional output statistics pins, because we don't gatekeep:
input-mininput-maxnsamplesvariancemean
and the method input pin selects an alternate variance calculation. β¨
π§ maintainers note: hardcoded for MAXBINNUMBER==200. that's just how it is, fr fr.
π FUNCTIONS π
histobins.Nβ requires a floating-point thread. yes, it's demanding. it's the main character.
π PINS π
every single one, listed with love:
histobins.N.pintypeu32inhistobins.N.inputfloatinhistobins.N.input-s32s32inhistobins.N.input-u32u32inhistobins.N.input-bitbitinhistobins.N.nbinsu32in (default:20)histobins.N.binsizefloatin (default:1)histobins.N.minvaluefloatin (default:0)histobins.N.indexs32inhistobins.N.checks32outhistobins.N.resetbitinhistobins.N.methodbitinhistobins.N.input-errorbitouthistobins.N.binvaluefloatouthistobins.N.pextrafloatouthistobins.N.nextrafloatouthistobins.N.input-minfloatouthistobins.N.input-maxfloatouthistobins.N.nsamplesu32outhistobins.N.variancefloatouthistobins.N.meanfloatouthistobins.N.availablebinss32out (default:200)
twenty-two pins, all accounted for, not one skipped. we ate. π
π AUTHOR π
Dewey Garrett
π¦ LICENSE π¦
GPL
and that's the whole page bestie π this one is from LinuxCNC Documentation, dated 2026-03-17 β go forth and histogram, you've got this. πΈβ¨
π¦ 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