/** * Send an "ok" message to the host, indicating * that a command was successfully processed. * * If ADVANCED_OK is enabled also include: * N<int> Line number of the command, if any * P<int> Planner space remaining * B<int> Block queue space remaining */voidGCodeQueue::ok_to_send() {
#if NUM_SERIAL > 1
constint16_t pn = port[index_r];
if (pn < 0) return;
PORT_REDIRECT(pn);
#endifif (!send_ok[index_r]) return;
SERIAL_ECHOPGM(MSG_OK);
#if ENABLED(ADVANCED_OK)
char* p = command_buffer[index_r];
if (*p == 'N') {
SERIAL_ECHO('');
SERIAL_ECHO(*p++);
while (NUMERIC_SIGNED(*p))
SERIAL_ECHO(*p++);
}
SERIAL_ECHOPGM(" P"); SERIAL_ECHO(int(BLOCK_BUFFER_SIZE - planner.movesplanned() - 1));
SERIAL_ECHOPGM(" B"); SERIAL_ECHO(BUFSIZE - length);
#endifSERIAL_EOL();
}
CNCjs 无法将高级 ok 消息识别为正确的 ok,只是挂在等待状态。根据响应高级 ok 消息的 Marlin 代码,以下是一些可能的组合:
马林:gcode/queue.cpp
https://github.com/MarlinFirmware/Marlin/blob/2.0.x/Marlin/src/gcode/queue.cpp?fbclid=IwAR1NxIYkG8diSEoc3EEIrn6RNJImfJvdxO7wWWDHLchlub9ZNzMl8RyKdEI