SAMPLER(9)

πŸ“¦
version 2.9.4 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 that sampler creates to buffer the realtime data. You can pass multiple depth values 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 that sampler exports and later samples data from. You gotta supply one string for each FIFO, separated by commas. sampler exports 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.M input β€” 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-depth s32 output β€” the current number of samples sitting in the FIFO. When this hits depth, new data starts overwriting old data and some samples get lost 😭 farewell, data.
  • sampler.N.full bit output β€” TRUE when FIFO N is full, FALSE when there's still room for another sample.
  • sampler.N.enable bit input β€” when TRUE, samples get captured and placed in FIFO N; when FALSE, no samples are acquired. Defaults to TRUE.

πŸ’… PARAMETERS πŸ’…

  • sampler.N.overruns s32 read/write β€” the number of times sampler tried to write data to the HAL pins but found no room in the FIFO. It increments whenever full is true, and you can reset it with the setp command.
  • sampler.N.sample-num s32 read/write β€” a number that identifies the sample. It's automatically incremented for each sample, and you can reset it with the setp command. The sample number can optionally be printed in the first column of the output from halsampler, using the -t option (see man 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 Β© 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