Page 1 of 4
M200 prompts sometimes disappear <fixed>
Posted: Fri Nov 29, 2024 1:53 pm
by corbin
Hi!
In macro programming I sometimes (rather systematically) see the M200 prompts just disappear after a timeout, and I can't figure out why. CNC12 is still waiting for a Cycle Start, and hitting Cycle Start will make things continue along, but the prompt will have been long gone. I haven't narrowed down why certain lines of code in certain places cause this behavior.
Any ideas?
Example:
M200 "Remove Tool %.0f from the spindle and press Cycle Start to Continue." #20 ; prompt for input ; #20 is T, #T doesn't work
I've tried tossing in a "IF #50001" before and after the lines to prevent any lookahead, but I miss be missing something...
Thank you,
Corbin
Re: M200 prompts sometimes disappear
Posted: Fri Nov 29, 2024 2:36 pm
by suntravel
I never noticed this issue, but I seldom need longer than a few seconds to hit cycle start after M200....
Uwe
Re: M200 prompts sometimes disappear
Posted: Fri Nov 29, 2024 3:16 pm
by Centroid_Jacob
What are you doing after the M200, Corbin?
I just experimented with it at home with v5.20 and the prompt has stayed up for 30 minutes now waiting to continue with the job but, like you suggested, there is possibly an edge case causing it to disappear.
Re: M200 prompts sometimes disappear
Posted: Fri Nov 29, 2024 7:06 pm
by corbin
Centroid_Jacob wrote: ↑Fri Nov 29, 2024 3:16 pm
What are you doing after the M200, Corbin?
I just experimented with it at home with v5.20 and the prompt has stayed up for 30 minutes now waiting to continue with the job but, like you suggested, there is possibly an edge case causing it to disappear.
EDIT: Ignore this and see my test case (next post).
Re: M200 prompts sometimes disappear
Posted: Fri Nov 29, 2024 7:46 pm
by corbin
OKAY! I've isolated it to this test case:
#140 = 3
m221 #140 "show for 3 seconds"
; some code that takes less than 3 seconds
m200 "Hit cycle start...if you can see this!"
Re: M200 prompts sometimes disappear
Posted: Fri Nov 29, 2024 11:06 pm
by suntravel
It will work only if the code to the next message is longer than 3s, if not the next message disappears also if the 3s are over.
Uwe
Re: M200 prompts sometimes disappear
Posted: Sat Nov 30, 2024 11:24 am
by cnc_smith
I use the M200 and the other M2xx.
If you want several lines of to show up with your message use the \n to create a second line instead of creating a new M2xx line.
(\n is explained in the manual 13.51.2 Special characters)
You have to create a new variable to display long or short for other M2xx #141 = 0 the message will be displayed until cycle start is press.
Re: M200 prompts sometimes disappear
Posted: Sat Nov 30, 2024 12:42 pm
by suntravel
cnc_smith wrote: ↑Sat Nov 30, 2024 11:24 am
I use the M200 and the other M2xx.
If you want several lines of to show up with your message use the \n to create a second line instead of creating a new M2xx line.
(\n is explained in the manual 13.51.2 Special characters)
You have to create a new variable to display long or short for other M2xx #141 = 0 the message will be displayed until cycle start is press.
Dana,
I think his problem is the timer for M221.
If any other M2xx will send a message before the timer of M221 is over, it will be deleted from the screen after the timer is done.
.
You must make sure that any code after M221 will run longer than the timer of M221 is set to, before commanding another Mxxx message
Uwe
Re: M200 prompts sometimes disappear
Posted: Sat Nov 30, 2024 2:19 pm
by cncsnw
His test case indicates the problem is with what came before the M200.
He evidently used M221 to display a message that was to remain on the screen for three seconds, but then before that timer expired, ran an M200 that put a new message on the screen.
Apparently the timer for the M221 message continued to run, and when it expired, CNC12 then erased the M200 message.
This seems like a (minor) bug. If any timed message is on the screen when another message is to be displayed (M200, M224, M225, ...) then the first message timer should be cancelled (since the timed message is gone).
Re: M200 prompts sometimes disappear
Posted: Sat Nov 30, 2024 2:32 pm
by suntravel
Yep, thats what I think too. I have had to edit my last post, because timer from M221 is the root cause not M200 (there is no timer)...
Uwe