User’s Guide – For Optimus Series BASIC Compiler Version 3.
Copyright Notice Copyright © 2005 Metrologic Instruments Inc. All rights reserved The software contains proprietary information of Metrologic Instruments Inc.; it is provided under a license agreement containing restrictions on use and disclosure and is also protected by copyright law. Reverse engineering of the software is prohibited. Due to continued product development this information may change without notice.
i Contents Copyright Notice II Introduction 1 Typographical Conventions ..........................................................................................................................2 Revision History ...........................................................................................................................................2 Development Environment 3 2.1 Disk Contents...........................................................................................................
ii Contents 4.4 Operator Precedence .............................................................................................................................19 4.5 Labels....................................................................................................................................................19 4.6 Subroutines ...........................................................................................................................................20 4.7 Programming Style ......
Contents iii 5.19.4 Bluetooth ............................................................................................................................138 5.20 File Manipulation..............................................................................................................................147 5.20.1 DAT Files ...........................................................................................................................148 5.20.2 DBF Files and IDX Files .........................
1 CHAPTER 1 Introduction The BASIC Compiler provides users with a complete programming environment to develop application programs for the terminals in the BASIC language. The Windows-based Basic Compiler comes with a menu-driven interface to simplify software development and code modifications. Many system configurations, such as COM port properties and database file settings can be set up in the menus.
2 BASIC Compiler User's Guide Typographical Conventions Before you start using this guide, it is important to understand the terms and typographical conventions used in the documentation. The following kinds of formatting in the text identify special information. Formatting convention Type of Information Triangular Bullet ( ) Highlight features or subjects that stand out from the text. Special Bold Items you must select, such as menu options, command buttons, or items in a list.
3 CHAPTER 2 Development Environment In This Chapter 2.1 Disk Contents .............................................................. 3 2.2 System Requirements .................................................. 4 2.3 BASIC Run-time Engine ............................................. 5 2.4 Development Flow....................................................... 5 2.1 Disk Contents The BASIC Compiler Kit contains two directories, namely, BC and DOWNLOAD.
4 CipherLab BASIC Compiler User's Guide Font files for Optimus S & R: Font_OP_Japanese.shx // Japanese Font size: 16x16 (4 lines) Font_OP_Japanese 12.shx // Japanese Font size: 12x12 (5 lines) Font_OP_Korean.shx // Korean Font size: 16x16 (4 lines) Font_OP_Korean12.shx // Korean Font size: 12x12 (5 lines) Font_OP_Simplified_Chinese. // Simplified shx Chinese Font size: 16x16 (4 lines) . // Simplified Font_OP_Simplified_Chinese1 Chinese 2.
Chapter 2 Development Environment Items Requirements CPU Pentium 75MHz Operating System Windows 95/98/2000/NT/XP Minimum RAM 16 MB Minimum Hard Disk Space 20 MB 5 Note: Any terminal being programmed will need to have a minimum 128KB RAM. 2.3 BASIC Run-time Engine The BASIC Run-time Engines work as interpreters of the BASIC commands. Terminals have to be loaded with the BASIC Run-time Engines to run the BASIC programs.
6 CipherLab BASIC Compiler User's Guide Step 1 - download the BASIC Run-time to the target terminal. Step 2 - edit and compile the BASIC program. Step 3 - download the BASIC object file to the target terminal. 2.4.1 Download Run-time Engine The BASIC Run-time Engines are programs being loaded on terminals to execute the BASIC object files. They must exist in the terminals before the BASIC object files are downloaded.
Chapter 2 Development Environment 7 2.4.3 Download the BASIC Object Files The user can 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, the user cannot use it to view or edit any BASIC code. Both the .ini and .syn files must be downloaded to the target terminal. Be careful that if the .ini file is missing, the BASIC Compiler will download the default settings instead.
8 CHAPTER 3 Using The BASIC Compiler The 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. There are five menus on the menu bar, and each menu provides several commands/items. File Menu Edit Menu Configure Menu Compile Menu Help Menu This chapter discusses the function and operation of each command/item. In This Chapter 3.1 File Menu.....................
Chapter 3 Using The BASIC Compiler Open Function To open an existing BASIC program. Operation Click "File" on the menu bar and select "Open". 9 For the same function, press hot key CTRL+ O or click the [Open] icon on the tool bar. Save Function To save the current editing BASIC program. Operation Click "File" on the menu bar and select "Save". For the same function, press hot key CTRL+ S or click the [Save] icon on the tool bar.
10 CipherLab BASIC Compiler User's Guide Cut Function To cut a paragraph off the text and place it on the clipboard. The paragraph will be removed. Operation Drag the cursor to select the paragraph to be cut off. This paragraph will be highlighted (in a reverse color). Click "Edit" on the menu bar and select "Cut". For the same function, press hot key CTRL+ X or click the [Cut] icon on the tool bar. Copy Function To copy a paragraph from the text to the clipboard.
Chapter 3 Using The BASIC Compiler Operation 11 Click "Edit" on the menu bar and select "Find". In the pop-up window, enter the key word to be found in the text. Then, click the [Find] button to start searching. For the same function, press hot key CTRL+ F or click the [Find] icon on the tool bar. 3.3 Configure Menu Seven items are provided here for the user to define the system settings.
12 CipherLab BASIC Compiler User's Guide Function Secondary COM Port Operation Setting Configure Transaction Files Create Files Barcode Setting To set the properties of the secondary COM port. Click "Configure" on the menu bar and select "Secondary COM Port Setting". Select the desired settings for each property in the pop-up window. Function To define how many transaction files to be used and the data length for each transaction file.
Chapter 3 Using The BASIC Compiler Command To Do... Syntax checking Function To check the syntax of the BASIC program. Operation Click "Compile" on the menu bar and select "Syntax checking". In the case of any syntax error in the BASIC program, the "Output" window pops up to show the line numbers and display the relevant syntax error message. Compile Function To compile the BASIC program. Operation Click "Compile" on the menu bar and select "Compile".
14 CipherLab BASIC Compiler User's Guide Command To Do... Contents Function To display a table of contents for the BASIC online documentation. Operation Click "Help" on the menu bar and select "Contents". The online help file will be opened. Click on any topic for more detailed information. Function To display the help file index. Operation Click "Help" on the menu bar and select "Index". The online help file will be opened.
15 CHAPTER 4 Basics of the BASIC Language In This Chapter 4.1 Constants ..................................................................... 15 4.2 Variables...................................................................... 16 4.3 Expression and Operators ............................................ 17 4.4 Operator Precedence.................................................... 19 4.5 Labels........................................................................... 20 4.6 Subroutines .................
16 CipherLab BASIC Compiler User's Guide Integer Constants - Real Number Constants - Positive or negative real numbers, that is, numbers that contain Whole numbers between - 32,768 and + 32,767. No decimal point. a decimal point, such as 5.34 or - 10.0. Long Integer Constants - Whole numbers between - 2,147,483,648 and + 2,147,483,647. 4.2 Variables Variables are symbols used to represent data items, such as numerical values or character strings that are used in a BASIC program.
Chapter 4 Basics of the BASIC Language 17 An array variable name has as many dimensions as there are subscripts in the array. For example, A(12) would reference a value in a one dimension array. T(2,5) would reference a value in a two-dimension array. ... and so on. Each element in an array is referenced by an array variable that is subscripted with an integer or an integer expression. For example, DIM IntegerA%(20) : It declares an integer array with 20 elements.
18 CipherLab BASIC Compiler User's Guide 4.3.2 Arithmetic Operator The arithmetic operators are: Operator Operation Sample Expression ^ Exponentiation A% = 9^3 - Negation (unary) A% = -B% * Multiplication A! = B! * C! \ Division (integer) A% = B! \ C! / Division (real) A! = B! / C! + Addition A% = B% + C% - Subtraction A% = B% - C% MOD Modulo arithmetic A% = B% MOD C% 4.3.3 Relational Operator Relational operators are used to compare two values.
Chapter 4 Basics of the BASIC Language XOR Exclusive or 19 IF (A% = B%) XOR (C% = D%) 4.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.
20 CipherLab BASIC Compiler User's Guide ... GOTO Label2 ... Label2: PRINT "This is a character string label." 4.6 Subroutines A subroutine is a set of instructions given a particular name or a line label. Users can simplify their programming by breaking programs into smaller logical subroutines. A subroutine will be executed when being called by a GOSUB command. For example, ON KEY(1)GOSUB KeyF1 ... KeyF1: PRINT "F1 is pressed.
Chapter 4 Basics of the BASIC Language 21 Since all the variables in the 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. A subroutine in BASIC can be recursive, which means it can call itself or other subroutines that in turn call the first subroutine.
22 CHAPTER 5 BASIC Commands This chapter provides detailed descriptions of the commands supported by the 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 portable terminals are supported. These commands are within the user's BASIC programs to perform a wide variety of tasks, such as communications, LCD, buzzer, scanner, file manipulation, etc.
Chapter 5 BASIC Commands 23 See Also List of related commands is provided, if there is any. Note: The types of terminals that support a specified BASIC command are listed to the right of the title bar of the command. In This Chapter 5.1 General Commands ..................................................... 25 5.2 Commands for Decision Structures ............................. 28 5.3 Commands for Looping Structures.............................. 32 5.4 Commands for String Processing ......................
24 CipherLab BASIC Compiler User's Guide 5.1 General Commands This section describes commands that are not confined to any specific hardware features. ABS Purpose To return the absolute value of a numeric expression. Syntax A = ABS(N) Remarks "A" is a numeric variable to be assigned to the absolute value of a numeric expression. "N" is a numeric expression; it can be an integer or a real number.
Chapter 5 BASIC Commands Example 25 GOSUB DoIt ... GOSUB Done ... SUB DoIt( ) PRINT "Now I've done it!" END SUB ... Done: PRINT "Now I've done it!" RETURN GOTO Purpose To branch out unconditionally to a specified line number of line label from the normal program sequence. Syntax GOTO LineNumber|LineLabel Remarks "LineNumber" is the integer number in front of a program line. "LineLabel" is the string label of a program line.
26 CipherLab BASIC Compiler User's Guide Syntax REM remark ' remark Remarks "remark" may be any sequence of characters. The BASIC compiler will ignore whatever follows the REM or ' until end of the line. Example REM This is a comment. ' This is a comment. SET_PRECISION Purpose To set the precision of the decimal points for printing real number expressions. Syntax SET_PRECISION(N%) Remarks "N%" is a numeric expression in the range of 0 to 6. The precision is set to two digits by default.
Chapter 5 BASIC Commands 27 5.2 Commands for Decision Structures Based on the value of an expression, decision structures cause a program to take one of the following two actions: To execute one of several alternative statements within the decision structure itself. To branch to another part of the program outside the decision structure. In BASIC, decision-making is handled by the IF...THEN...[ELSE...][ENDIF] and ON...GOSUB|GOTO...statement. The IF...THEN...[ELSE...
28 CipherLab BASIC Compiler User's Guide {ELSE IF condition2 THEN Statementblock2} [ELSE StatementblockN] END IF Remarks “condition” is a logical expression. “Statementblock” can be multiple lines of BASIC statements. Example IF LEFT$(String1$,1) = “A” THEN PRINT “String1 is led by A.” ELSE IF LEFT$(String1$,1) = “B” THEN PRINT “String1 is led by B.” ELSE PRINT “String1 is not led by A nor B.
Chapter 5 BASIC Commands 29 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. If the value of N is 0, or greater than the number of routines listed, the interpreter will continue with the next executable statement. "SubName" is the name of a subroutine. "SubLabel" is the line label of a subroutine.
30 CipherLab BASIC Compiler User's Guide Example PRINT "Input a number (1-9):" INPUT Num% CLS ON Num% GOTO 100, 100, 200, 200, 300, 400, 400, 400 ... 100 PRINT "Number 1-3 is input." GOTO 500 200 PRINT "Number 4-5 is input." GOTO 500 300 PRINT "6 is input." GOTO 500 400 PRINT "Number 7-9 is input." 500 ... 5.3 Commands for Looping Structures Looping structures repeat a block of statements, either for a specified number of times or until a certain condition is matched.
Chapter 5 BASIC Commands Example 31 DataCount% = TRANSACTION_COUNT FOR Counter% = 1 TO DataCount% Data$ = GET_TRANSACTION_DATA$(Counter%) HostCommand$ = READ_COM$(1) IF HostCommand$ = "STOP" THEN EXIT WRITE_COM(1,Data$) NEXT FOR ... NEXT Purpose To repeat the execution of a block of statements for a specified number of times. Syntax FOR N% = startvalue TO endvalue [STEP step] [Statement Block] NEXT [N%] Remarks "N%" is an integer variable to be used as a loop counter.
32 CipherLab BASIC Compiler User's Guide Remarks If the "condition" is true, loop statements are executed until the WEND statement is encountered. Then the program execution returns to the WHILE statement and checks the condition again. If it is still true, the process will be repeated. Otherwise, the execution continues with the statement following the WEND statement. Example WHILE TRANSACTION_COUNT > 0 Data$ = GET_TRANSACTION_DATA$(1) WRITE_COM(1,Data$) DEL_TRANSACTION_DATA(1) WEND 5.
Chapter 5 BASIC Commands 33 If there is no difference between the corresponding characters of two strings and they are the same length, then the two strings are equal. If there is no difference between the corresponding characters of two strings, but one of the strings is longer, the longer string is greater than the shorter string. For example, "abc" = "abc" and "aaaaaaaa" > "aaaaa" are both true expressions. Leading and trailing blank spaces are significant in comparing strings.
34 CipherLab BASIC Compiler User's Guide "X$", "Y$" may be a string variable, string expression, or string constant. If Y$ is found in X$, INSTR returns the position of the first occurrence of Y$ in X$, from the starting point. If N is larger than the length of X$ or if X$ is null, of if Y$ cannot be found, INSTR returns 0. If Y$ is null, INSTR returns N (or 1 if N is not specified).
Chapter 5 BASIC Commands Syntax A$ = MID$(X$, N%[, M%]) 35
36 CipherLab BASIC Compiler User's Guide Remarks "A$" is a string variable to be assigned to the result. "N%" and "M%" are numeric expressions in the range of 0 to 255. "X$" may be a string variable, string expression, or string constant. MID$ function returns a string of length M characters from X$ beginning with the Nth character. If M is omitted, or if there are fewer than M characters to the right of the Nth character, all the characters beginning with the Nth character to the rightmost are returned.
Chapter 5 BASIC Commands Example S1$ = TRIM_LEFT$(" Hello World!") 37 ' S1$ = "Hello World!" TRIM_RIGHT$ Purpose To return a copy of a string with trailing blank spaces stripped away. Syntax A$ = TRIM_RIGHT$(X$) Remarks "A$" is a string variable to be assigned to the result. "X$" is a string variable that may contain some space characters at the end. Example S2$ = TRIM_RIGHT$("Hello World! ") ' S2$ = "Hello World!" 5.4.
38 CipherLab BASIC Compiler User's Guide Example A$ = CHR$(65) Purpose To return a string that represents the hexadecimal value (base 16) of the decimal argument. Syntax A$ = HEX$(N%) Remarks "A$" is a string variable to be assigned to the result. ' A$ = "A" HEX$ "N%" is a numeric expression in the range of 0 to 2,147,483,647; it is rounded to an integer before HEX$(N%) is evaluated.
Chapter 5 BASIC Commands Syntax A$ = STR$(N%) Remarks "A$" is a string variable to be assigned to the result. 39 "N%" is a numeric expression. Example String$ = STR$(123) UCASE$ Purpose To return a copy of a string in which all lowercase letters will be converted to uppercase letters. Syntax A$ = UCASE$(X$) Remarks "A$" is a string variable to be assigned to the result. "X$" may be a string variable, string expression, or string constant.
40 CipherLab BASIC Compiler User's Guide 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 "SET_PRECISION" function. Example A! = VALR("123.45") PRINT "A = ", A! REM A = 123.45 ... 5.4.
Chapter 5 BASIC Commands 41 5.5 Commands for Event Trapping An event is an action recognized by the terminal, such as a function keystroke is detected (KEY event), a signal is received from the serial port (COM event), and so on. There are two ways to detect the occurrence of an event and reroute the program control to an appropriate subroutine: polling and trapping. With event polling, the BASIC program explicitly checks for any event that happens at a particular point in its execution.
42 CipherLab BASIC Compiler User's Guide 6 READER Event: a barcode data is decoded. 7 TCPIP Event: any data packet is received via TCP/IP. 8 TIMER Event: a time-out condition of an activated timer. 9 TOUCHSCREEN Event: a touchable item is activated by selecting. OFF ALL Purpose To disable all the event triggers. Syntax OFF ALL Remarks All the event triggers will be disabled. To resume the event trigger, the command ON event GOSUB... has to be called.
Chapter 5 BASIC Commands Example COM Model Number 1~2 7xx, 8000, 8300 1~4 8500 43 ON COM(1) GOSUB HostCommand ... HostCommand_1: OFF COM(1) REM disable the trapping during data processing. ON COM(1) GOSUB HostCommand RETURN See Also ON COM… GOSUB… OFF ESC Purpose To terminate the "ESC Event Trigger" that executes a specific subroutine when the ESC key is pressed. Syntax OFF ESC Remarks All the event triggers will be disabled. To resume the event trigger, the command ON event GOSUB...
44 CipherLab BASIC Compiler User's Guide Example OFF HOUR_SHARP See Also ON HOUR_SHARP GOSUB… OFF KEY Purpose To terminate the "FUNCTION KEY Event Trigger" that executes a specific subroutine when a function key is pressed. Syntax OFF KEY(number%) Remarks "number%" is an integer variable in the range of 1 to 12, indicating a function key of the keypad. Example ON KEY(1) GOSUB On_Shift ON KEY(2) GOSUB Off_Shift ... On_Shift: OFF KEY Mode$ = "IN" GOSUB Process ON KEY(1) GOSUB On_Shift RETURN ...
Chapter 5 BASIC Commands 45 OFF READER Purpose To terminate the "READER Event Trigger" that executes a specific subroutine when data is received from the reader ports. Syntax OFF READER(N%) Remarks "N%" is an integer variable, indicating the reader port. It is 1 for portable terminals. Example ON READER(1) GOSUB BcrData_1 ...
46 CipherLab BASIC Compiler User's Guide Example ON TIMER(1,200) GOSUB ClearScreen ' TIMER(1) = 2 sec ... ClearScreen: OFF TIMER(1) CLS RETURN See Also ON TIMER… GOSUB… ON COM ... GOSUB ... Purpose To activate the "COM Event Trigger" that executes a specific subroutine when data is received from the COM ports. Syntax ON COM(N%) GOSUB SubName|SubLabel Remarks "N%" is an integer variable, indicating the COM port.
Chapter 5 BASIC Commands Example 47 ON ESC GOSUB Key_Esc ... Key_Esc: OFF ESC ... ON ESC GOSUB Key_Esc RETURN See Also Keypad commands, OFF ESC ON HOUR_SHARP GOSUB ... Purpose To activate the "HOUR_SHARP Event Trigger" that executes a specific subroutine when the system time is on the hour. Syntax ON HOUR_SHARP GOSUB SubName|SubLabel Remarks "SubName|SubLabel" is the name or line label of a subroutine to be called when the event is triggered. Example ... ON HOUR_SHARP GOSUB OnHourAlarm ...
48 CipherLab BASIC Compiler User's Guide Remarks "number%" is an integer variable in the range of 1 to 12 (1 to 9 for 711), indicating the function key of the keypad. "SubName|SubLabel" is the name or line label of a subroutine to be called when the event is triggered. Example ON KEY(1) GOSUB On_Shift ON KEY(2) GOSUB Off_Shift ... On_Shift: Mode$ = "IN" RETURN Off_Shift: Mode$ = "OUT" RETURN See Also Keypad commands, OFF KEY ON MINUTE_SHARP GOSUB ...
Chapter 5 BASIC Commands 49 ON READER ... GOSUB ... Purpose To activate the "READER Event Trigger" that executes a specific subroutine when data is received from the reader ports. Syntax ON READER(N%) GOSUB SubName|SubLabel Remarks "N%" is an integer variable, indicating the reader port. It is 1 for portable terminals. "SubName|SubLabel" is the name or line label of a subroutine to be called when the event is triggered. Example ON READER(1) GOSUB BcrData_1 ...
50 CipherLab BASIC Compiler User's Guide ON TIMER ... GOSUB ... Purpose To activate the "TIMER Event Trigger" that executes a specific subroutine when the system runs out of the time duration specified by the user. Syntax ON TIMER(N%, duration%) GOSUB SubName|SubLabel Remarks "N%" is an integer variable in the range of 1 to 5, indicating the ordinal number of timer. "duration%" is an integer variable, indicating a specified period of time in units of 10 ms.
Chapter 5 BASIC Commands Example 51 ON READER(1) GOSUB BcrData_1 ON READER(2) GOSUB BcrData_2 ... BcrData_1: LOCK BEEP(2000,5) Data$ = GET_READER_DATA(1)$ GOSUB AddNewData UNLOCK RETURN BcrData_2: BEEP(2000,5) Data$ = GET_READER_DATA(2)$ GOSUB AddNewData RETURN In this example, the BASIC program can trap the READER(1) and READER(2) events and reroute to the subroutines BcrData_1 and BcrData_2 respectively.
52 CipherLab BASIC Compiler User's Guide 5.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. AUTO_OFF Purpose To set a specified period of time for the system to automatically shut down the user program as long as there is no operation in the interval. If the time interval is set to zero, this function will be disabled.
Chapter 5 BASIC Commands 53 DEVICE_ID$ Purpose To get the serial number of the terminal. Syntax A$ = DEVICE_ID$ Remarks “A$” is a string variable to be assigned to the result. A string of the terminal’s serial number will be returned. Example PRINT “S/N:”, DEVICE_ID$ GET_LANGUAGE Purpose To retrieve the font/language setting.
54 CipherLab BASIC Compiler User's Guide Remarks “A%” is an integer variable to be assigned to the result.
Chapter 5 BASIC Commands 55 MENU Purpose To create a menu and let the user to select an item by using (1) the shortcut keys or (2) the UP/DOWN arrow keys, and then the ENTER key to confirm the selection. Also, allow the use of the ESC key to cancel the current operation. 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 the user has selected.
56 CipherLab BASIC Compiler User's Guide See Also AUTO_OFF, RESTART RESTART Purpose To restart the system. Syntax RESTART Remarks The RESTART command will terminate the execution of the BASIC program and restart it. Example HostCommand$ = READ_COM$(1) ... IF HostCommand$ = "RESTART" THEN RESTART ELSE ... See Also AUTO_OFF, POWER_ON SET_LANGUAGE Optimus Purpose To make use of a font (language) by selecting it from the multi-language font file.
Chapter 5 BASIC Commands Remarks Note that this function will fail if the multi-language font file does not exist. "N%" is an integer variable in the range of 16 to 32.
58 CipherLab BASIC Compiler User's Guide Purpose To write version information to the system. Syntax VERSION(A$) Remarks "A$" is a string variable, indicating program name, date, etc. The user can use this command to write version information to the system. Such information can be checked from the "Version" submenu of the "System Menu". Note that this command must be on the first line of the program; otherwise, it will be ignored. The string for version information cannot exceed 15 characters.
Chapter 5 BASIC Commands Remarks 59 "A%" is an integer variable to be assigned to the result. The following list shows the possible values of CODE_TYPE.
60 CipherLab BASIC Compiler User's Guide Example DISABLE READER(1) See Also ENABLE READER, GET_READER_DATA$ ENABLE READER Purpose To enable the reader ports of the terminal. Syntax ENABLE READER(N%) Remarks "N%" is an integer variable, indicating the reader port; it is 1 for portable terminals. The reader ports are disabled by default. To enable barcode decoding function, the reader ports have to be enabled by the ENABLE READER command. Example ENABLE READER(1) ON READER(1) GOSUB Bcr_1 ...
Chapter 5 BASIC Commands See Also 61 DISABLE READER, ENABLE_READER, OFF READER, ON READER GOSUB… GET_READER_SETTING Purpose To get the value of a specified parameter of the barcode settings. Syntax A% = GET_READER_SETTING(N%) Remarks "A%" is a string variable to be assigned to the result. "N%" is an integer variable, indicating the number of a parameter. (cf. READER_SETTING) Example Setting1% = GET_READER_SETTING(1) IF Setting1% = 1 THEN PRINT "Code 39 readability is enabled.
62 CipherLab BASIC Compiler User's Guide 3 1: Enable CIP 39 0: Disable CIP 39 4 1: Enable Industrial 25 0: Disable Industrial 25 5 1: Enable Interleave 25 0: Disable Interleave 25 6 1: Enable Matrix 25 0: Disable Matrix 25 7 1: Enable Codabar (NW7) 0: Disable Codabar (NW7) 8 1: Enable Code 93 0: Disable Code 93 9 1: Enable Code 128 0: Disable Code 128 10 1: Enable UPCE 0: Disable UPCE 11 1: Enable UPCE Addon 2 0: Disable UPCE Addon 2 12 1: Enable UPCE Addon 5 0: Disable UPCE Addon 5 13
Chapter 5 BASIC Commands 63 0: Disable Plessey 21 Reserved 22 1: Transmit Code 39 Start/Stop Character 0: DO NOT transmit Code 39 Start/Stop Character 23 1: Verify Code 39 Check Character 0: DO NOT verify Code 39 Check Character 24 1: Transmit Code 39 Check Character 0: DO NOT transmit Code 39 Check Character 25 1: Full ASCII Code 39 0: Standard Code 39 26 1: Transmit Italian Pharmacode Check Character 0: DO NOT transmit Italian Pharmacode Check Character 27 1: Transmit CIP 39 Check Character
64 CipherLab BASIC Compiler User's Guide 0: Use Industrial 25 Start/Stop Pattern 1: Use Interleave 25 Start/Stop Pattern 2: Use Matrix 25 Start/Stop Pattern 37 Codabar Start/Stop Character 0: abcd/abcd 1: abcd/tn*e 2: ABCD/ABCD 3: ABCD/TN*E 38 1: Transmit Codabar Start/Stop Character 0: DO NOT transmit Codabar Start/Stop Character 39 MSI Check Digit Verification 0: Single Modulo 10 1: Double Modulo 10 2: Modulo 11 and Modulo 10 40 MSI Check Digit Transmission 0: the last Check Digit is not transmit
Chapter 5 BASIC Commands 65 0: DO NOT transmit EAN8 Check Digit 50 1: Transmit EAN13 Check Digit 0: DO NOT transmit EAN13 Check Digit 51 1: Transmit UPCE System Number 0: DO NOT transmit UPCE System Number 52 1: Transmit UPCA System Number 0: DO NOT transmit UPCA System Number 53 1: Convert EAN8 to EAN13 0: No conversion 54 1: Transmit EAN 128 Concatenation Characters 0: DO NOT transmit EAN 128 Concatenation Characters 55 1: Enable Negative Barcode 0: Disable Negative Barcode 56 0: No Read Re
66 CipherLab BASIC Compiler User's Guide 70 Scan Mode for Scanner Port 1 0: Auto Off Mode 1: Continuous Mode 2: Auto Power Off Mode 3: Alternate Mode 4: Momentary Mode 5: Repeat Mode 6: Laser Mode 7: Test Mode 8: Aiming Mode 71 (Not for portable terminals.) 72 Scanner Time-out Duration in seconds for Scanner Port 1: applicable to Aiming mode, Laser mode, Auto Off mode, and Auto Power Off mode 73 (Not for portable terminals.
Chapter 5 BASIC Commands 85 67 1: Enable Telepen 0: Disable Telepen Example READER_SETTING(1,1) See Also CODE_TYPE, GET_READER_SETTING ' Code 39 readability is enabled. 5.9 Keyboard Wedge Commands The portable terminals are able to send data to the host through the keyboard wedge interface by using command SEND_WEDGE. The SEND_WEDGE function is governed by a set of parameters called WedgeSetting$. Command SET_WEDGE is used to configure these parameters. Note only Optimus R supports wedge interface.
68 CipherLab BASIC Compiler User's Guide Wedge_2$ 2-1 00: Normal 10: Capital lock keyboard 11: Shift lock keyboard Wedge_2$ 0 1: Use numeric keypad to transmit digits 0: Use alpha-numeric key to transmit digits Wedge_3$ 7-0 Inter-character delay 5.9.2 KBD / Terminal Type The first element determines which type of keyboard wedge is applied. The possible value is listed as follows.
Chapter 5 BASIC Commands 69 For example, if the terminal type is PCAT (US), then the first element of the WedgeSetting$ can be defined as follows, Wedge_1$ = CHR$(1) 5.9.3 Capital Lock Auto-Detection If "Capital Lock Auto-Detection" is enabled, the SEND_WEDGE function can automatically detect the capital lock status of keyboard when the keyboard type selected is PCAT (all available languages), PS2-30, PS55, or Memorex Telex.
70 CipherLab BASIC Compiler User's Guide 5.9.6 Digits Position This setting can force the SEND_WEDGE function to treat the position of the digit keys on the keyboard differently. If this setting is set to upper, the SEND_WEDGE function will add shift key when transmitting digits. This setting will be effective only when the keyboard type selected is PCAT (all available language), PS2-30, PS55, or Memorex Telex. However, if the user chooses to send digits using numeric keypad, this setting is meaningless.
Chapter 5 BASIC Commands 71 For example, to set the inter-character delay to be 10 millisecond, the third element of the WedgeSetting$ can be defined as, Wedge_3$ = CHR$(10) 5.9.10 Composition of Output String The keyboard wedge character mapping is shown below. Each character in the output string is translated by this table when the SEND_WEDGE function transmits data.
72 CipherLab BASIC Compiler User's Guide 0xC0 : Indicates that the next character is to be treated as scan code. Transmit it as it is, no translation required. 0xC0 | 0x01 : Send next character with Shift key. 0xC0 | 0x02 : Send next character with left Ctrl key. 0xC0 | 0x04 : Send next character with left Alt key. 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.
Chapter 5 BASIC Commands 73 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" + [Tab] SEND_WEDGE (DataString$) ... See Also SET_WEDGE, WEDGE_READY SET_WEDGE Purpose To configure the keyboard wedge interface.
74 CipherLab BASIC Compiler User's Guide Remarks The return value is 1 if it is ready for sending data; otherwise, it returns 0. Note that it takes approximately 110 ms to detect the status of the keyboard wedge connection. Therefore, for continuous and fast data transmission, simply call this function once. DO NOT call this function repeatedly. Example IF (WEDGE_READY = 1) THEN ... SEND_WEDGE (DATA$) ... END IF ... See Also SEND_WEDGE, SET_WEDGE 5.
Chapter 5 BASIC Commands 75 KEY_CLICK Purpose To enable/disable the key click sound. Syntax KEY_CLICK(status%) Remarks "status%" is an integer variable, indicating the key click status. Value Meaning 0 Mute 1~5 Each represents a different tone The key click is enabled by default. Example KEY_CLICK(0) ' disable the key click STOP BEEP Purpose To terminate the beeping.
76 CipherLab BASIC Compiler User's Guide Commands for triggering the HOUR_SHARP event, the MINUTE_SHARP event, and the TIMER event: OFF HOUR_SHARP, OFF MINUTE_SHARP, OFF TIMER, ON HOUR_SHARP GOSUB..., ON MINUTE_SHARP GOSUB..., ON TIMER GOSUB... Up to five timers can be set by the ON TIMER... GOSUB... command for the "TIMER Event Trigger". Note: The system time variable TIMER is maintained by CPU timers and has nothing to do with this calendar chip.
Chapter 5 BASIC Commands Example 77 ON DAY_OF_WEEK GOSUB 100, 200, 300, 400, 500, 600, 700 ... 100 PRINT "Today is Monday." RETURN 200 PRINT "Today is Tuesday." RETURN 300 PRINT "Today is Tuesday." RETURN See Also DATE$, TIME$ Purpose To set or to get the current time. Syntax TIME$ = X$ TIME$ Y$ = TIME$ Remarks TIME$ = X$, to set the current time. "X$" is a string variable in the form of "hhmmss". Y$ = TIME$, to get the current time, in the form of "hhmmss".
78 CipherLab BASIC Compiler User's Guide Remarks "A&" is a long integer variable to be assigned to the result. Note that the TIMER is a read-only function. The system timer cannot be set by using this function. Example StartTime& = TIMER ...
Chapter 5 BASIC Commands 79 LED Purpose To specify the LED lighting behavior. Syntax LED(number%, mode%, duration%) Remarks "number%" is a positive integer variable, indicating the LED number. Value Meaning 1 Red LED 2 Green LED "mode%" is an integer variable, indicating the digital output mode. The values of the mode and their interpretation are listed below. Value Meaning 1 Turn on the LED for the specific duration and then go back off.
80 CipherLab BASIC Compiler User's Guide Commands for triggering the ESC event and the KEY event: OFF ESC, OFF KEY, ON ESC GOSUB..., ON KEY GOSUB... ALPHA_LOCK Purpose To set the input mode and key lock status. Syntax ALPHA_LOCK(status%) Remarks "status%" is an integer variable, indicating the alpha-input status. Possible settings for the 7xx series: Value Meaning 0 Unlocked, numeric mode by default. 1 Locked in alpha mode. 2 Locked in numeric mode.
Chapter 5 BASIC Commands 81 Remarks By calling this function, the data queuing in the keyboard buffer will be cleared. Example CLR_KBD ON KEY(1) GOSUB KeyData_1 ... See Also INKEY$, PUTKEY FUNCTION_TOGGLE Optimus Purpose To set the state of function toggle. Syntax FUNCTION_TOGGLE(status%) Remarks "status%" is an integer variable, indicating the state of the function toggle.
82 CipherLab BASIC Compiler User's Guide Remarks "X$" is a string variable to be assigned to the character read. It can be used with menu operation to detect a shortcut key being pressed, or with touch screen operation to detect a touched item. Example ...
Chapter 5 BASIC Commands Remarks Example 83 "mode%" is an integer variable, indicating the input mode. Value Meaning 0 Nothing will be displayed on the LCD. 1 The input characters will be displayed on the LCD (default). 2 "*" will be displayed instead of the input characters. LOCATE 1,1 INPUT_MODE(1) INPUT Login$ LOCATE 2,1 INPUT_MODE(2) INPUT Password$ 5.15 LCD Commands This section describes the commands relating to the liquid crystal display (LCD). 5.15.
84 CipherLab BASIC Compiler User's Guide CLR_RECT Purpose To clear a rectangular area. Syntax CLR_RECT(x%, y%, size_x%, size_y%) Remarks "x%" is the x coordinate of the upper left point of the rectangular area. "y%" is the y coordinate of the upper left point of the rectangular area. "size_x%" is the width of the rectangular area in pixels. "size_y%" is the height of the rectangular area in pixels. Example CLR_RECT(1,1,20,20) See Also CLS, FILL_RECT Purpose To clear the contents on the LCD.
Chapter 5 BASIC Commands Example CURSOR(0) See Also CURSOR_X, CURSOR_Y, LOCATE 85 CURSOR_X Purpose To get the current x-coordinate of the cursor. Syntax X% = CURSOR_X Remarks "X%" is an integer variable to be assigned to the column position of the cursor. Example ON READER(1) GOSUB BcrData_1 ...
86 CipherLab BASIC Compiler User's Guide Example ON READER(1) GOSUB BcrData_1 ... BcrData_1: BEEP(2000,5) Data$ = GET_READER_DATA$(1) Pre_X% = CURSOR_X Pre_Y% = CURSOR_Y Locate 8, 1 PRINT Data$ Locate Pre_Y%, Pre_X% RETURN See Also CURSOR, CURSOR_X, LOCATE FILL_RECT Purpose To fill a rectangular area. Syntax FILL_RECT(x%, y%, size_x%, size_y%) Remarks "x%" is the x coordinate of the upper left point of the rectangular area. "y%" is the y coordinate of the upper left point of the rectangular area.
Chapter 5 BASIC Commands Remarks 87 "DataCount%" is an integer variable to be assigned to the result; it is the total data count stored in the specified transaction file. "file_index%" is an integer variable in the range of 1 to 6, indicating which transaction file is to store the bitmap data. "x%" is an integer variable, indicating the x coordinate of the upper left point of the rectangular area. "y%" is an integer variable, indicating the y coordinate of the upper left point of the rectangular area.
88 CipherLab BASIC Compiler User's Guide See Also PRINT, SHOW_IMAGE LCD_CONTRAST Purpose To set the contrast level for the LCD. Syntax LCD_CONTRAST(N%) Remarks "N%" is an integer variable, indicating the contrast level in the range of 1 to 8. The higher value, the stronger contrast. Example LCD_CONTRAST(4) See Also BACK_LIGHT_DURATION, SET_VIDEO_MODE ' set the LCD contrast to level 4 (medium contrast) LOCATE Purpose To move the cursor to a specified location on the LCD.
Chapter 5 BASIC Commands Example 89 LOCATE 1,1 PRINT String$(20,"") ' clear the whole line LOCATE 1,1 A=5 PRINT A, "square is "; A*A See Also CLS, ICON_ZONE_PRINT, SHOW_IMAGE SHOW_IMAGE Purpose To show a bitmap image on the LCD. Syntax SHOW_IMAGE(x%, y%, size_x%, size_y%, image$) Remarks "x%" is an integer variable, indicating the x coordinate of the upper left point of the rectangular area. "y%" is an integer variable, indicating the y coordinate of the upper left point of the rectangular area.
90 CipherLab BASIC Compiler User's Guide Example icon_1$ = chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(248)+chr$(255)+chr$(7) icon_2$ = chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(8)+chr$(0)+chr$(4) icon_3$ = chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(254)+chr$(255)+chr$(5) icon_4$ = chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(254)+chr$(255)+chr$(5) icon_5$ = chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(254)+chr$(255)+chr$(5) icon_6$ = chr$(192)+chr$(3)+chr$(0)+chr$(0)+chr$(250)+chr$(255)+chr$(5) icon_7$ = chr$(96)+chr$(214)+chr$(201)+chr
Chapter 5 BASIC Commands See Also 91 GET_IMAGE, ICON_ZONE_PRINT, PRINT WAIT_HOURGLASS Optimus Purpose To show a moving hourglass on the LCD. Syntax WAIT_HOURGLASS(x%, y%, type%) Remarks Call this function constantly to maintain its functionality. There are five different patterns of an hourglass that take turn to show on the LCD within a certain period to symbolize the passage of time. The time factor is decided by programming but never less than two seconds.
92 CipherLab BASIC Compiler User's Guide Factors to Monochrome Graphic A monochrome graphic has three factors: Key Factor Parameter Value Meaning Video Display mode: mode% 0 Normal mode 1 Reverse mode -1 Dot_Reverse 0 Dot_Clear 1 Dot_Mark 0 Shape_Normal 1 Shape_Fill Pixel state: Shape state: mode% type%
Chapter 5 BASIC Commands 93 SET_VIDEO_MODE Purpose To set the display mode for the LCD. Syntax SET_VIDEO_MODE(mode%) Remarks "mode%" is an integer variable, indicating the display mode.
94 CipherLab BASIC Compiler User's Guide 5.15.2 Special Font Files There are two standard fonts, namely the 6x8 and 8x16 fonts. However, the portable terminals are capable of displaying special characters, such as the Chinese and Japanese characters, providing that the specific font file has been downloaded to the terminals. Refer to section 2.1 for details. SELECT_FONT Purpose To select a font size for the LCD to display.
Chapter 5 BASIC Commands Remarks 95 "A%" is an integer variable to be assigned to the result. The voltage level of the backup battery is returned in units of milli-volt (mV). The backup battery is used to backup the SRAM and keep the calendar chip running, even when the power is off. The backup battery would be considered as "Battery Low" when the BACK_BATTERY is lower than 2900 mV.
96 CipherLab BASIC Compiler User's Guide 5.17 Communication Ports There are at least two communication ports on each terminal, namely COM1 and COM2. The user has to call the SET_COM_TYPE function to set up the communication type for the COM ports before using them. 5.17.1 Port Mapping The following table shows the mapping of the communication ports.
Chapter 5 BASIC Commands 97 Specifying which type of interface is to be used, the user can use the same commands to open, close, read, and write the data via different interfaces: RS-232, Serial IR, IrDA, Bluetooth (SPP/DUN), or WLAN. Commands for triggering the COM event: OFF COM, ON COM GOSUB... CLOSE_COM Purpose To disable a specified communication port. Syntax CLOSE_COM(N%) Remarks "N%" is an integer variable, indicating which communication port is to be disabled.
98 CipherLab BASIC Compiler User's Guide READ_COM$ Purpose To read data from a specified communication port. Syntax A$ = READ_COM$(N%) Remarks "A$" is a string variable to be assigned to the data. "N%" is an integer variable, indicating from which communication port the data is to be read. If the buffer of the communication port is empty, an empty string will be returned. Example ON COM(1) GOSUB HostCommand ...
Chapter 5 BASIC Commands 4 Standard IrDA 5 RF, Bluetooth (SPP/DUN) 6 GSM_SMS 7 GSM_Modem 99 This function needs to be called BEFORE opening a COM port. Note that the COM port mapping is different for each model of terminal, and, a COM port may not support all the communication types.
100 CipherLab BASIC Compiler User's Guide 5.17.2 RS-232, Serial IR and IrDA Communications Baud rate: Eight options - 115200, 76800, 57600, 38400, 19200, 9600, 4800, 2400 Data bits: 7 or 8 Parity: Even, Odd, or None Stop bit: 1 Flow Control (RS-232 only): RTS/CTS, XON/XOFF, or None COM_DELIMITER Purpose To change the delimiter of COM port sending and receiving string. Syntax COM_DELIMITER(N%, C%) Remarks "N%" is an integer variable, indicating which communication port is to be set.
Chapter 5 BASIC Commands IRDA_STATUS Purpose To check the IrDA connection status or transmission status. Syntax A% = IRDA_STATUS(N%) Remarks "A%" is an integer variable to be assigned to the result. Value Meaning 0 NG 1 OK "N%" is an integer variable, indicating the action to take. Example Value Meaning 0 To check IrDA connection status. 1 To check whether data being transmitted successfully or not.
102 CipherLab BASIC Compiler User's Guide IRDA_TIMEOUT Purpose To set the timeout for IrDA connection. Syntax IRDA_TIMEOUT(N%) Remarks "N%" is an integer variable in the range of 1 to 8, indicating a specified period of time. Value Meaning 1 3 sec 2 8 sec 3 12 sec 4 16 sec 5 20 sec 6 25 sec 7 30 sec 8 40 sec Example IRDA_TIMEOUT(7) See Also IRDA_STATUS ' set timeout to 30 seconds SET_COM Purpose To set parameters for a specified communication port.
Chapter 5 BASIC Commands Parity% 1: None 103 Specifies the parity of the COM port. 2: Odd 3: Even Data% 1: 7 data bits Specifies the data bits of the COM port. 2: 8 data bits Handshake% 1: None 2: CTS/RTS Specifies the method of flow control for the COM port. 3: XON/XOFF Example SET_COM(1,1,1,2,1) See Also CLOSE_COM, OPEN_COM, READ_COM$, SET_COM_TYPE, WRITE_COM ' COM1, 115200, None, 8, No handshake SET_RTS Purpose To set the RTS level for the direct RS-232 port.
104 CipherLab BASIC Compiler User's Guide 5.18.1 RF Models & Specifications Below are the two types of RF communications and their specifications. A base refers to a base station, either for Narrow Band (433 MHz) or Spread Spectrum (2.4 GHz). Product Family 433 MHz 2.4 GHz RF, embedded Narrow Band Spread Spectrum Narrow Band (also referred as 433 MHz RF) Frequency Range: 433.12 ~ 434.
Chapter 5 BASIC Commands 105 5.18.2 RF System Requirements Base to Host: RS-232 connection Base Baud Rate: Up to 115,200 bps Base to Base: RS-485 connection Number of Bases per System: Maximum 16 433 MHz RF System Number of Terminals per Base: Maximum 15 Number of Terminals per System: Maximum 45 2.4 GHz RF System Number of Terminals per Base: Maximum 99 Number of Terminals per System: Maximum 99 IDs and Groups An ID to a terminal or a base is like a name to a person.
106 CipherLab BASIC Compiler User's Guide 5.18.3 RF Terminal Properties Below are the RF properties on terminals. 2.
Chapter 5 BASIC Commands CHECK_RF_BASE Purpose To check if the terminal is connected to a base. Syntax A% = CHECK_RF_BASE Remarks “A%” is an integer variable to be assigned to the result. Example Value Meaning 0 No base found. 1 Base is present. IF (CHECK_RF_BASE = 1) THEN … END IF See Also CHECK_RF_SEND CHECK_RF_SEND Purpose To check if data has been sent successfully or not. Syntax A% = CHECK_RF_SEND Remarks "A%" is an integer variable to be assigned to the result.
108 CipherLab BASIC Compiler User's Guide Syntax A% = GET_RF_CHANNEL Remarks "A%" is an integer variable to be assigned to the result. Value Meaning 1~4 Channels available for 433 MHz. 1~6 Channels available for 2.4 GHz. Example channel% = GET_RF_CHANNEL See Also GET_RF_ID, GET_RF_POWER, SEARCH_RF_CHANNEL, SET_RF_CHANNEL GET_RF_ID Purpose To retrieve the ID of the terminal. Syntax A% = GET_RF_ID Remarks "A%" is an integer variable to be assigned to the result.
Chapter 5 BASIC Commands 109 SEARCH_RF_CHANNEL Purpose To automatically search for available channels when not being connected to a base for a specific period of time Syntax SEARCH_RF_CHANNEL(N%) Remarks "N%" is an integer variable, indicating a specified period of time in units of 1 second. Example SEARCH_RF_CHANNEL(10) See Also GET_RF_CHANNEL, SET_RF_CHANNEL, SET_RF_TIMEOUT SET_RF_CHANNEL Purpose To set the channel of the terminal.
110 CipherLab BASIC Compiler User's Guide SET_RF_POWER Purpose To set the RF output power. Syntax SET_RF_POWER(N%) Remarks "N%" is an integer variable, indicating the power level of the terminal. Value Meaning 1 10 dbm 2 5 dbm 3 4 dbm 4 0 dbm 5 -5 dbm Example SET_RF_POWER(2) See Also GET_RF_POWER, SET_RF_CHANNEL, SET_RF_ID SET_RF_TIMEOUT Purpose To set the duration of retries in seconds, for sending data.
Chapter 5 BASIC Commands 111 RF Practice Programming Flow 1. Set COM port (SET_COM_TYPE) Assign COM2 to RF communication, i.e. SET_COM_TYPE(2,5). 2. Open COM port (OPEN_COM) To initialize the RF module and set up connection, call OPEN_COM(2). 3. Set COM delimiter (COM_DELIMITER) For example, use carriage return (0x0d) as the string delimiter by calling COM_DELIMITER(2,13). 4. Data Transmission To transmit/receive data, call WRITE_COM(2) and READ_COM$(2) respectively. 5.
112 CipherLab BASIC Compiler User's Guide 5.18.4 RF Base Properties Below are the RF properties on base stations. 433 MHz Base Properties Mode: 1 – standalone, 2 – slave, 3 – master Channel: 1~4 ID: 01 ~ 16 Group: 1~3 Time out: 1 ~ 99 seconds (duration of retries for sending data) Output power: 1 ~ 5 levels (10, 5, 4, 0, -5 dbm) Baud rate: 115200, 57600, 38400, 19200, 9600 2.
Chapter 5 BASIC Commands 113 5.18.5 Programming RF Base - RS-232 Host Command Sets Automatically Update Status: @AT Purpose RF Base To update information of bases and terminals automatically. Note that there will be no return of @BSbbgc if only one base exists.
114 CipherLab BASIC Compiler User's Guide Set / Get Channel: @CH Purpose To set or get the Base’s channel. Syntax @CHbbc\r RF Base bb: Base ID (01 ~ 16) c: New channel (1 ~ 4); set 0 to get the Base’s channel. Return @CHbbCoCn\r bb: Base ID (01 ~ 16) Co: Original channel (1 ~ 4) Cn: New channel (1 ~ 4) Send Data to Terminal: @DT Purpose To send data to the terminal.
Chapter 5 BASIC Commands Set / Get Group: @GP Purpose To set or get the Base’s group. Syntax @GPbbg\r 115 RF Base (433 MHz only) bb: Base ID (01 ~ 16) g: New group (1 ~ 3); set 0 to get the Base’s group. Return @GPbbGoGn\r bb: Base ID (01 ~ 16) Go: Original group (1 ~ 3) Gn: New group (1 ~ 3) Header of Data Packets: @HD RF Base Purpose To enable or disable the header of a data packet.
116 CipherLab BASIC Compiler User's Guide Set / Get Mode: @ME RF Base Purpose To set or get the Base’s mode. Syntax @MEbbm\r bb: Base ID (01 ~ 16) m: Base mode (1 ~ 3); set 0 to get the Base’s mode. Set Base Mode Return 1 Standalone 2 Slave 3 Master @MEbbmomn\r bb: Base ID (01 ~ 16) mo: Original mode (1 ~ 3) mn: New mode (1 ~ 3) Change Output Power: @PW Purpose To change the Base’s output power.
Chapter 5 BASIC Commands Set Base Quiet: @QT 117 RF Base Purpose To enable or disable the message (“@Oktt\r”, “@NGtt\r”, “@WTtt\r”) generation of the Base when sending data to the terminal. Syntax @QTbbs\r bb: Base ID (01 ~ 16) s: set 0 for responsive; set 1 for quiet (i.e. no message) Return @QTbbSoSn\r bb: Base ID (01 ~ 16) So: Original state Sn: New state RS-232 Baud Rate: @SP Purpose RF Base To change the RS-232 baud rate setting of the Base.
118 CipherLab BASIC Compiler User's Guide Return @TMbbtt…\r (tt repeat) bb: Base ID (01 ~ 16) tt: Terminal ID (01 ~ 45) Transmission Timeout: @TO Purpose To set or get the timeout setting. Syntax @TObbtt\r RF Base bb: Base ID (01 ~ 16) tt: Timeout setting (01 ~ 99 sec); set 00 to get the current timeout. Return @TObbttTT\r bb: Base ID (01 ~ 16) tt: Original timeout (01 ~ 99 sec) TT: New timeout (01 ~ 99 sec) Update Program: @UP Purpose To enter the download mode for updating the Base program.
Chapter 5 BASIC Commands 119 5.19 Wireless Communications Please refer to the previous section for port mapping. 5.19.1 Wireless Models This section describes the commands relating to wireless network configuration. These command sets are only applicable to the models below. Product Family Optimus S (SP5500) Optimus R (SP5600) Wireless, optional Bluetooth IEEE 802.11b 5.19.2 Network Configuration Net Configuration Network Configuration Index 802.
120 CipherLab BASIC Compiler User's Guide -18 18 EAP Enable -19 19 EAP ID -20 20 EAP Password -21 21 Power Saving Enable Enable -22 22 Preamble Type Long -23 MAC ID BT MAC ID Disable -24 -25 25 BT Remote Name -26 26 BT Security -27 27 BT PIN Code -28 28 BT Broadcast Enable -29 29 BT Power Saving Enable -30 30 Ad-hoc -40 to -47 40 to 47 BT Frequent Device List GSM/GPRS Index Configuration Item SET_NE
Chapter 5 BASIC Commands 121 GET_NET_PARAMETER$ Purpose To get network settings. Syntax A$ = GET_NET_PARAMETER$(index%) Remarks "A$" is a string variable to be assigned to the result. "index%" is an integer variable, indicating a specific configuration item by index number. Error code: Value Meaning 0 Normal status: the connection is open. 3000 Invalid index number. 3004 Connection is closed. 3012 START TCPIP not applied.
122 CipherLab BASIC Compiler User's Guide Example See Also SET_NET_PARAMETER (1, "192.168.1.
Chapter 5 BASIC Commands Net Status Network Configuration Index 802.
124 CipherLab BASIC Compiler User's Guide 11 GSM RSSI 0 -113 dbm or less 1 -111 dbm 2 -109 dbm ... (3 ~ 29) ... (1 for +2 dbm) 12 GSM/GPRS PIN Code 30 -53 dbm 31 -51 dbm or greater 99 Not known or not detectable 0 Disabled 1 PIN code required GET_NET_STATUS Purpose To get network status. Syntax A% = GET_NET_STATUS(index%) Remarks Note that it is necessary to define the DNS server IP before executing this command. "A%" is an integer variable to be assigned to the result.
Chapter 5 BASIC Commands 125 5.19.3 IEEE 802.11b IEEE 802.11b is an industrial standard for Wireless Local Area Networking (WLAN), which enables wireless communications over a long distance. The speed of the connection between wireless devices will vary with range and signal quality. To maintain a reliable connection, the 802.11b system automatically fallback from 11 Mbps to 5.5, 2 or 1 Mbps as range increases or signal quality decreases. Frequency Range: 2.4 ~ 2.5 GHz Data Rate: 11, 5.
126 CipherLab BASIC Compiler User's Guide TCP/IP Networking Here are the BASIC functions and statements relating to TCP/IP networking. Commands for triggering the TCPIP event: OFF TCPIP, ON TCPIP GOSUB... DNS_RESOLVER Purpose To get the IP address of the remote device. Syntax IP$ = DNS_RESOLVER(A$) Remarks Note that it is necessary to define the DNS server IP before executing this command. "IP$" is a string variable to be assigned to the result.
Chapter 5 BASIC Commands Example 4020 Connection #0 is connected 4021 Connection #1 is connected 4022 Connection #2 is connected 4023 Connection #3 is connected 4040 Connection #0 is disconnected 4041 Connection #1 is disconnected 4042 Connection #2 is disconnected 4043 Connection #3 is disconnected 4060 Connection #0: data is coming 4061 Connection #1: data is coming 4062 Connection #2: data is coming 4063 Connection #3: data is coming 4080 IP is ready ON TCPIP GOSUB TCPIP_Trigg
128 CipherLab BASIC Compiler User's Guide NCLOSE Purpose To close a TCP/IP connection. Syntax NCLOSE(N%) Remarks "N%" is an integer variable in the range of 0 to 3, indicating the connection number. Example NCLOSE (0) See Also NREAD$, NWRITE, TCP_ERR_CODE, TCP_OPEN NREAD$ Purpose To read data via a TCP/IP connection. Syntax A$ = NREAD$(N%) Remarks "A$" is a string variable to be assigned to the result. "N%" is an integer variable in the range of 0 to 3, indicating the connection number.
Chapter 5 BASIC Commands Remarks 129 "A%" is an integer variable to be assigned to the result. Value Meaning 0 Normal - data can be sent 3000 Invalid connection number 3004 Connection is closed 3007 Cannot send data 3012 Never run START TCPIP "N%" is an integer variable in the range of 0 to 3, indicating the connection number. "L%" is an integer variable, indicating the length of data.
130 CipherLab BASIC Compiler User's Guide Remarks This command is to be replaced by GET_NET_PARAMETER$. Example NetSetting$ = SOCKET_IP$(0) See Also GET_NET_PARAMETER$, TCP_ERR_CODE SOCKET_OPEN Purpose To check if the connection is open or not. Syntax A% = SOCKET_OPEN(N%) Remarks "A%" is an integer variable to be assigned to the result.
Chapter 5 BASIC Commands 131 "N%" is an integer variable, indicating which wireless module is to be used (all applicable to the CPT-8500, and partially to 8x60). Value Meaning 0 802.11b (default) 1 Bluetooth 2 GPRS 3 Mobile’s GPRS via Bluetooth Example START TCPIP See Also OFF TCPIP, ON TCPIP GOSUB…, STOP TCPIP, TCP_ERR_CODE, TCP_OPEN ' this is hardware-dependent STOP TCPIP Purpose To disable communication via TCP/IP.
132 CipherLab BASIC Compiler User's Guide 3002 Undefined local port in server mode 3003 Undefined remote port in client mode 3004 Connection is closed. 3005 No data received in buffer 3006 Data too long 3007 Networking is busy or data is too long. 3008 Data transmission error 3009 Hardware initialization failure 3010 START TCPIP has already been running. May need STOP TCPIP. 3011 All connections are unavailable.
Chapter 5 BASIC Commands Remarks 133 Note that the function must be called before using any socket read/write commands. "N%" is an integer variable in the range of 0 to 3, indicating the connection number. "IP$" is a string variable, indicating the IP address of the remote port. If it is set to "0.0.0.0", the connection will become server mode and the LP% must be defined. "RP%" is an integer variable, indicating the port number of the remote port, which is to be connected.
134 CipherLab BASIC Compiler User's Guide 2. Initialize the 802.11b/Bluetooth module and networking protocol stack (1) START TCPIP The 802.11b/Bluetooth module will not be powered until the START TCPIP routine is called. When the application program stops using the network, the STOP TCPIP routine can be called to terminate networking and shut down the 802.11b/Bluetooth module so that it can save power. Note that any previous network connection and data will be lost after calling STOP TCPIP.
Chapter 5 BASIC Commands 135 5. Other useful functions There are other routines for obtaining additional information or setting control for a connection. (1) SOCKET_OPEN, SOCKET_HAS_DATA To check the connection status by polling method. (2) SOCKET_IP$ To get the networking configuration and the remote site IP address. (3) TCPIP_ERR_CODE To get the operation result after calling any TCPIP routines. (4) TCPIP event trigger: ON TCPIP GOSUB… and OFF TCPIP are used to get higher working performance.
136 CipherLab BASIC Compiler User's Guide 5.19.4 Bluetooth Serial Port Profile (SPP) is for ad hoc networking, without going through any access point. Personal Area Networking Profile (PAN) makes use of Bluetooth Network Encapsulation Protocol (BNEP) for IP networking over Bluetooth. Access points (AP) are required. Use the same commands as for 802.11b - TCP/IP networking. Dial-Up Networking Profile (DUN) makes use of a Bluetooth modem or mobile phone as a wireless modem. Frequency Range: 2.
Chapter 5 BASIC Commands 137 BT_INQUIRY$ Purpose To search any available Bluetooth devices in range. Syntax A$ = BT_INQUIRY$ Remarks It takes about 20 seconds to get the Bluetooth device information of whomever in range. The string contains address (12 bytes) and name (20 bytes) of the devices. Note that there might be many devices concatenated together, each occupying 32 bytes.
138 CipherLab BASIC Compiler User's Guide Value (type%) Meaning 1 PAN (AP required) 3 SPP 4 DUN It will try to pair with any Bluetooth device that has the specific type of service. If authentication is enabled, then correct PIN code will be required for setting up the Link Key. Once the pairing procedure is completed, the MAC ID of the remote device will be recorded in the “Frequent Device List” for quick connection in the future.
Chapter 5 BASIC Commands 139 Frequent Device List Getting Frequent Device List The length of Frequent Device List by calling GET_NET_PARAMETE$ is 83 characters: LIST$ = GET_NET_PARAMETER$(40) The first character of Frequent Device List is the service type that the device is engaged. Currently, there are three types that have been defined: Service Type In Frequent Device List 1 PAN (= AP mode, i.e. access points are required.) Max.
140 CipherLab BASIC Compiler User's Guide Example code: FREQ_DEV$ = “” CLS FOR K% = 1 TO 8 FDL$ = “” FDL$ = GET_NET_PARAMETER$(-39-K%) IF MID$(FDL$,1,1)<>CHR$(0) THEN DEV$ = MID$(FDL$,14,20) MAC_ID$ = MID$(FDL$,2,12) MACHINE$ = MID$(FDL$,1,1) FREQ_DEV$ = FREQ_DEV$+DEV$ FREQ_MAC$ = FREQ_MAC$+MAC_ID$ FREQ_MC$ = FREQ_MC$+MACHINE$ END IF NEXT K% I% = MENU(FREQ_DEV$) Setting Frequent Device List To enable quick connection to a specific device without going through the inquiry and pairing procedure, a user-d
Chapter 5 BASIC Commands 141 … Example code (2): ‘setting up a SPP Frequent Device List with authentication (needs PIN code) by calling SET_NET_PARAMETER: … FDL$ = CHR$(3+128) + ”00d017401234” + ”TestDev.
142 CipherLab BASIC Compiler User's Guide Bluetooth Practice Bluetooth Configuration The parameters can be SET_NET_PARAMETER. accessed via GET_NET_PARAMETER$ and Bluetooth e.g. SPP Application 1. Set COM port (SET_COM_TYPE) Assign either COM1 SET_COM_TYPE(2,5) or COM2 to communication, 2. Configure COM port (SET_COM) SET_COM(N%, Baudrate%, Parity%, Data%, Handshake%) – To determine which SPP mode to initialize, use the second parameter regarding baud rate setting.
Chapter 5 BASIC Commands 143 3. Open COM port (OPEN_COM) To initialize the Bluetooth module and set up connection, call OPEN_COM(2). 4. Detect Connection To detect if the connection is completed, call GET_NET_STATUS(8). For example: LOOP003: IF GET_NET_STATUS(8) = 0 THEN GOO LOOP003 BEEP(4400,4) CLS PRINT “Connect OK” 5. Data Transmission To transmit/receive data, call WRITE_COM(2) and READ_COM$(2) respectively. 6. Detect Connection To detect if the connection is maintained, call GET_NET_STATUS(8).
144 CipherLab BASIC Compiler User's Guide The “Serial to Keyboard Converter” helps to develop a keyboard key in application without any serial port input function. It supports multi regions, i.e., an application can make use of this tool for varying keyboard layout. The 8x60 series allows application send data for the purpose of keyboard input via Bluetooth SPP in general wedge functions, such as SEND_WEDGE, SET_WEDGE, and WEDGE_READY.
Chapter 5 BASIC Commands 145 5.20 File Manipulation This section describes the commands relating to file manipulation. There are two different types of file structures supported in BASIC. DAT Files DBF File and IDX Files For portable terminals, a BASIC program can have up to 6 transaction files and 5 DBF files (3 IDX files for each DBF file).
146 CipherLab BASIC Compiler User's Guide 5.20.1 DAT Files This one has a sequential file structure, which is much like the ordinary sequential file but is modified to support FIFO structure. We call this type of file as DAT file. Because DAT files are usually used to store transaction data, they are also referred to as Transaction files. The length of each record in the transaction file is limited to 250 bytes. For portable terminals, a BASIC program can have up to 6 transaction files.
Chapter 5 BASIC Commands 147 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. The command DEL_TRANSACTION_DATA_EX(1, N%) works the same as the command DEL_TRANSACTION_DATA(N%). "N%" is an integer variable, determining how many transaction records to be deleted and how to delete.
148 CipherLab BASIC Compiler User's Guide ELSE IF KeyData$ = “Y” THEN EMPTY_TRANSACTION END IF See Also DEL_TRANSACTION_DATA, EMPTY_TRANSACTION_EX EMPTY_TRANSACTION_EX Purpose To remove all the transaction data from a specified transaction file. Syntax EMPTY_TRANSACTION_EX(file%) Remarks "file%" is an integer variable in the range of 1 to 6, indicating which transaction file the command is to affect. The command EMPTY_TRANSACTION_EX(1) works the same as the command EMPTY_TRANSACTION.
Chapter 5 BASIC Commands Syntax A$ = GET_TRANSACTION_DATA_EX$(file%, N%) Remarks "A$" is a string variable to be assigned to the transaction data. 149 "file%" is an integer variable in the range of 1 to 6, indicating which transaction file to access. The command GET_TRANSACTION_DATA_EX$(1,1) works the same as the command GET_TRANSACTION_DATA$(1). "N%" is an integer variable, indicating the ordinal number of the record to be read from the first transaction file. Example ...
150 CipherLab BASIC Compiler User's Guide SAVE_TRANSACTION_EX Purpose To save (append) a transaction record to a specified transaction file. Syntax SAVE_TRANSACTION_EX(file%, data$) Remarks "file%" is an integer variable in the range of 1 to 6, indicating which transaction file to access. The command SAVE_TRANSACTION_EX(1,data$) works the same as the command SAVE_TRANSACTION(data$). "data$" is a string variable, representing the string to be saved in the specified transaction file.
Chapter 5 BASIC Commands 151 TRANSACTION_COUNT_EX Purpose To get the total number of transaction records saved in a specified transaction file. Syntax A% = TRANSACTION_COUNT_EX(file%) Remarks "A%" is an integer variable to be assigned to the result. "file%" is an integer variable in the range of 1 to 6, indicating which transaction file to access. The command TRANSACTION_COUNT_EX(1) works the same as the command TRANSACTION_COUNT. Example ...
152 CipherLab BASIC Compiler User's Guide Syntax UPDATE_TRANSACTION_EX(file%, N%, data$) Remarks "file%" is an integer variable in the range of 1 to 6, indicating which transaction file to access. The command UPDATE_TRANSACTION_EX(1, N%, data$) works the same as the command UPDATE_TRANSACTION(N%, data$). "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. Example ..
Chapter 5 BASIC Commands 153 Data records are not manipulated directly from the DBF file but rather through its associated IDX files. The value of file pointers of the IDX files (index pointers) does not represent the address of the data records stored in the DBF file. It indicates the sequence number of a specific data record in the IDX file. ADD_RECORD Purpose To add a record to a specified DBF file.
154 CipherLab BASIC Compiler User's Guide For example, if DBF 1 contains four records: 011-231, 120-117, 043-010, 067-150. The key (index) of the first associate IDX is defined as starting at position 1 with length of 3, and the key (index) of the second associate IDX is defined as starting at position 5 with length of 3. All the file pointers of the DBF and IDX files are currently pointing to the last record.
Chapter 5 BASIC Commands Example 155 ON COM(1) GOSUB HostCommand ... HostCommand: Cmd$ = READ_COM$(1) CmdIdentifier$ = LEFT$(Cmd$, 1) DBFNum% = VAL(MID$(Cmd$, 2, 1)) IDXNum% = VAL(MID$(Cmd$, 3, 1)) CardID$ = RIGHT$(Cmd$, LEN(Cmd$)-3) IF CmdIdentifier$ = "!" THEN EMPTY_FILE(DBFNum%) ELSE ... See Also DEL_RECORD FIND_RECORD Purpose To search for records in a specified DBF file that matches the key string with respect to a specified IDX.
156 CipherLab BASIC Compiler User's Guide IDXNum% = VAL(MID$(Cmd$, 3, 1)) CardID$ = RIGHT$(Cmd$, LEN(Cmd$)-3) IF CmdIdentifier$ = "?" THEN IF FIND_RECORD(DBFNum%, IDXNum%, CardID$) = 1 THEN PRINT "Data is found in DBF.", DBFNum% ELSE PRINT "Data is not found in DBF.", DBFNum% END IF ELSE ... GET_RECORD$ Purpose To get a record in a specified DBF file, which the file pointer of a specified IDX file is pointing to.
Chapter 5 BASIC Commands 157 ELSE … See Also UPDATE_RECORD GET_RECORD_NUMBER Purpose To get the ordinal number of the record pointed to by the file pointer of a specified DBF file and IDX file. Syntax A% = GET_RECORD_NUMBER(file% [,index%]) Remarks "A%" is an integer variable to be assigned to the number. "file%" is an integer variable in the range of 1 to 5, indicating which DBF file to be accessed. "index%" is an integer variable in the range of 1 to 3, indicating which IDX file to be accessed.
158 CipherLab BASIC Compiler User's Guide Syntax MOVE_TO_NEXT(file% [,index%]) Remarks "file%" is an integer variable in the range of 1 to 5, indicating which DBF file to be accessed. "index%" is an integer variable in the range of 1 to 3, indicating which IDX file to be accessed. If it is not specified, the default IDX file which keeps the original data sequence will be used.
Chapter 5 BASIC Commands 159 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. "index%" is an integer variable in the range of 1 to 3, indicating which IDX file to be accessed. If it is not specified, the default IDX file which keeps the original data sequence will be used. "data$" is a string variable, representing the character string to replace the old data. Example ON COM(1) GOSUB HostCommand ...
160 CipherLab BASIC Compiler User's Guide Error Code Interpretation 10 No free memory for file extension. For other types of error, i.e. invalid file ID, it will cause a run-time error. Example ... ADD_RECORD(1,Data$) IF (GET_FILE_ERROR = 10) THEN ErrorMessage$ = "No free file space." END IF ... 5.21 Memory This section describes the commands relating to the flash memory, SRAM, and the Smart Media Card (SMC). FLASH_READ$ Purpose To read a data string from the flash memory.
Chapter 5 BASIC Commands Remarks 161 "A%" is an integer variable to be assigned to the result. Value Meaning 1 Write flash memory successfully. -1 The BASIC program is too large; no free flash memory available. -2 Error command for erasing the flash memory. -3 The given index is out of the range. -4 Fail to write (probably flash memory is not erased yet or something goes wrong). "N%" is an integer variable in the range of 1 to 256, indicating the ordinal number of the record.
162 CipherLab BASIC Compiler User's Guide RAM_SIZE Purpose To get the size of data memory (SRAM) in kilo-bytes. Syntax A% = RAM_SIZE Remarks "A%" is an integer variable to be assigned to the result. Example PRINT "SRAM size = ", RAM_SIZE See Also FREE_MEMORY, ROM_SIZE ROM_SIZE Purpose To get the size of program memory (Flash) in kilo-bytes. Syntax A% = ROM_SIZE Remarks "A%" is an integer variable to be assigned to the result.
Chapter 5 BASIC Commands * L(8), T(0) * L(9), T(0) ON_ENQUIRY(128) ASGN(2) ... * * L(10), T(0) * ASGN(3) * * * L(11), T(0) * L(69), T(0) ASGN("Terminal 510") * L(70), T(0) L(12), T(0) GOTO(68) ASGN("510AC_100.BAS") ... L(13), T(0) * EVENT(16) * L(79), T(1) ARY(1) * L(80), T(1) ... ") OFF_READER(1) * L(39), T(0) SET_COM(1,1,1,2,1) * * START_NETWORK L(82), T(1) CLS * ...
164 CipherLab BASIC Compiler User's Guide START_DEBUG Purpose To start the debug function. Syntax START_DEBUG(N%, Baudrate%, Parity%, Data%, Handshake%) Remarks Parameters Values Remarks N% 1 or 2 Indicates which COM port is to be set. Baudrate% 1: 115200 bps Specifies the baud rate of the COM port. 2: 76800 bps 3: 57600 bps 4: 38400 bps 5: 19200 bps 6: 9600 bps 7: 4800 bps 8: 2400 bps Parity% 1: None Specifies the parity of the COM port.
Chapter 5 BASIC Commands Example STOP_DEBUG See Also START_DEBUG 165 5.23 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. The 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. Note: Each reserved command is ended with a carriage return, which can be changed by the COM_DELIMITER function.
166 CipherLab BASIC Compiler User's Guide Syntax A$ = READ A$ = READ(file%) Remarks "A$" is a string variable to be assigned to the result; it may be the desired data string if the command is successfully processed. Otherwise, it may have one of the values as follows: Value Meaning OVER There is no data in the transaction file. NAK Any format error occurs. The READ command will read the top most record of the first transaction file, which is the default one.
Chapter 5 BASIC Commands 167 Syntax A$ = TR Remarks "A$" is a string variable to be assigned to the result, which is in the form of "yyyymmddhhnnss" as described below. yyyy: 4 digits for year mm: 2 digits for month dd: 2 digits for day hh: 2 digits for hour, in 24-hour format nn: 2 digits for minute ss: 2 digits for second Otherwise, it may return one of the values below. Value Meaning NAK Any format error occurs. Example TR See Also TW Purpose To set new system time.
168 CipherLab BASIC Compiler User's Guide
169 APPENDIX I Barcode Setting The data terminals support the decodability of several barcode symbologies, such as: Code 39 Italy Pharmacode French Pharmacode Industrial 2 of 5 Interleave 2 of 5 Matrix 2 of 5 Codabar Code 93 Code 128 UPCE UPCE with Addon2 UPCE with Addon5 EAN8 EAN8 with Addon2 EAN8 with Addon5 EAN13 & UPCA EAN13 with Addon2 EAN13 with Addon5 MSI Plessey Telepen RSS14 RSS14 Limited RSS14 Expanded The BASIC Co
170 CipherLab BASIC Compiler User's Guide This appendix describes associated symbology parameters and scanner parameters. Symbology Parameters Code 39 Transmit Start / Stop This parameter specifies whether the start/stop characters of Code 39 are included in the data being transmitted. Verify Checksum If this parameter is enabled, the target terminal will perform checksum verification when decoding Code 39 barcodes. If the checksum is incorrect, the barcode will not be accepted.
Appendix I Barcode Setting 171 Length Qualification Because of the weak structure of the 2 of 5 barcodes, it is possible to make a "short scan" error. To prevent the "short scan" error, user can define the "Length Qualification" settings to insure that the correct code is read by qualifying the allowable code length. The barcode can be qualified by "Fixed Length" or "Max/Min Length". If "Fixed Length" is selected, up to 2 fixed lengths can be specified.
172 CipherLab BASIC Compiler User's Guide EAN13 & UPCA ISBN Conversion If this parameter is enabled, the EAN 13 codes starting with 978 and 979 will be converted to ISBN code. ISSN Conversion If this parameter is enabled, the EAN 13 codes starting with 977 will be converted to ISSN code. Transmit Checksum If this parameter is enabled, the EAN 13 checksum character will be included in the data being transmitted.
Appendix I Barcode Setting 173 Checksum Transmission If this parameter is enabled, the checksum characters (two characters) will be transmitted together with data. Original Telepen (Numeric) If this parameter is enabled, the target terminal supports Telepen in numeric numbers only. AIM Telepen (Full ASCII) If this parameter is enabled, the target terminal supports Telepen in full ASCII code, including all the alphanumeric and special characters.
174 CipherLab BASIC Compiler User's Guide RSS14 Expanded Transmit Code ID If this parameter is enabled, the default Code ID will be included in the data being transmitted. Scanner Parameters The user can define the scanner parameters for reader ports 1 and 2. Note: The settings for reader port 2 on the 7xx series data terminals will be ignored because they support only one reader port. Scan Mode Auto Off Mode This is the default scan mode.
Appendix I Barcode Setting 175 Test Mode The reader is always scanning and will decode repeatedly even with the same barcode. Momentary Mode The reader will be scanning as long as the switch is pressed. Alternate Mode The reader will start scanning once the switch is triggered. It will continue scanning until the scan trigger is pressed again. Aiming Mode This mode is used when two barcodes are printed too close to each other. By selecting this mode, the user needs to trigger twice to decode.
176 CipherLab BASIC Compiler User's Guide Time-Out This parameter is used to limit the maximum scanning time interval when the scan mode is set as Auto Off mode Auto Power Off mode Aiming mode Laser mode The time interval is specified in units of second, ranging from 0 to 255. It is set 10 seconds by default. Negative Barcode Normally, barcodes are printed with the color of the bars darker than that of the spaces.
177 APPENDIX II Run-Time Error Table Error Code Explanation 1 Unknown operator 2 Operand count mismatch 3 Type mismatch 4 Can't perform type conversion 5 No available temp string 6 Illegal operand 7 Not an L-value 8 Float error 9 Bad array subscript 10 Unknown function 11 Illegal function call 12 Return without GOSUB
179 APPENDIX III 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. ALPHA_LOCK(status%) Indicating the command ALPHA_LOCK is processed. AND Indicating the logical operation AND is processed.
180 CipherLab BASIC Compiler User's Guide CODE_TYPE Indicating the command CODE_TYPE is processed. COM_DELIMITER(N%,C%) Indicating the command COM_DELIMITER is processed. CURSORX Indicating the command CURSOR_X is processed. CURSORY Indicating the command CURSOR_Y is processed. DATE$ Indicating the system date is inquired. 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.
Appendix III Debugging Messages 181 EVENT(9) Indicating the "TIMER(1) EVENT" happens. EVENT(10) Indicating the "TIMER(2) EVENT" happens. EVENT(11) Indicating the "TIMER(3) EVENT" happens. EVENT(12) Indicating the "TIMER(4) EVENT" happens. EVENT(13) Indicating the "TIMER(5) EVENT" happens. EVENT(14) Indicating the "ON MINUTE EVENT" happens. EVENT(15) Indicating the "ON HOUR EVENT" happens. EVENT(16) Indicating the "READER(1) EVENT" happens.
182 CipherLab BASIC Compiler User's Guide GET_CTS(N%) Indicating the command GET_CTS is processed. N% is the number of the COM port. GET_DEVICE_ID Indicating the command DEVICE_ID is processed. GET_FILE_ERROR Indicating the command GET_FILE_ERROR is processed. GET_IMAGE Indicating the command GET_IMAGE is processed. GET_LANGUAGE Indicating the command GET_LANGUAGE is processed. GET_NET_PARAMETER$(index Indicating the command GET_NET_PARAMETER$ is %) processed.
Appendix III Debugging Messages 183 INKEY$(A$) Indicating the command INKEY is processed. INPUT Indicating the command INOUT is processed. INPUT_MODE(mode%) Indicating the command INPUT_MODE is processed. INSTR([N%,] X$,Y$) Indicating the command INSTR is processed. INT(N%) Indicating the command INT is processed. IRDA_STATUS(N%) Indicating the command IRDA_STATUS is processed. N% is the connection or transmission status. IRDA_TIMEOUT(N%) Indicating the command IRDA_TIMEOUT is processed.
184 CipherLab BASIC Compiler User's Guide NCLOSE(N%) Indicating the command NCLOSE is processed. N% is the connection number. NOT Indicating the logical operation NOT is processed. NREAD$(N%) Indicating the command NREAD$ is processed. N% is the connection number. NWRITE(N%,A$) Indicating the command NWRITE is processed. OCT$(N%) Indicating the command OCT$ is processed. OFF_ALL Indicating the command OFF ALL is processed. OFF_COM(N%) Indicating the command OFF COM is processed.
Appendix III Debugging Messages 185 ON_TIMER(N1%,N2%) Indicating the command ON TIMER GOSUB is called. ON_TOUCHSCREEN(N%) Indicating the command ON TOUCHSCREEN GOSUB is called. N% is the line number of the subroutine to branch to. OPEN_COM(N%) Indicating the command OPEN_COM is processed. N% is the number of the COM port. OR Indicating the logical operation OR is processed. POWER_ON(N%) Indicating the command POWER_ON is processed. N% is the value of the setting.
186 CipherLab BASIC Compiler User's Guide SET_PRECISION(N%) Indicating the command SET_PRECISION is processed. N% is the numeric precision. SET_RF_CHANNEL(N%) Indicating the command SET_RF_CHANNEL is processed. N% is the channel. SET_RF_ID(N%) Indicating the command SET_RF_ID is processed. N% is the ID. SET_RF_POWER(N%) Indicating the command SET_RF_POWER is processed. N% is the power level. SET_RF_TIMEOUT(N%) Indicating the command SET_RF_TIMEOUT is processed. N% is the assigned time interval.
Appendix III Debugging Messages 187 T(N%) Indicating the stack's level. When the program branches to a subroutine, the stack's level increases 1; when the program returns, the stack's level decreases 1. It can be used to check if the "stack overflow" problem happens. TCP_ERR_CODE Indicating the command TCP_ERR_CODE is processed. TCP_OPEN(...) Indicating the command TCP_OPEN is processed. TIME$ Indicating the system time is inquired. TIME$(X$) Indicating the system time is updated.
189 Index @ A @AT • 119 @BC • 119 @BS • 119 @CH • 120 @DT • 120 @ER • 120 @GP • 121 @HD • 121 @ID • 121 @ME • 122 @PW • 122 @QT • 123 @SP • 123 @TM • 123 @TO • 124 @UP • 124 About Barcode Type • 58, 184 About Bluetooth • 142 About Category of Commands • 23 About COM Ports • 102 About DAT Files • 159 About DBF/IDX Files • 165 About Error Message • 137, 173, 191 About Fonts • 3, 98 About Graphics • 95 About GSM/GPRS • 151 About IEEE 802.
190 Index CLEAR • 179 CLOSE_COM • 103 CLR_KBD • 83 CLR_RECT • 87 CLS • 88 CODE_TYPE • 58 COM_DELIMITER • 106 Commands Barcode Reader • 58 Battery • 101 Buzzer • 76 Calendar&Time • 78 COM Ports • 102 Debugging • 176 Decision Structure • 28 Event Trapping • 41 File Manipulation • 158 General • 25 Host, Reserved • 179 Keyboard Wedge • 69 Keypad • 82 LCD • 87 LED • 81 Looping Structures • 31 Memory • 173 RF (433 MHz/2.
Index IF ... THEN ... [ELSE...] • 28 IF ... THEN ... {ELSE IF...} [ELSE...] END IF • 28 IF … THEN … END IF • 29 INKEY$ • 84 INPUT • 85 INPUT_MODE • 85 INSTR • 34 INT • 26 IP_CFG or IP_CONFIGURE • 133 IRDA_STATUS • 107 IRDA_TIMEOUT • 108 K KEY_CLICK • 77 L LCASE$ • 38 LCD_CONTRAST • 91 LED • 81 LEFT$ • 35 LEN • 34 LINE • 96 LOCATE • 91 LOCK • 51 OFF TIMER • 45 OFF TOUCHSCREEN • 46 ON ... GOSUB ... • 29 ON ... GOTO .. • 30 ON COM... GOSUB... • 46 ON ESC GOSUB... • 47 ON HOUR_SHARP GOSUB... • 47 ON KEY...
192 Index SET_RFID_WRITE • 68 SET_RTS • 109 SET_SCREENITEMS • 100 SET_SIGNAREA • 100 SET_VIDEO_MODE • 97 SET_WEDGE • 75 SGN • 27 SHIFT_LOCK • 86 SHOW_IMAGE • 92 SMC_FREE_MEMORY • 175 SMC_SIZE • 176 SOCKET_CAN_SEND • 134 SOCKET_HAS_DATA • 135 SOCKET_IP$ • 135 SOCKET_OPEN • 136 START TCPIP • 136 START_DEBUG • 178 STOP BEEP • 77 STOP TCPIP • 137 STOP_DEBUG • 178 STR$ • 38 STRING$ • 40 SYSTEM_PASSWORD • 58 T TCP_ERR_CODE • 137 TCP_OPEN • 138 TIME$ • 79 TIMER • 80 TR • 180 TRANSACTION_COUNT • 163 TRANSACTION_