Defining Communications Protocols for the Serial Printer

Once the printer is properly connected to your system via a COM port, you can define the communications protocols for that printer from TCL. If you prefer, you can skip these three steps and define the communications protocols via the Ports tab of the Administration Utility in the procedure which follows. If you prefer this second approach, proceed directly to the procedure titled Defining the COM Port as a Serial Printer Connection.

NOTE

mvBase defers to the most recent configuration of communications protocols, regardless of the manner in which they are defined. Thus, you may override communications protocols made in the Ports tab by using the PROTOCOL TCL command. Conversely, you may override protocols made with the PROTOCOL TCL command by using the Ports tab.

  1. See the documentation supplied with your particular printer for communication characteristics. These should always be set prior to setting up the system’s line protocols.

  2. From an mvTerm session, log to the SYSPROG account at TCL (if not still logged on from step 5 above).

  3. Using the PROTOCOL command, set the baud rate and other line protocols. If you require additional information about this command, see the Guide to mvBase Files and Accounts.

Format

PROTOCOL line [baud] [parity] [bits] [[-]D] [[-]XI] [[-] XO] [[-]W] [[-]B] [[-]C] [(C) (I) (O) (S)]

Parameter(s)

The hyphen [-] disables a characteristic. If no hyphen is present, the characteristic is enabled. Parameters can be entered in any sequence, separated by spaces or commas. When mvBase is initially installed, all lines are set to default settings, cited below where pertinent.

line

Number of the serial printer line.

The PROTOCOL command allows you to manipulate the software flow control by setting both the inward and the outward X-ON/X-OFF protocols.

baud

Baud rate. (Default: 9600). You can enter any of the following baud rates:

50  75  110  134  150  200  300  600  1200  1800  2400  4800  9600  9200  38400

NOTE— Verify that the I/O boards and terminals operate at the baud rate selected.

parity

Parity. Set the parity by entering the letter code for any of the following types. (Default: EVEN).

O

ODD

E

EVEN

M

MARKING

S

SPACE

N

NONE

bits

Number of significant data bits. The data bits can be set to 5, 6, 7, or 8. (Default: 7).

D or R

Enables or disables the RTS (Ready to Send) signal. To enable RTS, use D or R. To disable RTS, use -D or -R.

The RTS protocol is used to enable hardware flow control and works the same way as the MODEM-ON/MODEM-OFF commands. RTS signals are sent from peripheral devices to the system to start and stop transmission of data. If the RTS protocol is enabled, each time the RTS signal goes high, data is transmitted; each time the signal goes low, data transmission stops. If RTS is disable, the system ignores any RTS signal.

XI

Enables or disables inward X-ON/X-OFF codes. If enabled, the system automatically sends an X-OFF (CTRL+S) signal to the printer if the type-ahead buffer becomes more than two-thirds full. This prevents the device from transmitting any more input to the system. When the type-ahead buffer becomes less than one-third full, the system automatically sends an X-ON (CTRL+Q) signal, allowing input to resume.

XO

Enables or disables outward X-ON/X-OFF codes. The X-ON/X-OFF protocol works the same as the X-ON/X-OFF commands. If enabled, the user can stop terminal output by pressing CTRL+S, and start output again by pressing CTRL+Q. If disabled, these control key signals will not work.

W

Enables or disables automatic flow of input in the type-ahead buffer. If type-ahead wrap is enabled and the type-ahead buffer fills up, additional characters entered into the buffer will push out the first characters entered. Thus, the buffer will always hold the 127 most recently entered characters.

If type-ahead wrap is disabled and the type-ahead buffer fills up, no additional characters can be entered into it.

B

Enables or disables the bell signal on input buffer full. If enabled, a bell signal is sent whenever the type-ahead buffer is full. If disabled, no signal is sent. Nothing more can be sent on the line until the information in the type-ahead buffer is processed.

The bell character may be set to B=<ii>, where ii equals an ASCII hexadecimal character in the range of 01 through FE, which defines the character sent when the input buffer is full. The default bell signal is B=<07>.

C

Enables or disables CTS (Clear to Send) signal. This signal is sent from the system to the printer when the system is ready to receive data. If CTS is enabled, each time the signal goes high, the system is ready to receive data. Each time the system goes low, the system is not ready to receive data. If CTS is disabled, the system ignores any CTS signal.

C={0/1}

Forces CTS signal low (C=0) or high (C=1).

Options

Options can be any of the following. If an option is not appended to the PROTOCOL command, neither the input nor the output buffer will be affected by the command’s execution. Options can be entered in any sequence, separated by spaces or commas.

C

Clears local input and output buffers and resets any flags.

I

Clears local input buffer and resets any flags.

O

Clears local output buffer and resets any flags.

S

Changes the current Stop bit on the specified line to the specified bits.

In summary, the default settings for some parameters cited above are:

baud

9600

parity

EVEN

bits

7

DTR

OFF

X-in

OFF

X-out

OFF

bell

ON

type-ahead

ON

Example

For example, if setting up printer 2 as a serial printer on line 6 with a baud rate of 9600, no parity, 8 data bits, and using the DTR protocol, use this command line:

>PROTOCOL 6 9600 N 8 +D

See Also

Setting Up mvBase Printers on COM Ports

Preparing for Configuration

Physically Connecting the Serial Printer

Defining the COM Port as a Serial Printer Connection