Oki X400 X400 Programming Command Manual - Page 5

Printing with the Parallel Port

Page 5 highlights

characters after every line. The command string should be continuous and uninterrupted by and/or commands. The examples given in this manual are printed on separate lines because they will not fit on one line and do not contain any and/or characters. If these characters are needed, they are explicitly noted by the inclusion of and notations. 2. If you are using the printer's RS232 interface, it is necessary to set the COM port on the PC such that the CTS and DSR signals will be ignored. Send your OPEN "COM" statement in the following way: OPEN "COM1:9600,N,8,1,CS,DS" AS #1 This sets the RS232 communication parameters of the host PC's COM1 port for 9600 baud, None parity, 8 Data bits, 1 Stop bit and directing the port to ignore the CTS and DSR control signals. 3. You may want to minimize keystrokes and program size by assigning the character to a string variable since this character is used quite often. The following two examples in BASIC show a typical example using these hints. Both of these examples use the Standard Protocol codes. Printing with the Parallel Port 5 REM Parallel Example 10 E$=CHR$(27) 20 WIDTH "LPT1:",255 30 LPRINT E$;"A"; 40 LPRINT E$;"H400";E$;"V100";E$;"WL1OKI"; 50 LPRINT E$;"Q1"; 60 LPRINT E$;"Z"; Identifies the program as a parallel port print label. The "REM" prevents this data from being sent to the printer and displays it only on the screen. Sets the "E$" string as an character Sets the width of output to 255 characters Sends an "A" command code to the LPT1 parallel port Sends the data "OKI" to be placed 400 dots horizontally and 100 dots vertically on the label and printed in the "WL" font. Instructs the printer to print one label. Tells the printer that the last command has been sent. The printer can now create and print the job. 3

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137

characters after every line. The command string should be continuous and uninterrupted by <CR> and/or
<LF> commands. The examples given in this manual are printed on separate lines because they will not
fit on one line and do not contain any <CR> and/or <LF> characters. If these characters are needed, they
are explicitly noted by the inclusion of <CR> and <LF> notations.
2.
If you are using the printer’s RS232 interface, it is necessary to set the COM port on the PC such that the
CTS and DSR signals will be ignored. Send your OPEN “COM” statement in the following way:
OPEN “COM1:9600,N,8,1,CS,DS” AS #1
This sets the RS232 communication parameters of the host PC’s COM1 port for 9600 baud, None parity,
8 Data bits, 1 Stop bit and directing the port to ignore the CTS and DSR control signals.
3.
You may want to minimize keystrokes and program size by assigning the <ESC> character to a string
variable since this character is used quite often.
The following two examples in BASIC show a typical example using these hints. Both of these examples use
the Standard Protocol codes.
Printing with the Parallel Port
5
10
20
30
40
50
60
REM
Parallel Example
E$=CHR$(27)
WIDTH “LPT1:”,255
LPRINT E$;”A”;
LPRINT E$;”H400”;E$;”V100”;E$;”WL1OKI”;
LPRINT E$;”Q1”;
LPRINT E$;”Z”;
Identifies the program as a parallel port
print label. The “REM” prevents this data
from being sent to the printer and displays
it only on the screen.
Sets the “E$” string as an <ESC> character
Sets the width of output to 255 characters
Sends an “<ESC>A” command code to the
LPT1 parallel port
Sends the data “OKI” to be placed 400 dots
horizontally and 100 dots vertically on the
label and printed in the “WL” font.
Instructs the printer to print one label.
Tells the printer that the last command has
been sent. The printer can now create and
print the job.
3