Page 20 of 33
5.4 Programming Example to Show All Four Character
Basic Program
10 WIDTH LPRINT 255
20 FOR X=1 TO 4
30 LPRINT CHR$(27)+”s”;CHR$(X) :REM SELECT THE CHARACTER SET
40 LPRINT “Text”;X :REM SEND SOME TEXT
50 NEXT X
60 LPRINT “———————————————” :REM CODE BELOW IS FOR FEED + CUT
70 FOR X=1 TO 10
80 LPRINT :REM FEED TO CLEAR DELIVERY
90 NEXT X
100 LPRINT CHR$(27) + “c” :REM CUT THE PAPER
110 END
5.5 Non-Volatile Data (with Optional 512KByte Ram)
Non-volatile data may be down loaded to the SP-5000. A total of 31 (0-30) banks (16Kbytes per bank) may be
used for data downloading purposes. One bank remains for internal printer functions. Graphic images may be
down loaded to the printer via *.PRN files that are created by the SP-5000 Driver for Microsoft Windows® when
printed to a file. A downloading example of a *.PRN graphics image with 24,576 Bytes of data is as follows:
Image Size Example = 24,576 Bytes
·
Each bank can accept 16KB - 7Bytes of data for a total of 16377 Bytes per bank
Calculate the Number of Banks Required
·
Divide the image size (24,576) by the Bytes per bank (16377) = 24576/16377=1.5006 Banks
·
Round up to the next whole number of banks (30 maximum)
·
2 banks will be required)
Calculate the Data Remainder (High and Low)
·
24576-16377=8199 Bytes
8199/256= 32.02734375 (round down to the next whole number) = 32 = H remainder
·
32*256=8192 Bytes
8199-8192=7 Bytes (must be less than 256) = L remainder = 7
To down load the image to the printer, send the following ESC Code:
ESC+p+n1+n2,h,l ESC+p+0,2,32,7
n1 = 0-30 = Banks where data is stored
n2 = Number of banks required
h = High remainder
l = Low remainder
5.5.1 An Example of Programming Non-Volatile Data in BASIC
Basic Program
10 WIDTH LPRINT 255
20 LPRINT CHR$(27)+”p”;CHR$(0);CHR$(2);CHR$(32);CHR$(7);
30 SYSTEM
Prepares printer to accept file (24,576 Bytes) into two banks starting with the first bank (0)
10 LPRINT CHR$(27)+”q”+CHR$(0);
20 SYSTEM
Prints file (24,576 Bytes) starting with the first bank (0 defaults to print all banks)
5.5.2 Printing Non-Volatile Data