More help required
20 Mar 2022 08:02 #237778
by Willheg
More help required was created by Willheg
Hello again knowledgeable ones.
I have asked a few questions in the past for a panel I am building and have managed from some research trial and error, and like i said questions an information from here to get almost everything working.
I will start by saying i'm running AXIS with a GladeVCP if this makes sense as I do not feel the need to make a full screen set for my application, and am not sure if I want to get that far into as I feel I have already gone to far as it is. But anyway, just after i started this panel I found Linuxcnc was being upgraded and I was to far in to even think about rewriting to the latest version that everything is on at the moment. Also don't know if my PC this machine runs on would handle the upgrade, might have a look one day soon but for now I would just like to get the panel I'm working on to work how I would like then see where I go from there.
Where I am stuck now is I have created a individual custom full screen error message window which works great with most errors, but I have found one that did not work, which is if the requested tool is not found in the database it would error the normal way but if I click the ok button it would quit linuxcnc out with a message as attached next:
The program 'axis' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 37213 error_code 3 request_code 15 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
/usr/bin/gladevcp:295: GtkWarning: GdkWindow 0x400001f unexpectedly destroyed
gtk.main()
Shutting down and cleaning up LinuxCNC...
/usr/bin/gladevcp:295: GtkWarning: GdkWindow 0x4000003 unexpectedly destroyed
gtk.main()
**** GLADE VCP ERROR: X Protocol Error: 3
/usr/bin/linuxcnc: line 550: 4527 Killed $EMCTASK -ini "$INIFILE"
I have tried using a hidden gremlin viewer in my glade file and taking gcode_error to point to a scrip in my python file which works ok and brings up my custom window but it still brings up athe standard AXIS one as well and when I close the standard one it crashes Linuxcnc like before.
Any help on stopping the standard AXIS gcode error window appearing and make it use my new window that would be great.
Thanks for any help, pointers or anything.
William.
I have asked a few questions in the past for a panel I am building and have managed from some research trial and error, and like i said questions an information from here to get almost everything working.
I will start by saying i'm running AXIS with a GladeVCP if this makes sense as I do not feel the need to make a full screen set for my application, and am not sure if I want to get that far into as I feel I have already gone to far as it is. But anyway, just after i started this panel I found Linuxcnc was being upgraded and I was to far in to even think about rewriting to the latest version that everything is on at the moment. Also don't know if my PC this machine runs on would handle the upgrade, might have a look one day soon but for now I would just like to get the panel I'm working on to work how I would like then see where I go from there.
Where I am stuck now is I have created a individual custom full screen error message window which works great with most errors, but I have found one that did not work, which is if the requested tool is not found in the database it would error the normal way but if I click the ok button it would quit linuxcnc out with a message as attached next:
The program 'axis' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 37213 error_code 3 request_code 15 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
/usr/bin/gladevcp:295: GtkWarning: GdkWindow 0x400001f unexpectedly destroyed
gtk.main()
Shutting down and cleaning up LinuxCNC...
/usr/bin/gladevcp:295: GtkWarning: GdkWindow 0x4000003 unexpectedly destroyed
gtk.main()
**** GLADE VCP ERROR: X Protocol Error: 3
/usr/bin/linuxcnc: line 550: 4527 Killed $EMCTASK -ini "$INIFILE"
I have tried using a hidden gremlin viewer in my glade file and taking gcode_error to point to a scrip in my python file which works ok and brings up my custom window but it still brings up athe standard AXIS one as well and when I close the standard one it crashes Linuxcnc like before.
Any help on stopping the standard AXIS gcode error window appearing and make it use my new window that would be great.
Thanks for any help, pointers or anything.
William.
Please Log in or Create an account to join the conversation.
23 Mar 2022 16:43 #238116
by andypugh
Replied by andypugh on topic More help required
Maybe you can use a .axisrc file to modify Axis to not pop up error windows?
I have had a quick play around, but couldn't actually find the bit of axis.py that creates the error messages (overriding that would be the next part of the plan)
I have had a quick play around, but couldn't actually find the bit of axis.py that creates the error messages (overriding that would be the next part of the plan)
Please Log in or Create an account to join the conversation.
24 Mar 2022 05:23 #238192
by cmorley
Replied by cmorley on topic More help required
Do you have an embedded gladevcp panel?
X error seems to indicate it crashed for some reason.
Are you using it to pop an error window?
X errors are not in displayed in sync of the actual problem.
But you have a bigger problem.
linuxcnc can not reliably deliver error messages to more then one UI.
Errors are consumed by the reader so having more then one reader creates a race condition.
You would need to stop AXIS from reading linuxcnc's error status or piggyback the data off of it.
X error seems to indicate it crashed for some reason.
Are you using it to pop an error window?
X errors are not in displayed in sync of the actual problem.
But you have a bigger problem.
linuxcnc can not reliably deliver error messages to more then one UI.
Errors are consumed by the reader so having more then one reader creates a race condition.
You would need to stop AXIS from reading linuxcnc's error status or piggyback the data off of it.
Please Log in or Create an account to join the conversation.
24 Mar 2022 21:27 #238276
by andypugh
Replied by andypugh on topic More help required
This was what I was trying to do, but I failed to find the bit of Axis that handles errors. (Or, possibly, I didn't edit the right axis.py file, I do have several on the dev machine)You would need to stop AXIS from reading linuxcnc's error status or piggyback the data off of it.
Please Log in or Create an account to join the conversation.
30 Mar 2022 10:35 #238703
by Willheg
Replied by Willheg on topic More help required
Hello again everyone,
Thanks for the replies, I will reread these when I get a better chance to look over them as I am currently on my phone and will see if I can find something in your replies.
If needs be I could zip up what I have so far and see if someone can make sence of what I have, but it is not clearly coded and a bit here and there.
hoping not to have to do this as like I say I have not tested it all in the real world to feel comfortable in releasing it to the wrong people.
To answer cmorley's question on it being an embeded panel, the answer is I think so, I am using the glavevcp command in the ini file and it shows on the right after axis loads.
I feel I am not far enough into it to make it all stand alone nor do I feel lije it will ever get far enough to be stand alone.
After posting my question I have been playing with remapping the T command and inserting my new window in it with external tool table checks everytime a T command is called, and just using INTERP_OK in place of INTERP_ERROR. This has sloved some of the issue but it now still loads all the gcode but advises about any errors in full screen.
The next bit I would like to try and sort is if it errors to load a blank gcode so as the operator cannot run an error riden file, just trying to work out if this is possible.
Will keep playing round to see what i can find out there and what i can make happen from trile and error.
But as always if anyone has any pointers or info or abything please fire back at me.
Thank you all.
Thanks for the replies, I will reread these when I get a better chance to look over them as I am currently on my phone and will see if I can find something in your replies.
If needs be I could zip up what I have so far and see if someone can make sence of what I have, but it is not clearly coded and a bit here and there.
hoping not to have to do this as like I say I have not tested it all in the real world to feel comfortable in releasing it to the wrong people.
To answer cmorley's question on it being an embeded panel, the answer is I think so, I am using the glavevcp command in the ini file and it shows on the right after axis loads.
I feel I am not far enough into it to make it all stand alone nor do I feel lije it will ever get far enough to be stand alone.
After posting my question I have been playing with remapping the T command and inserting my new window in it with external tool table checks everytime a T command is called, and just using INTERP_OK in place of INTERP_ERROR. This has sloved some of the issue but it now still loads all the gcode but advises about any errors in full screen.
The next bit I would like to try and sort is if it errors to load a blank gcode so as the operator cannot run an error riden file, just trying to work out if this is possible.
Will keep playing round to see what i can find out there and what i can make happen from trile and error.
But as always if anyone has any pointers or info or abything please fire back at me.
Thank you all.
Please Log in or Create an account to join the conversation.
01 May 2022 09:21 - 01 May 2022 09:28 #241779
by Willheg
Replied by Willheg on topic More help required
Hello again all,
So upon some more tinkering and trying I am at wits end with this.
I have now managed to get some more errors to be caught by my python script but I have noticed I still don't manage to catch all of them if to many are sent at one, ie if I create a gcode file with 6 (msg, text) it sometimes catches 2, sometimes it will catch all 6, but very random. I am also trying to get it so that linuxcnc also pauses when it hits an error ar a msg or debug command but am still trying to get my head around how to achieve this. But this might be a matter for another day or topic.
Anyway back to my original issues, I managed to fix some of the axis error closing linuxcnc by remapping the "T" command to just run a INTERP_OK on everything. Probably not the best idea but trying to work round my issues.
So what I am wondering now is, would it be easier or better to save my frustrations that I am having by making a full panel (more work than I was hoping to have to do, but have used a lot of time already to get where I am and would love to just make this all work, although I'm almost ready to give up, not that that is what I will do yet as that's not me normally.) or keep trying to use just a "side bar" like I am currently trying to do.
Hope someone can enlighten me or inspire me on what I should do.
Thanks for reading.
So upon some more tinkering and trying I am at wits end with this.
I have now managed to get some more errors to be caught by my python script but I have noticed I still don't manage to catch all of them if to many are sent at one, ie if I create a gcode file with 6 (msg, text) it sometimes catches 2, sometimes it will catch all 6, but very random. I am also trying to get it so that linuxcnc also pauses when it hits an error ar a msg or debug command but am still trying to get my head around how to achieve this. But this might be a matter for another day or topic.
Anyway back to my original issues, I managed to fix some of the axis error closing linuxcnc by remapping the "T" command to just run a INTERP_OK on everything. Probably not the best idea but trying to work round my issues.
So what I am wondering now is, would it be easier or better to save my frustrations that I am having by making a full panel (more work than I was hoping to have to do, but have used a lot of time already to get where I am and would love to just make this all work, although I'm almost ready to give up, not that that is what I will do yet as that's not me normally.) or keep trying to use just a "side bar" like I am currently trying to do.
Hope someone can enlighten me or inspire me on what I should do.
Thanks for reading.
Last edit: 01 May 2022 09:28 by Willheg. Reason: Added reply check box tick
Please Log in or Create an account to join the conversation.
- robertspark
- Offline
- Platinum Member
Less
More
- Posts: 915
- Thank you received: 216
01 May 2022 10:00 #241786
by robertspark
Replied by robertspark on topic More help required
how about posting the code for someone to maybe take a look?
Please Log in or Create an account to join the conversation.
01 May 2022 10:20 #241788
by Willheg
Replied by Willheg on topic More help required
Hello robertspark,
Yes I will do that in the next few days.
I'm not asking anyone to do everything for me but i'm not a python programmer like I have said so this mean my code will be probably pretty messy and so far it has been a look at other code and see what I can learn and also a lot of trile and error.
I have probably missed a lot of try:except: areas which may help my problems as well but yeah I feel I am at the point where I will have to post my code and see if anyone can find my issues or understand what I have done.
And I just hope in the future if I get this sorted that I might be able to help someone else with any issues they may have.
Thanks again.
Yes I will do that in the next few days.
I'm not asking anyone to do everything for me but i'm not a python programmer like I have said so this mean my code will be probably pretty messy and so far it has been a look at other code and see what I can learn and also a lot of trile and error.
I have probably missed a lot of try:except: areas which may help my problems as well but yeah I feel I am at the point where I will have to post my code and see if anyone can find my issues or understand what I have done.
And I just hope in the future if I get this sorted that I might be able to help someone else with any issues they may have.
Thanks again.
Please Log in or Create an account to join the conversation.
- robertspark
- Offline
- Platinum Member
Less
More
- Posts: 915
- Thank you received: 216
01 May 2022 11:26 - 01 May 2022 11:27 #241793
by robertspark
Replied by robertspark on topic More help required
I'm not a programmer, but I've dabbled with a lot of languages now just to get the job done.
I normally start off with a clean slate or something that works and just change a bit at a time and re-run it, to ensure that I've not got the syntax wrong.
Its not the most efficient way to do it, given you'll find that the code changes from what you first start out with to what you end up with and it takes a lot of trial and error.
However, if you know roughly where you are having problems just post that section.
I had a funny one yesterday that was throwing errors.... and it was really giving me a headache.... then I noticed that there were a few commas missing...... it ran a little better, but still would not run and threw up a load of other errors.... I then found a pesky semi-colon missing !!!!
its a problem when you flit from C to C# to python etc etc! And you have a day job that is not cnc / programming related. And you don't get endless time to just work on one thing so you flit in and out of it in 10 or 15 minute sessions and have to regather your thoughts and what you tried last time or were trying to do.
mind maps / flow charts can help, I keep a load of note pads and just scribble whatever in them so I can just rescribble / add to the flow charts of whatever I'm trying to do and I can also flip though and see what did not work.
Key to programming is just finding what works for you, most people are self taught anyway by necessity
I normally start off with a clean slate or something that works and just change a bit at a time and re-run it, to ensure that I've not got the syntax wrong.
Its not the most efficient way to do it, given you'll find that the code changes from what you first start out with to what you end up with and it takes a lot of trial and error.
However, if you know roughly where you are having problems just post that section.
I had a funny one yesterday that was throwing errors.... and it was really giving me a headache.... then I noticed that there were a few commas missing...... it ran a little better, but still would not run and threw up a load of other errors.... I then found a pesky semi-colon missing !!!!
its a problem when you flit from C to C# to python etc etc! And you have a day job that is not cnc / programming related. And you don't get endless time to just work on one thing so you flit in and out of it in 10 or 15 minute sessions and have to regather your thoughts and what you tried last time or were trying to do.
mind maps / flow charts can help, I keep a load of note pads and just scribble whatever in them so I can just rescribble / add to the flow charts of whatever I'm trying to do and I can also flip though and see what did not work.
Key to programming is just finding what works for you, most people are self taught anyway by necessity
Last edit: 01 May 2022 11:27 by robertspark.
The following user(s) said Thank You: Willheg, tommylight
Please Log in or Create an account to join the conversation.
03 May 2022 01:38 #241895
by Willheg
Replied by Willheg on topic More help required
Hello again robertspark,
From what you have written there its sounda a lot like me, have a day job, house and children and all my other hobbies, so yeah get maybe an hour here and there every now and then.
I do similar things like you have said, bit by bit etc etc but I am at the point where I am going round in circles and for ecery new bit i manage to break at least one old bit somehow.
Like I said my coding is not well commented or layed out so I'm worried if I share it to see if anyone can help they will be like man what is this guy on but also at the same time like I noted before I'm now going round in circles and chasing my tail and feel i should just share my code to see if anyone xan adcise what I might be doing wrong.
This said I do not want to rely on anyone else doing to much work free of charge as I understand peoples time is money or for there own things, but if anyone is keen then that would be great if they had a look and advised what I'm not doing right if they can understand what I am trying to do.
anyway need to clean up the code i currently have a tad more from all my triles before i post it to see what people think as to weather I am on the right track or completly brainless.
Thanks again so far and chatch you again soon.
From what you have written there its sounda a lot like me, have a day job, house and children and all my other hobbies, so yeah get maybe an hour here and there every now and then.
I do similar things like you have said, bit by bit etc etc but I am at the point where I am going round in circles and for ecery new bit i manage to break at least one old bit somehow.
Like I said my coding is not well commented or layed out so I'm worried if I share it to see if anyone can help they will be like man what is this guy on but also at the same time like I noted before I'm now going round in circles and chasing my tail and feel i should just share my code to see if anyone xan adcise what I might be doing wrong.
This said I do not want to rely on anyone else doing to much work free of charge as I understand peoples time is money or for there own things, but if anyone is keen then that would be great if they had a look and advised what I'm not doing right if they can understand what I am trying to do.
anyway need to clean up the code i currently have a tad more from all my triles before i post it to see what people think as to weather I am on the right track or completly brainless.
Thanks again so far and chatch you again soon.
Please Log in or Create an account to join the conversation.
Moderators: HansU
Time to create page: 0.091 seconds