Special formats

BARR/PRINT TCP/IP

You can use two types of special formats to send commands or resources to printers: Hexadecimal and Transparent.

The Siemens DPRN program frequently generates hexadecimal formats to send resources or command information to TCP/IP-compatible Siemens printers.

You can use transparent formats to send EBCDIC resources or command information to printers. No conversion from ASCII to EBCDIC is performed.


Hexadecimal command plus data

Special applications generate the Hexadecimal Command Plus Data format to send channel commands (machine carriage control) plus data to the printer. You would typically use this format to load printer resources. It handles both 7-bit and 8-bit data.

In Hexadecimal Command Plus Data format, each data byte is given in hexadecimal as two ASCII characters (0 to 9 and A to F). For example, byte 11 would be coded in the VAX Acronym for Virtual Address Extension. A family of 32-bit minicomputers introduced by Digital Equipment Corporation in 1978. files as 31 31. When the Barr software receives the data, it converts the ASCII 31 31 back to EBCDIC 11.

A five-byte format string terminated by a carriage return (CR) precedes the command data. A line feed, carriage return (LF CR) command turns off Hexadecimal Command Plus Data format. Use this format:

Field

Bytes

Contents

Format Header

2

Required value of 1F 4B.

Channel Command Word

2

Two ASCII bytes. Must be a Write type of command.

Carriage Return (CR)

1

0D. Signals end of format string.

Command Data

n

Two ASCII bytes per hexadecimal code in the data.

Line Feed, Carriage Return (LF CR)

2

0A 0D. Signals end of data and Hexadecimal Command Plus Data format.

An example string with an explanation of each byte follows:

1F 4B 35 33 0D 46 36 30 30 30 30 31 41 0A 0D

Format header

1F 4B

Channel command word

35 33

Carriage return

0D

Command data

46 36 30 30 30 30 31 41

Line feed, carriage return

0A 0D

Resulting hexadecimal stream (in S/370 receive mode):

05 00 53 F6 00 00 1A 05 00

Hexadecimal in-line

Hexadecimal In-Line format is similar to Hexadecimal Command Plus Data format, but you use it to issue a command within a line of print data. You can use Hexadecimal In-Line format to issue printer escape sequences to activate a previously loaded resource and to combine short print lines. The format header can be one or two bytes, depending on whether the escape sequence begins in position 1.

For an in-line command specified anywhere within a print line except position 1, use this format:

Field

Bytes

Contents

Format Header

1

Required value of 1F.

Escape Characters

n

Each escape character is given as two ASCII bytes.

Format Trailer

1

Required value of 1F.

For example, to code the escape sequence FF 34 within a line of data, the format string looks like this:

. . . 48 49 1F 46 46 33 34 1F 54 48 45 52 45 . . .

ASCII print data (HI)

48 49

Beginning of in-line format string

1F

Escape sequence FF 34

46 46 33 34

End of in-line format string

1F

ASCII print data (THERE)

54 48 45 52 45

Resulting hexadecimal stream:

48 49 FF 34 54 48 45 52 45

When you use Hexadecimal In-Line format, the carriage return, line feed (0D 0A) characters are ignored, but a space (20) is inserted. This is a convenient way to make a line that exceeds the maximum allowable line length appear as two short lines to TCP/IP and thus print correctly as one line.

To concatenate two short print lines, turn on Hexadecimal In-Line mode at the end of the first line and turn it off at the beginning of the second line. For example, to combine a line containing the text HI with the next line THERE, specify the following:

48 49 1F 0D 0A 1F 54 48 45 52 45 0D 0A

ASCII print data for line 1 (HI)

48 49

Beginning Hexadecimal In-Line mode

1F

Carriage control (end of line 1)

0D 0A

End Hexadecimal In-Line mode

1F

ASCII print data for line 2 (THERE)

54 48 45 52 45

Carriage control (end of line 2)

0D 0A

Resulting hexadecimal stream:

48 49 20 54 48 45 52 45 0D 0A

To print lines longer than 255 characters, use the command IF 52 in the input stream. When the software encounters this command, the current contents of the line buffer are flushed to the output without a carriage control.

Hexadecimal command

Special applications generate the Hexadecimal Command format to send channel commands to the printer without data. Data can be 7-bit or 8-bit data.

A five-byte format string must begin in position 1. Use this format:

Field

Bytes

Contents

Format Header

2

Required value of 1F 4D.

Channel Command Word

2

Given as two ASCII bytes. Must be an Immediate type of command.

Carriage Return (CR)

1

Required value of 0D.

An example string with an explanation of each byte follows.

1F 4D 38 42 0D

Format header

1F 4D

Channel command 8B (Skip to Channel 1)

38 42

Carriage return (CR) end of format string

0D

Resulting hexadecimal stream (in S/370 receive mode):

01 00 8B 01 00

Transparent command plus data

Special applications generate the Transparent Command Plus Data format to send channel commands (machine carriage control) plus data to the printer, usually for loading printer resources. You can use it for 8-bit data.

A five-byte format string precedes the command data. After the software processes a specified number of bytes, the transfer mode switches back to ASCII. Transparent data must be structured this way:

Field

Bytes

Contents

Format Header

2

Required value of 1F 4A.

Channel Command Word

1

Required. Must be a Write type of command.

Length

2

Given with Most Significant Byte first (MSB LSB). Number of bytes for which Transparent mode is in effect.

Command Data

n

The number of data bytes must equal the specified length.

An example string with an explanation of each byte follows.

1F 4A 53 00 04 F6 00 00 1A

Format header

1F 4A

Channel command

53

Length (4 bytes of data follow)

00 04

Command data

F6 00 00 1A

Resulting hexadecimal stream (in S/370 receive mode):

53 F6 00 00 1A

Transparent command

Special applications generate Transparent Command format to send only channel commands to the printer without command data. Data must be 8-bit data.

A four-byte format string must begin in position 1. Use this format:

Field

Bytes

Contents

Format Header

2

Required value of 1F 4C.

Channel Command Word

1

Must be an Immediate type of command.

Carriage Return (CR)

1

Required value of 0D.

An example string with an explanation of each byte follows.

1F 4C 8B 0D

Format header

1F 4C

Channel command (Skip to Channel 1)

8B

Carriage return (CR), end of format string

0D

Resulting hexadecimal stream (in S/370 receive mode):

01 00 8B 01 00