Stringing commands together, Chapter 2: emulations – Dascom T2250 User Guide IGP for Dot Matrix Printers User Manual

Page 47

Advertising
background image

Chapter 2: Emulations

47

For example, if you wanted to print a pattern 10 times you would look up 10 in the repetition
column above; the ASCII character that corresponds to 10 is an asterisk (*). Therefore, placing
an asterisk after a dot-pattern designator would cause the printer to repeat the pattern 10 times.

For numbers greater than 15, you must send a two-byte code:

Byte 1

= (the remainder of the number of desired repetitions)

÷

16


Byte 2

= (number of desired repetitions)

— (largest possible multiple of 16 that will result in a positive integer or 0)

The maximum number of times a dot pattern may be repeated per request is 255. The ASCII
characters that are used to represent multiples of 16 are 0–? (HEX 30–3F).

Example:

To send 70 repetitions, you must first find the largest multiple of 16 that is less than or
equal to 70, then subtract that number from 70 to find the remainder. From the above
table you can see that the largest multiple of 16 that is less than or equal to 70 is 64.
Subtracting 64 from 70 gives us a result of 6. To find the ASCII equivalent of 6, use
Figure 17. To compile the 2-byte code for 70 repetitions, remember, the remainder
comes first. The result will be & for the remainder of 6, followed by 4 for the multiple of
16 (64).

To print the previous dot pattern 70 times you would send the following escape
sequence:

ESC

[ < 3 h u & 4

1B 5B 3C 33 68 75 26 34

Stringing Commands Together

Different dot-pattern designators may be strung together in a single escape sequence to enable
printing special graphics. To illustrate stringing designators together, we will use a single dot-
pattern command repeated eight times and string together 6 of these commands. That escape
sequence is:

ESC

[<3h

A ( A ( A ( A ( A ( A ( CRLF

1B5B3C3368 41 28 41

28

41

28

41

28

41

28

41 28 0D0A

Where:

A = The dot pattern.

( = 8 repetitions of the dot pattern. (se Figure 17)

This would result in the selected dot pattern being printed 48 times across the page. Or you may
send just a single command that specifies that the selected dot pattern is to be printed 48 times:

ESC [ < 3 h A SP

3 CR LF

1B 5B 3C 33 68 41 20 33

0D

0A

Advertising