Skip to content

Execution Mode


The execution mode query is used by the client to change the execution mode between delayed and real time. It uses the query:

!s-eMOD-[EXECUTION_MODE]-e!

Where the EXECUTION_MODE variable is a single uint8_t binary value that can take two values:

  • _eMOD_Delayed (uint8_t c=100) → In order to change the execution mode to delayed.
  • _eMOD_RealTime (uint8_t c=101) → In order to change the execution mode to real time.

And the response from the server is either a positive control query, with the same code provided by the client as confirmation, or a negative control query with the error codes:

  • _NACK_InvalidQuery (uint8_t c=255) → If the query format is invalid: contains null-bytes, invalid header or tail sequences, or the query function code is not recognized.
  • _NACK_InvalidParameter (uint8_t c=252) → If EXECUTION_MODE has a value different than uint8_t c=100 (delayed mode) or uint8_t c=101 (real time mode).

The possible communication schemas for this query are:

Execution mode comm schema Execution mode comm schema
Diagram for a successful and failed change of execution mode

Delayed Execution Mode

While operating under the delayed execution mode, the servo movement query alters its functionality. Instead of relaying a servo movement query to the mcu, the server will update its internal "target position". If the mcu is of the type SmartMCU, the server will send these movements for the mcu to store, but not execute, using the same movement query but replacing the m movement code with a u:

-u-[NUMBER_OF_MOVEMENTS]-[SERVO_ID:SERVO_POS]-<...>-[SERVO_ID:SERVO_POS]-!

The query still follows a similar connection schema as the servo movement query on real time mode:

delayed srvp comm schema delayed srvp comm schema
Diagram for a SRVP query on delayed mode

This query will not be sent to a mcu of the type DumbMCU.

To execute movements while working under delayed execution mode, the client must first configure them by sending one or more servo movement queries. After loading the movements, the client can issue a move servos (delayed mode) query to execute them.