Hiden spindle control buttons in AXIS
08 Nov 2024 15:45 #314079
by COFHAL
Hiden spindle control buttons in AXIS was created by COFHAL
Why are the spindle control buttons not visible in AXIS?
Please Log in or Create an account to join the conversation.
08 Nov 2024 16:10 #314081
by Aciera
Replied by Aciera on topic Hiden spindle control buttons in AXIS
Please Log in or Create an account to join the conversation.
08 Nov 2024 16:34 #314082
by COFHAL
Replied by COFHAL on topic Hiden spindle control buttons in AXIS
I already tried that but it didn't work, even though that pin (spindle.0.on) is connected in my configuration in the .HAL file.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19123
- Thank you received: 6406
08 Nov 2024 17:24 #314085
by tommylight
Replied by tommylight on topic Hiden spindle control buttons in AXIS
There are a lot of entries for the spindle in the hal and ini file.
Make another config with spidnle, copy the relevant stuff from spindle sections in both files.
Make another config with spidnle, copy the relevant stuff from spindle sections in both files.
Please Log in or Create an account to join the conversation.
08 Nov 2024 18:18 #314088
by Aciera
Replied by Aciera on topic Hiden spindle control buttons in AXIS
looking at, what I believe to be, the relevant code in '/home/dave/linuxcnc-dev/src/emc/usr_intf/axis/scripts/axis.py'
for hal.pin_has_writer():
Not sure but since the code is checking OUT halpins for 'writers' it might not be enough to assign the pin to a signal but it may actually need to connected to another pin.
def forget(widget, *pins):
if "AXIS_NO_AUTOCONFIGURE" in os.environ: return
if hal_present == 1:
for p in pins:
if hal.pin_has_writer(p): return
m = widget.winfo_manager()
if m in ("grid", "pack"):
widget.tk.call(m, "forget", widget._w)
forget(widgets.brake, "spindle.0.brake")
forget(widgets.spindle_cw, "spindle.0.forward", "spindle.0.on",
"spindle.0.speed-out", "spindle.0.speed-out-abs", "spindle.0.speed-out-rps", "spindle.0.speed-out-rps-abs")
forget(widgets.spindle_ccw, "spindle.0.reverse",
"spindle.0.speed-out", "spindle.0.speed-out-abs", "spindle.0.speed-out-rps", "spindle.0.speed-out-rps-abs")
forget(widgets.spindle_stop, "spindle.0.forward", "spindle.0.reverse", "spindle.0.on",
"spindle.0.speed-out", "spindle.0.speed-out-abs", "spindle.0.speed-out-rps", "spindle.0.speed-out-rps-abs")
forget(widgets.spindle_plus,
"spindle.0.speed-out", "spindle.0.speed-out-abs", "spindle.0.speed-out-rps", "spindle.0.speed-out-rps-abs")
forget(widgets.spindle_minus,
"spindle.0.speed-out", "spindle.0.speed-out-abs", "spindle.0.speed-out-rps", "spindle.0.speed-out-rps-abs")
forget(widgets.spindlef, "spindle.0.forward", "spindle.0.reverse", "spindle.0.on", "spindle.0.brake",
"spindle.0.speed-out", "spindle.0.speed-out-abs", "spindle.0.speed-out-rps", "spindle.0.speed-out-rps-abs")
forget(widgets.spindlel, "spindle.0.forward", "spindle.0.reverse", "spindle.0.on", "spindle.0.brake",
"spindle.0.speed-out", "spindle.0.speed-out-abs", "spindle.0.speed-out-rps", "spindle.0.speed-out-rps-abs")
forget(widgets.spinoverridef,
"spindle.0.speed-out", "spindle.0.speed-out-abs", "spindle.0.speed-out-rps", "spindle.0.speed-out-rps-abs")
for hal.pin_has_writer():
".pin_has_writer('pin_name'): Return a FALSE value if a pin has no writers and TRUE if it does"},
Not sure but since the code is checking OUT halpins for 'writers' it might not be enough to assign the pin to a signal but it may actually need to connected to another pin.
Please Log in or Create an account to join the conversation.
08 Nov 2024 18:26 #314089
by Aciera
Replied by Aciera on topic Hiden spindle control buttons in AXIS
Looking at 'pin_has_writer':
I would expect that this would give the signal 'spindle-on' the writer 'spindle.0.on':
But I'm really just guessing here.
PyObject *pin_has_writer(PyObject *self, PyObject *args) {
char *name;
if(!PyArg_ParseTuple(args, "s", &name)) return NULL;
if(!hal_shmem_base) {
PyErr_Format(PyExc_RuntimeError,
"Cannot call before creating component");
return NULL;
}
hal_pin_t *pin = halpr_find_pin_by_name(name);
if(!pin) {
PyErr_Format(PyExc_NameError, "Pin `%s' does not exist", name);
return NULL;
}
if(pin->signal) {
hal_sig_t *signal = (hal_sig_t*)SHMPTR(pin->signal);
return PyBool_FromLong(signal->writers > 0);
}
Py_INCREF(Py_False);
return Py_False;
}
I would expect that this would give the signal 'spindle-on' the writer 'spindle.0.on':
net spindle-on <= spindle.0.on
But I'm really just guessing here.
Please Log in or Create an account to join the conversation.
Time to create page: 0.251 seconds