- Posts: 6803
- Thank you received: 2181
Python Component issueing errors or warnings to LinuxCNC
5 years 5 months ago #208500
by cmorley
Replied by cmorley on topic Python Component issueing errors or warnings to LinuxCNC
So I slapped together some code to test with:
and the message is accepted but never sent it seems.
I can't find much examples of sending messages on the error channel other then emctaskmain.cc
Code:
PyObject *MESSAGE_(pyErrorChannel *s, PyObject *args ) {
char *m;
EMC_OPERATOR_DISPLAY operator_display_msg;
if(!PyArg_ParseTuple(args, "s", &m)) return NULL;
if(!s->c->valid()) {
PyErr_Format( error, "Error buffer invalid" );
return NULL;
}
operator_display_msg.id = 0;
strncpy(operator_display_msg.display, m, LINELEN);
operator_display_msg.display[LINELEN - 1] = 0;
s->c->write(operator_display_msg);
Py_RETURN_NONE;
}
static PyMethodDef Error_methods[] = {
{"poll", (PyCFunction)Error_poll, METH_NOARGS, "Poll for errors"},
{"MESSAGE_", (PyCFunction)MESSAGE_, METH_VARARGS, "Send message"},
{NULL}
};
and the message is accepted but never sent it seems.
I can't find much examples of sending messages on the error channel other then emctaskmain.cc
Please Log in or Create an account to join the conversation.
5 years 5 months ago #208549
by Roiki
Replied by Roiki on topic Python Component issueing errors or warnings to LinuxCNC
I don't think you send it on the error channel but the command channel. Try it that way and see what happens?
Please Log in or Create an account to join the conversation.
5 years 5 months ago #208560
by cmorley
Replied by cmorley on topic Python Component issueing errors or warnings to LinuxCNC
Yes that did the trick - thanks.
Unfortunately all display messages can only be accepted in auto mode.
There is an NML_ERROR message but I don't understand how to send this NML message
More research needed..
Unfortunately all display messages can only be accepted in auto mode.
There is an NML_ERROR message but I don't understand how to send this NML message
More research needed..
Please Log in or Create an account to join the conversation.
5 years 5 months ago #208605
by cmorley
Replied by cmorley on topic Python Component issueing errors or warnings to LinuxCNC
Well it seems EMC_OPERATOR_ERROR_TYPE messages can be made to always display by modifying emctaskmain.cc to accept them.
I just don't understand if there is a disadvantage to always accepting them.
I just don't understand if there is a disadvantage to always accepting them.
Please Log in or Create an account to join the conversation.
5 years 5 months ago #208654
by andypugh
Replied by andypugh on topic Python Component issueing errors or warnings to LinuxCNC
Do it and see who complains?
Please Log in or Create an account to join the conversation.
5 years 5 months ago #208673
by cmorley
Replied by cmorley on topic Python Component issueing errors or warnings to LinuxCNC
lol You know you are right.
Thanks Andy
Thanks Andy
Please Log in or Create an account to join the conversation.
Time to create page: 0.130 seconds