Motion Perfect terminals - cursor control

Motion Perfect terminals - cursor control

From Motion Perfect v4 version 4.4.1 onwards, the terminals 0, 5, 6 and 7 support a sub-set of the VT100 cursor control codes.  These are in the form of escape sequences starting with the <ESC> code ASCII code 27 ($1B in Hex)

Currently supported commands:

Cursor Control
Cursor Home <ESC>[{ROW};{COLUMN}H
Sets the cursor position where subsequent text will begin. If no row/column parameters are provided (ie. <ESC>[H), the cursor will move to the home position, at the upper left of the screen.


Cursor Up <ESC>[{COUNT}A
Moves the cursor up by COUNT rows; the default count is 1.

Cursor Down <ESC>[{COUNT}B
Moves the cursor down by COUNT rows; the default count is 1.

Cursor Forward <ESC>[{COUNT}C
Moves the cursor forward by COUNT columns; the default count is 1.

Cursor Backward <ESC>[{COUNT}D
Moves the cursor backward by COUNT columns; the default count is 1.

Force Cursor Position <ESC>[{ROW};{COLUMN}f
Identical to Cursor Home.


Erasing Text
Erase End of Line <ESC>[K
Erases from the current cursor position to the end of the current line.

Erase Start of Line <ESC>[1K
Erases from the current cursor position to the start of the current line.

Erase Line <ESC>[2K
Erases the entire current line.

Erase Down <ESC>[J
Erases the screen from the current line down to the bottom of the screen.

Erase Up <ESC>[1J
Erases the screen from the current line up to the top of the screen.

Erase Screen <ESC>[2J
Erases the screen with the background colour and moves the cursor to home.


A BASIC program using the PRINT command has to send the ESC code twice in the PRINT so that is sends on ESC to the terminal.


For example:
' move to row 14 / column 10
PRINT CHR(27); CHR(27); "[14;10H";

    • Related Articles

    • Will processes change with Motion Perfect 5?

      Process numbering is controlled entirely by the firmware so nothing should change when you update Motion Perfect.  For example, process numbers for MC405 are 0 to 9.
    • MC202 controller and Motion Perfect

      For the MC202 you must use Motion Perfect 2. Motion Perfect versions 3, 4 and 5 are for the later generation of Motion Coordinators that connect using Ethernet. I am running this version of Motion perfect 2 on my Windows 10 PC. You need a COM port on ...
    • Can I use Motion Perfect v4 with the new MC404-Z?

      The MC404-Z and other new products require the latest version of Motion Perfect to run them.  At the time of writing this post, the latest version is MPv5 version 5.0.2 and that is the recommended version for programming the MC404-Z 4 axis stepper ...
    • Motion Perfect problem when SCOPE command is used

      When running the SCOPE command in a program, I think Motion Perfect doesn't like the SCOPE command being issued over and over when I run it. It seems more stable when I comment the SCOPE command out after it's ran once. ...
    • Few questions regarding Motion Perfect

      If you want to do the same as the Motion Stop button in Motion Perfect then this is the command list done by Motion Stop: RAPIDSTOP(2) HALT WDOG=0 That stops all axes, stops all programs and disables the drives.