HAL file operation
I need to open (close, append, read, write) file.
For example to store statistic, to collect and store some values e t c.
How can I do it in HAL? Is it possible?
Please Log in or Create an account to join the conversation.
Hi!
I need to open (close, append, read, write) file.
For example to store statistic, to collect and store some values e t c.
How can I do it in HAL? Is it possible?
I believe so, have a look to see if sampler and halsampler do what you want:
www.linuxcnc.org/docview/html/man/man9/sampler.9.html
Please Log in or Create an account to join the conversation.
How to flush FIFO to file every second?
The problem I use "loadusr halsampler -t FILENAME" and only after the end of EMC it flush all data to file
I use new thread called sampler-thread for 1 Sec (loadrt threads name1=sampler-thread period1=1000000000.
Please Log in or Create an account to join the conversation.
loadrt halsampler
addf halsampler sampler-thread
You also need to specify which pins you want halsampler to have, and then they need to be linked to other hal pins that you want to log.
Please Log in or Create an account to join the conversation.
I did it all. All works, the output in stdout or in file (if I assign it) present.you need the realtime part too.
loadrt halsampler
addf halsampler sampler-thread
You also need to specify which pins you want halsampler to have, and then they need to be linked to other hal pins that you want to log.
But there is one alittle problem. If I write to stdout, all other messages about the EMC also present.
If I write to file, then the file not writen at once. The EMC collect all data in cache and flush it only after the exit from EMC or if the buffer (may be 1024 bytes) becomes empty.
I need to get the stream, not buffered operation.
Please Log in or Create an account to join the conversation.
#each second = 1000000000 nS
loadrt threads name1=sampler-thread period1=1000000000
loadrt sampler depth=3 cfg=ff
addf sampler.0 sampler-thread
#to file
loadusr halsampler -t A-MINMAX
net X.ferror-min <= minmax.0.min sampler.0.pin.0
net X.ferror-max <= minmax.0.max sampler.0.pin.1
Please Log in or Create an account to join the conversation.
andypugh wrote:
Sorry, I am afraid I can't help there, I have never actually used the components, I just knew that they existed.I need to get the stream, not buffered operation.
You could try a question to the mailing list.
Please Log in or Create an account to join the conversation.
Run halsampler process by hand, not from .hal fileI need to get the stream, not buffered operation.
Please Log in or Create an account to join the conversation.