SAMPLER(9)
β¨ SAMPLER(9) β the sampler page, HAL User's Manual edition π
okay bestie, buckle up, we're doing realtime data capture and it's honestly iconic π
πΈ NAME πΈ
sampler β grab data from HAL in real time, no cap, just vibes and timestamps β¨
π¦ SYNOPSIS π¦
loadrt sampler depth=depth1[,depth2...] cfg=string1[,string2...]
π DESCRIPTION π
so sampler and halsampler(1) are literally a duo, a dynamic, a main character team-up π«Ά You use them together to sample HAL data in real time and stash it in a file.
Here's the tea: sampler is the realtime HAL component. It exports HAL pins, creates a FIFO in shared memory, and then just starts sampling data from the HAL and dropping it into that FIFO, nonstop, like it's got somewhere to be.
Then halsampler shows up β it's non-realtime, it's chill β and it copies data out of the FIFO to stdout. From there you can redirect it to a file or pipe it to some other program. slay π
β¨ OPTIONS β¨
depth=depth1[,depth2...]β sets the depth of the realtimeβnon-realtime FIFO thatsamplercreates to buffer the realtime data. You can pass multipledepthvalues separated by commas if you need more than one FIFO (say, because you wanna sample data from two different realtime threads π).cfg=string1[,string2...]β defines the set of HAL pins thatsamplerexports and later samples data from. You gotta supply one string for each FIFO, separated by commas.samplerexports one pin for each character in the string. The legal characters are:F,f(float pin)B,b(bit pin)S,s(s32 pin)U,u(u32 pin)
π₯ FUNCTIONS π₯
sampler.Nβ one function is created per FIFO, numbered from zero. that's it, that's the function π§
π PINS π
sampler.N.pin.Minput β the pin for the data that's gonna wind up in column M of FIFO N (and in column M of the output file). The pin type depends on the config string, iykyk.sampler.N.curr-depths32 output β the current number of samples sitting in the FIFO. When this hitsdepth, new data starts overwriting old data and some samples get lost π farewell, data.sampler.N.fullbit output βTRUEwhen FIFO N is full,FALSEwhen there's still room for another sample.sampler.N.enablebit input β whenTRUE, samples get captured and placed in FIFO N; whenFALSE, no samples are acquired. Defaults toTRUE.
π PARAMETERS π
sampler.N.overrunss32 read/write β the number of timessamplertried to write data to the HAL pins but found no room in the FIFO. It increments wheneverfullis true, and you can reset it with thesetpcommand.sampler.N.sample-nums32 read/write β a number that identifies the sample. It's automatically incremented for each sample, and you can reset it with thesetpcommand. The sample number can optionally be printed in the first column of the output fromhalsampler, using the-toption (seeman 1 halsampler).
π SEE ALSO π
halsampler(1), streamer(9), halstreamer(1)
π AUTHOR π
Original version by John Kasunich, as part of the LinuxCNC project. Improvements by several other members of the LinuxCNC development team. legends, honestly π«Ά
π REPORTING BUGS π
Report bugs at https://github.com/LinuxCNC/linuxcnc/issues β please do, the devs wanna know π
β COPYRIGHT β
Copyright Β© 2006 John Kasunich.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
no warranty bestie, not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE β read the source, it's giving transparency π
and that's the whole page!! π¦ brought to you by LinuxCNC Documentation, dated 2006-11-18, under the SAMPLER(9) header β periodt, go sample something πβ¨
π¦ where this page comes from
- debian trixie: linuxcnc-uspace 1:2.9.4-2+deb13u1 Β· GFDL-1.1-or-later
- ubuntu questing: linuxcnc-uspace 1:2.9.4-2ubuntu2
- 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
- Copyright (c) 2006 John Kasunich
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms