SATO GT408, GT412, GT424e, GT408e, GT412e User Manual

Page 1
GT408/412/424e
Printer
SEMBL USER GUIDE
PN 9001148A
Page 2
SATO America, Inc.
10350A Nations Ford Road
Main Phone: (704) 644.1650
Technical Support Hotline: (704) 644.1660
Technical Support Fax: (707) 644.1661
E-Mail: satosales@satoamerica.com
technical support@satoamerica.com
www.satoamerica.com
WARNING
THE EQUIPMENT REFERENCED IN THIS DOCUMENT COMPLIES WITH THE REQUIREMENTS IN PART 15 OF FCC RULES FOR A CLASS B COMPUTING DEVICE. OPERATION OF THIS EQUIPMENT IN A RESIDENTIAL AREA MAY CAUSE UNACCEPTABLE INTERFERENCE TO RADIO AND TV
RECEPTION.
Page 3
TABLE OF CONTENTS
OUTLINE 1
BASIC INTERPRETER OVERVIEW 1
BASIC INTERPRETER TABLE 3
Basic Interpreter Table 3 Operator 4 Character Operation 5 Control Flag 5
INSTRUCTION REFERENCE 6
ECHO 6 CLOSE 6 CTRL-C 6 DIM 6 END 7 FOR NEXT 7 ASC 7 IF ENDIF 7 GOTO 8 INPUT 8 LET 8 LIST 9 LOAD 9 CLEAR 9 OPEN 9 OUTBYTE 9 PRINT 10 REM 10 RENUM 10 RESTART 10 RUN 11 SBPL 11 SLEEP 11 STEP 11 SAVE 11 AND 12 NOT 12 OR 12 & 12 $ 12 <, <=, >, >=, =, <> 13 ^, *, /, +, - 13 MID 13 MOD 13 LEN 13 VAL 14 CHR$ 14 STR$ 14 DATE$ 14 TIME$ 14 DELETE 15 KILL 15 DIR 15 ISERROR 15
PN 9001148A
Page 4
ISWARNING 18 STOP 19 EXIT FOR 19 INKEY 19 GOSUB RETURN 20 ON ERROR 20 DEBUG 20 TRACE 21 “ (apostrophe) 21 ECHOBACK 21 TIMER 22 ON TIME$~ 22 INBYTE 23 BEEP 23 CANCTRL 23 GETSTATUS 24 CTIME 24 CTIMER 24 ON CTIME 25 INARRAY 25 INUNTIL 26
SPECIFICATION DETAILS OF THE COMMAND 27
Device 27 Port 28 Input Process 29 Output Process 29 Key Input Value (using printer key only) 30 Key Input Value (using Shift key + Printer key) 30
KEY WORDS 31
Valid Key Words 31 Invalid Key Words 32
ERROR MESSAGES 33
FUNCTIONALITY 34
Send Migration Command of SEMBL 34 SEMBL selection by LCD Menu 34 Pre-Set SEMBL Auto-Execution 34
AUTO EXECUTION OF BASIC PROGRAM 35
Auto Run when Shifting to SEMBL Mode 35 Auto Run when Inputting Power 35
EXITING FROM THE SEMBL MODE 36
Send SEMBL Shift Command 36 Select other than SEMBL from LCD 36 Power On/Off 36 Other SEMBL Mode Exit Conditions 36
BASIC OPERATION OF SEMBL MODE 37
File Preparation to Send 37 Hyperthermal Settings 37 Hyperthermal Operation 39 RPUTY File Transmission 39 Repreating Execution 39
REMARKS FOR SEMBL OPERATION 40
PN 9001148A
Page 5
OUTLINE
The Basic Interpreter Mode can execute the printer’s program in BASIC format enabling applications such as performing stand alone printing. Since the emulation content is different, there is limitation in the application command which will be described in the manual.
BASIC INTERPRETER OVERVIEW
SPECIAL NOTES
SEMBL-BASIC has changed the partial specification based on ZBI of the ZEBRA. Details may be found in the Instruction Reference.
Input is performed at the half-sized alphanumeric character ASCII Code in accordance with ANSI.
The valid code range is 20 CR(0D and HT(09
16), LF(0A16, ETX(0316), and BS(0816). Other control codes will be ignored after receipt
16) will also be thrown out. There is not a code limitation in the string quote and
16, 7E16, and partial control code. The valid control code is only
CHR$().
When 2 byte code and half-sized code (80
16 . FF16) at shiftout side is used for the LCD
display data string, it might not be generated correctly.
Command input and parameters that accompany the command will not differentiate between upper and lower case. When command and command parameter are entered in lower case, or with the mixture of upper and lower, it will be interpreted similarly as if it is upper case.
Numeric mark has the following limitation:
Other than decimal numeral, numeral marks of hexdecimal, octal, and binary is applicable.
NUMERAL DESCRIPTION METHOD EXAMPLE
Decimal
10
Hexidecimal
16
Octal
8
Binary
2
Data string that is composed by using numeric of 0 thru 9.
Data string that is composed by using both numeric &H. 0 thru 9 and alphabet A thru F.
Data string that is composed by numeric of &O. 0 thru 7
Data string that is composed by numeric of &B. 0 thru 1
1021, -5, 0
&H3FD, &H8005, -&H5, &H0 &H8005 and -&H5 shows the same value
&O1775, &O700005, -&O5, &O0 &O700005 and -&O5 shows the same value
&B001111111101, &B1000000000000101, &B101, &B0
Only positive and negative integral numbers may be used. Fractions cannot be assigned.
As for hexadecimal, the lower case mark is allowed in A thru F.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 1
Page 6
Integral numbers will be single-precision real numbers. Double-precision and exponent mark is not allowed.
The valid range of numerical value is -2147483647 thru 2147483637 (with code 4 byte value:
-7FFFFFFF
16 thru -7FFFFFFF16). When the valid range is exceeded, a rounded interpretation
within the valid range will be provided, but perhaps without the expected result.
The maximum quantity of the digits for character string is 256. An error will appear if exceeding the valid range.
The definable number of numeric variable is at maximum 256.
The definable number of string variable is at maximum 256.
Both numeric variables and string variables can define the one-dimensional and two dimensional arrays in the variable. In either case, the definable array element number is defined in the number.
Variable name is valid to 8 digits. Length exceeding 8 digits is interpreted by rounding off to 8 digits beginning at variable definition.
Variable identifier distenguishes the upper and lower cases. In other words, variable WORK and work, Work is all treated as other variable.
Please assign the priority order by putting parenthesis at logical operation above 3 items: e.g..IF (A = B) OR (A = C). 1 thru 32767.
The line number is valid to 5 digits, and can be assigned with a range of 1 . 32767.
The maximum times a line number can be programmed is 1000.
The file number limit is that which can be stored in the extended memory cartridge. A memory full error will appear if 512 KB is reached. About 32 byte will be consumed with each file.
The following is the output format of BASIC syntax error during direct input (not RUN):
801 Syntax Error: invalid command (error detail explanation).
Following is the output format of BASIC syntax error when running a program (RUN):
818 (110) Syntax Error: file not found.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 2
Page 7
BASIC INTERPRETER TABLE
BASIC INTERPRETER TABLE
COMMAND CONTENT COMPATIBILITY
AUTONUM Line number auto assign numbering X
BEEP Built-in Buzzer O
BREAK Interrupt execution O
CANCTRL Cancel code enable/disable O
CLOSE Channel close O
CLRERR Error flag clear X
CTIME Obtain the internal clock counter O
CTIMER Cancel theinternal clock timer setting O
CTRL-C Force interruption O
DEBUG Enable the TRACE BREAK O
DIM Variable declaration O
DELETE Line deletion O
KILL File deletion O
DATE Date send-back O requires calendar IC
DATAREADY Check the availability of assigned data X
DIR File name display O
DO-LOOP Enable WHILE/UNTIL X
ECHO LCD display ON/OFF O
ECHOBACK Cancel receive code send-back setting O
END Program end O
‘(APOSTROPHE) Commant start O
EXIT Process end (only EXIT FOR) O
FOR-LOOP Loop form O
GOTO Unconditional branch O
GOSUB-RETURN Migrate to assigned sub-routine O
IF.ENDIF Conditional branch O
INARRAY Array input O
INBYTE 1 character input O
INKEY Key switch input O
INPUT 1 line input O
INUNTIL Termination code assign input O
LET Substitution O
LIST List display O
LOAD Calling program O
MAX Send-back the largest value of the two X
SATO GT4xxe SEMBL User Guide PN 9001148A Page 3
Page 8
BASIC INTERPRETER TABLE
COMMAND CONTENT COMPATIBILITY
MAXLEN Send-back the longest numerical string X
MAXNUM Send-back the biggest numerical value X
MIN Send-back the smallest value among two of it X
CLEAR Initialize program O
ON-CTIMER Assign destination when internal clock O
ON-ERROR Assign destination when error occur O
ON-TIME$ Assign destination when timer interrupt O
OPEN Channel open O
ASC ASCII code conversion of character string O
OUTBYTE 1 character output O
POS Position check X
PRINT 1 line output O
REM Assign comment O
RENUM Line number change O
RESTART Interrupted program restart O
RUN Running program O
SBPL Assign BASIC interpreter mode end O
SLEEP Delay O
STEP Execute step O
SAVE Save program O
SEARCHTO$ Data Search X
SETERR Set printer error flag X
TIME Send-back internal clock second O require calendar IC
TIMER Cancel interrupt timer setting O require calendar IC
TRACE Display execution result of the line O
OPERATOR
COMMAND CONTENT COMPATIBILITY
AND AND operation O
NOT Negative O
OR Inclusive OR O
& Character conjunction O
$ Character type O
<, <=, >, >=, =, <> Comparison O
^, */, +- Arithmetic O
MID Character extract O
MOD Divide overflow O
SATO GT4xxe SEMBL User Guide PN 9001148A Page 4
Page 9
CHARACTER OPERATION
COMMAND CONTENT COMPATIBILITY
CHR$ Character conversion O
DATES$ Send-back the date with character string O
LEN Send-back the length with character string O
STR$ Value character conversion O
TIME$ Acquire timer O
VAL Character value conversion O
EXTRACT$ Data extraction X
LCASE$ Send-back of lower case X
LTRIM$ Delete left space X
REPEAT$ Character repetition X
RTRIMS$ Delete right space X
UCASE$ Send-back upper case X
CONTROL FLAG
COMMAND CONTENT COMPATIBILITY
ISERROR Error flag O
ISWARNING Warning flag O
GETSTATUS Acquisition of printer status information O
SATO GT4xxe SEMBL User Guide PN 9001148A Page 5
Page 10
INSTRUCTION REFERENCE
ECHO
Function Cancel the setting of ouput data monitoring.
Format ECHO<ON/OF>
Example ECHO ON
From ON assignment, the content of the standard output will be displayed onto the LCD at the same time, enable the monitoring. End the monitoring by assigning OFF and return to the normal LCD display. Except CRLF, characters that cannot be displayed such as control code, etc, will be displayed with “.”.
NOTE: During ECHO ON, the display of ONLINE/OFFLINE and QTY is suppressed. And the following cases show that the ECHO ON setting is cancelled (OFF) automatically:
error message displays when error occurs
offline by pressing the LINE key.
CLOSE
Function Close the channel.
Format CLOSE<#channel>
Example CLOSE#1
CLOSE is to shut down the channel allocated to the port opened by OPEN. The default port will be reallocated to the closed channel. Input/Output is only allowed in the default port until it is reopened.
NOTE: When program is ended without executing END, the channel cannot be closed.
CTRL-C
Function Force termination of the program
Format 0316
Example
Data that is sent from the PC to the printer becomes control code ETX (03 only when it is at Cancel Code “enable/disable” assign CANTRL ON.
16). Execute force termination
DIM
Function Variable declaration
Format DIM <variable name> [,<variable name>] AS<form>
10 DIM A,B,C AS INTEGER...declaration of integer-form variable. 20 DIM B(10) AS INTEGER ...declaration of integer-form 1-D array variable.
Example
Declare a variable based on a parameter. Definition of interger-form, string-form is enabled. Integer­form is the integer in 4 bytes which takes the range of -2147483647 thru 2147483647. Legend of 1-D and 2-D array is describable. Maximum for definition number of array name is up to 128 in both integer­form and string-form. Interger-form and string-form is allowed to declare up to 256 variables respectively (each array element is treated as interger-form or string-form).
30 DIM C(10,20) AS INTEGER ...declaration of integer-form 2-D array variable. 40 DIM S$,T$,U$ AS STRING ...declaration of string-form variable. 50 DIM T$(5) AS STRING ...declaration of string-form 1-D array variable. 60 DIM T$(5) AS STRING ...declaration of string-form 1-D array variable.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 6
Page 11
END
Function Declare the end of a program.
Format END
Example END
End the execution of a program, closes all channels and returns back to command leave. Although the last END can be abbreviated in the program, channel closing cannot be executed.
FOR NEXT
Function Execute loop handling.
FOR<# variable>=<# from> TO <# form> [STEP <# form>]
Format
Example
Able to boil out from the loop with EXIT FOR. Allows use of nesting up to 24 groups with the entire nesting inside and outside of GOSUB. STEP can take the value of both positive and negative definite. The variable of NEXT cannot be abbreviated.
abbreviation NEXT <# variable>
10 FOR X=1 TO 10 20 PRINT X; “:SEMBL IS FUN” 30 NEXT X
ASC
Function ASCII code conversion of character string.
Format ASC ( <character string> )
10 LET A$=”ABC”
Example
20 PRINT ASC(A$) >RUN result 65
IF ENDIF
Function Conditional branch
IF <Boolean-form> THEN abbreviation ELSE IF <Boolean-form> THEN
Format
Example
Nesting is applicable. When executing nesting, there is not an upper limit of the group.
abbreviation ELSE abbreviation ENDIF
10 IF A$=”0” THEN 20 PRINT “SEMBL PRINTER” 30 ELSE IF A$=”1” THEN 40 PRINT “SEMBL IS GOOD” 50 ELSE 60 PRINT “X=0” 70 ENDIF
SATO GT4xxe SEMBL User Guide PN 9001148A Page 7
Page 12
GOTO
Function Jump to the assigned line, and then execute the program.
Format GOTO<Line No.>
Example
10 PRINT “Sato Printers” 20 GOTO 10
Jump to <Line No.>, continue with program execution.
NOTE: When jumping from the inside to the outside of FOR-NEXT, or the opposite of FOR-NEXT, the resultant behavior cannot not be predicted. Also, when Jumping from the inside to the outside of GOSUB sub-routine, or the opposite of GOSUB sub-routine, the resultant behavior cannot be predicted.
INPUT
Function Substitute the inputted 1 line data into the variable.
Format INPUT [<#channel>,] <variable> [,variable]
10 OPEN “SPL” AS #1 20 INPUT #1, A$
Example
Enter line feed code (CR CR LF) as 1 line, data (exclusive of line feed code) in the line feed code will be substituted with a variable. Remain at standby status until the line feed code is entered. The valid code range is 20
16 . 7E16 , and partial control code CR(0D16), LF(0A16), ETX(0316), BS(0816) only. Back Space
will be executed (delete 1 character) when BS is available in the input data.
ETX signified force termination, when ETX is available in the input data, the program will terminate at that point. However, if data is available subsequently after ETX, this data will be treated as a command the resultant perfomance cannot be pridicted.
The upper limit of input data is 256 characters (CR locates at 257th character). If this limit is exceeded, the result may not be as anticipated.
30 PRINT A$ 40 END >RUN result: A000000 ...before RUN, when sending ENQ(05
16) from the HOST
Assign a KEY and INPUT at the open port. The printer’s original key operation will not be executed until INPUT has ended.
LET
Function Substitution of a value for the variable.
Format LET <variable name> = <form>
10 LET J=1 20 J=(J+1)
Example
When entering the line number and adding legend, LET is allowed for non-descriptions. This is used when data is entered without a line number to operate as a substitution. Substitutions have to be located on the left side as a variable.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 8
30 PRINT J >RUN result: 2
Page 13
LIST
Function Display the program list.
Format LIST [<initial line no.>] [-[<end line no.>]] del.up
>LIST 30 ...list & display the line of No. 30.
Example
This command cannot be executed by giving a line number. The assignment of a range can be made even if a line number does not exist.
>LIST 30- ...list & display the line of No. 30 to the end. >LIST 30-100 ...list & display the line of No. 30 to 100.
LOAD
Function Load the program.
Format LOAD <“file name”>
Example LOAD “PROGRAM1.BAS”
When the extended memory cartridge has not yet been installed, loading of the program cannot be executed. As for the device that is assignable, please refer to Detail Specification of Command. This command cannot be executed by giving a line number.
CLEAR
Function Initialize the program and variable on the memory.
Format CLEAR
Example CLEAR
When clear is executed, the entire channel will be reassigned to the default port. This cannot be executed by giving a line number.
OPEN
Function Channel open.
Format OPEN <port name character string> AS <#channel>
Example 10 OPEN “SPL” AS #1
Other than the standard output, OPEN is executed by assigning the port name defined by NAME before its ran through the system. Refer to Details Specification Command for further details.
ACCESS descriptor does not have any meaning in SEMBL (all is sequential access).
OUTBYTE
Function Generate 1 character
Format OUTBYTE [<#channel>,]
OPEN “PO1” AS#1 LET A$=”Hello”
Example
OUTBYTE#1,A$ RUN result: H
SATO GT4xxe SEMBL User Guide PN 9001148A Page 9
Page 14
PRINT
Function Generate 1 line
Format PRINT [<#channel>,]<form>;<form>...[;]
10 LET A$=”This is a Printer” 20 LET B$=” of SATO.”
Example
30 PRINT A$;B$ RUN result: This is a printer of SATO
The format can be linked with a separator “;” and its maximum allowed size is 1024 bytes. If “;” is not placed at the end of the format, CRLF will be added automatically in the output result. Note that “;” cannot be desrcibed without format.
REM
Function Comment assignment
Format REM [comment]
Example 10 REM FORMAT1 PRINT LABEL
Please describe this command in the next row of the line number. The description cannot be made before the line number, the middle, nor end of the line description.
RENUM
Function Change program line number.
Format RENUM [<start number>[,<incrementation>]]
10 LET A=5
Example
20 GOTO 10 RENUM 50,5 result: 50 LET A=5, 55 GTO 50
Incrementation can be abbreviated. The default is 10. Start number and incrementation can be abbreviated at the same time. The default for start number and incrementation is 10, 10. The start number alone cannot be abbreviated. This command cannot be executed by giving a line number.
RESTART
Function Re-start of a terminate program.
Format RESTART
Example
A program that is interrupted at CTRL-C(03 line. This command cannot be executed by giving a line number.
16) or BREAK will be restarted from the following interrupted
SATO GT4xxe SEMBL User Guide PN 9001148A Page 10
Page 15
RUN
Function Running a program.
Format RUN [“file name”]
10 PRINT”SEMBL & SBPL”
Example
This command can be executed by giving a line number. When giving a file name as a parameter, LOAD and execute this file. The program will not be executed if the parameter file cannot be LOADED.
>RUN result: SEMBL & SBPL
SBPL
Function Assignment of BASIC Interpreter Mode End.
Format SBPL
Example SBPL
To give a line number and description, please describe it before the END statement. However, the line from SBPL statement onward will not be interrupted and will be thrown out.
SBPL text cannot be described consecutively after the SBPL command. Separate this text from the BASIC program file into another file, then send it after confirming it has been returned to normal mode.
SLEEP
Function Delay
Format SLEEP <standby time: unit in second:>
Example >10 SLEEP 60
Delay only the set time (units in seconds) of the line being assigned. During the delay, it can be interrupted by inputting CTRL-C, input detection of CTRL-C is at each interval.
STEP
Function Step execution.
Format STEP
Example
Execute the program with a single step each when running every command.
SAVE
Function Save a program.
Format SAVE <“file name”>
Example >SAVE “SATO!.BAS”
A program is usable after being saved. If the extend memory cartridge is not installed, the program cannot be saved.
There is not a limitation on the storage file quantity nor their size in the program file stored in the extended memory cartridge. The entire file cannot exceed 512KB or it cannot be saved. This command can be executed by giving a line number.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 11
Page 16
AND
Function AND
Format AND
Example <numerical value> AND <numerical value>
NOT
Function Negative
Format NOT
10 LET A=5
Example
20 IF NOT A=0 THEN 30 PRINT A 40 ENDIF
OR
Function Inclusive OR
Format <numerical value> OR <numerical value>
Example
&
Function Character conjunction
Format <character string> & <character string>
10 LET A$=”SEMBL” 20 LET B$=”SBPL”
Example
A space (20
16) is required in between & and 2 items character string.
30 LET C$=A4 & B$ 40 PRINT C$ >RUN result: SEMBLSBPL
$
Function Character type.
Format
Example A$
SATO GT4xxe SEMBL User Guide PN 9001148A Page 12
Page 17
<, <=, >, >=, =, <>
Function Comparison
Format
Example
10 IF X=10 THEN 20 IF A+B>0 THEN X=X+1
^, *, /, +, -
Function Arithmetic operator
Format
Example X^Y
MID
Function Character extraction
Format MID (<character string>, <start digit>, <extract digit number>)
10 LET A$=”SATO PRINTER SBPL” 20 LET B$=MID(A$,1,12)
Example
30 PRINT B$ >RUN result: SATO PRINTER
MOD
Function Overflow calculation
Format MOD(X,Y)
10 LET A=9 20 LET B=2
Example
30 PRINT MOD(A,B) >RUN result: 12
LEN
Function Obtain the length of character string.
Format LEN(A$)
10 LET A$=”SATO PRINTER”
Example
20 PRINT LEN(A$) >RUN Result: 12
SATO GT4xxe SEMBL User Guide PN 9001148A Page 13
Page 18
VAL
Function Numerical value conversion of character string.
Format VAL(<characterr string>)
10 LET A$=”123” 20 LET C=VAL(A$)
Example
The first character cannot convert data string other than the figure (ignored).
30 PRINT C >RUN result: 123
CHR$
Function Value of the character with the assigned character code is acquired.
Format CHR$(>numerical experssion>)
10 LET A=97
Example
20 PRINT CHR$(A) >RUN result: a
STR$
Function Character conversion of numerical value.
Format STR$(numerical value)
10 LET A=53
Example
20 PRINT stR$(A) >RUN result: 53
DATE$
Function Obtain date information.
Format DATE$
10 PRINT DATES
Example
Date is in the order of YY/MM/DD. If calendar chip is not installed, the content becomes “**/**/**”.
>RUN result: 03/10/20
TIME$
Function Obtain time information.
Format TIME$
10 PRINT TIME$
Example
Time is in the order of hh:mm:ss. If calendar chip is not installed, the content becomes “**:**:**”.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 14
>RUN result: 23:15:30
Page 19
DELETE
Function Delete the line.
Format DELETE <line number> [- [<line number>]]
>DELETE 10 ...delete line No.10
Example
When a line number is assigned and the subjected line is not available, the command will be invalid. The line number range is from the assigned start line until the assigned end line. If the line subjected to this assigned line is not available, the line that falls within this range will be taken as the subjected line. This command can be executed by giving a line number.
>DELETE 10- ...delete line No.10 to the end >DELETE 10-100 ...delete line No.10 to 100
KILL
Function Delete registration file
Format KILL “file name”
Example >KILL “PROGRAM1.BAS” ... deletion of registration file
When a file name is assigned and the subjected file is not registered, the command will be invalid. This command cannot be executed by giving a line number.
DIR
Function Generate a list of file that has been stored.
Format DIR [“file name”]
Example >DIR
Generates a list of BASIC files which has been stored in the extended memory cartridge for standard output. This command cannot be executed by giving a line number.
ISERROR
Function This is the printer error flag, Integer of non 0 is obtained when an error occurs.
Format ISERROR
10 LET ERRNO = ISERROR 20 IF ERRNO = 0 THEN 30 PRINT “NOT ERROR” 40 ELSE
Example
If the printer status is ONLINE or OFFLINE, it is 0. All errors that occur without specified reason, or when a SEMBL peculiar error occurs, an integer except 0 will be returned. The return value when the printer error occurs will conform to the error code of the error number icon displayed on the LCD. When a SEMBL syntax error or SEMBL system error occurs, the return value will match the error code included in the error message generated by SEMBL. When both happens at the same time, the priority of error warnings will be printer error--> (printer alert) >SEMBL error. The list of ISERROR return value is shown in the following tables.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 15
50 PRINT “ERROR “;ERRNO 60 ENDIF 70 END >RUN result: ERROR 7 ... when head is opened
Page 20
ISERROR RETURN VALUES
# ERROR CONDITION RETURN VALUE ERROR ICON CATEGORY
1 No error 0 Normal
2 Machine error 1 01 Printer Error
3 FLASH_ROM error 2 02 Printer Error
4 Parity error 3 03 Printer Error
5 Overrun error 4 04 Printer Error
6 Flaming error 5 05 Printer Error
7 Buffer over 6 06 Printer Error
8 Head open 7 07 Printer Error
9 Paper end 8 08 Printer Error
10 Ribbon end 9 09 Printer Error
11 Sensor error 10 10 Printer Error
12 Head error 11 11 Printer Error
13 Cartridge writing error 12 12 Printer Error
14 Cartridge reading error 13 13 Printer Error
15 Download data error 14 14 Printer Error
16 Cutter error 15 15 Printer Error
17 Cutter bracket open 16 16 Printer Error
18 BCC check error 17 17 Printer Error
19 Rewind full 18 18 Printer Error
20 Item Number error 19 19 Printer Error
21 Head resolution error 20 20 Printer Error
22 Kanji ROM error 21 21 Printer Error
23 Calendar error 22 22 Printer Error
24 RFID tag error 23 23 Printer Error
SATO GT4xxe SEMBL User Guide PN 9001148A Page 16
Page 21
ISERROR RETURN VALUES
# ERROR CONDITION RETURN VALUE CATEGORY
25 False command 801 SEMBL syntax error
26 False IF nesting 802 SEMBL syntax error
27 0 division 803 SEMBL syntax error
28 Character string length limit over 804 SEMBL syntax error
29 Output buffer overflow 805 SEMBL syntax error
30 Integer type error 806 SEMBL syntax error
31 Character string error 807 SEMBL syntax error
32 IF not ended 808 SEMBL syntax error
33 GOTO error 809 SEMBL syntax error
34 FOR not ended 810 SEMBL syntax error
35 Array element number upper limit 811 SEMBL syntax error
36 Variable definition # upper limit 812 SEMBL syntax error
37 Channel number upper limit 813 SEMBL syntax error
38 Non-definition port name 814 SEMBL syntax error
39 Line number upper limit over 815 SEMBL syntax error
40 Line number upper limit over 816 SEMBL syntax error
41 False line number 817 SEMBL syntax error
42 Unknown file 818 SEMBL syntax error
43 GOSUB repeat upper limit over 819 SEMBL syntax error
44 False RETURN 820 SEMBL syntax error
45 False file name 821 SEMBL syntax error
46 File name length limitation over 822 SEMBL syntax error
47 Token number upper limit over 823 SEMBL syntax error
48 False device 824 SEMBL syntax error
49 FOR stack overflow 825 SEMBL syntax error
50 Memory cartridge not assessible 840 SEMBL system error
51 Memory cartridge R/W error 841 SEMBL system error
52 Memory cartridge memory full 842 SEMBL system error
SATO GT4xxe SEMBL User Guide PN 9001148A Page 17
Page 22
ISWARNING
Function This is the printer warn flag. Integer of non 0 is obtained when warning occurs.
Format ISWARNING
10 LET WARNNO = ISWARNING 20 IF (WARNNO AND 3) = 0 THEN 30 PRINT “NOT WARNING” 40 ELSE
Example
Printer status will return a interger of 0 + n for OFFLINE and ONLINE respectively. Where n is the warning code. However, when printer error occurs, warning code n will be in 0. And the warning will be detected preferentially from SEMBL syntax error. The list of ISWARNING return values are shown in the next table beginning at ONLINE & OFFLINE line status.
50 PRINT “WARNING”;WARNNO 60 ENDIF 70 END >RUN result: WARNING 1 ... online, ribbon near end
ISWARNING CONDITIONS
#
1 ONLINE No warning 0 0
2 Ribbon near end 1 1
3 Receive buffer near full 2 2
4 Ribbon near end + receive buffer near full 3 3
5 Label near end 4 4
6 Ribbon near end + label near end 5 5
7 Receive buffer near full label near end 6 6
8 Ribbon near end + receive buffer near full + label near end 7 7
9 OFFLINE No warning 0 100
10 Ribbon near end 1 101
11 Receive buffer near full 2 102
12 Ribbon near end + receive buffer near full 3 103
13 Label near end 4 104
14 Ribbon near end + label near end 5 105
15 Receive buffer near full + label near end 6 106
16 Ribbon near end + receive buffer near full + label near end 7 107
LINE
STATUS
WARNING CONDITION
WARN
CODE
RETURN
VALUE
SATO GT4xxe SEMBL User Guide PN 9001148A Page 18
Page 23
STOP
Function Interrupt the execution of program.
Format STOP
10 PRINT “Line 1” 15 STOP 20 PRINT “Line 2”
Example
This command functions only at DEBUG ON.
>DEBUG ON >RUN result: Line 1 15 break >
EXIT FOR
Function Boil out the FOR-NEXT loop
Format EXIT FOR
10 FOR I = 1 TO 10 20 PRINT I; 30 IF I = 3 THEN 40 EXIT FOR
Example
50 ENDIF 60 NEXT I 70 END >RUN result: 123
INKEY
Function Detect the key switch pressing of the printer.
Format INKEY <variable>
10 INKEY A 20 PRINT A
Example
Return value from the key is prescribed. Detectable key is: LINE, FEED, LEFT, RIGHT, UP, DOWN, ENTER, CANCEL, and FUNCTION. Trigger key (determine key) and shift key (key to be pressed simultaneously) can be detected. Once INKEY is issued, key input will be detected, printer’s original key operation may not operate until key input is detected and INKEY is completed.
30 END >RUN result: 2048 ... when pressing the LINE key
SATO GT4xxe SEMBL User Guide PN 9001148A Page 19
Page 24
GOSUB RETURN
Function Branch to the sub-routine/recovery from the sub-routine.
Format
Example
Nesting of sub-routine recalls are allowed up to 8 groups.
GOSUB<line number> RETURN
10 PRINT “Before GOSUB” 20 GOSUB 50 30 PRINT “After GOSUB” 40 END 50 PRINT “Into Subroutine” 60 Return >RUN result: Before GOSUB, Into Subroutine, After GOSUB
ON ERROR
Function
Format ON ERROR GOTO <line number> ON ERROR GOSUB <line number>
Example
Usage of GOTO or GOSUB to indicate if the ON ERROR will be as same as the usual GOTO and GOSUB. The original return point of ON ERROR GOSUB is the next line of the error detect line.
To return to the operation program after an error is processed using ON ERROR GOTO, indicate the GOTO at the end of error process.
When running the SEMBL program and a printer error is detected once, jump to the branch instruction ON ERROR. The involved setting of ON ERROR will be cleared.
To operate the error detection continuously, set ON ERROR again. The ON ERROR assignment is not inherited from another SEMBL program. The ON ERROR and ISERROR types are similar.
Detect printer error when executing SEMBL program, jump to the assigned branch instruction.
10 ON ERROR GOTO 200 20 operation program 100 END 200 PRINT “PRINTER ERROR” 210 BREAK >RUN (when printer error occur) result: PRINTER ERROR. break
DEBUG
Function Set/cancel the debug mode.
Format DEBUG <ON/OFF>
Example DEBUG ON
Set the debug mode by assigning ON. During the debug mode setting, TRACE and BREAK is valid for standard operation. By assigning OFF, the debug mode will be cancelled and TRACE and BREAK will not be processed. The default for non-assignment is off.
This command can be appied by executing direct input and providing line number.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 20
Page 25
TRACE
Function Display the trace information.
Format TRACE <ON/OFF>
10 LET A=5 20 GOTO 40 30 PRINT “Error”
Example
40 PRINT A >DEBUG ON >TRACE ON >RUN result: <TRACE>00010, <TRACE> A=5, <TRACE>00020, <TRACE>00040, 5
By assigning ON, trace information will be displayed with the standard output by the following format (<TRACE>trace information). The generated trace information will be entering the variable and the line number. When the content of the defined variable changes, it will display as: <TRACE>variable$=new substitution value. The line number will be displayed thusly: <TRACE>Line No.
By assigning OFF, output of trace information is completed. Default for non-assignment is Off. This command can be appied by executing direct input and providing line number.
NOTE: Trace output from this command operates effectively only with DEBUG ON. No requirements are needed for the order of assignments of DEBUG ON and TRACE ON.
‘ (APOSTROPHE)
Function Start the comment.
Format [form] ‘ [comment]
10 LET W=10 ‘Initialize
Example
20 PRINT w’;W+1 >RUN result: 10
This command can be described in the optional location hereafter the line number. From this command to the end of the line will be treated as comment, and will be ignored when executing this command. This command cannot be described before, nor in the middle of, the line number.
NOTE: When the format is inserted midway, the inserted format may not be interpreted correctly. Even if it is used as a separator HT(09
16) before the comment, it will be skipped. You must use a space (2016).
ECHOBACK
Function Cancel receive code send-back setting
Format ECHOBACK <ON/OFF>
Example ECHOBACK OFF
By assigning ON, data that is received at the communication port will be sent back to its origin divided into 1 byte each. Cancel the send-back setting by assigning OFF by either running direct input or adding the line number. The default setting for non-assignment is ON.
NOTE: With the ON setting, the input echo display setting of the terminal application must be canceled on the host side. When the host side terminal application is not applied, it is recommended to set the ECHOBACK OFF in order to speed up the process.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 21
Page 26
TIMER
Function Cancel timer interruption setting
Format TIMER <ON/OFF> [“setting timer”]
Example
By assigning ON, the timer interruption may be set from the time interrupt process. The timer interruption is assigned by the format of HH:MM:SS within the character string and enclosed with ‘’’’. HH allows two digit assignment of the hours with a maximum of 24. MM allows two digit assignment of the minutes with a maximum of 59. SS allows two digit assignment of the seconds with a maximum of 59.
The timer assignment character string can be abbreviated. When it is abbreviated, the time section that was assigned previously will be applied. Cancel the setting of timer interruption by entering OFF. This command can be assigned by either running direct input or adding the line number.
TIMER ON “12:15:00” TIMER OFF
ON TIME$~
Function
Format ON TIME$ GOTO <line number> ON TIME$ GOSUB <line number>
Example
With the assignment of TIMER ON, the preset timer’s progressed time will be detected and proceed with branch execution. Usage of GOTO or GOSUB which is described after ON TIME$ will be similar to the usual GOTO and GOSUB.
The return destination of ON TIME$ GOSUB is at the next line of timer match detection line. After timer interruption of ON TIME$ GOTO, when you want to return back to the operation program, describe the GOTO in the end of timer interruption.
While running the SEMBL program, timer interruption is detected once and multidrops onto ON TIME$ branch destination, this ON TIME$ branch destination is not inherited from another SEMBL program, you are required to add a description within the operation program one by one if necessary.
NOTE: When the Calendar chip is not installed, timer interruption will not occur in the preset timer depending on TIMER ON. Detection of setting timer that has progressed has to be executed before running the next line. Hence, detection will not be running during SLEEP, do it only after ended SLEEP.
Detect timer interruption when running SEMBL program, jump to the assigned branch instruction.
10 TIMER ON “10:30:00” 20 ON TIME$ GOSUB 100 30 operation progragrm 90 END 100 PRINT “Now On Time!” 110 RETURN
SATO GT4xxe SEMBL User Guide PN 9001148A Page 22
Page 27
INBYTE
Function Substitute the inputted 1 byte into the variable.
Format INBYTE [<3channel>,] <variable>
10 OPEN “PO1” AS #1 20 FOR I=1 TO 8 30 INBYTE #1, INB$ 40 PRINT ASC(INB$);”,”;
Example
Inclusive of the received byte that is ignored at INPUT, data will be read from the received buffer.
NOTE: INBYTE operates effectively only when data is sent to an open port: “PO1” and “PO2”. INBYTE will behave unstably when INBYTE sends data to an open port other than “PO1” and “PO2”.
50 NEXT I 60 END >RUN result: 27,88,32,30,44,65,66,6 ... when sending ESC X 20, A B C from HOSTPC to printer
BEEP
Function Printer built-in bzzer beeps.
Format BEEP [<tone>]
BEEP ... 1 short beep BEEP 0 ... 1 short beep
Example
Short beeps last for 175 milliseconds and long beeps last for 400 millisecond. Interval of the continuous beep (tone 2, 3, 4) is 5 millisecond or longer. This command can be assigned by either running direct input or adding the line number. BEEP and BEEP 0 has the same behavior.
NOTE: When the buzzer beeps, the BASIC application is in suspension.
BEEP 1 ... 1 long beep BEEP 2 ... 2 consecutive short beep BEEP 3 ... 2 consecutive long beep BEEP 4 ... 3 consecutive long beep
CANCTRL
Function Set cancel code (0316) into enable/disable.
Format CANCTRL <ON/OFF>
Example CANCTRL ON
In cancel code ETX(0316) which is sent from the host, valid or invalid will be set with the assignment of ON/OFF. Once cancel code is received during RUN from the CANCTRL ON, BREAK the execution of BASIC program. From CANCTRL OFF, even if the cancel code is received during RUN, it will be read as an invalid code. This command can be assigned by either running direct input or adding the line number. The default setting is CANCTRL OFF (cancel invalid) for non-assignment.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 23
Page 28
GETSTATUS
Function Obtain printer’s status information.
Format GETSTATUS <character variable$>
10 DECLARE STRING STS$ 20 GETSTATUS STS$
Example
Send the printer’s status information in accordance with currently established interface protocol. The printer’s status information conforms to the format of ENQ respond data. When interface is setting at serial is Ready/Busy or XON/XOFF, the interface will create the status information at format of STATUS4 expediently.
For details of ENQ respond information format, you can refer to that item of each interface in the SBPL Programin Guide.
30 PRINT “Printer Status :”;STS$ >RUN result: Printer Status : A000000 .. when interface protocol is at STATUS4, no error online standby to receive data.
CTIME
Function Obtain progress time from system lock.
Format CTIME
10 PRINT CTIME
Example
SEMBL operation time is notified by multiplying the count of the printer’s system clock. The recall value range is 0 - 2147483647(H’7FFFFFFF). If the clock count exceeds the upper limit, it will return to 0 and is applicable regardless of whether the calendar chip is installed. To convert the clock counter into units of seconds, remember that 1 count=5 millisecond.
The clock count is initialized depending on the migration of SEMBL MODE and the system’s clock timer setting command of CTIMER.
>RUN result: 328790
CTIMER
Function Cancel system lock timer setting.
Format CTIMER <ON/OFF> [<clock count value>]
Example
By assigning ON, the clock count value that disrupts clock interruption is set when the current progressed clock count is initialized into 0. 0 - 2147483647(H’7FFFFFFF) is given for interrupt timer.
The progressed clock counter value can be abbreviated. When it is abbreviated, the clock count value that was assigned previously will be applied. By assigning OFF, the setting of the progressed clock interruption is cancelled.
This command can be assigned by either running direct input or adding the line number.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 24
CTIMER ON 6000 CTIMER OFF
Page 29
ON CTIME
Function
Format
Example
By assigning CTIMER ON, the progression of the pre-set clock count is detected and proceeds with branch execution. The usage of GOTO or GOSUB is described after the ON CTIME is similar to the usual GOTO and GOSUB. The return destination of ON CTIME GOSUB will be the next line of the progressed clock detection line.
After the progressed clock interruption has used the ON CTIME GOTO and you want to return to the operation program, the description of GOTO must be added to the end of the interruption.
When running the SEMBL program, once the interruption clock is detected and multidrops to the ON CTIME branch destination, the ON CTIME setting will be cleared. To continuously operate this progressed clock interruption, assign ON CTIME again. The assignment of the ON CTIME branch destination is not inherited from another SEMBL program, you must describe it in the operation program ono by one if necessary.
NOTE: The progressed clock interruption will happen regardless of whether the calendar chip is installed or not. Detection of the progressed clock is executed before running the next line. Thusly, start the detection only after completing SLEEP but not during SLEEP.
Detect progressed clock interruption when running SEMBL program, jump to the assigned branch instruction.
ON CTIME GOTO <line number> ON CTIME GOSUB <line number>
10 CTIMER ON 6000 20 ON CTIME GOSUB 100 30 operation program 90 END 100 PRINT “30 Seconds Passed!” 110 RETURN
INARRAY
Function Substitute the input data of byte array into the array variable.
Format INARRAY [<#channel>,] <array variable>, <input digit no.>
10 DIM ARY(8) AS INTEGER 20 Open “PO1” AS #1 30 INARRAY #1,ARY(1),8 40 FOR I=1 TO 8
Example
The receive buffer reads the assigned byte size input data and stores it into the array variable in 1 byte increments. The array variable is handed over as a command and storage start member must be assigned. The storage start member can be assigned also for first non-member.
NOTE: INBYTE operates effectively only when printing to the open port of “PO1” and “PO2”. When printed to an open port except “PO1” and “PO2”, the behavior is unstable. If the assigned variable does not belong to the array variable, the command will become an error. If the assigned digit is larger than the declaration of array variable, INARRAY implicitly extends to the maximum size of the array and then stores the received data.
50 PRINT ASC(ARY(I));”,”; 60 NEXT I 70 END >RUN result: 27,88,32,30,44,65,66,67...when sending <ESC>X20,ABC from HOSTPC to the printer.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 25
Page 30
INUNTIL
Function
Substitute the input data of byte array into the array variable until obtaining the end code.
Format INUNTIL [<#channel>,] <array variable>, <input digit no.>, <end code>
10 DIM ARY(10) AS INTEGER 20 OPEN “PO1” AS #1 30 INUNTIL #1,ARY(1),10,0 40 FOR I=1 TO 10 50 PRINT ASC(ARY(I));”,”; 60 IF ASC(ARY(I))=THEN
Example
70 END 80 ENDIF 90 NEXT I 100 GOTO 30 >RUN result: 65,66,67,68,69,70,72,73,74,75,76,77,0, ...when sending ABCDEF GHIJKL<NUL>from HOSTPC to the printer.
The receive buffer reads the input data containing the assigned end code and stores the data into an array variable in 1 byte increments. This command operates after initializing all array elements by the end code before receiving data. The array variable is provided as a command requiring the storage start number to be assigned. The storage start number can also be assigned for the non-first number.
NOTE: INUNTIL operates effectively only when printing to the open port of “PO1” and “PO2”. When printed to open port except “PO1” and “PO2”, the behavior is unstable. If the assigned variable does not belong to an array variable, the command will become an error. If the receive digit is larger than the declaration of an array variable, INUNTIL implicitly extends the array number to the assigned input digit and then stores the received data.
Even if the receive byte size exceeds the assigned input size, the end code cannot be obtained and the command will be ended. If the data is received, INUNTIL must be printed again. You can judge whether to reprint INUNTIL or not by checking the array end member to determine if it is the end code.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 26
Page 31
SPECIFICATION DETAILS OF THE COMMAND
DEVICE
DEVICE DEFAULT DESCRIPTION SUMMARY
A Not defined
B CARD Assigned to extend FLASH-ROM cartridge Fixed operation*
C Not defined
D Not defined
E ROM Assigned into built-in FLASH-ROM Not supported
F Not defined
G Not defined
H Not defined
I Not defined
J Not defined
K Not defined
L Not defined
M Not defined
N Not defined
O Not defined
P Not defined
Q Not defined
R MEMORY Assigned into built-in SDRAM Not supported
S Not defined
T Not defined
U Not defined
V Not defined
W Not defined
X Not defined
Y Not defined
Z Not defined
* SBPL which is supposed to be installed in new scantro does not have command to re-define the memory device. In the SEMBL which is supposed to be installed in new scantro, device is not defined yet, B: treat it as assigned. If there is no extension assignment, add “.BAS” automatically (during storing, reading).
SATO GT4xxe SEMBL User Guide PN 9001148A Page 27
Page 32
PORT
Channel number subjected to definition. There are ten types definable: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. The zero (0) is the default for non-assignment. Standard console output will be assigned (generally is screen, interface allocated to data port in printer.
Port name can be opened (key word). Port name is the key word of 3 fixed character, below is assigned by the system.
PORT
SYMBOL DESCRIPTION INPUT OUTPUT APPLICABLE
PO1 Connect to the data port as the printer. o (o) o
PO2 Connect to the sub-port as the printer. o (o) o
LCD Connect to LCD screen of operation panel. x o o
EXT
SCN No mechanism for standard or option (for extension) . . x
SW1 Not used - DSW not installed. o x x
SW2 Not used - DSW not installed. o x x
SW3 Not used - DSW not installed. o x x
SW4
KEY Connect to every key. o x o
LED Connect to every lamp. x o x
SPL Printer’s input/output. o o o
DEF Connect to data port. o o o
Output from printer to PC is not working for data port/sub-port and centronics parallel. the setting of data port/sub-port is executed at printer’s menu setting (interface mode). As for SW4, sensors of dispenser and cutter is valid only when installing optional mechanism. The input value is undefined for non­installation. If data port is set in currently installed extension IF board (parallel, serial, LAN, USB), standard IF board (mini LAN) will become sub-port. If data port is set in standard IF board (mini LAN), currently installed extension IF board (parallel, serial, LAN, USB) will become sub-port.
Connect to external input port (PRIN/PRIN2), external output port (PREND/PE/MC_ERR/CE)
Connect to sensors of: head open, dispenser, cutter, ribbon supply and rewind.
oo o
(o) x o
SATO GT4xxe SEMBL User Guide PN 9001148A Page 28
Page 33
INPUT PROCESS
SYMBOL DESCRIPTION INPUT UNIT
PO1 Read data received from data port. 1 line or 1 byte
PO2 Read data received from sub-port. 1 line or 1 byte
LCD Cannot input. .
EXT Read input data from external signal input Port 1 and 2 (PRIN/PRIN2). 1 byte
SCN Cannot input. .
SW1 Cannot input. .
SW2 Cannot input. .
SW3 Cannot input. .
SW4
Read status information of sensors: head open, dispenser, cutter, ribbon supply and rewind.
1 byte
KEY Read every key. 2 byte
LED Cannot input. .
SPL Read status data (serial status 1 or SOH return data) sent-back to PC. Define size
DEF Read data received from the data port. 1 line or 1 byte
OUTPUT PROCESS
SYMBOL DESCRIPTION OUTPUT UNIT
PO1 Output data to PC return data or external connection device into sub-port. Option
PO2 Output data to PC return data or external connection device into data port. Option
LCD Operation panel screen. Occupy 2 lines of scrollable message display. Option
EXT External output signal into signal output port (PREND/PE/MC_ERR/CE). 1 byte
SCN Cannot output. .
SW1 Cannot output. .
SW2 Cannot output. .
SW3 Cannot output. .
SW4 Cannot output. .
KEY Cannot output. .
LED Cannot output. .
SPL Hand over (become print data) as data received from SBPL analyst. Option
DEF Output as PC return data into data port. Option
NOTE: .SER.PAR.LAN.USB.LN2.DEF echo back the output content onto LCD by assignment. . To display onto the LCD with a maximum of 16 characters onto each line. All characters beyond 16 will not be displayed.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 29
Page 34
KEY INPUT VALUE (USING PRINTER KEY ONLY)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 . VALUE KEY
X 0 0 0 0 1 1024 1 FEED
X 0 0 0 1 0 2048 2 LINE
X 0 0 0 1 1 3072 3 ENTER
X 0 0 1 0 0 4096 4 CANCEL
X 0 0 1 0 1 5120 5 RIGHT
X 0 0 1 1 0 6144 6 LEFT
0 0 1 1 1 7168 7 UP
0 1 0 0 0 8192 8 DOWN
0 1 0 0 1 9216 9 FUNCTION
0 0 0 0 0 n/a
Fomula: key input value.trigger value x 1024.shift key value.
The trigger key value shows the value obtained with the pressing of a single key to decide input. The trigger key value is calculated from 6 bits of the upper bit (inside of 2 bytes) in which polarity bit has to be excluded.
To remove only the trigger value, divide the key value by 1024 and obtain the quotient. The trigger and shift keys are not allowed for simultaneous input if the keys are the same. Among nine (9) keys, they cannot entirely be shift keys.
KEY INPUT VALUE (USING SHIFT KEY + PRINTER KEY)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 . VALUE KEY
X 0 0 0 0 0 0 0 0 0 1 11FEED
X 0 0 0 0 0 0 0 0 1 0 22LINE
X 0 0 0 0 0 0 0 1 0 0 44ENTER
X 0 0 0 0 0 0 1 0 0 0 8 8 CANCEL
X 0 0 0 0 0 1 0 0 0 0 16 16 RIGHT
X 0 0 0 0 1 0 0 0 0 0 32 32 LEFT
X 0 0 0 1 0 0 0 0 0 0 64 64 UP
X 0 0 1 0 0 0 0 0 0 0 128 128 DOWN
X 0 1 0 0 0 0 0 0 0 0 256 256 FUNCTION
X 0 0 0 0 0 0 0 0 0 0 N/A
Fomula: key input value.trigger value x 1024.shift key value.
The shift key value shows values of all keys that can be pressed simultaneously. When two or more keys are pressed simultaneously, the key input value will be the add-up sum (OR) of the shift key value. Hence, th actual value of the shift key to be obtained when pressing two or more keys simultaneously, will be displayed in the total sum value of each pressed shift key.
Example: press ENTER while pressing LINE.FUNCTION.DOWN simultaneously and the key input value . ENTER(3) x 1024 . (LINE(2) . FUNCTION(256) . DOWN(128) . 3072 . 386 . 3458
The shift key value is calculated from 10 bits of the lower bit (inside of 2 bytes) in which one (1) bit each is allocated so that it allows multiple keys to be pressed at the same time. To remove only the trigger value, divide the key value by 1024 and obtain the quotient.
The trigger and shift keys are not allowed for simultaneous input if the keys are the same. Among nine (9) keys, they cannot entirely be shift keys.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 30
Page 35
KEY WORDS
VALID KEY WORDS
# KEY WORD # KEY WORD
1 ACCESS 34 MOD
2AND
3AS
4 ASC
5 CHR
6CLOSE
7CTIME
8CTIMER
9DATE
10 DELETE
11 DEBUG
12 DIM
13 DIR
14 ECHO
15 ECHOBACK
16 ELSE
17 END
18 ENDIF
19 ERROR
20 EXIT
21 FOR
22 GOSUB
23 GOTO
24 IF
25 INBYTE 58 TIMER
26 INKEY
27 INPUT
28 ISERROR 61 VAL
29 ISWARNING
30 KILL
31 LEFT
32 LEN
33 MID
NOTE: Regardless of the upper and lower case, key words are apllicable in the BASIC syntax as a variable name.
35 NEXT
36 NOT
37 INTEGER
38 OFF
39 ON
40 OR
41 OUTBYTE
42 PRINT
43 REM
44 RENUM
45 RESTART
46 RETURN
47 RIGHT
48 RUN
49 SAVE
50 SBPL
51 SLEEP
52 STEP
53 STOP
54 STR
55 STRING
56 THEN
57 TIME
59 TO
60 TRACE
62 ‘.
63 &B
64 &H
65 &O
SATO GT4xxe SEMBL User Guide PN 9001148A Page 31
Page 36
INVALID KEY WORDS
# KEY WORD # KEY WORD
1 AUTONUM 10 MAXNUM
2CLRERR
3 DATAREADY
4DO
5 LCASE
6LOOP
7LTRIM
8MAX
9MAXLEN
NOTE: These are only recommended for use as variable names in the BASIC syntax regardless of their case.
11 POS
12 REPEAT
13 RTRIM
14 SEARCHTO
15 SETERR
16 UCASE
17 UNTIL
18 WHILE
SATO GT4xxe SEMBL User Guide PN 9001148A Page 32
Page 37
ERROR MESSAGES
The table below displays the list error messages generated by BASIC interpreter with standard output.
ERROR MESSAGES
# ERROR MESSAGE OUTPUT CONDITIONS
1 801 syntax error: invalid command
2 802 syntax error: if nesting out of order
3 803 syntax error: divide by zero (0)
4 804 syntax error: line/strings length >256
5 805 syntax error: print buffer overflow
6 806 syntax error: value not integer
7 807 syntax error: value not strings
8 808 syntax error: no else/endif
9 809 syntax error: no destination to go
10 810 syntax error: no next
11 811 syntax error: array count > 128
12 812 syntax error: value count > 256
13 813 syntax error: channel number > 9
14 814 syntax error: illegal port name Non-definition port name
15 815 syntax error: line count >1000 Exceed line’s upper limit
16 816 syntax error: line number > 32767 Exceed line number’s upper limit
17 817 syntax error: illegal line number Character other than numeric is included in the line
18 818 syntax error: file not found The assigned file cannot be found
19 819 syntax error: gosub stack overflow GOSUB nesting group exceeds upper limit of 8 groups
20 820 syntax error: return without gosub RETURN not accompanied by GOSUB is discovered
821 syntax error: filename not
21
recognized
22 822 syntax error: filename too long Filename exceeds the defined length
23 823 syntax error: no parameter memory Number exceeded 64 of the controlled upper limit
24 824 syntax error: unmatched device Assigning device (B: other) not filename supported
25 825 syntax error: for-next stack overflow FOR-NEXT nesting group exceeds the 24 upper limit
26 826 syntax error: timer not recognized
27 827 syntax error: illegal goto destination GOTO destination conflict. Go further into block group
28 828 syntax error: beep number > 4 Exceeds the upper limit of printer’s built-in buffer zone
29 840 syntax error: unreachable device
30 841 syntax error: device read/write fail Failed to write data into extension memory cartridge
31 842 syntax error: device memory full Capacity of the memory cartridge is insufficient
Found character not defined in the filename Filename format is removed from 8.3 format
Found character not defined in the time assignment Time assignment exceeds the valid range
Cannot access to the extension memory cartridge (includes non-installation)
SATO GT4xxe SEMBL User Guide PN 9001148A Page 33
Page 38
FUNCTIONALITY
There are three ways to enter the SEMBL Mode:
send SEMBL migration command
SEMBL selection by LCD menu
preset the SEMBL auto-run feature.
Once the migration to the SEMBL Mode is complete, the printer will generate the character string of “WELCOME!<CR><LF>” to the standard output.
SEND MIGRATION COMMAND OF SEMBL
In the Online Mode, send the SBPL command of SEMBL migration. The printer will immediately migrate from the online mode to SEMBL Mode so the text will executed. The following is an example of the send data: ESC A ESC C I ESC Z
CAUTION
Do not confuse the ESC C I with other SBPL commands. Do not describe SEMBL text after the above mentioned SBPL data. When shifting from online to SEMBL mode, clear the receive buffer once. SEMBL text that is sent continuously cannot be secured. Send SEMBL text following mode migration.
By giving a program a name that is stored as a parameter in the ESC C I, the program will run automatically. Details may be found in the “Auto Run of BASIC Program” chapter that follows.
SEMBL SELECTION BY LCD MENU
The following procedure provides instruction on how to shift to the SEMBL Mode by use of the LCD menu without dependence on the transmission of the SEMBL migration command. Details may be found in the “Auto Run of BASIC Program” chapter that follows.
1. Press the LINE key to take the printer offline.
2. Press the ENTER key to display the Mode Select screen.
3. Select the SEMBL MODE icon.
4. Press the ENTER key to access the START PROGRAM select screen.
5. Select NONE and then press ENTER to enter the SEMBL Mode.
PRESET SEMBL AUTO-EXECUTION
By setting the SEMBL auto run feature in the Advanced Mode, the printer can operate in SEMBL Mode automatically when powering on. Details may be found in the “Auto Run of BASIC Program” chapter that follows.
1. Press the LINE key to take the printer offline.
2. Press the ENTER key to display the Mode Select screen.
3. Select the ADVANCED MODE icon.
4. Press the ENTER key several times to access the SEMBL MODE AUTO START screen.
5. Select NONE and then press ENTER key to power on in the SEMBL Mode thereafter.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 34
Page 39
AUTO EXECUTION OF BASIC PROGRAM
There are two methods to run the BASIC program which is registered in the printer:
Auto run when shifting to SEMBL Mode,
Auto run when inputting power.
AUTO RUN WHEN SHIFTING TO SEMBL MODE
There are two ways to initiate this activity:
using SEMBL Mode shifting command,
select SEMBL MODE from the LCD menu.
(1)
USING SEMBL MODE SHIFTING COMMAND
As the parameter of SBPL command of the SEMBL Mode shifting, the registered program name is handed over. Example: ESC CI , PROGRAM1.BAS
Read the same name of the BASIC program file from the extended memory cartridge and then allow it to auto RUN.
After the PROGRAM FINISHED execution, it remains with the SEMBL Mode. The READ PROGRAM LIST will not disappear.
(2)
SELECT SEMBL MODE FROM THE LCD MENU
Use the up and down keys to select the terget program name and press the ENTER key in the START PROGRAM select screen (refer to previous).
Read the same name in the BASIC program file from the extended memory cartridge and then let it auto RUN. After the program is finishes execution, it remains with the SEMBL Mode. The READ PROGRAM list will not disappear.
AUTO RUN WHEN INPUTTING POWER
Use the up and down keys to select the target program name and press th ENTER key in the SEMBL MODE AUTO START screen (refer to previous).
When powering on again, read the same name BASIC program file from the extended memory cartridge while starting the printer with SEMBL Mode, and then allow it to RUN. After the program finishes execution, it remains with the SEMBL Mode. The READ PROGRAM list will not disappear.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 35
Page 40
EXITING FROM THE SEMBL MODE
There are four methods of shifting from SEMBL Mode to usual mode (online mode):
Send SBPL shift command,
select other than SEMBL MODE from the LCD menu,
power on/off,
other SEMBL Mode exit conditions.
Neither of the stored BASIC programs will be cancelled. Once exited from the SEMBL Mode is entered, the printer will generate a character string of “GOODBYE.<CR><LF>” to the standard output.
SEND SEMBL SHIFT COMMAND
Send th direct command SBPL to th printer with the SEMBL Mode. The printer will immediately shift from SEMBL to Online mode enabling the process of SBPL text.
NOTE
SBPL command is not allowed with execution that applies to the line number.
Do not describe the SBPL text after the SBPL command.
When shifting is made from SEMBL to Online Mode, clear the received buffer once. Otherwise the SEMBL text is sent continuously and cannot be secured.
Send the SEMBL text after confirming the mode migration.
SELECT OTHER THAN SEMBL FROM LCD
Once the printer is shifted from the SEMBL Mode to another mode, it is BO from the SEMBL Mode. In other words, it is not only shifting to the Online Mode, but also meaning that when the printer enters into each mode, the related SEMBL Mode has come to an end.
1. Press the LINE key to take the printer offline.
2. Press the ENTER key to display the Mode Select screen.
3. Select the SEMBL Mode icon and press the ENTER key.
4. For the Online Mode, the printer automatically goes online. For all other modes, enter the password to shift. Once the password is canceled, return to the SEMBL Mode is possible.
POWER ON/OFF
Power off the printer and then restore the power to restart in the Noline Mode providing that the SEMBL Auto Run setting is NO within the Advanced Mode.
OTHER SEMBL MODE EXIT CONDITIONS
The printer is able to exit from the SEMBL Mode unconditionally when YES is selected at the CANCEL PRINT JOB and ENTER is pressed - the printer will shift to the Online Mode. This does not apply to the POWER ON/OFF condition.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 36
Page 41
BASIC OPERATION OF SEMBL MODE
SEMBL allows the data processing function to operate as a BASIC Interpreter. Therefore, registration to the extended memory cartridge from the BASIC program download and the BASIC debug operation are carried out in the interactive mode.
Below is an example of how to carry out ths operation in the interactive mode with the printer in SEMBL mode using the Hyperterminal application for Windows.
FILE PREPARATION TO SEND
Hyperterminal cannot edit the optional transmission text on the application. Hence, to run a relatively heavy operation program, it is recommended that BASIC text transmission be created by a separated editor and then prepare it as a file in advance. Example:
Operation Program File
10 REM Program 1 20 DECLARE STRING s$ 30 S$ = “SATO PRINTER” 40 OPEN #1: NAME “SPL” 50 PRINT #1: CHR$(27);”A” 60 PRINT #1: CHR$(27);”X22,”;S$; 70 PRINT #1: CHR$(27);”Z”; 80 END
A direct command and a single basic program can be sent by inputting them on the terminal screen of the Hyperterminal according to the prompt (“>”) returned by the printer.
HYPERTHERMAL SETTINGS
Hyperthermal can connect with the communication either with serial line or Windows SOCKET. The following example explains the process of connecting to COM1:
Connection Method Directly to COM1
Emulation Auto Detect
Telnet Terminal ID ANSI
Buffer Line Number 500
ASCII Setting When sending data, local echo OFF, add ON to the line feed character at the end of the line.
The following is the property screen for setting file SBI.ht based on the above criteria for Hyperterminal in the Windows 98 platform.
Use the ECHOBACK ON (default) on the SEMBL side for this scenario.
SATO GT4xxe SEMBL User Guide PN 9001148A Page 37
Page 42
SATO GT4xxe SEMBL User Guide PN 9001148A Page 38
Screen Sequence for Setting Hyperterminal
Page 43
HYPERTERMINAL OPERATION
Send the previously prepared BASIC text file through the transfer menu .send text file. . This is done by programming the registration through the transmission of the Operation Program file, checking the operation from the RUN command direct input, and saving the registration program from the STORE command direct input.
Once pressing the CTRL key and C simultaneously, CTRL-C control code (03
16) will be sent to
the printer. By pasting on edit menu/copy on the host side, the text area that is selected on the terminal screen can be copied/pasted.
RPUTY FILE TRANSMISSION
Files that use RpUty can be transferred without depending on Hyperterminal. However, in ordere to throw away the text sent from the printer, status check of the SEMBL can only be done by LCD display with ECHO ON.
REPEATING EXECUTION
There are two ways that this may be perfromed: forming a repeating loop in the BASIC operation program or combining SEMBL auto run with the SBPL command. The following displays the SBPL data send:
Registered BASIC
SATO GT4xxe SEMBL User Guide PN 9001148A Page 39
Page 44
REMARKS FOR SEMBL OPERATION
SEMBL always generates a prompt to print the output data and the status information data of operational standard output. The standard ouput of SEMBL is allocated in the data port.
Therefore, it combines the status notification data of ENQ and SOH responses and sends to the data port connection a signal that the host’s status monitor might not be properly working.
To carry out the host’s status monitoring while operating in SEMBL, the sub-port is only allowed to be used for status monitoring. Thusly, the sub-port can no longer be used for external device connection.
Example 1
Example 2
?
?
?
?
?
SATO GT4xxe SEMBL User Guide PN 9001148A Page 40
?
?
?
?
?
?
Loading...