Programming Manual Keyboard
SATO Europe
28
LOCATE
Description
Position cursor in LCD display.
Syntax
LOCATE x, y
Remarks
LOCATE moves the cursor to the given position in LCD display. If the coordinates are
invalid, the command will be ignored.
The permissible value of the x parameter is from 0 to 79.
The permissible values of they parameter are 0 and 1. Where 0 and 1 are the first and
the second lines respectively of the LCD display.
Example
LOCATE 1, 1
Keyboard
Programming Manual
29
SATO Europe
PRINT…[USING]
Description
The PRINT command is used to output the numeric data and strings to the LCD
display. TSKL also supports formatted output to LCD display with the PRINT USING
command.
The maximum number of specified formats for the PRINT USING command is 15.
Syntax
PRINT list of expression [;]
Specify the numeric data output format:
PRINT USING “###.##”,A
Specify the string data output format:
PRINT USING “\ \”,A$
Remarks
A blank line is displayed on the LCD if there is no expression after the PRINT
command. The PRINT USING command sends (hex) 0D 0A (carriage return and line
feed) at the end of the expression if no “;” (semicolon) is at the end of the expression.
The “,” (comma) is used to separate the values by 8 spaces. There are no spaces
between the two values if the “;” (semicolon) is used between the two expressions. If
“;” (semicolon) is the last character of PRINT statement, the cursor will stop in this line.
The “#” (pound sign) and “\” (back slash) are used to specify the output format of
numeric data and string data respectively. If the actual value is greater than the
specified format, a “%” (percent) sign will be paced at the end of value.
Example
B=123.45
PRINT 12+3;ASC(“A”)
PRINT USING “###.##”,B;
Programming Manual Keyboard
SATO Europe
30
INPUT
Description
Input numeric data or strings from the keypad or K012 COM2 port and assign them to
variables.
Syntax
INPUT prompt; variables
Remarks
Prompt must be a string constant. The variable list contains the variable names to be
assigned.
The input value will pass to the variable if ENTER is pressed. Other input devices such
as a bar code scanner or scale may be connected to the COM2 port of the K012 to get
data instead of keying in data on the keyboard.
Example
INPUT “ENTER ITEM NAME”,ITEM$
INPUT PRICE
Keyboard
Programming Manual
31
SATO Europe
OUT
Description
Output a data stream from the K012 serial port.
Syntax
OUT port; list of expressions[;]
Remarks
Port specifies the serial port to send data. It can be 0 (K012 COM1) or 1 (K012 COM2).
The List of Expressions consists of string or numeric expressions separated by
semicolons. The OUT command sends 0D0A (carriage return and line feed) at the end
of the expression except if the semicolon is used as the terminating character. Comma
(“,”) also sends 0D0A to the serial port.
Example
OUT 0;A;A$
Programming Manual Keyboard
SATO Europe
32
FOUT
Description
Output a specified file from the K012 serial port.
Syntax
FOUT Port, FileHandle, FileSize
Remarks
Port specifies the serial port to send data. It can be 0 (K012 COM1) or 1 (K012 COM2).
The number of FileHandle is between 0 and14. FileSize is expressed in bytes.
Example
OPEN “DATA1” FOR INPUT AS #1
FOUT 0,1,1024
Keyboard
Programming Manual
33
SATO Europe
OUT USING
Description
Output a formatted data stream from the K012 serial port.
Syntax
OUT port USING “format”,list of expressions[;]
Remarks
Port specifies the K012 serial port to send data. It can be 0 (K012 COM1) or (K012
COM2) port.
List of expressions consists of string or numeric expressions separated by semicolons.
The OUT USING command sends 0D0A (carriage return and line feed) at the end of
the expression except if the semicolon (“;”) is used as a terminator. Comma (“,”) also
sends 0D0A to the serial port.
Example
OUT 0 USING ”####.## “,A
OUT 1 USING “\ \”,A$
Programming Manual Keyboard
SATO Europe
34
DOWNLOAD
Description
The “DOWNLOAD” keyword is the identifier to save files into K012 memory. The two
types of file that can be downloaded into keyboard memory are program files and data
files.
Syntax
Program file:
DOWNLOAD “FILENAME.BAS”
File contents…
EOP
Data file:
DOWNLOAD “FILENAME”, FILESIZE,
Remarks
Filename may be up to 8 characters with a 3-character extension.
The extension for program files must be BAS.
Data files can be any format of file. 0D 0A is used as separator of each data for a text
data file.
The FILESIZE parameter is expressed in bytes.
Example
Program file:
DOWNLOAD “DEMO.BAS”
CLS
PRINT “This is a test”
EOP
Data file:
DOWNLOAD “DEMO.DAT”,10,0123456789
Dostları ilə paylaş: |