ramifications of killing linuxcnc process
- allwinedesigns
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 0
04 Sep 2017 21:59 #98514
by allwinedesigns
ramifications of killing linuxcnc process was created by allwinedesigns
What are the ramifications of killing the linuxcnc process (kill -9)? What kind of clean up happens when you let it gracefully quit?
Please Log in or Create an account to join the conversation.
05 Sep 2017 09:42 #98520
by andypugh
Replied by andypugh on topic ramifications of killing linuxcnc process
On exit the values of the persistent parameters are saved to the linuxcnc.var file, and (optionally) the current axis positions are saved to the position.txt file. Also, I believe that changes to the tool table will be saved at this point too. (that is, any changes made in the G-code rather than the tool table editor).
Generally you will get away with it. But why do you want to?
Generally you will get away with it. But why do you want to?
Please Log in or Create an account to join the conversation.
- allwinedesigns
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 0
05 Sep 2017 13:16 #98527
by allwinedesigns
Replied by allwinedesigns on topic ramifications of killing linuxcnc process
It takes a long time for linuxcnc to shutdown (at least ~20 seconds) and I'm not sure why. I'm working on an interface for the PocketNC based on EmperorWeb and Rockhopper (you can see an old version of it here www.allwinedesigns.com/blog/pocketnc-jog-wheel). I'm setting up systemd scripts for starting and stopping linuxcnc and Rockhopper (a Python webserver that provides a web socket interface to linuxcnc). In the Rockhopper interface I'd like to be able to restart the servers after changing INI variables to quickly see their changes reflected. If I could force kill linuxcnc, it would go much faster. I guess I could avoid the problem if there's a way to change INI variables at run time via Python, is that doable?
Please Log in or Create an account to join the conversation.
05 Sep 2017 13:45 #98528
by andypugh
Replied by andypugh on topic ramifications of killing linuxcnc process
Many of the INI values that are used directly, rather than being read in to the HAL file and used to set HAL pins are mirrored as HAL pins, and these can be changed in a live system.
They belong to milltask:
linuxcnc.org/docs/html/man/man1/milltask.1.html
But are created by inihal.cc
github.com/LinuxCNC/linuxcnc/blob/master/src/emc/ini/inihal.cc
The other settings exist in the INI but are read by the HAL and are used in "setp" commands. You can just "setp" them to other values.
They belong to milltask:
linuxcnc.org/docs/html/man/man1/milltask.1.html
But are created by inihal.cc
github.com/LinuxCNC/linuxcnc/blob/master/src/emc/ini/inihal.cc
The other settings exist in the INI but are read by the HAL and are used in "setp" commands. You can just "setp" them to other values.
Please Log in or Create an account to join the conversation.
05 Sep 2017 14:13 #98529
by rodw
Replied by rodw on topic ramifications of killing linuxcnc process
I'm not sure if it's specific to an experimental branch (dgarr/external_offsets) but the latest simulator there includes a separate popup window to edit ini file parameters on the fly. Its loaded by a few lines in the .ini file. Great for tuning and easy to copy to a working config.
Please Log in or Create an account to join the conversation.
- allwinedesigns
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 0
05 Sep 2017 14:33 #98530
by allwinedesigns
Replied by allwinedesigns on topic ramifications of killing linuxcnc process
The idea is to only use a web interface to interact with the machine, so no terminal or builtin GUIs from linuxcnc. EmperorWeb provides a web interface for general interaction with the machine (jogging, running gcode, setting tool offsets, etc.). It does so by communicating with Rockhopper, a python web server that provides a web socket API for UIs such as EmperorWeb, so everything must be done by Rockhopper. Rockhopper provides its own web interface for editing INI variables and displaying the hal graph. I'd like to modify Rockhopper in some way so the changes to the INI variables are picked up right away, rather than needing to write them to the INI file and restarting (which is my current plan, and the reason for this post).
@rodw, I'm not familiar with the linuxcnc source, is the simulator a python script that I could potentially look at to learn something? If so, do you have a link to where that might be? If not, unfortunately I don't think it will work for my purposes.
@andypugh, it seems like we're getting closer to a solution by setting hal pins, but I'm still unsure the best way to proceed. How can you change hal pins from python? Would I need to shell out to something like halcmd or is there a python module for that?
I appreciate the help!
@rodw, I'm not familiar with the linuxcnc source, is the simulator a python script that I could potentially look at to learn something? If so, do you have a link to where that might be? If not, unfortunately I don't think it will work for my purposes.
@andypugh, it seems like we're getting closer to a solution by setting hal pins, but I'm still unsure the best way to proceed. How can you change hal pins from python? Would I need to shell out to something like halcmd or is there a python module for that?
I appreciate the help!
Please Log in or Create an account to join the conversation.
05 Sep 2017 14:44 #98531
by andypugh
Replied by andypugh on topic ramifications of killing linuxcnc process
if you "import hal" then the help suggests that the pin object has a set method.
Please Log in or Create an account to join the conversation.
- allwinedesigns
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 0
05 Sep 2017 15:31 #98532
by allwinedesigns
Replied by allwinedesigns on topic ramifications of killing linuxcnc process
Thanks, I found the set_p method and it seems to work with the milltask pins, but I'm unsure how to reference the others. How would I name the pins that aren't owned by milltask ([AXIS_0]SCALE for example)?
Please Log in or Create an account to join the conversation.
- allwinedesigns
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 0
05 Sep 2017 15:47 #98533
by allwinedesigns
Replied by allwinedesigns on topic ramifications of killing linuxcnc process
Oh, I think I see what you mean now. In my hal file I see:
setp [PRUCONF](DRIVER).stepgen.00.position-scale [AXIS_0]SCALE
I'm unable to reference [PRUCONF](DRIVER).stepgen.00.position-scale using halcmd or python. That seems machinekit specific. Any ideas?
setp [PRUCONF](DRIVER).stepgen.00.position-scale [AXIS_0]SCALE
I'm unable to reference [PRUCONF](DRIVER).stepgen.00.position-scale using halcmd or python. That seems machinekit specific. Any ideas?
Please Log in or Create an account to join the conversation.
- allwinedesigns
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 0
05 Sep 2017 16:10 #98534
by allwinedesigns
Replied by allwinedesigns on topic ramifications of killing linuxcnc process
[PRUCONF]DRIVER was also defined in my INI file as hal_pru_generic, so this worked:
setp hal_pru_generic.stepgen.00.position-scale -8333
Thanks for your help!
setp hal_pru_generic.stepgen.00.position-scale -8333
Thanks for your help!
Please Log in or Create an account to join the conversation.
Time to create page: 0.083 seconds