sampler syntax

More
12 May 2014 05:09 #46828 by southbayguy
sampler syntax was created by southbayguy
I'm interested in obtaining a record of various motion variables over a 10-second period. It looks to me like the HAL sampler functionality is the way to do it. I'm doing something wrong with the syntax. At the command line, in the linuxcnc directory, I've tried

halcmd loadrt sampler depth=10000 cfg=f sampler.0.axis.0.f-error.0

by which I'm hoping to create a FIFO with 10000 floating point records, each record being the following error for X axis on each of 10000 update loops.
From reading the Man pages, I think the 0 in sampler.0 designates the first (and only) FIFO, and the 0 following axis.0.f-error says to put the data in the first column of the file.

As time goes by, I would like to record other data in other columns and I would like to learn methods for turning data recording on and off.
Any help is appreciated.

Please Log in or Create an account to join the conversation.

More
12 May 2014 06:09 - 12 May 2014 06:11 #46830 by PCW
Replied by PCW on topic sampler syntax
Pretty sure the syntax is:

loadrt sampler depth=10000 cfg=f
(for one floating point number)

then you connect the the pin you wish to sample to the pin that the sampler component exports:

net sdx sampler.0.pin.0 <= axis.0.f-error

setting sampler.0.enable true or false enables or disables recording

man sampler
Last edit: 12 May 2014 06:11 by PCW.
The following user(s) said Thank You: southbayguy

Please Log in or Create an account to join the conversation.

More
15 May 2014 09:30 #46951 by southbayguy
Replied by southbayguy on topic sampler syntax
Thank you for your help. I'm making progress on this, but I'm not there yet.

I open a terminal window, change directories to linuxcnc, then do

halcmd loadrt sampler depth=4000 cfg=f
halcmd net sdx axis.0.f-error
halcmd net sdx sampler.0.pin.0
halcmd setp sampler.0.enable true

Then I open another terminal window, change directories to linuxcnc, and do

halsampler

... I figure I should see data streaming into the window where I typed halsampler ... but I get nothing.

My machine is enabled and sometimes during this exercise I jog the X axis back and forth. Makes no difference.

I opened HalMeter and it shows changing values for axis.0.f-error, for sdx, and for sampler.0.pin.0 (all the same value)
So it looks like the net commands worked, creating a signal called sdx and connecting it to axis.0.f-error, and then connecting signal sdx to pin sampler.0.pin.0 ... I'm thinking that side looks okay.

I'm wondering why halsampler isn't giving me anything. I figure I'll wait to see data streaming in a window before trying to redirect output to a file.

Any guidance is appreciated. Thanks.

Please Log in or Create an account to join the conversation.

More
15 May 2014 09:53 #46952 by PCW
Replied by PCW on topic sampler syntax
you must addf the sampler function to the desired RT thread or nothing will happen...
The following user(s) said Thank You: southbayguy

Please Log in or Create an account to join the conversation.

Time to create page: 0.102 seconds
Powered by Kunena Forum