Please enable JavaScript to view this site.

ZTERM

This escape sequence is for use on telnet sessions - it allows the host to communicate bi-directionally with a serial device connected to the PC running ZTERM.

Parameter

Value or Description

Sequence

ESC ESC CHR$(3) Parameters CHR$(0)

Parameters

Port number (1 for COM1, 2 for COM2 etc) followed by a comma

 

Baud rate followed by a comma

 

Parity flag (N - None, E - Even, O - Odd, M - Mark, S - Space) followed by a comma

 

Data bits (5 - 8) followed by a comma

 

Stop bits (1 or 2)

 

After this escape sequence is sent, any data arriving on the serial port will be sent through to the host as if it had been typed on the PC's keyboard. Data sent from the host will still be sent to the terminal emulator and not to the serial port - for example, you may have a bar-code reader attached to the PC and want it to be able to send data to the host at any time.

To divert data sent from the host to the serial port, simply enable transparent print mode - ^T on / ^X off on the AM62x emulations, ^X on / ^T off on the Wyse emulators and ESC [ 4 i on / ESC [ 5 i off for the VT100 and ANSI emulators.

Example 1

There's a bar-code reader on COM2 at 9600 baud without parity and we want any data it generates sent to the host:

PRINT CHR$(27);CHR$(27);CHR$(3);

PRINT "2,9600,N,8,1";CHR$(0);

 

Example 1

An electronic scale is connected to COM1 at 1200 baud with 7 data bits and even parity. Whenever it receives a carriage-return on it's serial port, it weighs the object and sends the weight on it's serial port followed by a carriage-return. We're using the ANSI emulator in this case:

PRINT CHR$(27);CHR$(27);CHR$(3);

PRINT "1,1200,E,7,1";CHR$(0);

PRINT CHR$(27);"[4i";! send output to the serial port
PRINT CHR$(13);! CR to tell the scale to weigh the object
INPUT "";A$        ! pick up results
PRINT CHR$(27);"[5i";! turn off serial output
PRINT CHR$(27);CHR$(27);CHR$(4);! turn off passthrough mode

 

Please note that this sequence is not supported on Windows CE versions of ZTERM.