Use M100 to send popup messages - my solution

More
09 Mar 2019 08:10 #128133 by pl7i92
Thank you very mutch to give the Users some Idee on How to do it
Please can you also make this in Post into the G-M code section

This will give users alot of SIDE Infos you may do also a CLEAN M number to gt rit of them for the next part

Please Log in or Create an account to join the conversation.

More
09 Mar 2019 11:18 #128151 by TwoFeetDown
Thanks for the suggestion to repost. I have done this.
I don't understand what you mean by 'do a CLEAN M number'. Could you explain please?
I really appreciate your interest and help on this.
Jim

Please Log in or Create an account to join the conversation.

More
11 Mar 2019 19:43 #128376 by newbynobi
Did you know, that gmoccapy does support user messages?
It is not exactly what you are have done, but you can use the user messages i.e. to get a message if you lube level is low, just using hal pin.

Norbert

Please Log in or Create an account to join the conversation.

More
11 Mar 2019 20:24 #128379 by TwoFeetDown
Thanks for your reply Norbert. I was not aware of that.

I did use the toolchange messages for a while (as was suggested on this forum) but that required reprogramming the toolchange code and the tooltable each time. I found it to be pretty cumbersome.

I wanted a system that I could maintain easily, that popped up BIG messages, and that could handle a fairly large number of messages, and that would either stop execution of allow it to continue. As you can see from my message file I like to guide myself through some operations, especially if I don't do them very often.

To be honest, I'm still trying to figure hal out. I managed to get my VFD working and controlled by S and M codes, but I did it by finding pretty specific instructions from some nice fellows who had figured it out. I think I need to find a good tutorial on hal. It is really powerful and it would be great to be able to use it.

Please Log in or Create an account to join the conversation.

More
12 Mar 2019 14:34 - 12 Mar 2019 14:37 #128435 by andypugh
For sending messages via HAL pins there is also this component:
linuxcnc.org/docs/devel/html/man/man9/message.9.html

I use it to show a "coolant low" message on my milling machine (and a "coolant-high" so that I know when to stop pouring.

But, as you have observed, that is cumbersome to do from G-code and the message that pops up is subtle at best. So I do see a use for both approaches.

Have you considered offering return values from "Yes / No" or "abort / retry / ignore" options?
Last edit: 12 Mar 2019 14:37 by andypugh.

Please Log in or Create an account to join the conversation.

More
12 Mar 2019 15:47 #128447 by TwoFeetDown
Thanks for the 'message' link. I'll keep it in mind when new opportunities present themselves.

I don't attempt to perform any logic before messages are requested with M1xx Pxxx. Every time the code encounters a request it will display the message. So if the message says you should 'touch off to the surface' and you have not done it then click 'Stop Executing' or press the [Esc] key to stop the program, touch off to the surface, and rerun the program. When the 'touch off' message appears on this run click 'Continue' or press [Enter] (since you have touched off) and the program will resume. Depending upon the number of 'instructional messages' you have it may result in having to 'Continue' several times.

There are two options offered for everything except error messages.
'Continue [Enter] ' returns a zero that results in the program resuming execution.
'Stop Executing [Esc] returns a 1 that causes the program to stop (abort)

Errors e.g. 'Message file not found', 'Message not found for that number' only offer the Stop Executing' option. My feeling is that if a message was supposed to appear it is important enough that problems here should be investigated and fixed before proceeding.

Anyone who has a rudimentary knowledge of Python (like I do) should be able to play with the M100 code to customize it to their specs.

Not that anyone would really care to do this, but this messaging system can also be used for non-Linuxcnc purposes. This morning I wrote a little VB6 (yes, I know, VB6 is 'dead', but I still prefer it to any other language I have used in the last 40 years :) that calls M100 successfully and detects the return code.

Please Log in or Create an account to join the conversation.

Time to create page: 0.108 seconds
Powered by Kunena Forum