Page 1
BASIC Language Programming Part I: Basics and Hardware Control For 8 Series Mobile Computers Version 5.06...
Page 2
Due to continued product development this information may change without notice. The information and intellectual property contained herein is confidential between CIPHERLAB and the client and remains the exclusive property of CIPHERLAB CO., LTD. If you find any problems in the documentation, please report them to us in writing.
Page 3
RELEASE NOTES Version Date Notes 5.06 Jun. 22, 2015 Part I Modified: Appendix I – SYMBOLOGY PARAMETER TABLE FOR CCD/LASER/LONG RANGE READER: : 300~306, 308 updated with 8400 : 312~317 added for Quiet Zone check settings (8200/8400) Modified: Appendix II – SCAN ENGINE, CCD OR LASER: : 300~306 updated with 8400 : 308 updated with 8400 (Addon Security) : 312 ~ 317 added for Quiet Zone check settings (8200/8400)
Page 4
5.03 Feb. 19, 2014 Part I Replace “RSS” with “GS1 DataBar” Modified: Chapter 1 – Windows 95/98/7 supported (chapter 1, 2) Modified: 2.3 Configure Menu – descriptions for “Create DBF Files” command revised Modified: 4.15 KEYPAD COMMANDS | 4.15.1 GENERAL – >8000 supports OSK_TOGGLE,...
Page 5
5.02 Mar. 27, 2013 Part I Modified: 4.7.2 Code Type – CodeType Table II: add 8400/8700 2D scan engine to Composite_CC_A/B/C symbologies (Decimal 47/55/118) Modified: 4.15.1 General – OSK_TOGGLE, SET_PWR_KEY: support for 8400/8700 added Modified: Appendix I – Symbology Parameter Table II: add 8400/8700 2D scan engine to No.
Page 6
4.23 July. 02, 2012 Part I New: Add 8700-Long Range followed to CCD, Laser Part II New: Appendix II add Wi-Fi Profile index New: Appendix IV add PCAT — Swiss(German) and Hungarian for 8400/8700. New: 4.2 Wi-Fi Profile 4.21 Mar.
Page 7
Part I 3.2.1 Variable Names and Declaration Characters — add “About Real Number” 4.6.2 System Information — SYSTEM_INFORMATION$() for 8200 bootloader version 4.10 Buzzer Commands — BEEP() allows setting 8200’s speaker mute 4.15.3 FN Key — Auto Resume mode for 8300 allows re-pressing the function key to exit the function mode ...
2.2 Edit Menu ..........................11 2.3 Configure Menu ........................13 2.4 Compile Menu ........................15 2.5 Help Menu ..........................16 BASICS OF THE CIPHERLAB BASIC LANGUAGE ............. 17 3.1 Constants ..........................17 3.1.1 String ..........................17 3.1.2 Numeric ........................17 3.2 Variables ..........................
Page 10
CipherLab BASIC Programming Part I 4.4.1 Combining Strings ....................39 4.4.2 Comparing Strings ....................39 4.4.3 Getting the Length of a String ................40 4.4.4 Searching for Strings ....................40 4.4.5 Retrieving Part of Strings ..................41 4.4.6 Converting for Strings .................... 43 4.4.7 Creating Strings of Repeating Characters ............
Page 11
CipherLab BASIC Programming Part I 4.18.1 Font Size ........................140 4.18.2 Display Capability ....................140 4.18.3 Multi-language Font File ..................141 4.18.4 Special Font Files ....................141 4.19 Memory Commands ..................... 144 4.19.1 Flash .......................... 145 4.19.2 SRAM......................... 147 4.19.3 SD Card ........................148 4.20 File Manipulation......................
This manual is meant to provide detailed information about how to use the BASIC Compiler to write application programs for CipherLab 8 Series Mobile Computers. It is organized in chapters giving outlines as follows: Part I: Basics and Hardware Control Chapter 1 “Development Environment”...
Chapter 1 DEVELOPMENT ENVIRONMENT Before you install the CipherLab BASIC Compiler, it is necessary to check that your PC meets the following minimum requirements: Items Requirements Pentium 75MHz Operating System Windows 95/98/2000/NT/XP/7/8 Minimum RAM 16 MB Minimum Hard Disk Space...
Page 16
CipherLab BASIC Programming Part I BASIC Runtimes BC8000.shx 8000 generic version Download font file if not using system font BC8200.shx 8200 generic version BC8300.shx 8300 generic version BC8400.shx 8400 generic version BC8500.shx 8500 generic version BC8700.shx 8700 generic version...
Part I 1.2 BASIC RUNTIME ENGINES The BASIC Run-time Engines work as interpreters of the BASIC commands. CipherLab Mobile Computers have to be loaded with the BASIC Run-time (Engines) to run the BASIC programs; each has its own Run-time Engine to drive its specific hardware features.
Chapter 1 Development Environment 1.3 DEVELOPMENT FLOW Developing a BASIC program for the mobile computers is as simple as counting 1-2-3. There are three steps: Step 1 – Download the BASIC Run-time to the target mobile computer. Step 2 – Edit and compile the BASIC program. Step 3 –...
CipherLab BASIC Programming Part I 1.3.3 DOWNLOAD BASIC OBJECT FILES Use the BASIC Compiler or the standalone BASIC download utility, Synload.exe, to download a compiled BASIC program. Synload.exe provides only the download function of the BASIC Compiler, that is, it cannot be used to view or edit any BASIC code.
Chapter 2 USING BASIC COMPILER The CipherLab BASIC Compiler looks like a traditional Windows environment application that supports file management, text editing, and some other functions to simplify the BASIC program development. To run the compiler, one of the Windows operating...
CipherLab BASIC Programming Part I 2.1 FILE MENU Six commands are provided in this menu. Command To Do… Function To create a new BASIC program. Operation Click “File” on the menu bar and select “New”. For the same function, press hot key CTRL+ N or click the [New] icon on the tool bar.
Chapter 2 Using BASIC Compiler 2.2 EDIT MENU Seven commands are provided here to facilitate the editing of the BASIC source code. Command To Do… Undo Function To abort the previous editing command or action. Operation Click “Edit” on the menu bar and select “Undo”. For the same function, press hot key CTRL+ Z or click the [Undo] icon on the tool bar.
Page 24
CipherLab BASIC Programming Part I Function Delete To delete a paragraph from the text. This paragraph will not be placed on the clipboard. Operation Drag the cursor to select the paragraph to be deleted. This paragraph will be highlighted (in a reverse color). Click “Edit” on the menu bar and select “Delete”.
Using BASIC Compiler 2.3 CONFIGURE MENU Seven items are provided here for users to define the system settings. With the 8 Series mobile computers support multiple applications that only one of them is active, the “Configure Transaction Files” and “Create DBF Files” items provide the option of “Share file space with other applications”;...
Page 26
CipherLab BASIC Programming Part I Function Configure To define the transaction files (up to 6) to be used and the data Transaction length for each transaction file. Once the data length is defined, Files the system will reserve space for the program. If the space is larger than needed, it would be a waste.
Chapter 2 Using BASIC Compiler 2.4 COMPILE MENU Three commands are provided on this menu. Command To Do… Function Syntax To check the syntax of the BASIC program. checking Operation Click “Compile” on the menu bar and select “Syntax checking”. In the case of any syntax error in the BASIC program, the “Output”...
CipherLab BASIC Programming Part I 2.5 HELP MENU One command is provided on this menu. Command To Do… About Function To display the ownership and version of the program. Note that the version information is necessary when tracing a programming problem.
Chapter 3 BASICS OF THE CIPHERLAB BASIC LANGUAGE The chapter describes the basics of the CipherLab BASIC language. IN THIS CHAPTER 3.1 Constants ..............17 3.2 Variables..............18 3.3 Expression and Operators ..........21 3.4 Operator Precedence ........... 23 3.5 Labels ............... 23 3.6 Subroutines ..............
CipherLab BASIC Programming Part I 3.2 VARIABLES Variables are symbols used to represent data items, such as numerical values or character strings that are used in a BASIC program. The value of a variable may be assigned explicitly and can be changed during the execution of a program. Be aware that the value of a variable is assumed to be undefined until a value is assigned to it.
Page 31
Chapter 3 Basics of the CipherLab BASIC Language About Real Number Every decimal integer can be exactly represented by a binary integer; however, this is not true for fractional numbers. It is therefore very important to realize that any binary floating-point system can represent only a finite number of floating-point values in exact form.
ArrayD(i+1, j) expression. The first element of an array is subscripted with 1. In the CipherLab BASIC language, the maximum number of dimensions for an array is 2, and, up to 32,767 elements per dimension is allowed while compiling.
Operators perform mathematical or logical operations. The operators provided by the CipherLab BASIC Compiler may be divided into four categories, namely, Assignment Operator, Arithmetic Operators, Relational Operators, and Logical Operators.
CipherLab BASIC Programming Part I 3.3.3 RELATIONAL OPERATOR Relational operators are used to compare two values. The result of the comparison is either “True” or “False”. This result may then be used to make a decision regarding program flow. Operator...
Chapter 3 Basics of the CipherLab BASIC Language 3.4 OPERATOR PRECEDENCE The precedence of BASIC operators affects the evaluation of operands in expressions. Expressions with higher precedence operators are evaluated first. The precedence of BASIC operators is listed below in the order of precedence from highest to lowest. Where several operators appear together, they have equal precedence.
PRINT “Subroutine2 is executed.” END SUB Since all the variables in the CipherLab BASIC program are treated as global variables, passing arguments to subroutines is meaningless and enclosing arguments in the brackets of the subroutines will lead to a syntax error while compiling.
Page 37
Chapter 3 Basics of the CipherLab BASIC Language Loop: GOTO Loop Factorial: IF Fact% < 1 THEN RETURN FactResult! = FactResult! * Fact% Fact% = Fact% -1 GOSUB Factorial RETURN...
CipherLab BASIC Programming Part I 3.7 PROGRAMMING STYLE The following are the guidelines used in writing programs in this manual, including the sample program. These guidelines are recommended for program readability, but they are not compulsory. Reserved words and symbolic constants appear in uppercase letters: ...
Chapter 4 BASIC COMMANDS This chapter provides detailed descriptions of the commands supported by the CipherLab BASIC Compiler. In addition to the commands commonly used in traditional versions of BASIC, a number of commands that deal with specific hardware features of the mobile computers are supported.
Page 40
CipherLab BASIC Programming Part I IN THIS CHAPTER 4.1 General Commands ............. 29 4.2 Commands for Decision Structures ........ 32 4.3 Commands for Looping Structures ........ 37 4.4 Commands for String Processing ........39 4.5 Commands for Event Trapping ........47 4.6 System Commands .............
Chapter 4 BASIC Commands 4.1 GENERAL COMMANDS This section describes commands that are not confined to any specific hardware features. Purpose To return the absolute value of a numeric expression. Syntax A = ABS(N) “A” is a numeric variable to be assigned to the absolute value of a numeric expression.
Page 42
CipherLab BASIC Programming Part I GOSUB Purpose To call a specified subroutine. Syntax GOSUB SubName|SubLabel Remarks “SubName” is the name of a subroutine. “SubLabel” is the line label of a subroutine. Example GOSUB DoIt … GOSUB Done … SUB DoIt( ) PRINT “Now I’ve done it!”...
Page 43
Chapter 4 BASIC Commands Purpose To insert explanatory remarks in a program. Syntax REM remark ‘ remark Remarks “remark” may be any sequence of characters. The BASIC compiler will ignore whatever follows REM or the apostrophe (‘) until end of the line. Example REM This is a comment.
To branch to another part of the program outside the decision structure. In CipherLab BASIC, decision-making is handled by the IF…THEN…[ELSE…][ENDIF] and ON…GOSUB|GOTO… statement. The IF…THEN…[ELSE…][ENDIF] statement can be used anywhere the ON…GOSUB|GOTO… statement can be used. The major difference between the two statements is that ON…GOSUB|GOTO…...
Page 45
Chapter 4 BASIC Commands IF … THEN … [ELSE…] Purpose To provide a decision structure for single-line conditional execution. Syntax IF condition THEN action1 [ELSE action2] Remarks “condition” is a logical expression. “action” is a BASIC statement. Example IF Data1% > Data2% THEN Temp% = Data1% ELSE Temp% = Data2%...
Page 46
CipherLab BASIC Programming Part I IF … THEN … END IF Purpose To provide a decision structure for a conditional execution with multiple lines of actions. Syntax IF condition1 THEN action1 action2 … END IF Remarks “condition” is a logical expression.
Page 47
Chapter 4 BASIC Commands ON … GOSUB … Purpose To call one of the several specified subroutines depending on the value of the expression. Syntax ON N GOSUB SubName|SubLabel {, SubName|SubLabel} Remarks “N” is a numeric expression that is rounded to an integer. The value of N determines which subroutine is to be called.
Page 48
CipherLab BASIC Programming Part I ON … GOTO … Purpose To branch to one of several specified Line Labels depending on the value of an expression. Syntax ON N GOTO LineLabel {, LineLabel} Remarks “N” is a numeric expression which is rounded to an integer. The value of N determines which line label in the list will be used for branching.
Looping structures repeat a block of statements, either for a specified number of times or until a certain condition is matched. In CipherLab BASIC, two kinds of looping structures, FOR…NEXT and WHILE…WEND can be used. The command EXIT can be used as an alternative to exit from both FOR…NEXT and WHILE…WEND loops.
Page 50
CipherLab BASIC Programming Part I WHILE … WEND Purpose To repeat the execution of a block of statements while a certain condition is TRUE. Syntax WHILE condition [Statement Block] WEND Remarks If the “condition” is true, loop statements are executed until the WEND statement is encountered.
BASIC Commands 4.4 COMMANDS FOR STRING PROCESSING This section describes BASIC commands used to manipulate sequences of ASCII characters known as strings. In CipherLab BASIC, strings are always variable length, from null to a maximum of 250. 4.4.1 COMBINING STRINGS Two strings can be combined with the plus operator “+”.
CipherLab BASIC Programming Part I 4.4.3 GETTING THE LENGTH OF A STRING Purpose To return the length of a string. Syntax A% = LEN(X$) Remarks “A%” is an integer variable to be assigned to the result. “X$” may be a string variable, string expression, or string constant.
Chapter 4 BASIC Commands 4.4.5 RETRIEVING PART OF STRINGS Several commands are provided to take strings apart by returning pieces of a string, from the left side, or the right side, or the middle of the target string. LEFT$ Purpose To retrieve a given number of characters from the left side of the target string.
Page 54
CipherLab BASIC Programming Part I RIGHT$ Purpose To retrieve a given number of characters from the right side of the target string. Syntax A$ = RIGHT$(X$, N%) Remarks “A$” is a string variable to be assigned to the result. “X$” may be a string variable, string expression, or string constant.
Chapter 4 BASIC Commands 4.4.6 CONVERTING FOR STRINGS Several commands are available for converting strings to uppercase or lowercase letters, as well as converting strings to numbers, and vice versa. Purpose To return the decimal value for the ASCII code for the first character of a given string.
Page 56
CipherLab BASIC Programming Part I OCT$ Purpose To convert a decimal numeric expression to a string that represents the value of the numeric expression in octal notation. Syntax A$ = OCT$(N%) Remarks “A$” is a string variable to be assigned to the result.
Page 57
Chapter 4 BASIC Commands VALR Purpose To convert a string expression to a real number. Syntax A! = VALR(X$) Remarks “A!” is a real number variable to be assigned to the result. “X$” is a string that includes numeric characters. The precision of the converted result is governed by the command SET_PRECISION.
CipherLab BASIC Programming Part I 4.4.7 CREATING STRINGS OF REPEATING CHARACTERS STRING$ Purpose To return a string containing the specified number of the requested character. Syntax A$ = STRING$(N%, J%) A$ = STRING$(N%, X$) Remarks “A$” is a string variable to be assigned to the result.
… 4.5.1 EVENT TRIGGERS This section describes a variety of events that the CipherLab BASIC can trap as well as the related commands. Below are 10 different events that can be trapped. 1) COM Event: a signal is received from the COM port.
Page 60
CipherLab BASIC Programming Part I OFF ALL Purpose To terminate all the event triggers. Syntax OFF ALL Remarks To resume the event trigger, call ON event GOSUB… Example ON READER(1) GOSUB BcrData_1 ON READER(2) GOSUB BcrData_2 ON KEY(1) GOSUB KeyData_1 …...
Page 61
Chapter 4 BASIC Commands OFF ESC Purpose To terminate “ESC Event Trigger”. Syntax OFF ESC Remarks To resume the event trigger, call ON ESC GOSUB… Example ON ESC GOSUB Key_Esc … Key_Esc: OFF ESC … ON ESC GOSUB Key_Esc RETURN OFF HOUR_SHARP Purpose To terminate “HOUR_SHARP Event Trigger”.
Page 62
CipherLab BASIC Programming Part I OFF KEY 8000, 8200, 8300, 8400, 8700 Purpose To terminate “KEY Event Trigger”. Syntax OFF KEY(number%) Remarks To resume the event trigger, call ON KEY… GOSUB… When “number%” is an integer variable in the range of 1 to 12, it indicates a function key (F1~F12) of the keypad.
Page 63
Chapter 4 BASIC Commands OFF READER Purpose To terminate “READER Event Trigger”. Syntax OFF READER(N%) Remarks To resume the event trigger, call ON READER… GOSUB… “N%” is an integer variable, indicating the reader port (usually 1 for mobile computers). Example ON READER(1) GOSUB BcrData_1 …...
Page 64
CipherLab BASIC Programming Part I ON COM … GOSUB … Purpose To activate “COM Event Trigger”. Syntax ON COM(N%) GOSUB SubName|SubLabel Remarks “N%” is an integer variable, indicating the COM port. “SubName|SubLabel” is the name or line label of a subroutine.
Page 65
Chapter 4 BASIC Commands ON HOUR_SHARP GOSUB … Purpose To activate “HOUR_SHARP Event Trigger”. Syntax ON HOUR_SHARP GOSUB SubName|SubLabel Remarks “SubName|SubLabel” is the name or line label of a subroutine. When the system time is on the hour, a specific subroutine will be executed. Example ON HOUR_SHARP GOSUB OnHourAlarm …...
Page 66
CipherLab BASIC Programming Part I ON KEY … GOSUB … 8000, 8200, 8300, 8400, 8700 Purpose To activate “KEY Event Trigger”. Syntax ON KEY(number%) GOSUB SubName|SubLabel Remarks “number%” is an integer variable. When “number%” is an integer variable in the range of 1 to 12, it indicates a function key (F1~F12) of the keypad.
Page 67
Chapter 4 BASIC Commands Example (3) REM Parse key codes in subroutine ON KEY(256+255) GOSUB KeyEvent KeyEvent: KeyData$ = INKEY$ A% = ASC(KeyData$) IF A% = 144 THEN PRINT “KEY_F13 is pressed.” ELSE IF A% = 145 THEN PRINT “KEY_F14 is pressed.” END IF RETURN...
Page 68
CipherLab BASIC Programming Part I ON MINUTE_SHARP GOSUB … Purpose To activate “MINUTE_SHARP Event Trigger”. Syntax ON MINUTE_SHARP GOSUB SubName|SubLabel Remarks “SubName|SubLabel” is the name or line label of a subroutine. When the system time is on the minute, a specific subroutine will be executed.
Page 69
Chapter 4 BASIC Commands ON POWER_ON GOSUB … Purpose To activate “POWER_ON Event Trigger”. Syntax ON POWER_ON GOSUB SubName|SubLabel Remarks “SubName|SubLabel” is the name or line label of a subroutine. When the POWER key is pressed again after powering off the mobile computer, a specific subroutine will be executed.
Page 70
CipherLab BASIC Programming Part I ON TCPIP GOSUB… Purpose To activate “TCP/IP Event Trigger”. Syntax ON TCPIP GOSUB SubLabel Remarks “SubLabel” is the line label of a subroutine. When data is received from any TCP/IP connection or some error is taking place, a specific subroutine will be executed.
Chapter 4 BASIC Commands 4.5.2 LOCK AND UNLOCK Event trapping could be nested. If the event triggers are activated in a BASIC program, it is possible that an event-driven subroutine can be interrupted by any upcoming events. Normally, the new event would be processed first. In some cases where we don’t want the event-driven subroutine to be interrupted by other events, the commands LOCK and UNLOCK can be used to hold off new events.
Page 72
CipherLab BASIC Programming Part I UNLOCK Purpose To release all the activated event triggers held by LOCK. Syntax UNLOCK Remarks This command resumes event processing. Example Refer to the command LOCK.
Chapter 4 BASIC Commands 4.6 SYSTEM COMMANDS This section describes the system commands, such as the commands to change the CPU running speed, get the device ID, and/or restart the system. 4.6.1 GENERAL AUTO_OFF Purpose To set a specified period of time for the system to automatically shut down user’s program as long as there is no operation in the interval.
Page 74
CipherLab BASIC Programming Part I IOPIN_STATUS 8000, 8200, 8300, 8400, 8700 Purpose To check the I/O pin status. Syntax A% = IOPIN_STATUS(N%) Remarks “A%” is an integer variable to be assigned to the result. “N%” is an integer variable, indicating the item to be checked with.
Page 75
Chapter 4 BASIC Commands For 8200/8400/8700 only: To get the status when mass storage is in use. A% = A value that indicates the current status. Meaning USB is disconnected. USB is connected and device is not being accessed. USB is connected and device is being accessed.
Page 76
CipherLab BASIC Programming Part I MENU Purpose To create a menu. Syntax A% = MENU(Item$) Remarks “A%” is an integer variable to be assigned to the result. It is the ordinal number of the menu item that user has selected. If the ESC key is pressed to cancel the operation, it will return 0.
Page 77
Chapter 4 BASIC Commands POWER_ON Purpose To determine whether to restart or resume the program upon powering on. Syntax POWER_ON(N%) Remarks “N%” can be 0 or 1. Meaning Program Resume Program Restart Example POWER_ON(0) ‘ set to resume mode See Also AUTO_OFF, RESTART RESTART Purpose...
CipherLab BASIC Programming Part I 4.6.2 SYSTEM INFORMATION Being one category of system information, the device type is displayed as “xxxx”; each is a digit from 0 to 9. The last digit (“0”) is reserved for future use. Refer to SYSTEM_INFORMATION$(8) below.
Page 79
Chapter 4 BASIC Commands 8300 Series For hardware version 4.0, when the first digit is “2”, it may refer to CCD or Laser scan engine. You will need to check the fourth digit – “1” for CCD, “0” for Laser. 4-digit Device Type Meaning digit...
Page 80
CipherLab BASIC Programming Part I 8500 4-digit Device Type Meaning digit 0xxx No reader 1xxx CCD scan engine 2xxx Laser scan engine 3xxx 2D scan engine 4xxx Long Range Laser scan engine 5xxx Extra Long Range Laser scan engine digit...
Page 81
Chapter 4 BASIC Commands DEVICE_ID$ Purpose To get the serial number of the mobile computer. Syntax A$ = DEVICE_ID$ Remarks This command is to be replaced by SYSTEM_INFORMATION$. “A$” is a string variable to be assigned to the result. That is, a string for the serial number will be returned.
Page 82
CipherLab BASIC Programming Part I SYSTEM_INFORMATION$ Purpose To collect information on components, either hardware or software. Syntax A$ = SYSTEM_INFORMATION$(index%) Remarks “A$” is a string variable to be assigned to the result. “index%” is an integer variable, indicating a specific category of information.
Page 83
Chapter 4 BASIC Commands VERSION Purpose To write version information to the system. Syntax VERSION(A$) Remarks “A$” is a string variable, indicating program name, date, etc. This command is used to write information of program version to the system. Such information can be checked in System Menu | Information | USR.
CipherLab BASIC Programming Part I 4.6.3 SECURITY SYSTEM_PASSWORD Purpose To set the password protection for entering System Menu. Syntax SYSTEM_PASSWORD(A$) Remarks “A$” is a string constant or variable, representing the password. Example SYSTEM_PASSWORD(“12345”)
Chapter 4 BASIC Commands 4.6.4 PROGRAM MANIPULATION These two functions can be used as the basis of remote update of BASIC applications. Programs can be downloaded to the file system and activated immediately or later. DOWNLOAD_BASIC Purpose To read a new BASIC program from a specific COM port and store it to a specified transaction file.
Page 86
CipherLab BASIC Programming Part I UPDATE_BASIC Purpose To have a BASIC program become the active program. Syntax A% = UPDATE_BASIC(file%) Remarks “A%” is an integer variable to be assigned to the result. Value Meaning Invalid file number Invalid file format No free space in flash before writing Fail to read program header (.ini)
Page 87
Chapter 4 BASIC Commands 40~59 Runtime program(.bin or .shx) saved on SD card A .bin file takes the first priority. Source file and file system will be kept after execution. For 8200/8400/8700, if the source file is on SD card, “file%” must be set in a specific range, as shown above.
Page 88
CipherLab BASIC Programming Part I BASIC PROGRAM – FORMAT OF TRANSACTION FILE A complete BASIC program consists of one header file (.ini) and one object file (.syn). To ensure the execution of a BASIC program, both files must be stored correctly into one transaction file.
Page 89
Chapter 4 BASIC Commands It is acceptable that the header file is split into multiple records and the last part is followed by the object file. Non-fixed length It is unacceptable that the header file is saved after the object file or split into ...
CipherLab BASIC Programming Part I 4.7 BARCODE READER COMMANDS The CipherLab mobile computers are able to read barcode data from the reader ports. This section describes the BASIC commands that are related to the reader ports of the mobile computers.
Page 91
Chapter 4 BASIC Commands ENABLE READER Purpose To enable the reader ports of the mobile computer. Syntax ENABLE READER(N%) Remarks “N%” is an integer variable, indicating the reader port. N% = 1 for mobile computers. The reader ports are disabled by default. To enable barcode decoding function, the reader ports have to be enabled by ENABLE READER.
Page 92
CipherLab BASIC Programming Part I SAMPLE CODE READER_SETTING(5, 0) READER_SETTING(132, 0) READER_CONFIG ‘ enable the new settings for 2D or ‘ Long Range Laser engines ENABLE READER(1) ‘ enable the reader ON READER(1) GOSUB G_Reader_Data GOSUB MainScreen MainLoop: Data$ = GET_READER_DATA$(1) IF LEN(Data$) <>...
Page 93
Chapter 4 BASIC Commands ‘ is longer than 255 bytes ‘ (must be 2D code) CodeLEN% = CodeLEN%+LEN(Data$) PRINT Data$ GOTO GetMoreData END IF LOCATE 4, 1 PRINT “Code Length:”, CodeLEN% RETURN G_Reader_Data: BEEP(4000, 8) Count% = Count% + 1 IF CODE_TYPE = 65 THEN CodeType$ = “Code 39”...
Page 94
CipherLab BASIC Programming Part I ELSE IF CODE_TYPE = 72 THEN CodeType$ = “Code 93” ELSE IF CODE_TYPE = 73 THEN CodeType$ = “Code 128” ELSE IF CODE_TYPE = 74 THEN CodeType$ = “UPCE” ELSE IF CODE_TYPE = 75 THEN CodeType$ = “UPCE with Addon 2”...
Page 95
Chapter 4 BASIC Commands CodeType$ = “GTIN” ELSE IF CODE_TYPE = 90 THEN CodeType$ = “Telepen” ELSE IF CODE_TYPE = 91 THEN CodeType$ = “RSS” END IF RETURN...
CipherLab BASIC Programming Part I 4.7.2 CODE TYPE The following tables list the values of the CodeType variable. CodeType Table I: ASCII Symbology Supported by Scan Engine Coop 25 8000, 8200, 8300, 8400, 8700 -CCD, Laser, 8700 -Long Range ISBT 128...
Page 97
Chapter 4 BASIC Commands Reserved CodeType Table II: ASCII Symbology Supported by Scan Engine Composite_CC_A 8200, 8400, 8700 2D Composite_CC_B 8200, 8400, 8700 2D ISBT 128 2D, (Extra) Long Range Laser Code 39 2D, (Extra) Long Range Laser Code 32 (Italian Pharmacode) 2D, (Extra) Long Range Laser Interleaved 25 2D, (Extra) Long Range Laser...
Page 98
CipherLab BASIC Programming Part I UPC-A 2D, (Extra) Long Range Laser UPC-A Addon 2 2D, (Extra) Long Range Laser ‘ UPC-A Addon 5 2D, (Extra) Long Range Laser UPC-E1 2D, (Extra) Long Range Laser UPC-E1 Addon 2 2D, (Extra) Long Range Laser...
Page 99
Chapter 4 BASIC Commands CODE_TYPE Purpose To get the type of symbology being decoded upon a successful scan. Syntax A% = CODE_TYPE Remarks “A%” is an integer variable to be assigned to the result. Refer to the above table for code types. Example …...
CipherLab BASIC Programming Part I 4.7.3 READER SETTINGS Refer to Appendix I for two tables that describe the details of the reader settings. Table I is for the use of CCD or Laser scan engine. Table II is for the use of 2D or (Extra) Long Range Laser scan engine.
Chapter 4 BASIC Commands 4.8 RFID READER COMMANDS For 8300/8500/8700 Series, it allows an optional RFID reader that can coexist with the barcode reader, if there is any. The RFID reader supports read/write operations, which depend on the tags you are using. The supported labels include ISO 15693, Icode®, ISO 14443A, and ISO 14443B.
CipherLab BASIC Programming Part I 4.8.1 VIRTUAL COM The algorithm for programming the RFID reader simply follows the commands related to COM ports. The virtual COM port for RFID is defined as COM4. Thus, OPEN_COM(4) : enable the RFID module ...
Page 103
Chapter 4 BASIC Commands SET_RFID_READ 8300, 8500 Purpose To set the reading parameters of RFID. Syntax SET_RFID_READ(TagType&, start%, MaxLen%) Remarks The RFID reader cannot read until the parameters are specified. Example SET_RFID_READ(1, 0, 20) ‘ read tag type ISO 15693 …...
CipherLab BASIC Programming Part I 4.8.3 AUTHENTICATION GET_RFID_KEY 8300, 8500 Purpose To get the security key of some specific tags. Syntax A$ = GET_RFID_KEY(TagType %) Remarks “A$” is a string variable to be assigned to the result. “TagType%” is an integer variable, indicating a specific tag type that the security key is applied to.
Chapter 4 BASIC Commands 4.9 KEYBOARD WEDGE COMMANDS For 8300 Series, it can be programmed to send data to the host through the physical wedge interface by using the SEND_WEDGE(). For those that do not allow the keyboard wedge cable, alternatives are Bluetooth HID, USB HID and the Wedge Emulator utility. Emulator, and Part II: Appendix IV Examples.
CipherLab BASIC Programming Part I 4.9.1 DEFINITION OF THE WEDGESETTING ARRAY WedgeSetting$ is a 3-element character array passed to SET_WEDGE to describe the characteristics of the keyboard wedge interface. In a BASIC program, WedgeSetting$ can be defined as follows. WedgeSetting$ = Wedge_1$ + Wedge_2$ + Wedge_3$ The functions of the parameters Wedge_1$, Wedge_2$, and Wedge_3$ are described in the following subsections.
Page 107
Chapter 4 BASIC Commands ELEMENT: KBD / TERMINAL TYPE The first element determines which type of keyboard wedge is applied. The possible value is listed as follows. Value Terminal Type Value Terminal Type Null (Data Not Transmitted) PS55 002-81, 003-81 PCAT (US) PS55 002-2, 003-2 PCAT (FR)
Page 108
CipherLab BASIC Programming Part I ELEMENT Capital Lock Auto-Detection Keyboard Type Capital Lock Auto-Detection PCAT (all available Enabled Disabled languages), PS2-30, PS55, command SEND_WEDGE The command SEND_WEDGE or Memorex Telex automatically detect will transmit alphabets according capital lock status of keyboard.
Page 109
Chapter 4 BASIC Commands Shift / Capital Lock Keyboard This setting can force the command SEND_WEDGE to treat the keyboard type to be a shift lock keyboard or a capital lock keyboard. This setting will be effective only when the keyboard type selected is PCAT (all available languages), PS2-30, PS55, or Memorex Telex.
CipherLab BASIC Programming Part I 4.9.2 COMPOSITION OF OUTPUT STRING The mapping of the keyboard wedge characters is as listed below. Each character in the output string is translated by this table when the command SEND_WEDGE transmits data. ...
Page 111
Chapter 4 BASIC Commands 0xC0 | 0x08 : Send next character with Right Ctrl key. 0xC0 | 0x10 : Send next character with Right Alt key. 0xC0 | 0x20 : Clear all combination status key after sending the next character. For example, to send [A] [Ctrl-Insert] [5] [scan code 0x29] [Tab] [2] [Shift-Ctrl-A] [B] [Alt-1] [Alt-2-Break] [Alt-1] [Alt-3], the following characters are inserted into the string supplied to the command SEND_WEDGE.
CipherLab BASIC Programming Part I 4.9.3 WEDGE EMULATOR We provide a wedge emulator program “Serial to Keyboard Converter” (Serial2KB.exe). It lets users convert data to keyboard input via IR/IrDA/RS-232/Bluetooth SPP in general wedge functions, such as SEND_WEDGE, SET_WEDGE, and WEDGE_READY. This utility helps develop a keyboard key in an application without any serial port input function.
Page 113
Chapter 4 BASIC Commands SEND_WEDGE 8000, 8300, 8500 Purpose To send data to the host via keyboard wedge interface. Syntax SEND_WEDGE(DataString$) Remarks “DataString$” is the data string to be sent via the keyboard wedge interface. Example DataString$ = CHR$(9) + “TESTING” + CHR(9) ' [Tab] + “TESTING”...
CipherLab BASIC Programming Part I 4.10 BUZZER COMMANDS This section describes the commands related to the buzzer or speaker. Note: 8200 is equipped with a speaker instead of a buzzer. BEEP Purpose To specify a beep sequence of how a buzzer works.
Page 115
Chapter 4 BASIC Commands STOP BEEP Purpose To terminate the beep sequence. Syntax STOP BEEP Remarks The STOP BEEP statement terminates the beep immediately if there is a beep sequence in progress. Example BEEP(2000, 0) ON KEY(1) GOSUB StopBeep PRINT “Press F1 to stop the buzzer.” StopBeep: STOP BEEP RETURN...
CipherLab BASIC Programming Part I 4.11 LED COMMAND In general, the dual-color LED indicator or indicators on the mobile computer are used to indicate the system status, such as good read or bad read, error occurrence, etc. Purpose To specify the LED lighting behavior.
Page 117
Chapter 4 BASIC Commands Example ON READER(1) GOSUB BcrData_1 BcrData_1: BEEP(2000, 5) LED(2, 1, 5) ' GOOD READ LED Data$ = GET_READER_DATA$(1)
CipherLab BASIC Programming Part I 4.12 VIBRATOR COMMANDS This section describes the command related to the vibrator. This function is currently supported on 8300/8500 Series. Note: For 8300 Series, the hardware version must be 4. VIBRATOR 8300, 8200, 8400, 8500, 8700 Purpose To set the vibrator.
Chapter 4 BASIC Commands 4.13 REAL-TIME CLOCK COMMANDS This section describes the commands related to the calendar and timer. The system date and time are maintained by the calendar chip, and they can be retrieved from or set to the calendar chip by the commands DATE$ and TIME$. A backup rechargeable Lithium battery keeps the calendar chip running even when the power is turned off.
Page 120
CipherLab BASIC Programming Part I DAY_OF_WEEK Purpose To get the day of the week. Syntax A% = DAY_OF_WEEK Remarks “A%” is an integer variable to be assigned to the result. A value of 1 to 7 represents Monday to Sunday respectively.
Page 121
This argument is specified in units of 5 milliseconds. When the application is waiting for events in a loop, the power consumption will be dramatically reduced by calling this function. Example PRINT “CipherLab BASIC” WAIT(200) ‘ the system is on hold for 1 second...
CipherLab BASIC Programming Part I 4.14 BATTERY COMMANDS This section describes the commands related to power management that can be used to monitor the voltage level of the main and backup batteries. The mobile computer is equipped with a main battery for normal operation as well as a backup battery for keeping SRAM data and time accuracy.
BASIC Commands 4.15 KEYPAD COMMANDS All the CipherLab mobile computers provide a built-in keypad for data input. This section describes the commands related to the keypad operation. Commands for triggering the ESC event and the KEY event include: OFF ESC, OFF KEY, ON ESC GOSUB…, ON KEY GOSUB…...
Page 124
CipherLab BASIC Programming Part I INPUT Purpose To take user input from the keypad and store it in a variable. Syntax INPUT variable Remarks “variable” is a numeric or string variable that will receive the input data. The data entered must match the data type of the variable.
Page 125
Chapter 4 BASIC Commands PUTKEY 8200, 8400, 8500, 8700 Purpose To put one character to the keyboard buffer. Syntax PUTKEY(N%) Remarks “N%” is an integer variable, indicating the ASCII code of a character. It provides the capability of simulating the keypad operation. For example, it can be implemented with touch screen operation.
Page 126
CipherLab BASIC Programming Part I SET_MIDDLE_ENTER 8200, 8400, 8700 Purpose To set the middle ENTER key. Syntax SET_MIDDLE_ENTER(status%) Remarks “status%” is an integer variable, indicating the status of the middle enter key. Value Meaning Disable (Default for 8400/8700) Enable (Default for 8200)
Page 127
Chapter 4 BASIC Commands Example A$=INKEY$ IF A$ <> "" THEN B%=ASC(A$) IF B%=13 THEN locate 1,1 C%=CHECK_ENTER_KEY PRINT C% END IF END IF See Also SET_MIDDLE_ENTER OSK_TOGGLE 8000, 8200, 8400, 8700 Purpose To toggle the display of on-screen keypad on an iOS-based device. Syntax OSK_TOGGLE Remarks...
CipherLab BASIC Programming Part I 4.15.2 ALPHA KEY By default, the input mode is numeric and can be modified by the ALPHA key. When in Alpha mode, it takes turns to show alphabets and number when pressing the same key;...
Chapter 4 BASIC Commands 4.15.3 FN KEY The function (FN) key serves as a modifier key used to produce a key combination. 1) To enable this modifier key, press the function (FN) key on the keypad, and the status icon “ ”...
Page 130
CipherLab BASIC Programming Part I FUNCTION_TOGGLE 8300, 8400, 8500, 8700 Purpose To set the state of the FN (function) toggle. Syntax FUNCTION_TOGGLE(status%) Remarks “status%” is an integer variable, indicating the state of the function toggle. Group I Value Description 8300 Series...
Chapter 4 BASIC Commands 4.16 LCD COMMANDS The liquid crystal display (LCD) on the mobile computer is FSTN graphic display. The display capability may vary due to the size of LCD panel. A coordinate system is used for the cursor movement routines to determine the cursor location —...
Page 132
CipherLab BASIC Programming Part I BACKLIT Purpose To set the LCD backlight. Syntax BACKLIT(state%) Remarks “state%” is an integer variable, indicating a specific state (luminosity level) of the LCD backlight. Group I Value Description 8000/8200/8300/8400/8700 0 Backlight off Backlight on...
Page 133
Chapter 4 BASIC Commands SET_AUTO_BKLIT 8200, 8400, 8700 Purpose To set automatic LCD backlight. LCD backlight is on when any key is pressed. Syntax SET_AUTO_BKLIT(status%) Remarks “status%” is an integer variable, indicating the status of automatic backlight. Value Meaning Disable (Default) Enable Example SET_AUTO_BKLIT(1)
Page 134
CipherLab BASIC Programming Part I GET_BKLIT_LEVEL 8200, 8400, 8700 Purpose To get the LCD backlight level. Syntax A% = GET_BKLIT_LEVEL Remarks “A%” is an integer value, indicating the LCD backlight level. Value Meaning Backlight with very low luminosity Backlight with low luminosity...
Page 135
To set the display mode of the LCD. Syntax SET_VIDEO_MODE(mode%) Remarks “mode%” is an integer variable, indicating the display mode. Value Meaning Normal mode in use Reverse mode in use Example SET_VIDEO_MODE(1) ' this string will be printed in reverse mode PRINT “CipherLab mobile computers”...
CipherLab BASIC Programming Part I 4.16.2 CURSOR CURSOR Purpose To turn on/off the cursor indication on the LCD. Syntax CURSOR(status%) Remarks “status%” is an integer variable, indicating the cursor status. Value Meaning The cursor indication is off. The cursor indication is on.
Page 137
Chapter 4 BASIC Commands CURSOR_Y Purpose To get the y coordinate of the current cursor position. Syntax “Y%” = CURSOR_Y Remarks “Y%” is an integer variable to be assigned to the row position of the cursor. Example ON READER(1) GOSUB BcrData_1 BcrData_1: BEEP(2000, 5) Data$ = GET_READER_DATA$(1)
CipherLab BASIC Programming Part I 4.16.3 DISPLAY FILL_RECT Purpose To fill a rectangular area on the LCD. Syntax FILL_RECT(x%, y%, size_x%, size_y%) Remarks “x%”, “y%” are integer variables, indicating the x, y coordinates of the upper left point of the rectangular area.
Page 139
Chapter 4 BASIC Commands ICON_ZONE_PRINT Purpose To enable or disable the printing of characters in the icon area. Syntax ICON_ZONE_PRINT(status%) Remarks “status%” an integer variable, indicating the printing status of the icon area. Value Meaning The printing in the icon area is disabled (default). The printing in the icon area is enabled.
Page 140
CipherLab BASIC Programming Part I PRINT Purpose To display data on the LCD. Syntax PRINT expression[{,|;[expression]}] Remarks “expression” may be numeric or string expression. The position of each printed item is determined by the punctuation used to separate items in the list.
Chapter 4 BASIC Commands 4.16.4 CLEAR CLR_RECT Purpose To clear a rectangular area on the LCD. Syntax CLR_RECT(x%, y%, size_x%, size_y%) Remarks “x%”, “y%” are integer variables, indicating the x, y coordinates of the upper left point of the rectangular area. “size_x%”...
CipherLab BASIC Programming Part I 4.16.5 IMAGE The command SHOW_IMAGE can be used to display images on the LCD. User needs to allocate a string variable to store the bitmap data of the image. This string begins with the top row of pixels.
Page 144
CipherLab BASIC Programming Part I GET_IMAGE Purpose To read a bitmap pattern or capture signature from a rectangular area on the LCD. Syntax DataCount% = GET_IMAGE(file_index%, x%, y%, size_x%, size_y%) Remarks “DataCount%” is an integer variable to be assigned to the result; it is the total data count stored in the specified transaction file.
Chapter 4 BASIC Commands 4.16.6 GRAPHICS A monochrome graphic has three factors as listed in the table. Key Factors Parameters Functions Video Mode VIDEO_REVERSE See SetVideoMode() VIDEO_NORMAL Pixel State DOT_MARK See circle(), line(), putpixel() and rectangle() DOT_CLEAR DOT_REVERSE Shape State SHAPE_FILL See circle(), rectangle() SHAPE_NORMAL...
Page 146
CipherLab BASIC Programming Part I CIRCLE Purpose To draw a circle on the LCD. Syntax CIRCLE(cx%, cy%, r%, type%, mode%) Remarks “cx%”, “cy%” are integer variables, indicating the x, y coordinates of the center of a circle. “r%” is an integer variable, indicating the radius of a circle in pixels.
Page 147
Chapter 4 BASIC Commands PUT_PIXEL Purpose To mark a pixel (or a dot) on the LCD. Syntax PUT_PIXEL(x%, y%, mode%) Remarks “x%”, “y%” are integer variables, indicating the x, y coordinates of a pixel. “mode%” is an integer variable, indicating the state of a pixel. MODE% Meaning DOT_REVERSE...
CipherLab BASIC Programming Part I 4.17 TOUCH SCREEN COMMANDS For 8500 Series, the liquid crystal display (LCD) is also a touch screen when it is initialized by ENABLE_TOUCHSCREEN. Signature Capture Use the stylus to write anything directly on a specific area of the LCD, which is defined by SET_SIGNAREA.
Page 149
Chapter 4 BASIC Commands SET_SCREENITEMS(1, 2, ITEMSTR$) ON TOUCHSCREEN GOSUB GetTouch GetTouch: A%= GETSCREENITEM IF A%=1 THEN PRINT “OK” ELSE IF A%=2 THEN PRINT “CLEAR” END IF LOOP: GOTO LOOP...
Page 150
CipherLab BASIC Programming Part I DISABLE_TOUCHSCREEN 8500 Purpose To disable the touch screen. Syntax DISABLE_TOUCHSCREEN Remarks To restart the touch screen function, ENABLE_TOUCHSCREEN must be called. Example DISABLE_TOUCHSCREEN ENABLE_TOUCHSCREEN 8500 Purpose To enable the touch screen. Syntax ENABLE_TOUCHSCREEN Remarks The touch screen won't work until it is initialized by this command.
Page 151
Chapter 4 BASIC Commands SET_SCREENITEMS 8500 Purpose To specify the size and display mode of the touchable items. Syntax SET_SCREENITEMS(mode%, total_item%, item$) Remarks “mode%” is an integer variable, indicating the display mode when an item is touched. MODE% Meaning ITEM_NORMAL (A touched item will be displayed normally.) ITEM_REVERSE (A touched item will be displayed in a reverse color.) “total_item%”...
CipherLab BASIC Programming Part I 4.18 FONTS 4.18.1 FONT SIZE Basically, the mobile computer allows two font size options for the system font: 6x8 and 8x16. These options are also applicable to other alphanumerical font files (for single byte languages), such as the multi-language font file and Hebrew/Nordic/Polish/Russian font files.
Chapter 4 BASIC Commands 4.18.3 MULTI-LANGUAGE FONT FILE The multi-language font file includes English (default), French, Hebrew, Latin, Nordic, Portuguese, Turkish, Russian, Polish, Slavic, Slovak, etc. To display in any of these languages except English, you need to call SET_LANGUAGE to specify the language by region.
Page 154
CipherLab BASIC Programming Part I Central European, Latin II (Polish) Windows Code page 1250 Turkish MS-DOS Code page 857 Latin II (Slovak) Windows 1250 ISO-28592 (Latin 2) ISO 8859-2 IBM-LATIN II Greek MS-DOS Code page 737 Latin I Windows Code page 1252...
Page 155
Chapter 4 BASIC Commands SELECT_FONT Purpose To select a font size for the LCD to display alphanumeric characters properly. Syntax SELECT_FONT(font%) Remarks “font%” is an integer variable, indicating the font size. font% Meaning Font size 6x8 Font size 8x16 (Reserved) Font size 6x12 (for font files Tc12, Sc12, Jp12, Kr12) Font size 12x12...
CipherLab BASIC Programming Part I 4.19 MEMORY COMMANDS This section describes the commands related to the flash memory and SRAM, where Program Manager and File System reside respectively. For 8200/8400/8700 Series, it allows using SD card. Memory Size Flash Memory...
Chapter 4 BASIC Commands 4.19.1 FLASH The flash memory is divided into a number of memory banks, and each bank is 64 KB. If 2 MB, it is divided into 32 banks. (8000/8300/8500) If 4 MB, it is divided into 64 banks. (8400) ...
Page 158
CipherLab BASIC Programming Part I FLASH_READ$ Purpose To read a data string from the memory bank 0xF60000 ~ 0xF6FFFF. Syntax A$ = FLASH_READ$(N%) Remarks “A$” is a string variable to be assigned to the result. “N%” is an integer variable in the range of 1 to 256, indicating the ordinal number of the record.
Chapter 4 BASIC Commands 4.19.2 SRAM The File System keeps user data in SRAM, which is maintained by the backup battery. However, data loss may occur during low battery condition or when the battery is drained. It is necessary to upload data to a host computer before putting away the mobile computer.
CipherLab BASIC Programming Part I 4.19.3 SD CARD SD_FREE_MEMORY 8200, 8400, 8700 Purpose To get the size of free data memory on SD card in megabytes. Syntax A% = SD_FREE_MEMORY Remarks “A%” is an integer variable to be assigned to the result.
Chapter 4 BASIC Commands 4.20 FILE MANIPULATION There are many file manipulation commands available for programming the mobile computers. These commands help manipulate the transaction data and ease the implementation of database system. Two types of file structures are supported - Sequential structure called DAT file that is usually used to store transaction data.
Page 162
CipherLab BASIC Programming Part I DEL_TRANSACTION_DATA Purpose To remove a block of transaction data from the first (= default) transaction file. Syntax DEL_TRANSACTION_DATA(N%) Remarks “N%” is an integer variable, determining how many transaction records to be deleted and how to delete.
Page 163
Chapter 4 BASIC Commands DEL_TRANSACTION_DATA_EX Purpose To remove a block of transaction data from a specified transaction file. Syntax DEL_TRANSACTION_DATA_EX(file%, N%) Remarks “file%” is an integer variable in the range of 1 to 6, indicating which transaction file the command is to affect. These commands work the same – ...
Page 164
CipherLab BASIC Programming Part I EMPTY_TRANSACTION Purpose To remove all the transaction data from the first (= default) transaction file. Syntax EMPTY_TRANSACTION Remarks Note that if this function is called at the beginning of the program, data will be deleted after the battery is replaced or System Menu is launched.
Page 165
Chapter 4 BASIC Commands GET_TRANSACTION_DATA$ Purpose To read a transaction record from the first (= default) transaction file. Syntax A$ = GET_TRANSACTION_DATA$(N%) Remarks “A$” is a string variable to be assigned to the transaction data. “N%” is an integer variable, indicating the ordinal number of the record to be read from the first transaction file.
Page 166
CipherLab BASIC Programming Part I SAVE_TRANSACTION Purpose To save (append) a transaction record to the first (= default) transaction file. Syntax SAVE_TRANSACTION(data$) Remarks “data$” is a string variable, representing the string to be saved in the first (default) transaction file.
Page 167
Chapter 4 BASIC Commands TRANSACTION_COUNT Purpose To get the total number of transaction records saved in the first (= default) transaction file. Syntax A% = TRANSACTION_COUNT Remarks “A%” is an integer variable to be assigned to the result. Example … DataCount: DataCount% = TRANSACTION_COUNT PRINT DataCount%, “Transaction data is saved.”...
Page 168
CipherLab BASIC Programming Part I UPDATE_TRANSACTION Purpose To update a transaction record in the first (= default) transaction file. Syntax UPDATE_TRANSACTION(N%, data$) Remarks “N%” is an integer variable, indicating the ordinal number of the transaction record to be updated. “data$” is a string variable, representing the character string to replace the old data.
Chapter 4 BASIC Commands 4.20.2 DBF FILES AND IDX FILES This one is an index sequential file structure. Table look-up and report generation is easily supported by using index sequential file routines. There are actually two types of files associated with this file structure, namely, DBF files and IDX files. A DBF file has a fixed record length structure.
Page 170
CipherLab BASIC Programming Part I ADD_RECORD Purpose To add a record to a specified DBF file. Syntax ADD_RECORD(file%, data$) Remarks “file%” is an integer variable in the range of 1 to 5, indicating which DBF file to be accessed. “data$” is a string variable, representing the character string which user intends to add to the specified DBF file.
Page 171
Chapter 4 BASIC Commands DEL_RECORD Purpose To delete the record pointed by the file pointer in a specified DBF file. Syntax DEL_RECORD(file% [,index%]) Remarks “file%” is an integer variable in the range of 1 to 5, indicating which DBF file to be accessed.
Page 172
CipherLab BASIC Programming Part I EMPTY_FILE Purpose To remove all the records from a specified DBF file. Syntax EMPTY_FILE(file%) Remarks “file%” is an integer variable in the range of 1 to 5, indicating which DBF file to be accessed. Note that if this function is called at the beginning of the program, data will be deleted after the battery is replaced or System Menu is launched.
Page 173
Chapter 4 BASIC Commands FIND_RECORD Purpose To search for records in a specified DBF file that matches the key string with respect to a specified IDX. Syntax A% = FIND_RECORD(file%, index%, key$) Remarks “A%” is an integer variable to be assigned to the result. “file%”...
Page 174
CipherLab BASIC Programming Part I GET_RECORD$ Purpose To get a record in a specified DBF file, which the file pointer of a specified IDX file is pointing to. Syntax A$ = GET_RECORD(file% [,index%]) Remarks “A$” is a string variable to be assigned to the result.
Page 175
Chapter 4 BASIC Commands MOVE_TO Purpose To move the file pointer, of a specified DBF and IDX files, to a specified position. Syntax MOVE_TO(file% [,index%], record_number%) Remarks “file%” is an integer variable in the range of 1 to 5, indicating which DBF file to be accessed.
Page 176
CipherLab BASIC Programming Part I UPDATE_RECORD Purpose To update the record, which the file pointer of a specified DBF and IDX files is pointing to. Syntax UPDATE_RECORD(file%, index%, data$) Remarks “file%” is an integer variable in the range of 1 to 5, indicating which DBF file to be accessed.
Chapter 4 BASIC Commands 4.20.3 ERROR CODE The command GET_FILE_ERROR returns the error code, which is a number that indicates the result of the last file manipulation. A value other than 0 indicates error. GET_FILE_ERROR Purpose To get the error code of the previous file manipulation command. Syntax A% = GET_FILE_ERROR Remarks...
CipherLab BASIC Programming Part I 4.21 SD CARD SD card can be accessed directly by using the provided functions in user application. Yet, when 8200/8400/8700 is equipped with SD card and connected to your computer via the USB cable, it can be treated as a removable disk (USB mass storage device) as long as it is configured properly through programming or via System Menu | SD Card Menu | Run As USB Disk.
Chapter 4 BASIC Commands 4.21.2 DIRECTORY Unlike the file system on SRAM, the file system on SD card supports hierarchical tree directory structure and allows creating sub-directories. Several directories are reserved for particular use. Reserved Directory Related Application or Function Remark ...
CipherLab BASIC Programming Part I Index file #2 F3.DB3 Index file #3 F3.DB4 DBF file #4 Record file F4.DB0 System Default F4.DB1 Index Index file #1 F4.DB2 Index file #2 F4.DB3 Index file #3 F4.DB4 DBF file #5 Record file F5.DB0...
Appendix I SCANNERDESTBL ARRAY IN THIS CHAPTER Symbology Parameter Table for CCD/Laser/Long Range Reader ....169 Symbology Parameter Table for 2D/Extra Long Range Reader ....178 SYMBOLOGY PARAMETER TABLE FOR CCD/LASER/LONG RANGE READER No. (N1%) Values (N2%) & Description Default Scan Engine 1: Enable Code 39 CCD,...
Page 183
Appendix I ScannerDesTbl Array 1: Transmit CIP 39 Check Digit CCD, Laser, 8700 -Long 0: DO NOT transmit CIP 39 Check Digit Range 1: Verify Interleaved 25 Check Digit CCD, Laser, 8700 -Long 0: DO NOT verify Interleaved 25 Check Digit Range 1: Transmit Interleaved 25 Check Digit CCD,...
Page 184
CipherLab BASIC Programming Part I MSI Check Digit Verification CCD, Laser, 8700 -Long 2: Modulo 11 and Modulo 10 Range 1: Double Modulo 10 0: Single Modulo 10 MSI Check Digit Transmission CCD, Laser, 8700 -Long 2: Both Check Digits are NOT transmitted...
Page 185
Appendix I ScannerDesTbl Array 1: Convert EAN-8 to EAN-13 CCD, Laser, 8700 -Long 0: No conversion Range 1: Convert EAN8 to EAN13 in GTIN-13 format CCD, Laser, 8700 -Long 0: Convert EAN8 to EAN13 in Default format Range 1: Enable Negative Barcode CCD, Laser, 8700...
Page 186
CipherLab BASIC Programming Part I MSI Max Code Length / Fixed Length 1 Max. 64 CCD, Laser, 8700 -Long Range MSI Min Code Length / Fixed Length 2 Min. 1 CCD, Laser, 8700 -Long Range Scan Mode for Scanner Port 1...
Page 187
Appendix I ScannerDesTbl Array 1: Transmit GS1 DataBar Limited Application ID CCD, Laser, 8700 -Long 0: DO NOT transmit GS1 DataBar Limited Application ID Range 1: Transmit GS1 DataBar Limited Check Digit CCD, Laser, 8700 -Long 0: DO NOT transmit GS1 DataBar Limited Check Digit Range 1: Transmit GS1 DataBar Expanded Code ID CCD,...
Page 188
CipherLab BASIC Programming Part I 1: Verify Coop 25 Check Digit CCD, Laser, 8700 -Long 0: DO NOT verify Coop 25 Check Digit Range 1: Transmit Coop 25 Check Digit CCD, Laser, 8700 -Long 0: DO NOT transmit Coop 25 Check Digit...
Page 189
Appendix I ScannerDesTbl Array Addon security for UPC/EAN barcodes 8200/8400 CCD, Laser Level: 0~30 1: Skip checking Code 128 quiet zone 8200/8400 CCD, Laser 0: Check Code 128 quiet zone 1: Skip checking Code 39 quiet zone 8200/8400 CCD, Laser 0: Check Code 39 quiet zone 1: Skip checking UPC/EAN quiet zone 8200/8400...
CipherLab BASIC Programming Part I SYMBOLOGY PARAMETER TABLE FOR 2D/EXTRA LONG RANGE READER No. (N1%) Values (N2%) & Description Default Scan Engine 1: Enable Code 39 (Extra) Long Range 0: Disable Code 39 1 : Enable Code 32 (Italian Pharmacode)
Page 191
Appendix I ScannerDesTbl Array Reserved 1: Verify Code 39 Check Digit (Extra) Long Range 0: DO NOT verify Code 39 Check Digit 1: Transmit Code 39 Check Digit (Extra) Long Range 0: DO NOT transmit Code 39 Check Digit 1: Full ASCII Code 39 (Extra) Long Range 0: Standard Code 39...
Page 192
CipherLab BASIC Programming Part I 1: Convert UPC-E0 to UPC-A (Extra) Long Range 0: No conversion 1: Convert UPC-A to EAN-13 8200, 8400, 8700 2D 0: No conversion 1: Transmit UPC-E0 Check Digit (Extra) Long Range 0: DO NOT transmit UPC-E0 Check Digit...
Page 193
Appendix I ScannerDesTbl Array Matrix 25 Min Code Length / Fixed Length 2 8200, 8400, 8700 -2D Note Length1 must be greater than Length2. 1: MSI 25 Code Length Limitation in Max/Min Length Format (Extra) Long Range 0: MSI 25 Code Length Limitation in Fixed Length Format MSI Max Code Length / Fixed Length 1 Max.
Page 194
CipherLab BASIC Programming Part I Code 39 Min Code Length / Fixed Length2 (Extra) Long Range Note Length1 must be greater than Length2. 1: Transmit UPC-E1 System Number (Extra) Long Range 0: DO NOT transmit UPC-E1 System Number 1: Transmit UPC-E1 Check Digit...
Page 195
Appendix I ScannerDesTbl Array 1: Enable UPC-A (Extra) Long Range 0: Disable UPC-A (depends) 107, 1: Enable Only Addon 2 & 5 of UPC & EAN Families (Extra) Long Range (It requires “ANY” of the indexes to be set 1.) 0: Disable Only Addon 2 &...
Page 196
CipherLab BASIC Programming Part I 1: Codabar Length Limitation in Max/Min Length Format (Extra) Long Range 0: Codabar Length Limitation in Fixed Length Format Codabar Max Code Length / Fixed Length1 (Extra) Long Range Codabar Min Code Length / Fixed Length2...
Page 197
Appendix I ScannerDesTbl Array 2: Verify Interleaved 25 OPCC Check Digit (Extra) Long Range 1: Verify Interleaved 25 USS Check Digit 0: DO NOT verify Interleaved 25 Check Digit 1: Enable UPC-A System Number & Country Code (Extra) Long Range 0: Disable UPC-A System Number &...
Page 198
CipherLab BASIC Programming Part I 1: Enable Picklist Mode 8200, 8400, 8700 -2D 0: Disable Picklist Mode 1D Inverse Decoder 8200, 8400, 8700 -2D 2: Decode both regular and inverse 1: Decode inverse 1D barcode only 0: Decode regular 1D barcode only...
Page 199
Appendix I ScannerDesTbl Array 1: Enable Chinese 25 8200, 8400, 8700 -2D 0: Disable Chinese 25 Code 11 Check Digit Verification 2: Two check digits 8300 –LR only 1: One check digit 0: Disable 1: Enable GS1 formatting for EAN-128 8300 –LR 0: Disable GS1 formatting for EAN-128 AIMark[0]...
Appendix II SYMBOLOGY PARAMETERS Each of the scan engines can decode a number of barcode symbologies. This appendix describes the associated symbology parameters accordingly. IN THIS CHAPTER Scan Engine, CCD or Laser ..........189 Scan Engine, 2D or (Extra) Long Range Laser ....202 2D Scan Engine Only ............
CipherLab BASIC Programming Part I CODE 2 OF 5 FAMILY INDUSTRIAL 25 No. (N1%) Values (N2%) & Description Default Scan Engine 1: Enable Industrial 25 CCD, Laser, 8700 –Long 0: Disable Industrial 25 Range 1: Verify Industrial 25 Check Digit...
Page 203
Appendix II Symbology Parameters If “Fixed Length” is selected, up to 2 fixed lengths can be specified. If “Max/Min Length” is selected, the maximum length and the minimum length must be specified. It only accepts those barcodes with lengths that fall between max/min lengths specified.
CipherLab BASIC Programming Part I Verify Check Digit Select one of the three calculations to perform check digit verification when decoding barcodes. If true and the check digit found incorrect, the barcode will not be accepted. Transmit Check Digit Decide whether or not to include the check digit in the data being transmitted.
CipherLab BASIC Programming Part I TELEPEN No. (N1%) Values (N2%) & Description Default Scan Engine 1: Enable original Telepen (= Numeric mode) CCD, Laser, 8700 –Long 0: Disable original Telepen (= ASCII mode) Range 1: Enable Telepen CCD, Laser, 8700 –Long...
Page 211
Appendix II Symbology Parameters Decide whether or not to expand the read EAN-8 barcode into EAN-13. If true, the next processing will follow the parameters configured for EAN-13. EAN-13 No. (N1%) Values (N2%) & Description Default Scan Engine 1: Enable EAN-13 & UPC-A CCD, Laser, 8700...
Page 213
Appendix II Symbology Parameters 1: Convert UPC-A to EAN-13 CCD, Laser, 8700 –Long 0: No conversion Range 1: Transmit UPC-A Check Digit CCD, Laser, 8700 –Long 0: DO NOT transmit UPC-A Check Digit Range 1: Transmit UPC-A System Number CCD, Laser, 8700 –Long...
CipherLab BASIC Programming Part I 1: Enable UPC-E Triple Check CCD, Laser, 8700 –Long 0: Disable UPC-E Triple Check Range Convert UPC-E to UPC-A Decide whether or not to expand the read UPC-E barcode into UPC-A. If true, the next processing will follow the parameters configured for UPC-A.
Appendix II Symbology Parameters Codabar Min Code Length / Fixed Length2 (Extra) Long Range Note Length1 must be greater than Length2. Transmit Start/Stop Character Decide whether or not to include the start/stop characters in the data being transmitted. Length Qualification The barcode can be qualified by “Fixed Length”...
Page 216
CipherLab BASIC Programming Part I INTERLEAVED 25 No. (N1%) Values (N2%) & Description Default Scan Engine 1: Enable Interleaved 25 (Extra) Long Range 0: Disable Interleaved 25 1: Transmit Interleaved 25 Check Digit (Extra) Long Range 0: DO NOT transmit Interleaved 25 Check Digit...
CipherLab BASIC Programming Part I GS1 DATABAR (RSS) FAMILY No. (N1%) Values (N2%) & Description Default Scan Engine 1: Convert GS1 DataBar to UPC/EAN (Extra) Long Range 0: No conversion 1: Enable GS1 DataBar Expanded (Extra) Long Range 0: Disable GS1 DataBar Expanded...
Appendix II Symbology Parameters UPC/EAN FAMILIES The UPC/EAN families include No Addon, Addon 2, and Addon 5 for the following symbologies: UPC-E0 UPC-E1 UPC-A EAN-8 EAN-13 Bookland EAN (ISBN) For any member belonging to the UPC/EAN families, Index #139 is used to decide the joint configuration of No Addon, Addon 2, and Addon 5.
Page 222
CipherLab BASIC Programming Part I 1: Enable UPC-E1 System Number & Country Code (Extra) Long Range 0: Disable UPC-E1 System Number & Country Code Convert UPC-E0/UPC-E1 to UPC-A Decide whether or not to expand the read UPC-E0/UPC-E1 barcode into UPC-A. If true, the next processing will follow the parameters configured for UPC-A.
Appendix II Symbology Parameters CODE 11 The support of Code 11 on Long Range scan engine is currently implemented for 8300 only. No. (N1%) Values (N2%) & Description Default Scan Engine 1: Enable Code 11 0: Disable Code 11 8300 –LR only Note: By default, Code 11 is disabled on 8200/8400/8700.
CipherLab BASIC Programming Part I 2D SCAN ENGINE ONLY In addition to those symbologies described previously, the 2D scan engine supports the following symbologies: 1D SYMBOLOGIES CHINESE 25 No. (N1%) Values (N2%) & Description Default Scan Engine 1: Enable Chinese 25...
Page 227
Appendix II Symbology Parameters 1D INVERSE No. (N1%) Values (N2%) & Description Default Scan Engine 1D Inverse Decoder 8200, 8400, 8700 -2D 2: Decode both regular and inverse 1: Decode inverse 1D barcode only 0: Decode regular 1D barcode only POSTAL CODE FAMILY No.
Page 229
Appendix II Symbology Parameters UPC Never Linked Transmit UPC barcodes regardless of whether a 2D barcode is detected. UPC Always Linked Transmit UPC barcodes and the 2D portion. If the 2D portion is not detected, the UPC barcode will not be transmitted. ...
CipherLab BASIC Programming Part I 2D SYMBOLOGIES MAXICODE, DATA MATRIX & QR CODE No. (N1%) Values (N2%) & Description Default Scan Engine 1: Enable Maxicode 0: Disable Maxicode 1: Enable Data Matrix 0: Disable Data Matrix 1: Enable QR Code...
Page 231
Appendix II Symbology Parameters PDF417 No. (N1%) Values (N2%) & Description Default Scan Engine 1: Enable MicroPDF417 0: Disable MicroPDF417 1: Enable PDF417 0: Disable PDF417 Macro PDF Transmit / Decode Mode 2: Transmit any symbol in set / No particular order 1: Buffer all symbols / Transmit Macro PDF when complete 0: Passthrough all symbols 1: Enable Macro PDF Escape Characters...
Appendix III SCANNER PARAMETERS This appendix describes the associated scanner parameters. IN THIS CHAPTER Scan Mode ..............221 Read Redundancy ............224 Time-Out ............... 224 User Preferences ............225 SCAN MODE Index #70 of the unsigned character array ScannerDesTbl is used to define a scan mode that best suits the requirements of a specific application.
CipherLab BASIC Programming Part I The aiming dot will not go off until it times out or you press the trigger key again to start scanning. Index #145 is used for timeout duration, if necessary. COMPARISON TABLE Scan Mode Start to Scan...
Page 235
Appendix III Scanner Parameters Aiming Mode Press the scan trigger to aim at a barcode. Within one second, press the trigger again to decode the barcode. The scanning won't stop until (a) a barcode is decoded, (b) the preset timeout expires, or (c) you release the trigger.
CipherLab BASIC Programming Part I READ REDUNDANCY This parameter is used to specify the level of reading security. You will have to compromise between reading security and decoding speed. No. (N1%) Values (N2%) & Description Default Scan Engine 3: Three Times Read Redundancy for Scanner Port 1...
Appendix IV RESERVED HOST COMMANDS There are some commands reserved for the host computer to read/remove data of the transaction file, or to adjust the system time. User's BASIC program does not need to do any processing because these tasks will be processed by the background routines of the BASIC run-time.
Page 240
CipherLab BASIC Programming Part I READ Purpose To read the top most record of a specified transaction file. Syntax A$ = READ A$ = READ file% Remarks The command READ will read the top most record of the first transaction file, which is the default one.
Page 241
Appendix IV Reserved Host Commands Purpose To set new system time. Syntax A$ = TWyyyymmddhhnnss Remarks “A$” is a string variable to be assigned to the result. Meaning The command is processed successfully. Any format error occurs. Format of system time – ...
Appendix V DEBUGGING COMMANDS The command START_DEBUG will write the activities happening on the system to a specified COM port. It is very useful when user needs to monitor the system or diagnose a problem. When START_DEBUG is executed, the system will send a series of messages to a specified COM port until the command STOP_DEBUG is executed.
Page 244
CipherLab BASIC Programming Part I Example SET_COM_TYPE(1, 1) ‘ specify RS-232 for COM1 START_DEBUG(1, 1, 1, 2, 1) ‘ use COM1 to send debug messages ‘ the COM port properties are 115200, None, 8, No handshake STOP_DEBUG Purpose To terminate the debug function.
CipherLab BASIC Programming Part I DEBUGGING MESSAGES Debugging messages indicate the activities happening on the system. The common debugging messages are listed as follows. Message Explanation ABS(N) Indicating the command ABS is processed. ADD(N1%,N2%) Indicating an addition is processed. ADD_RECORD(file%,data$) Indicating the command ADD_RECORD is processed.
Page 247
Appendix V Debugging Commands DATE$(X$) Indicating the system date is updated. X$ is the new system date. DAY_OF_WEEK Indicating the command DAY_OF_WEEK is processed. DEL_RECORD(file%[,index%]) Indicating the command DEL_RECORD is processed. DEL_TRANSACTION_DATA(N%) Indicating the command DEL_TRANSACTION_DATA is processed. N% is the number of records to be deleted. DEL_TRANSACTION_DATA_EX(fi Indicating command...
Page 248
CipherLab BASIC Programming Part I EVENT(15) Indicating the “ON HOUR EVENT” happens. EVENT(16) Indicating the “READER(1) EVENT” happens. EVENT(17) Indicating the “READER(2) EVENT” happens. EVENT(18) Indicating the “FUNCTION(1) EVENT” happens. EVENT(19) Indicating the “FUNCTION(2) EVENT” happens. EVENT(20) Indicating the “FUNCTION(3) EVENT” happens.
Page 249
Appendix V Debugging Commands GET_READER_DATA$(N%) Indicating the command GET_READER_DATA$ is processed. N% is the number of the reader port. GET_READER_SETTING(N%) Indicating the command GET_READER_SETTING is processed. N% is the setting number. GET_RECORD$(file%[,index%]) Indicating the command GET_RECORD$ is processed. GET_RECORD_NUMBER(file%[,i Indicating the command GET_READER_NUMBER is processed. ndex%]) GET_RFID_KEY(TagType%) Indicating the command GET_RFID_KEY is processed.
Page 250
CipherLab BASIC Programming Part I LE? (N1%,N2%) Indicating the decision “IF N1% <= N2%” is processed. LED(...) Indicating the command LED is processed. LEFT$(X$,N%) Indicating the command LEFT$ is processed. LEN(X$) Indicating the command LEN is processed. LINE(...) Indicating the command LINE is processed.
Page 251
Appendix V Debugging Commands OFF_TCPIP Indicating the command OFF TCPIN is processed. OFF_TIMER(N%) Indicating the command OFF TIMER is processed. N% is the number of the timer. OFF_TOUCHSCREEN Indicating the command OFF TOUCHSCREEN is processed. ON_COM(N1%,N2%) Indicating the command ON COM GOSUB is called. N1% is the umber of the COM port;...
Page 252
CipherLab BASIC Programming Part I RECORD_COUNT(file%) Indicating the command RECORD_COUNT is processed. RECTANGLE(...) Indicating the command RECTANGLE is processed. RESTART Indicating the command RESTART is processed. RETURN(N%) Indicating the command RETURN is processed. N% is the line number to return, if it is not null.
Page 253
Appendix V Debugging Commands START TCPIP Indicating the command START TCPIP is processed. STOP_BEEP Indicating the command STOP BEEP is processed. STOP TCPIP Indicating the command STOP TCPIP is processed. STR$(N%) Indicating the command STR$ is processed. STRING$(...) Indicating the command STRING$ is processed. SUB(N1%,N2%) Indicating a subtraction is processed.
Page 254
CipherLab BASIC Programming Part I WEDGE_READY Indicating the command WEDGE_READY is processed. WRITE_COM(N%,A$) Indicating the command WRITE_COM is processed. Indicating the logical operation XOR is processed.
Appendix VI RUN-TIME ERROR TABLE Error Code Explanation Unknown operator Operand count mismatch Type mismatch Can't perform type conversion No available temp string Illegal operand Not an L-value Float error Bad array subscript Unknown function Illegal function call Return without GOSUB...
Page 258
CipherLab BASIC Programming Part I > > > > Key Name Key Code 8000 8200 8300 8400 8500 8700...
Page 259
Appendix VII Key Code Table Key Name Key Code 8000 8200 8300 8400 8500 8700...
Page 260
CipherLab BASIC Programming Part I DOWN DOWN DOWN DOWN DOWN DOWN LEFT LEFT LEFT LEFT LEFT RIGHT RIGHT RIGHT RIGHT RIGHT Key Name Key Code 8000 8200 8300 8400 8500 8700 FESC FESC FESC FESC FESC FESC INSERT INSERT (middle CR)
Need help?
Do you have a question about the 8 Series and is the answer not in the manual?
Questions and answers