SATO M-5900RV Manuel D’Utilisation

Page de 258
SATO  M-5900RV Operator and Technical Reference Manual
Page 4-3
Section 4.  Programming Reference
PN 9001081
Rev. C
4.4  Using Basic
It may be useful to test your printer using a BASIC program on a PC.  You may
also write your actual production programs in BASIC.  Whatever the reason, if
you will be working in BASIC, some of the following hints may help you get
started:
1.   Set the WIDTH of the output device to 255 characters to avoid
automatically sending <CR>and <LF> 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 CTS and DSR signals will be ignored.  Send your
OPEN “COM” statement in the following way:
OPEN “COM1:9600, E,8,1,CS,DS” AS#1
This sets the RS232 communication parameters of the host PC’s COM1 port
for 9600 baud, Even 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
REM Parallel Example:
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 the output to
255 characters.
Sends an "<ESC>A"
command code to the LPT
parallel port.
10 E$=CHR$(27)
20 WIDTH "LPT1:",255
30 LPRINT  E$; "A";