Applicable Model(s)

STEPware

Title

Using STEPware Escape Control Commands

Date

10/23/2023

Rev

00

P/N

0907-1066

Summary

This document provides some examples on implementing STEPware’s Escape Control Commands.
The examples are code fragments written in a typical Basic language.

It is assumed that the reader has some knowledge of

  • the Basic programming language;
  • the language of the controller to which the Maple Systems OIT will be connected.

Important Notes

NOTE 1: Not all controllers will support the commands and structure listed below. The Engineer
will need to determine if the code will work as listed; or what modifications are
necessary.

NOTE 2: Normally, a PRINT statement automatically appends a Carriage Return after the data in
the statement is printed. In the code below, the PRINT statements are followed by a
semicolon (;). This causes the PRINT statement to NOT add a Carriage Return to the
printed data. It is common in BASIC for the semicolon to work like this; however, it
may not be supported in special versions of BASIC used in some controllers.

NOTE 3: The commands are Case Sensitive. An uppercase letter is a different command than
the same letter in lowercase.

NOTE 4: See STEPware Help or the STEPware documentation for more information on the
Escape Control Commands presented in this document.


Control Codes

All Escape Control Commands must begin with the ESC (ASCII 27D, 1BH) character, and end
with the STX (ASCII 02D, 02H) character.

In Basic, these are generated as follows:
100 PRINT CHR$(27) ‘ ESC character
110 PRINT CHR$(2) ‘ STX character


Escape Control Commands

Display Message Command
ESC m[message number] STX
‘ The code below will cause the OIT to display Message #12 100 PRINT CHR$(27);”m12”;CHR$(2) ;


Echo Text Command
ESC e[text] STX
‘ The code below will cause the Text sent to the OIT
‘ to be sent back to the Host
‘ can be done like this…
100 TESTTEXT$ = “Echo Test”
110 PRINT CHR$(27);”e”;TESTTEXT$;CHR$(2);
‘ or like this
100 PRINT CHR$(27);”eEcho Test”;CHR$(2);


Enable Handshaking Command
ESC H[handshake] STX
‘ The code below will cause the OIT to use
‘ Hardware Handshaking
100 PRINT CHR$(27);”H2”;CHR$(2);


Function Key Control Command
ESC K [function key #] [enable]0 0 STX
‘ The code below will disable Function Key #5
‘ the 2 trailing zeroes are placeholders and are required
100 PRINT CHR$(27);”K5100”;CHR$(2);


Function Key LED Control Command
ESC X [function key #] [mode] STX
‘ The code below will blink the LED on Function Key #2
‘ the command is applicable only to units that have LEDs
100 PRINT CHR$(27);”X022”;CHR$(2);


Keyboard Control Command
ESC k [enable] 0 0 [click] [setup] STX
‘ The code below will turn off the audible keyclick
‘ the 2nd and 3rd zeroes are placeholders and are required
100 PRINT CHR$(27);”k00010”;CHR$(2);


Print Text Command
ESC P [text] STX
‘ The code below will print a text string on the Serial
‘ printer attached to the OIT’s 2nd serial port
‘ (2-port models only)
‘ can be done like this…
100 TESTTEXT$ = “Print Test”
110 PRINT CHR$(27);”P”;TESTTEXT$;CHR$(2);
‘ or like this
100 PRINT CHR$(27);”PPrint Test”;CHR$(2);


Set Status LED Command
ESC Y [status led #] [mode] STX
‘ The code below will turn on status LED #8
‘ the command is applicable only to units that have LEDs
100 PRINT CHR$(27);”Y081”;CHR$(2);


Set System LED Command
ESC Z [system led #] [mode] STX
‘ The code below will turn off the Run LED
‘ the command is applicable only to units that have LEDs
100 PRINT CHR$(27);”Z030”;CHR$(2);


Set Tab Width Command
ESC z [width] STX
‘ The code below will set the number of spaces
‘ for a Tab character to 8
100 PRINT CHR$(27);”z3”;CHR$(2);


Set Turnaround Delay Command
ESC t [width] STX
‘ The code below will set the Turnaround Delay
‘ to 250 msec.
100 PRINT CHR$(27);”t3”;CHR$(2);


Set Viewing Angle or Brightness Command
ESC a [bias or brightness] STX
‘ The code below will adjust the Viewing Angle (LCD models)
‘ or Brightness (VFD models)
‘ set for maximum
100 PRINT CHR$(27);”a0”;CHR$(2);


Sound Bell Command
ESC g [seconds] STX
‘ The code below will sound the OIT’s audible transducer
‘ for 2 seconds
100 PRINT CHR$(27);”g2”;CHR$(2);

Scroll to Top