Script on startup
- MatthiasF1210
- Offline
- Junior Member
- Posts: 37
- Thank you received: 0
is there a way to execute a nc-file or python script on startup of Gmoccapy after the gui is loaded?
Thanks
Matthias
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19123
- Thank you received: 6406
open_file = name_of_the_file_to_open.ngc
It works with Axis GUI so it should with Gmoccapy.
Should also be possible for python, but i'll leave that to more experienced members here.
Please Log in or Create an account to join the conversation.
'net n-is-homed halui.joint.n.is-homed' add: halui.mdi-command-nn
In .ini file
[HALUI]
MDI_COMMAND = Mnnn
In the executable Mnnn file your code
(n for axis and numbers)
Please Log in or Create an account to join the conversation.
Norbert
Please Log in or Create an account to join the conversation.
- MatthiasF1210
- Offline
- Junior Member
- Posts: 37
- Thank you received: 0
Thanks for the hint.
My Ini File:
[HALUI]
MDI_COMMAND = o<startupcheck> call
My Postgui.hal:
net allhomed => halui.mdi-command-00
"allhomed" is calculated from all homeswitches.
But there is one problem left. Since my machine is still moving to the "home" Positionig after homing was done, there is an Error Msg "Change to MDI not possible" Is there a way to place an delay?
thanks
Matthias
Please Log in or Create an account to join the conversation.
Norbert
Please Log in or Create an account to join the conversation.
That last condition will be slightly painful, as it's an s32 and needs to be convereted to float to use wcomp to test for zero.
Please Log in or Create an account to join the conversation.
- MatthiasF1210
- Offline
- Junior Member
- Posts: 37
- Thank you received: 0
i've done it.
in my hal-file
# -- NC-script on Startup Check with debounce --
loadrt debounce cfg=32,10,1
addf debounce.2 servo-thread
setp debounce.2.delay 1000
net all-homed => debounce.0.0.in
net mdi-cmd-startup <= debounce.0.0.out => halui.mdi-command-00
Thanks
Matthias
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19123
- Thank you received: 6406
linuxcnc.org/docs/2.8/html/man/man9/timedelay.9.html
Please Log in or Create an account to join the conversation.
i've done it.
in my hal-file
# -- NC-script on Startup Check with debounce --
loadrt debounce cfg=32,10,1
addf debounce.2 servo-thread
setp debounce.2.delay 1000
net all-homed => debounce.0.0.in
net mdi-cmd-startup <= debounce.0.0.out => halui.mdi-command-00
Is there a native gmoccapy pin which needs to be connected to the "all-homed" signal, or is it created by using a few and2 components combining all "joint.N.is-homed" pins to create an "all-homed" pin?
Thanks.
Please Log in or Create an account to join the conversation.