Problema M117 e M0 su Marlin. Sbaglio a compilare il gcode? October 25, 2018 11:23AM |
Registered: 6 years ago Posts: 99 |
G28 M0 Primo angolo G0 F1000 Z10 G0 F3000 X40 Y40 Z0.1 M0 Secondo angolo G0 F1000 Z10 G0 F3000 X190 Y40 Z0.1
Re: Problema M117 e M0 su Marlin. Sbaglio a compilare il gcode? October 25, 2018 12:12PM |
Registered: 6 years ago Posts: 1,059 |
* M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
* M117 - Display a message on the controller screen * M118 - Display a message in the host console.
M117 Il messaggio M0 " qui aspetta la pressione sul tasto"
// // Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. // //#define ULTRA_LCD
/** * MK4duo Firmware for 3D Printer, Laser and CNC * * Based on Marlin, Sprinter and grbl * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm * Copyright (C) 2013 Alberto Cotronei @MagoKimbra * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see [www.gnu.org]. * */ /** * mcode * * Copyright (C) 2017 Alberto Cotronei @MagoKimbra */ #if HAS_RESUME_CONTINUE #define CODE_M0 #define CODE_M1 /** * M0: Unconditional stop - Wait for user button press on LCD * M1: Same as M0 */ inline void gcode_M0_M1(void) { const char * const args = parser.string_arg; millis_t ms = 0; bool hasP = false, hasS = false; if (parser.seenval('P')) { ms = parser.value_millis(); // milliseconds to wait hasP = ms > 0; } if (parser.seenval('S')) { ms = parser.value_millis_from_seconds(); // seconds to wait hasS = ms > 0; } planner.synchronize(); #if ENABLED(ULTIPANEL) if (!hasP && !hasS && args && *args) lcd_setstatus(args, true); else { LCD_MESSAGEPGM(MSG_USERWAIT); #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 dontExpireStatus(); #endif } #elif ENABLED(NEXTION) if (!hasP && !hasS && args && *args) lcd_yesno(4, args, "", MSG_USERWAIT); else lcd_yesno(4, MSG_USERWAIT); #else if (!hasP && !hasS && args && *args) SERIAL_LT(ECHO, args); #endif printer.setWaitForUser(true); printer.keepalive(PausedforUser); if (ms > 0) { watch_t watch(ms); while (!watch.elapsed() && printer.isWaitForUser()) printer.idle(); } else { #if ENABLED(ULTIPANEL) if (lcd_detected()) #endif while (printer.isWaitForUser()) printer.idle(); } IS_SD_PRINTING ? LCD_MESSAGEPGM(MSG_RESUMING) : LCD_MESSAGEPGM(WELCOME_MSG); printer.setWaitForUser(false); printer.keepalive(InHandler); } #endif // HAS_RESUME_CONTINUE
Re: Problema M117 e M0 su Marlin. Sbaglio a compilare il gcode? October 25, 2018 01:14PM |
Registered: 6 years ago Posts: 99 |
Quote
onekk
M0 è uno stop non dovrebbe stampare nulla
M117 dovrebbe stampare sul display LCD almeno come riportato sulla pagina:
RepRap Wiki GCode
* M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
In MK4duo.ino la spiegazione dice solo che aspetta la pressione del tasto sull'LCD, non che stampa un messaggio sull'LCD
* M117 - Display a message on the controller screen * M118 - Display a message in the host console.
Il comando M117 dovrebbe stampare sull'LCD e il M118 dovrebbe stampare sulla console (terminale seriale)
Seguendo la logica il conportamento voluto dovrebbe ottenersi con
M117 Il messaggio M0 " qui aspetta la pressione sul tasto"
Ora non posso provare però la nota (Only if ULTRA_LCD is enabled) magari si riferisce al fatto che funzioni solo sui display non grafici visto che la linea è preceduta da questo nel Configuration_Features.h di MK4Duo, che non dovrebbe discostarsi molto dal Marlin "liscio" in questa parte di codice…
Saluti
Carlo D.
Re: Problema M117 e M0 su Marlin. Sbaglio a compilare il gcode? October 25, 2018 06:19PM |
Registered: 10 years ago Posts: 6,409 |