- Posts: 19306
- Thank you received: 0
Mesa 5i25/6i25 my own component: how to begin?
You need to setp sampler.0.enable 1 too, to start sampling. Or net it to amp-enable, or something.
Please Log in to join the conversation.
Is is smart to use only one thread for both hm2_5i25.0.read and sampler.0 ?
If I run each of these commands from halrun interface, the data output never stops,
unless I interrupt it with Ctrl+C.
If I run this script as a file with halrun -f halsample.hal ,
then the data output stops by itself depedent on the period of the main_thread as I found out by trial and error.
I do not know why this happens as I do not see any hm2/hm2_5i25.0: Watchdog has bit!
in /var/log/linuxcnc.log .
Please Log in to join the conversation.
The pyVCP panel widget bits aside, it shows the connections, thread speeds, depths etc that work.
This process is halted via the quit for the widget, you need to engineer something in to stop sampling
regards
Please Log in to join the conversation.
sirop wrote: So I wrote only a HAL script so far:
Code:loadrt threads name1=main_thread period1=100000 # name2=sample_thread period2=100000
You seem to have two threads both running at 100uS. (And you are only using one of them)
That's unusually fast for a 5i25.read / write thread.
As the hm2 data is only updated after a .read there is no point sampling any faster.Is is smart to use only one thread for both hm2_5i25.0.read and sampler.0 ?
This might be a side-effect of the fast sampling, does it stop the same way with a 1000uS thread time?If I run this script as a file with halrun -f halsample.hal ,
then the data output stops by itself depedent on the period of the main_thread as I found out by trial and error..
Please Log in to join the conversation.
No, I use only one thread as there is a comment sign "#" before name2:andypugh wrote:
sirop wrote: So I wrote only a HAL script so far:
Code:loadrt threads name1=main_thread period1=100000 # name2=sample_thread period2=100000
You seem to have two threads both running at 100uS. (And you are only using one of them)
"Unusually fast" means unnecessarily fast? Probably, you right.That's unusually fast for a 5i25.read / write thread.
I just wanted to test out out how far I can go with my Intel NUC, 4 Celeron cores.
I hope I understand you correctly and you mean thread period saying thread time.This might be a side-effect of the fast sampling, does it stop the same way with a 1000uS thread time?If I run this script as a file with halrun -f halsample.hal ,
then the data output stops by itself depedent on the period of the main_thread as I found out by trial and error..
So with thread period of 100uS the output stops after 2419 entries if I run this script as a file.
With thread period of 1000uS the output stops after 242 entries if I run this script as a file.
As said already, if I run this script interactively line by line from the halrun cmd, the data output never stops.
Please Log in to join the conversation.
sirop wrote: So with thread period of 100uS the output stops after 2419 entries if I run this script as a file.
With thread period of 1000uS the output stops after 242 entries if I run this script as a file.
That looks like a constant time (2.5 seconds).
What happens with halcmd -kf ?
You might even need halcmd -Ikf to keep the halcmd session open after the script completes.
www.linuxcnc.org/docs/html/man/man1/halcmd.1.html
Please Log in to join the conversation.
andypugh wrote:
sirop wrote: So with thread period of 100uS the output stops after 2419 entries if I run this script as a file.
With thread period of 1000uS the output stops after 242 entries if I run this script as a file.
That looks like a constant time (2.5 seconds).
What happens with halcmd -kf ?
You might even need halcmd -Ikf to keep the halcmd session open after the script completes.
www.linuxcnc.org/docs/html/man/man1/halcmd.1.html
Yes, this was good advice.
With halrun -Ikf halsample.hal the script yields 741538 output lines if the thread period is 100uS, and then everything "freezes"
as it seems from my ssh connection, and I have to restart my Debian wheezy.
/var/log/linuxcnc.log did not show any errors.
With the thread period of 1000uS it lasts longer, I am still waiting to see if the output stops somewhere.
More than 1000000 output lines are already there.
But anyway that was just a starting point for me as I wanted to do all these things in C.
Please Log in to join the conversation.
sirop wrote: /var/log/linuxcnc.log did not show any errors.
Realtime modules can only write to /var/log/kernel.log (which you can also view with dmesg).
I have seen freezes like you mention when accidentally outputting far too much data to the kernel log, so it might be worth a look in there.
(Though, looking at the sampler.c code I don't see any rtapi_print commands in the realtime loop.)
Please Log in to join the conversation.
andypugh wrote:
sirop wrote: /var/log/linuxcnc.log did not show any errors.
Realtime modules can only write to /var/log/kernel.log (which you can also view with dmesg).
I have seen freezes like you mention when accidentally outputting far too much data to the kernel log, so it might be worth a look in there.
(Though, looking at the sampler.c code I don't see any rtapi_print commands in the realtime loop.)
There is definetely not too much of Linuxcnc messages in /var/log/kern.log .
The nearest thing I found that could give me some hint about performance are these lines:
Indeed I have not yet properly checked all possible latency issues.
Please Log in to join the conversation.
In that case, forget what I said about the kernel log too, that only applies to LinuxCNC.
Please Log in to join the conversation.
