Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 6 of 6

QTERM-R55 User's Manual, pages 37 to 42

Pages 37 to 42 of 42: Appendix C.; Appendix D.

The original document is the PDF (1.6 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the QSI Corp QTerm R55 and Beijer QTerm R55

Page 37

APPENDIX C. QABASIC COMMAND SUMMARY This appendix is an abbreviated summary of all of the available qaBASIC Commands. A more detailed descriptions of the commands are in Chapter 2. Table C-1. qaBASIC Command Summary Command

Description

<>

Conditional comparison - not equal

<=

Conditional comparison - less than or equal to

>=

Conditional comparison - greater than or equal to

=

Conditional comparison - equal to, or assignment

<

Conditional comparison - less than

>

Conditional comparison - greater than x + y

Add two numbers x - y

Subtract two numbers x * y

Multiply two numbers x / y

Divide two numbers x ^ y

Take x to the y power

? x, ? string$

See Print

@

Can be used in place of at

:

Allows multiple commands to be placed on one line

;

Placed after a print statement to prevent a carriage return and linefeed from being appended to the end of the printed characters

#

An abbreviated form of REM - must be the first character on the line

‘

An abbreviated form of REM acos(x)

Calculates the ArcCosine of x and

Used to combine to conditional statements asc(string$)

Returns the ASCII value of the characture that is passed to it asin(x)

Calculates the ArcSine of x atan(x)

Calculates the ArcTangent of x atan(y,x)

Calculates the ArcTangent of (y/x)

autoscroll

Used to control whether the display scrolls when the cursor is on the last line of the display and a linefeed is printed autowrap

Used to control where the display will place the next character if the cursor is at the end of a line. continued QSI Corporation Fax 801-466-8792 Web www.qsicorp.com Phone 801-466-8770

Page 38

28

QTERM-R55 User's Manual

Table C-1. qaBASIC Command Summary Command

Description backlight

Turns the backlight on or off beep

Beeps for the number of seconds specified by x bell

Same as beep chr$(x)

Converts the ASCII value of x to a character clear screen

Clears the display close #x

Used to close file number x that was previously opened.

COM1

Reserved word - refers to the primary serial port

COM2

Reserved word - refers to the secondary serial port (if that option is available)

continue

Used in interrupt processing to deactivate an interrupt handling routine contrast

Adjusts the display contrast cos(x)

Calculates the Cosine of x cursor

Used to change the appearance or location of the cursor date$

Returns the date in a string data

Used to define data to be read in using read dim x

Sets the array size of x else

Used with if, code following else will be run if the condition is false end

Marks the end of program execution endif

Marks the end of an if statement eof

Used to determine if the end of a file has been reached error

Used in an on error statement to implement non-fatal error handling euler

The value of e1 exp(x)

Calculates ex fi

Same functionality as endif for

Used to perform a loop a certain number of times frac(x)

Returns the decimal part of x goint

Used to identify the label for the code used as an interrupt handler gosub

Branches program execution to another part of the program goto

Branches program execution to another part of the program if

Used to perform conditional tests inkey$

Gets a key from the keypad input

Reads the users input input at

Places the cursor at a specific location on the screen and receives input instr(string$, chars$)

Searches string$ for chars$ int(x)

Returns the integer part of x iskeypressed$

Used to get the key string for any key that may have been pressed - returns empty if no key has been pressed keyclick

Turns the keyclick feature on or off continued

QSI Corporation Fax 801-466-8792 Web www.qsicorp.com Phone 801-466-8770

Page 39

QTERM-R55 User's Manual

29

Table C-1. qaBASIC Command Summary Command

Description keydef

Defines the keystring for a key keyrelease

Used for enabling or disabling key release strings label

Used to place a marker in the code for use with gotos and gosubs led

Used to turn the terminal LEDs on or off left$(string$,x)

Returns the left x characters from string$ len(string$)

Returns the length of string$ log(x)

Calculates the logarithim of x lowbat

Used in the on lowbat statement that define a handler for the low battery interrupt lower$(string$)

Converts the characters in string$ to lower case ltrim$(string$)

Removes any spaces from the left side of the string max(x,y)

Returns the higher of the x and y values mid$(string$,x,y)

Returns the middle y characters from string$ starting at position x min(x,y)

Returns the lower of the x and y values mod(x,y)

Returns the remainder when dividing x by y next x

Increments x and goes to the start of the for loop normal

Used in the cursor normal statement to return the cursor mode to normal not

Returns the inverse of whatever is after it off

Used in other commands to turn something off on

Used in other commands to turn something on on x gosub

Performs a gosub to the label in the variable x on x goto

Performs a goto to the label in the variable x open #x

Open file x or

Used to combine two conditional statements pause x

Delays program execution for x seconds peek(x$)

Used to read QTERM-R55 internal variables - legal values of x$ are: rows, columns numkeys, cursorX, cursorY, COM1, COM2, ostick pi or PI

The value of pi 3.141592653589793 in 32 bit ANSI/IEEE 754-1985 format.

print

Prints whatever is after it to the display print at

Works the same as print but outputs to a specified location ran(x)

Returns a random number between 0 and x read

Reads one data item at a time from the data lines in the program recv

Receives input from the serial port and stores it as a number recv$

Receives input from the serial port and stores it as a string release

Used in a keydef statement to define a key release string rem

Signals a comment; the line is not executed restore

Used to specify the location that read gets its data from return

Used at the end of a gosub to return to the next line in the main program flow continued

QSI Corporation Fax 801-466-8792 Web www.qsicorp.com Phone 801-466-8770

Page 40

30

QTERM-R55 User's Manual

Table C-1. qaBASIC Command Summary Command

Description right$(string$, x)

Returns the right x number of characters from string$ rtrim$(string$)

Removes the white spaces on the right side of the string$ seek #x to line y

Sets file pointer to line y in file x seek #x y lines

Sets file pointer y lines away from current position send

Sends data over the serial port shift

Used in a keydef statement to define a shifted key string.

shiftstate

Sets the current state of the shift key shutdown

Allows battery-powered terminals to be turned off by software - terminals not powered by a battery treat this command as an end sin(x)

Calculates the Sine of x step

Specifies the value to increment the variable in a for loop sqrt(x)

Calculates the square root of x str$()

Forces whatever is in the parenthesis to be viewed as a string tan(x)

Calculates the Tangent of x then

Placed at the end of an if statement to indicate where to start executing code time$

Returns a string containing the current time to

Used in a for loop to specify the upper bound of the loop trim$(string$)

Removes spaces from both ends of a string upper$(string$)

Converts the characters in string$ to upper case val(string$)

Converts the string string$ to a number wait x

Same as pause x and y represent numbers string$ represents a string Other reserved keywords that currently do nothing but are not legal for variable names are: arrow break bitmap circle dot draw erase font frame interrupt inverse line map poke printer reverse select system text textwin transparent window xmap xtick ymap ytick

QSI Corporation Fax 801-466-8792 Web www.qsicorp.com Phone 801-466-8770

Page 41

APPENDIX D. USING THE R55 DOWNLOADER D.1

Purpose

The R55 Downloader is a Windows® application that sends qaBASIC program files and QTERM-R55 firmware upgrades out a specified COM port on the PC.

D.2

Upgrade. If a file with a .qbs or .bas extension is selected, the download type is automatically set to Application Download. D.3.3

Selecting the serial port

Select the COM port which is attached to the QTERM-R55 from the COM Port box.

Setup

To install the R55 Downloader on your PC hard drive, follow these steps:

• Copy the "R55 Downloader.exe" file from the diskette included with this manual to a directory on your hard drive. • Test your installation by running the program. From the Start Menu in Windows select "Run." Type "x:\<directory>\R55 Downloader.exe" (including the quotes) where x: is the drive and <directory> is the directory where you copied the "R55 Downloader.exe" file. You may wish to create a shortcut to launch this program. Refer to your operating system documentation for details. • A dialog box will appear with all the options that you need to configure the R55 Downloader to communicate with the QTERM-R55.

D.3.4

Setting the communication parameters

Select the baud rate, parity and flow control to match the communication settings of the primary COM port of the QTERM-R55. It is possible to use the R55 Downloader with a QTERMR55 that has been configured with EIA-485 on the primary interface. This requires a QCOM-4 serial interface device, available from QSI Corporation. Check the box labeled "This terminal is attached to a QCOM-4 using EIA-485 communications." Other EIA-485 interface adapters may or may not work with the R55 Downloader. Contact QSI Techical Support. D.3.5

Downloading the application

Launch the program as described above in Setup (section D.2). You may optionally specify the qaBASIC file that you wish to download on the command line (after “R55 Donwloader.exe”).

Prepare the QTERM-R55 to receive the application file or firmware upgrade via Power-On Setup [see Power-On Setup (section 1.1)]. Press the Download button to send the file to the terminal. A status bar will track the progress of the download. To stop sending data to the terminal, press Cancel. After the download is complete, the results of the download as well as any error messages will be displayed in the Download Results box.

D.3.2

D.3.6

D.3

Basic Operation

D.3.1

Using the R55 Downloader

Selecting the file to download

Use the Filename field at the top of the dialog box to specify the name of the file to download. To browse for a file press the ... button. If a file with a .bin extension is entered the download type is automatically set to Firmware

Cancel

If the R55 Downloader is transmitting an application file or a firmware upgrade, this button terminates the transmission. At all other times, pressing this button closes the R55 Downloader.

QSI Corporation Fax 801-466-8792 Web www.qsicorp.com Phone 801-466-8770

Page 42

32

QTERM-R55 User's Manual

D.4

Advanced Features

D.5

Preprocessor Directives

D.4.1

Port State

D.5.1

Overview

This Button indicates whether the serial port on the PC is open or closed. If the button is red, the port is closed. The button is green when the port is open. Other programs will not be able to access the serial port while R55 Downloader has it open. Normally the R55 Downloader opens the port automatically whenever it tries to send data to the serial port and closes the port whenever any communication parameters are changed. The port state may be toggled by pressing the button in the Port State box.

The R55 supports a few simple preprocessor directives. These directives are useful shortcuts to help speed application development. Each preprocessor directive is preceded with the '%' (percent) symbol. Each directive should be the last command on a line (i.e. don't try to use ':' to add more commands after the directive as they will be interpreted as part of the directive).

D.4.2

Use the include directive to include the contents of another file at that location of the current file. The syntax is as follows:

Send to R55

Enter text in this box and press the Transmit button. This feature is useful for sending short strings to the QTERMR55 to test application programs. D.4.3

Clear Box

Pressing this button erases the contents of the Download Results box. D.4.4

Preprocessor Settings

The R55 Downloader contains a preprocessor for qaBASIC [see Preprocessor Directives (section D.5)]. The settings of this preprocessor can be changed with the Preprocessor Settings button. Pressing this button will bring up a dialog box listing the various options. Select "Preprocess application files before downloading" to control whether the preprocessor runs on an application file. When the preprocessor runs, it parses all of the input files and generates an intermediate file; this intermediate file is then downloaded to the QTERM-R55. It is often useful to examine the contents of this intermediate file if the terminal reports that an application has errors. By default the intermediate file is R55.tmp.qbs and is stored in the directory which contains the application file. To change this, simply enter a new name in the "Save intermediate file as:" box, or browse using the ... button. To automatically delete the intermediate file when the R55 Downloader is closed, select "Delete intermediate file on exit." (Note: If you use more than one different intermediate file in one session, only the last file is deleted when the R55 Downloader is closed).

D.5.2

Include

%include "filename" Example: ' Setup the custom keypad %include "KeypadLayout.qbh" In this example the contents of "KeypadLayout.qbh" are copied into the application file. D.5.3

Define

The define directive is a macro substitution directive that redefines a symbol as something else. A symbol can be any string of characters. Symbols within quoted strings are not substituted. The syntax is: %define <symbol> <definition> Example: ' Shortcut to print out the serial port %define PC1 print #COM1 The directive in this example will cause every occurrence of PC1 (except within quoted strings) to be replaced with "print #COM1"

QSI Corporation Fax 801-466-8792 Web www.qsicorp.com Phone 801-466-8770