Home
Basic Compiler User's Manual V.2.0 - Kalisch Computer
Contents
1. ASGN OKGood Morning OFF_READER 1 L 81 T 1 L 39 T 0 OFF_READER 2 SET_COM 1 1 1 2 1 L 82 T 1 L 40 T 0 CLS OPEN_COM 1 L 83 T 1 HIDE_CALENDAR L 41 T 0 L 84 T 1 BEEP START_NETWORK 97 START_DEBUG 201 510 520 711 720 Purpose To start the debug function Syntax START_DEBUG NY Baudrate Parity Data Handshake Remarks Parameters Values Remarks N 1 This parameter indicates which COM port to be used to send the debug messages Baudrate 201 510 This parameter specifies 38400 ee 1115200 best in baud tate of the 19200 bps 76800 bps COM port 9600 bps 57600 bps 4800 bps 38400 bps 2400 bps 19200 bps 1200 bps 9600 bps 600 bps 4800 bps 300 bps 2400 bps Parity No Parity This parameter specifies Odd Parity the parity of the COM Even Parity port Data 7 Data Bits This parameter specifies 8 Data Bits the data bits of the COM port Handshake 1 No Handshake This parameter specifies CTS RTS the method of flow XON XOFF control of the COM port If a certain COM port has been used in the BASIC program it is better to use another COM port for debugging to avoid conflicts Usage START_DEBUG 1 1 1 2 1 use COM1 to send debug messages the COM port properties are 38400 N 8 No handshake for 201 STOP_DEBUG 201 510 520 711 720 Purpose To terminate the debugging function Syntax STOP_DEBUG Remarks Th
2. If there is no difference between corresponding characters of two strings and they are the same length then the two strings are equal If there is no difference between 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 gt aaaaa are both true expressions Leading and trailing blank spaces are significant in string comparisons For example the string abc is less than the string abc since a blank space is less than an a on the other hand the string abc is greater than the string abc 4 4 3 Getting the Length of a String LEN 201 510 520 711 720 Purpose To return the length of a string Syntax A LEN X Remarks A is an integer variable to be assigned with the result X may be a string variables string expressions or string constants Non printing characters and blanks are counted Usage String1 abcde A LEN String1 A 6 including the blank 29 4 4 4 Searching for Strings Seraching for a string inside another one is one of the most common string processing tasks INSTR is provided for this task INSTR 201 510 520 711 720 Purpose To search if one string exists inside another one Syntax A INSTR N X Y Remarks A is an integer variable to be assigned with the result N is a numeric expression in the ran
3. NAK OVER OVER _NEXT NEXT prefixed with an underline to distinguish from the reserved keyword NEXT DONE DONE tkkkkkkkkkk Initialization kkkkkkkkkk Set_Com 1 3 1 2 1 COM1 9600 no parity 8 no handshake OPEN_COM 1 ON COM 1 GOSUB ParseCmd ENABLE READER 1 ENABLE READER 2 ON READER 1 GOSUB BcrData_1 ON READER 2 GOSUB BerData 2 Junk GET READER DATAS 1 Junk GET READER DATAS 2 IKKKAKAKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Main VOL BUZ_VOL BACKLIT BACK_LIT BEEP 4750 5 0 5 4750 5 0 5 4750 5 CLS PRINT PROMPT1 LOCATE 2 1 PRINT PROMPT2 LOCATE 2 14 WAIT 400 CURSOR 0 LED 4 1 0 CLS SHOW_CALENDAR 1 1 1 BEEP 4750 5 Loop GOTO Loop VIR K IKK I KARRI IKI KIKI I KIBAKI IIIA e ke ke ke H I IIR IIIB IKI III IKI III III IK IIIA III III III III II IIIA RK Routine BerData 1 Purpose To get data from the reader port 1 and show it on the LCD Return Call SaveData j Show Timer ON TIMER 1 2 sec BerData_1 OFF TIMER 1 BEEP 4750 5 LED 1 1 2 BerData GET_READER_DATA 1 HIDE_CALENDAR CLS PRINT Data BerData GOSUB SaveData ON TIMER 1 200 GOSUB Show Timer RETURN IKKKKKKKKKEKKKKAKKKKKKKKKKKKKAKKAKKKKKKKKKKEKKKKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Routine BerData 2 S get data from the reader port 2 and show it on the LCD Return Call SaveData j Show Timer ON TIMER 1 2 sec ber2 OFF TIMER 1 BEEP 4750 5 LED 1 1 2 BerData G
4. SHIFT ENTER pressed at the same time to enter the Download Mode The new program can be downloaded through COM1 or COM3 port with the COM port properties as 38400 bauds no parity 8 data bits and no handshaking In case where the existing program does not provide the download function or the existing program is corrupted for any reason the user can use the 201 510 Flash Writer to download a new program Please refer to Appendix B for detailed instructions 2 520 Both the Kernel Menu and the System Menu provide the download function The user can press F5 F6 F7 and F8 at power on to enter the Kernel Menu In Kernel Menu select 1 Program Download and then select COM port and baud rate to download the new program Alternatively the user can press F1 F2 F3 at power on to enter the System Menu In System Menu select 6 Version and then 2 Flash Download and then select baud rate to download the new program The System Menu is automatically built within the user program when the user program links 520lib lib In rare cases where the existing program is corrupted this may not work But the user can always download a program through the Kernel Menu 3 7xx The 7xx portable terminals have the Kernel Menu and the System Menu that is very similar to 520 Both the Kernel Menu and the System Menu provide the download function The us
5. VAL MID Cmd 3 1 CardID RIGHT Cmd LEN Cmd 3 IF Cmdldentifier THEN EMPTY_FILE DBFNum ELSE 201 510 520 711 720 To search for a record in the specified DBF file vvhich matches the key string vvith respeci to the specified IDX A FIND RECORD file index key A is an integer variable to be assigned with the result file is an integer in the range of 1 to 3 1 to 5 for 7xx indicating which DBF file to be accessed index is an integer in the range of 1 to 3 indicating which IDX file to be accessed key is a character string which indicates the matching string to be found If any record member in the DBF file matches the key string with respect to the IDX FIND RECORD will return 1 and the file pointer of the IDX file will point to the first record with the matching string If no match is found the file pointer will point to the first record whose index value is greater than the value of key ON COM 1 GOSUB HostCommand HostCommand Cmd READ_COM 1 Cmaldentifier LEFT Cmd 1 DBFNum VAL MID Cmd 2 1 IDXNum VAL MID Cmd 3 1 CardID RIGHT Cmd LEN Cmd 3 IF Cmdldentifier 2 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 201 510 520 711 720 To get a record in the specified DBF file which is pointed to by
6. abc is returned for the command INQUIRY ABC and assigned to S1 On the host PC the user can send the string 01xyz through RS 232 and that will trigger the NET Event on the master The command identifier and the station ID in the received data will be stripped off by the background routines and then assigned to M2 by the command M2 READ_NET The same user can send the string O5XYZ through RS 232 and that will trigger the NET Event on the slave 05 S2 is assigned with the string XYZ after the command S2 READ_NET 80 GET_INQUIRY Purpose Syntax Remarks Usage INQUIRY Purpose Syntax Remarks Usage 201 510 520 To enable the master station to get the inquiry string from the slaves A GET_INQUIRY A is a string variable to be assigned with the inquiry from the slave which calls the command INQUIRY ON ENQUIRY GOSUB Verification Verification LOCK InqString GET_INQUIRY InqData RIGHTS IngString LEN InqString 3 strip off the station ID and the inquiry identifier FOR I 1 TO 10 WRITE_NET InqData WAIT 100 wait 0 5 sec Response READ_NET IF Response lt gt THEN GOTO Replying NEXT retry Response Cannot find the Host Replylnq REPLY Response UNLOCK RETURN 201 510 520 To send an inquiry string to the master and wait for response A INQUIRY nquiry Timeout A is a str
7. IKKKKKKKKKKKKKKAKKEKKKKKKKKKKEKKEKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Routine Verification Purpose To verify data Return Call IKKKKKAKKKKKKKKEKKKKEKKAKKKKKKKKKKEKKEKKKKAKKKKKEKKEKKKKKKKKKKKKKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Verification LOCK InqString GET_INQUIRY InqData RIGHT InqString LEN InqString 3 strip off the station ID 8 the inquiry identifier IF ConnectFlag 1 THEN GOTO Verification_Host ELSE GOTO Verification_Master END IF Verification_Host FOR 1 To 10 WRITE_NET InqData WAIT 100 wait 0 5 sec Response READ_NET IF Response lt gt THEN GOTO Host Reply NEXT Host_Reply REPLY Response UNLOCK RETURN Verification_Master CurrentTime VAL LEFT TIME 4 hhmm IF FIND RECORDI1 1 inqData 1 THEN OrgData GET_RECORD 1 1 Name MID OrgData 6 15 IF FIND RECORDI2 1 InqData 1 THEN LastEvent GET_RECORD 2 1 LastEventDate MID LastEvent 6 6 IF LastEventDate Date THEN LastEventNo VAL RIGHT LastEvent 1 ELSE LastEventNo 0 END IF ELSE LastEventNo 0 END IF ON LastEventNo 1 GOSUB Event1 Event2 Event3 Event4 Event5 IF ProcessFlag 1 THEN EventData InqData Date STR LastEventNo UPDATE_RECORD 2 1 InqData FIND_RECORD 2 1 InqData DEL_RECORD 2 1 ADD_RECORD 2 EventData END IF Name ReplyMsg MSG_NG 6 110 END IF REPLY
8. INPUT String1 BEEP 2000 5 DISABLE KBD PRINT String1 DISABLE PSEUDO_KBD 201 510 520 Purpose To disable the pseudo keyboard as well as the real keyboard Syntax DISABLE PSEUDO_KBD Remarks Pseudo keyboard is not a real keyboard but a special set of barcodes Each barcode represents a key on the real keyboard When pseudo keyboard function is enabled users can make a keystroke by scanning the corresponding barcode By reading the keyboard keystrokes are input to the terminal as if they come from a real keyboard A set of pseudo keyboards can be found in Appendix E Usage ENABLE PSEUDO_KBD INPUT String1 BEEP 2000 5 DISABLE PSEUDO_KBD PRINT String1 ENABLE KBD 201 510 520 711 720 Purpose To enable the built in keypad and or the external AT keyboard Syntax ENABLE KBD Remarks The keypad functionality is enabled by default But once disabled by the DISABLE KBD command this command can be used to restore the keypad functionality Usage ENABLE KBD INPUT String1 BEEP 2000 5 DISABLE KBD PRINT String1 ENABLE PSEUDO_KBD 201 510 520 Purpose To enable the pseudo keyboard as well as the real keyboard Syntax ENABLE PSEUDO_KBD Remarks Pseudo keyboard is not a real keyboard but a special set of barcodes Each barcode represents a key on the real keyboard When pseudo 67 keyboard function is enabled the user can enter a keystroke by scanning the corresponding barcode By reading the barcode keystrokes are input to the termin
9. NAK if any format error occurs X 101 5 Sample Programs This chapter provides six sample programs to illustrate the use of the BASIC commands 5 1 201TEST_1 BAS IKKKKKKKKKEKKKKAKKKKKKKKKKKKKKKKEKKKKKKKKKKEKKKKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Program BASIC Sample Program 201TEST_1 BAS i Target Machine 201 N Description The terminal reads data from the reader ports and show the data and l the code type on the LCD N VERSION 201 TEST 1 BAS START_DEBUG 1 1 1 2 1 IKKKEREKEEK Constants kkkkkkkkkk BUZ_VOL 2 BACK LT 3 PROMPT1 CipherLab 201 PROMPT2 201TEST_1 BAS tkkkkkkkkkk Initialization kkkkkkkkkk ENABLE REA DER 1 ENABLE READER 2 ON READER 1 GOSUB BcrData_1 ON READER 2 GOSUB BerData 2 Junk GET READER DATASI1 Junk GET READER DATAS 2 IKKKKKAKKKKKKKKKKKKKKKKKKKKKKKKKKKKKkK Main VOL BUZ_VOL BACKLIT BACK_LIT BEEP 4750 5 0 5 4750 5 0 5 4750 5 CLS PRINT PROMPT 1 LOCATE 2 1 PRINT PROMPT2 LOCATE 2 14 VVAIT 400 CURSOR 0 LED 4 1 0 Loop GOTO Loop VIKA ke RIK e e KIKI IIR IIR IRI IK III IIIA III III IK III IKI III IIIA III III IKI IIIB IIIA IKI III k k k kkk k k kk k Routine BerData 1 Purpose To get data from the reader port 1 and show it on the LCD Return Call CheckType BerData 1 BEEP 4750 5 LED 1 1 2 BerData GET_READER_DATA 1 GOSUB CheckType CLS PRINT BerData LOCATE 2 1 PRINT BerType RETURN V
10. OVER END IF ELSE IF LEFT HostCmd 4 TIME THEN IF MID HostCmd 5 1 AND LEN HostCmd INPUT_TIME_LENGTH THEN DATE MID HostCmd 6 6 TIME MID HostCmd 12 6 OutBuffer DONET ELSE OutBuffer DATE TIMES END IF ELSE OutBuffer NAK END IF WRITE_COM 1 OutBuffer RETURN HHHHHHHHH End of Program HHHH 105 5 3 201TEST_3 BAS VARKER IKI RIK IR KIKI KIKI IRA KI PIRI IKI FRIAR III IKI IIIA IPI IKI k k e e IK IAI III IFA I KIA k ke k k III k k k kk Program BASIC Sample Program 201TEST 3 BAS Target Machine 201 Description The terminals read data from the reader ports and send it to the master The master collects data from slaves and send it to the PC i The system time can be setup by the host PC 4 The data will be sent in a format of ppYYYYMMDDhhmmssx xX where pp is the station ID where the data is read X X is the data This program can be used for the master and the slave VERSION 201TEST 3 BAS START_DEBUG 1 1 1 2 1 IKAKKKKKKKK Constants kkkkkkkkkk BUZ_VOL 2 BACK LIT 3 PROMPT1 CipherLab 201 PROMPT2 201TEST_3 BAS INPUT_TIME_LENGTH 17 NAK NAK OVER OVER _NEXT NEXT prefixed with an underline to distinguish from the reserved keyword NEXT DONE DONE STATION_ID GET_STATION_ID KKKKKKKKKK Initialization kkkkkkkkkk SET_COM 1 3 1 2 1 COM1 9600 no parity 8 no handshake OPEN_COM 1 ON COM 1 GOSUB ParseCmd ST
11. RIGHT Ans LEN Ans 2 LogFlag C BEEP 4750 10 0 10 4750 10 MsgBuffer Communication error LogFlag D END IF GOSUB ShowMsg GOSUB SaveData RETURN IKKKKKKKKKKKKKKAKKKKKKKKKKKKKAKKEKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKEKKKKKKKKKKKKKKKKKKKKKKKKK Routine ShowMsg Purpose To show message Return Call ShowMsg IF LEN MsgBuffer gt 20 THEN LOCATE 1 1 PRINT MsgBuffer LOCATE 2 1 PRINT MID MsgBuffer 21 20 ELSE LOCATE 2 1 PRINT MsgBuffer END IF RETURN IKKKKKAKKKKKKKKAKKAKKKKKKKKKKKKKEKKKKKKKKKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKEKKKKKKKKKKKKKKKKKKKKKKKKK Routine SaveData Purpose To save data to the transaction file Return Call SaveData IF STATION_ID lt 10 THEN Data 0 STR STATION_ID DATE TIME LogFlag BerData ELSE Data STR STATION_ID DATES TIME LogFlag BerData END IF SAVE_TRANSACTION Data RETURN IKKKKKKKKKKKKKKAKKAKKKKKKKKKKEKKEKKKKAKKKKKKKKKKKKKKKKKKKKKKKKKKKAKKKKKKKKKKKKKEKKKKKKKKKKKKKKKKKKKKKKKKK Routine ResetScreen Purpose To clean the screen Return Call ResetScreen OFF TIMER 1 CLS SHOW_CALENDAR 1 1 1 RETURN VAR e IKK I KIRK IK IARI IK IARI IIIB KIKI III IKI III IKI II IIIA IIIB IIIA II IKI IK IIIA III IKI IK III III kk k k Routine ParseCmd Purpose To parse the host commands Return Call ParseCmad LOCK HostCmd READ NET IF LEFT HostCmd 4 TIME THEN IF MID H
12. THEN WRITE_COM 1 NAK RETURN END IF CmdLength LEN ComCommand Command LEFT ComCommana 1 CmdData RIGHT ComCommand LEN ComCommand 1 MMMM Add user ID JHT IF Command THEN IF CmdLength lt gt 6 THEN WRITE_COM 1 NAK ELSE IF FIND RECORD 1 1 MID CmdData 1 5 0 THEN ADD RECORDI1 CmdbData WRITE_COM 1 DONE ELSE DEL_RECORD 1 1 ADD RECORDI1 CmdbData WRITE_COM 1 DONE END IF MMMM Delete user ID JHT ELSE IF Command THEN IF CmdLength lt gt 6 THEN WRITE_COM 1 NAK ELSE IF FIND RECORDI1 1 MID CmdData 1 5 1 THEN DEL_RECORD 1 1 WRITE_COM 1 DONE ELSE WRITE_COM 1 NO MATCH END IF MMMM LIST List all user IDs HMMM ELSE IF ComCommand List THEN MOVE_TO 1 1 1 Loop_LIST Record GET_RECORD 1 1 only user s ID to be listed exclude the password Record LEFT Record 5 IF Record THEN WRITE_COM 1 VOID ELSE WRITE_COM 1 Record END IF MOVE_TO_NEXT 1 1 TempRecord GET RECORDSI1 1 only user s ID to be listed exclude the password TempRecord LEFT TempRecord 5 IF TempRecord lt gt Record THEN GOTO Loop_LIST TMM ZAN List all records ELSE IF ComCommand All THEN MOVE_TO 2 2 1 Loop_ALL Record GET_RECORD 2 2 IF Record THEN WRITE_COM 1 VOID ELSE WRITE_COM 1 Record END IF MOVE_TO_NEXT 2 2 TempRecord GET RECORDS 2 2 IF TempRecord lt gt Record THEN GOTO Loop_ALL
13. VIH Find user s record THAT ELSE IF Command THEN 118 IF CmdLength lt gt 6 THEN RITE_COM 1 NAK RETURN ELSE MOVE_TO 2 2 1 Loop_Find Record GET_RECORD 2 2 IF MID Record 15 5 CmdData THEN WRITE_COM 1 Record IF TempRecord Record THEN GOTO Next_Find TempRecord Record MOVE_TO_NEXT 2 2 GOTO Loop_Find END IF Next_Find WRITE_COM 1 OVER MMMM lt Move to previous ELSE IF ComCommand lt THEN MOVE_TO_PREVIOUS 2 1 WRITE_COM 1 DONE AL gt Move to next M MIN ELSE IF ComCommand gt THEN MOVE_TO_NEXT 2 1 WRITE_COM 1 DONE TIT Read read record ELSE IF ComCommand Read THEN Record GET_RECORD 2 1 IF Record THEN WRITE_COM 1 VOID ELSE WRITE_COM 1 Record END IF TMM Remove delete record TUM ELSE IF ComCommand Remove THEN Record GET_RECORD 2 1 IF Record THEN WRITE_COM 1 VOID ELSE DEL_RECORD 2 1 WRITE_COM 1 DONE END IF WH other commands Ni ELSE WRITE_COM 1 NAK END IF RETURN IKKKAKAKKKAKKKKAKKKKKKKKKKKKKAKKEKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKEKKKKKKKKKKKKKKKKKKK Routine ReadData Purpose To get data from the scanner port and show it on the LCD Return Errorlndex 0 successful match j 1 wrong label d 2 invalid data Call WriteToFile ClearLCD on timer 1 i ForceToLogout on timer 2 ReadData Data GET_READER_DATA 1 OFF TIMER 1 OFF TIMER 2
14. window Type the total record length for each DBF file and define the offset and length for IDX files For 720 terminal the user can choose to create DBF files on the Smart Media Card Barcode Setting Function To configure the system parameters pertaining to barcode symbologies and scanner performance Operation Click Config on the menu bar and select Barcode Setting to pop up the Barcode Setting window Check the box to enable the decodability of the target terminal to the particular barcode symbology For the description of each barcode setting please refer to the Appendix D 2 4 Compile Menu Three commands are provided on this menu 1 Syntax checking Function To check the syntax of the BASIC program Any errors found will pop up the Output window and display the relevant syntax error messages Operation Click Compile on the menu bar and select Syntax checking If there are any syntax errors in the BASIC program the system will pop up the Output window and show the line numbers and the error messages of all errors found Compile Function To compile the BASIC program If there are any syntax or compiling errors an Output window will pop up and display the error messages Operation Click Compile on the menu bar and select Compile or click the Compile icon on the tool bar If there are any syntax compiling errors in the BASIC program the system
15. 2 gZ E 2 INSTR N A 1 A2 Indicating the command INSTR is processed INT N Indicating the command INT is processed Indicating the command KEY_CLICK is processed N is the setting for KEY _CLICK N he key click sound A Z L N Indicating the line number being executed LCASE A E N1 N2 Indicating the decision IF N1 lt N2 is processed Indicating the command LED is processed N1 N2 N3 are the LED LED N1 N2 N3 settings Indicating the command LCASE is processed LEFT A Indicating the command LEFTS is processed LEN A Indicating the command LEN is processed LOCATE N1 N2 Indicating the command LOCATE is processed T NNN MAIN BATTERY MDSAS MODAN re Ne 134 ZI J gt S sz 2 E KE Indicating the command MOVE_TO is processed N1 is the number of he DBF file N2 is the number of the IDX file N3 is the record number MOVE_TO N1 N2 N3 0 move to Indicating the command MOVE_TO_NEXT is processed N1 is the MOVE_TO_NEXT N1 N2 number of the DBF file N2 is the number of the IDX file Indicating the command MOVE_TO_PREVIOUS is processed N1 is the MOVE_TO_PREVIOUS N1 N2 number of the DBF file N2 is the number of the IDX file MUL N1 N2 Indicating a multiplication is processed NEG N1 Indicating a negation is processed NEQ N1 N2 Indicating the decision IF N1 lt gt N2 is processed Z OT In
16. 510 and 520 only 1 transaction file can be used When the fixed terminals are networked the transaction data saved in the slaves will be automatically collected and saved in the master s transaction file and the original transaction data on the slaves will be erased DEL TRANSACTION DATA 201 510 520 711 720 Purpose To remove a block of transaction data from the default transaction file Syntax DEL_TRANSACTION_DATA N Remarks N is a numeric expression determining how many transaction records to be deleted and how to delete If N is a positive integer the specified number of records will be deleted from the top of the transaction file 1 i e the oldest records will be deleted If N is a negative integer the specified number of records will be deleted from the bottom of the transaction file 1 i e the latest records will be deleted Usage e PRINT Discard the latest transaction Y N Loop KeyData INKEY IF KeyData THEN GOTO Loop ELSE IF KeyData Y THEN DEL TRANSACTION DATAC 1 END IF DEL TRANSACTION DATA EX 711 720 Purpose To remove a block of transaction data from the specified transaction file Syntax DEL TRANSACTION DATA EX file N Remarks file is an integer 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 NY N is a numeric e
17. A STR N A is a string variable to be assigned with the result N is a numeric expression StationID STR GET_STATION_ID 201 510 520 711 720 To return a copy of a string in which all lowercase letters will be converted to uppercase letters A UCASE X A is a string variable to be assigned with the result X may be a string variable string expression or string constant String1 John Thomas String2 UCASE String1 String2 JOHN THOMAS 201 510 520 711 720 To return the numeric value of a string expression in long integer form A amp VAL X A amp is an integer long integer variable to be assigned with the result X is a string that is comprised of numeric characters If the first character is not numeric VAL function returns 0 The VAL function will strip leading blanks tabs and linefeeds from the argument string The return numeric value is in range of 2 147 483 648 to 2 147 483 647 33 Usage VALR Purpose Syntax Remarks Usage ON HOUR_SHARP GOSUB OnHourAlarm OnHourAlarm Hour VAL LEFT TIME 2 FOR Counter 1 TO Hour BEEP 800 50 WAIT 200 NEXT RETURN 711 720 To convert a string expression to a real number A VALR X AP is a real number variable to be assigned with the result X is a string that is comprised of numeric characters The precision of the converted result is governed by the SET_P
18. IF RIGHT Data 1 A THEN IF ScanFlag 0 THEN ScanFlag 1 BEEP 3000 10 CLS PRINT Data TempData LEFT Data LEN Data 1 PRINT Please scan B GOTO Exit ReadData ELSE IF ScanFlag 2 THEN Data LEFT Data LEN Data 1 119 IF Data TempData THEN BEEP 3000 30 CLS PRINT OK Errorlndex 0 Successful match END IF BEEP 2000 10 3000 10 2000 10 3000 10 CLS PRINT Wrong label Errorlndex 1 The labels does not match END IF ELSE IF RIGHT Data 1 B THEN IF ScanFlag 0 THEN ScanFlag 2 BEEP 3000 10 CLS PRINT Data TempData LEFT Data LEN Data 1 PRINT Please scan A GOTO Exit_ReadData ELSE IF ScanFlag 1 THEN Data LEFT Data LEN Data 1 IF Data TempData THEN BEEP 3000 30 CLS PRINT OK Errorlndex 0 Successful match END IF BEEP 2000 10 3000 10 2000 10 3000 10 CLS PRINT Wrong label Errorlndex 1 The labels does not match END IF BEEP 2000 10 3000 10 2000 10 3000 10 CLS PRINT Invalid Data Errorlndex 2 Invalid Data GOSUB VVriteToFile ON TIMER 1 200 GOSUB Clearl CD TIMER 1 2 sec ScanFlag 0 Exit_ReadData ON TIMER 2 60000 GOSUB ForceToLogout TIMER 2 10 min IKKKKKKKKKAKKKKAKKKKKKKKKKKKKKKKAKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKEKKKKKKKKKKKKKKKKKKKK Routine WriteToFile Purpose To record the User ID date time ErrorFlag and the scanned label to DBF2 R
19. N is the number of the parameter J is the value to be set to the parameter A set of parameters called barcode settings determines how the decoder will decode the barcode and magnetic card data The initial values of the barcode settings are given by the Barcode Settings Window of the BASIC compiler for details of the settings please refer to Appendix D The user can reset the values by using the READER_SETTING command in a BASIC program The following table shows the details of these parameters Value and Description No OF TT 0 Disable Code 39 Bax 1 Enable Italy Pharma code 0 Disable Italy Pharma code 1 Enable CIP 39 0 Disable CIP 39 0 Disable Industrial 25 0 Disable Interleave 25 0 Disable Matrix 25 1 Enable Codabar NW7 0 Disable Codabar NW7 0 Disable Code 93 0 Disable Code 128 0 Disable UPCE no Addon 0 Disable UPCE Addon 2 0 Disable UPCE Addon 5 0 Disable EAN8 no Addon 1 Enable EAN8 Addon 2 0 Disable EAN8 Addon 5 1 Enable EAN13 no Addon 1 Enable EAN13 Addon 2 0 Disable EAN13 Addon 5 0 Disable MSI 0 Disable Plessey Thee DT 0 Disable Code ABC 49 1 2 4 5 7 10 ti 12 13 14 15 16 17 18 19 20 21 2 1 Transmit Code 39 Start Stop Character aaae 0 DO NOT Verify Code 39 Check Character 2 1 Transmit Code 39 Check Character 0 DO NOT Traremt Code 39 Check Character 2 3 4 1 Full ASCII Code 39 0 DO NOT Transmit I
20. ON READER 1 GOSUB BerData 1 BerData 1 BEEP 2000 5 Data GET READER DATAS 1 WRITE_COM 1 Data 4 16 2 RS 485 Communications This section describes the BASIC functions and statements related to the RS 485 network The RS 485 is a multi drop communication standard which allows up to 32 stations expandable by use of repeater to be linked on the same network Each station must be assigned with a unique station ID for proper communication Only one of the stations on the network is assigned to be the bus arbitrator master while others are listeners slaves To avoid data collision only the master can start communication to the slaves and only the slave whom the master calls can respond Slaves will not respond to broadcast messages With programming in BASIC a valid station ID is a number in the range of 1 to 99 and the station with ID 1 is the master Commands READ_COM and WRITE_COM are used for the terminal to communicate with the host computer when the terminal is used in stand alone mode However when the terminals are on the RS 485 network it may be a little more involved First user has to call START NETWORK on each terminal to enable the RS 485 communications and then use different commands to exchange messages between the host computer and the terminals Commands INQUIRY GET_INQUIRY and REPLY are used for the communications between the master and the slaves Command WRITE_NET is used for the master to send messag
21. READ_NET IF Response lt gt THEN GOTO Replying NEXT retry Response Cannot find the Host Replylnq REPLY Response UNLOCK RETURN 82 START NETWORK 201 510 520 Purpose To enable the RS 485 communication Syntax START NETWORK Remarks This command must be called before the other RS 485 related commands After calling this command in a BASIC program the user can issue a set of reserved RS 232 commands from the host computer to the master to access the data of the transaction file and also adjust the system time Please refer to the section 4 20 for detailed information Usage START NETWORK STOP NETWORK 201 510 520 Purpose To disable the RS 485 communication Syntax STOP NETWORK Remarks This is the counter command of START NETWORK Usage STOP NETWORK 4 17 File Manipulation This section describes the commands relating to file manipulation 4 17 1 DAT Files There are two different types of file structures supported in CipherLab BASIC The first one is 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 a DAT file Because DAT files are usually used to store transaction data they are also referred to as Transaction files The length of the record in the transaction file is limited to 255 bytes For portable terminals 711 and 720 a BASIC program can have up to 6 transaction files For fixed terminals 201
22. card ID and barcode settings can be set up in the menus Using this powerful programming tool users can develop an application for their own needs without lengthy coding This manual is intended to provide detailed information about using the BASIC Compiler It is divided into five chapters The outline for each chapter follows Chapter 1 Development Environment gives a concise introduction about the Basic Compiler the development flow for applications and the BASIC Compiler Run time Engines Chapter 2 Using CipherLab BASIC Compiler gives a tour of the programming environment of the BASIC Compiler Chapter 3 Basics of CipherLab BASIC Language discusses the specific characteristics of the CipherLab BASIC Language Chapter 4 BASIC Commands discusses all the supported BASIC functions and statements More than 170 BASIC functions and statements are categorized according to their functions and discussed in details Chapter 5 Sample Programs contains several sample programs for readers reference Users can learn the usage of the BASIC functions and statements from these five sample programs CipherLab BASIC Compiler has been modified and improved since it first released in November 1997 Users can refer to Appendix A for version history 1 Development Environment 1 1 Disk Contents The CipherLab BASIC Compiler Kit contains two directories namely BC and DOWNLOAD The purposes contents of each
23. mode VVAIT duration 296 duration must be a positive integer that indicates the time duration to hold This argument is specified in units of 5 ms When the application is waiting for events in a loop by calling this function can dramatically reduce the power consumption PRINT CipherLab BASIC WAIT 200 The system is on hold for 1 second 62 4 11 Digital VO Commands Terminals 201 510 and 520 provide digital I Os for controlling and monitoring external devices This section describes the commands concerning the digital I Os DIGOUT 201 510 520 Purpose To set the digital ouput Syntax DIGOUT number mode duration Remarks number is a positive integer that indicates the digital output port For 201 and 510 it can be 1 or 2 For 520 it can be 1 to 4 mode may be 1 2 or 3 It indicates the digital output mode The meaning for each mode are listed below Mode Interpretation 1 Turn on the digital output for the specific duration and then go back off 2 Turn off the digital output for the specific duration and then go back on 3 Flash the I O with a specific period indefinitely The flashing period equals 2 X duration duration is an integer number which specifies the time duration in units of 10 ms A value of 0 in this argument will keep the I O state in the specific state indefinitely Usage ON READER 1 GOSUB BcrData_1 BerData 1 BEEP 2000 5 Data GET_READER_D
24. 0 VK RRA K AIK IR IIR II KARRI I IIR IIIA k kk Main VOL BUZ_VOL BACKLIT BACK_LIT BEEP 4750 5 0 5 4750 5 0 5 4750 5 CLS PRINT PROMPT1 LOCATE 2 1 PRINT PROMPT2 CURSOR 0 WAIT 400 LED 4 1 0 CLS SHOW_CALENDAR 1 1 1 BEEP 4750 5 Loop GOTO Loop IKKKKKKKKKKKKKKKKKKKKKKKKKKKKEKKEKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKEKKKKKKKKKKKKKKKKKKKKKKKKK Routine BerData 1 Purpose To get data from the reader port 1 and show it on the LCD Return Call VerifyData CleanScreen ON TIMER 1 2 sec BerData 1 OFF READER 1 OFF READER 2 CLS HIDE_CALENDAR BEEP 4750 5 LED 1 1 2 BerData GET_READER_DATA 1 LOCATE 1 1 PRINT ID BerData GOSUB VerifyData ON TIMER 1 600 GOSUB ResetScreen Junk GET_READER_DATA 1 Junk GET_READER_DATA 2 ON READER 1 GOSUB BerData 1 ON READER 2 GOSUB BerData 2 RETURN IKKKKKKKKKKKKKKKKKAKKKKKKKKKKKKKEKKKKAKKKKKKKKKKKKKKKKKKKKKKKKKKKAKKKKKKKKKKKKKEKKKKKKKKKKKKKKKKKKKKKKKKK Routine BerData 2 Purpose To get data from the reader port 2 and show it on the LCD Return Call SaveData CleanScreen ON TIMER 1 2 sec 109 BerData_2 OFF READER 1 OFF READER 2 CLS HIDE_CALENDAR BEEP 4750 5 LED 1 1 2 BerData GET_READER_DATA 2 LOCATE 1 1 PRINT ID BerData GOSUB VerifyData ON TIMER 1 600 GOSUB ResetScreen Junk GET_READER_DATA 1 Junk GET_READER_DATA 2 ON READER 1 GOSUB BerData_1 ON READER 2 GOSUB BerData 2 RETURN
25. 2 2 56 1 icon_3 2 3 56 1 icon_4 show_image 2 4 56 1 icon 5 shovy image shovy image shovy image shovy image shovy image shovy image 2 5 56 1 icon 6 2 6 56 1 icon 7 2 7 56 1 icon 8 2 8 56 1 icon 9 2 9 56 1 icon 10 2 10 56 1 icon 11 2 11 56 1 icon 12 2 12 56 1 icon_13 2 13 56 1 icon_14 2 14 56 1 icon_15 2 15 56 1 icon_16 show_image show_image show_image show_image show_image show_image show_image show_image show_image E nnn nnn SN were 74 4 15 Battery Commands This section describes the commands dealing with battery power BACKUP_BATTERY Purpose Syntax Remarks Usage MAIN_BATTERY Purpose Syntax Remarks Usage 711 720 To get the voltage level of the backup battery A BACKUP_BATTERY A is an integer variable to be assigned with the voltage level of the backup battery The voltage level of the backup battery is returned in units of mili volt mV The backup battery is used to backup the SRAM and keep the calendar chip running even when the system power is off The backup battery would be considered as Battery Low when the BACKUP_BATTERY is lower than 2900 mV That means the SRAM and calendar chip may lose their data at any time thereafter if the battery is not recharged or replaced CheckBackupBattery IF BACKUP_BATTERY lt BATTERY_L
26. JP shx Japanese version BC711 SC shx BC720 SC shx Simplified Chinese font size 16x16 BC711 SD shx BC720 SD shx Simplified Chinese font size 12x12 BC711 TC shx BC720 TC shx Traditional Chinese version e Font Files for 520 FN520 sc shx Simplified Chinese font size 16x16 FN520 tc shx Traditional Chinese font size 16x16 e Font Files for 711 720 Font jp shx Kanji font Font sc shx Simplified Chinese font size 16x16 Font sd shx Simplified Chinese font size 12x12 Font tc shx Traditional Chinese font size 16x16 To set up the BASIC programming environment on your PC simply copy these two mentioned directories from the CD ROM to the local hard disk 1 2 System Requirements Before you install CipherLab BASIC Compiler please make sure that your PC meets the minimum requirements The minimum requirements are listed below CPU Pentium 75MHz Operating System Windows 95 Minimum RAM 16 MB Minimum Hard Disk Space 20 MB Please Note Any terminal being programmed will need to have a minimum 128KB Ram 1 3 Development Flow Developing a BASIC program for the CipherLab terminal is as simple as counting 12 3 There are three steps e Step 1 download the BASIC Run time Engine to the target terminal e Step 2 edit and compile the BASIC program e Step 3 download the BASIC object file to the target terminal 1 3 1 Download Run time Engine The BASIC Run time Eng
27. SEND_WEDGE function will always transmit alphabets without adding shift key To set Ignore Alphabets Case add 32 to the value of the second element of WedgeSetting Wedge_2 4 8 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 Also if the user chooses to send digits using numeric keypad then this setting is meaningless To set Lower Position add 16 to the value of the second element of WedgeSetting Wedge_2 To set Upper Position add 24 to the value of the second element of WedgeSetting Wedge_2 Do not set this setting unless the user is sure about the selection 54 4 8 7 Shift Capital Lock Keyboard This setting can force the SEND_WEDGE function 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 language PS2 30 PS55 or Memorex Telex To set Capital Lock add 4 to the value of the second element of WedgeSetting Wedge_2 To set Shift Lock add 6 to the value of the second element of WedgeSetting VVedge 2 Do not set this setting unless the user is
28. String1 is leaded by B ELSE PRINT String1 is not leaded by A nor B END IF ON GOTO Purpose Syntax Remarks Usage ON GOSUB Purpose Syntax Remarks Usage 201 510 520 711 720 Branches to one of several specified LineLabels depending on the value of an expression ON N GOTO LineLabel LineLabel 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 If the value of N is 0 or greater than the number of line labels listed the interpreter will continue with the next executable statement LineLabef is the label of a line to branch to PRINT Input a number 1 9 INPUT Num CLS ON Num GOTO 100 100 100 200 200 300 400 400 400 100 PRINT Number 1 3 is inputed GOTO 500 200 PRINT Number 4 5 is inputed GOTO 500 300 PRINT 6 is inputed GOTO 500 400 PRINT Number 7 9 is inputed 500 201 510 520 711 720 Call one of the several specified subroutines depending on the value of the expression ON N GOSUB SubLabel SubLabelj N is a numeric expression that is rounded to an integer The value of N determines which subroutine to be called If the value of Nis 0 or greater than the number of routines listed the interpreter will continue with the next executable statement SubLabef is the label or name of a subroutine to be called PRINT Inp
29. are not transmitted 41 1 Transmit Plessey Check Characters NIH transmit Pessey Check Characters 0 No Conversion 0 No Conversion 0 No Conversion 0 No Conversion 50 46 47 2 2 3 1 Enable ISSN Conversion 0 No Conversion 1 Transmit UPCE Check Digit 0 DO NOT Transmit UPCE Check Digit 1 Transmit UPCA Check Digit 0 DO NOT Transmit UPCA Check Digit 1 Transmit EAN8 Check Digit 0 DO NOT Transmit EAN8 Check Digit 1 Transmit EAN13 Check Digit 0 DO NOT Transmit EAN13 Check Digit 1 Transmit UPCE System Number 0 DO NOT Transmit UPCE System Number 1 Transmit UPCA System Number 0 DO NOT Transmit UPCA System Number 1 Convert EAN8 to EAN13 0 No Conversion 1 Transmit Code ABC Concatenation Characters 0 DO NOT Transmit Code ABC Concatenation Characters Enable Reversed Barcode Disable Reversed Barcode 0 No Read Redundancy for Scanner Port 1 1 One Time Read Redundancy for Scanner Port 1 2 Two Times Read Redundancy for Scanner Port 1 3 Three Times Read Redundancy for Scanner Port 1 0 No Read Redundancy for Scanner Port 2 1 One Time Read Redundancy for Scanner Port 2 2 Two Times Read Redundancy for Scanner Port 2 3 Three Times Read Redundancy for Scanner Port 2 1 Industrial 25 Code Length Limitation in Max Min Length Format 0 Industrial 25 Code Length Limitation in Fix Length Format ndustrial 25 Max Code Length Fixed Length 1 ndustrial 25 Min Code Len
30. define the ID of the master setup card Operation Click Config on the menu bar and select Master Card ID to pop up the Master Card ID window and then type the new card ID in the field This feature is only valid for fixed terminals 201 510 520 Primary COM Port Setting Function To set the properties of the primary COM port Operation Click Config on the menu bar and select Primary COM Port Setting to pop up the Primary COM Port Properties window Then select the desired settings for each property Secondary COM Port Setting Function To set the properties of the secondary COM port Operation Click Config on the menu bar and select Secondary COM Port Setting to pop up the Secondary COM Port Properties window Then select the desired settings for each property 5 Config Transaction Files Function To define how many transaction files to be used and to define the data length for each transaction file Operation Click Config on the menu bar and select Config Transaction Files to pop up the Config Transaction Files window Check the boxes to enable the use of the transaction file and type the data length for each enabled transaction file Create DBF Files Function To define the DBF files to be used and to define IDX files for each DBF file Operation Click Config on the menu bar and select Create DBF Files to pop up the Create DBF Files
31. expression in the range of 0 to 255 Usage A CHR 65 U A A HEX 201 510 520 711 720 Purpose Returns a string which represents the hexadecimal value base 16 of the decimal argument Syntax A HEX N Remarks A is a string variable to be assigned with the result N is a numeric expression in the range 0 to 2 147 483 647 N is rounded to an integer before HEX N is evaluated Usage A HEX 140 A 8C LCASE 201 510 520 711 720 Purpose To return a copy of a string in which all uppercase letters will be converted to lowercase letters Syntax A LCASE X Remarks A is a string variable to be assigned with the result X may be a string variable string expression or string constant Usage String1 John Thomas String2 LCASE String1 String2 john thomas 32 OC TS Purpose Syntax Remarks Remarks Usage UCASE Purpose Syntax Remarks Usage VAL Purpose Syntax Remarks 201 510 520 711 720 To convert a decimal numeric expression to a string that represent the value of the numeric expression in octal notation A OCT N AS is a string variable to be assigned with the result N is a numeric expression in the range 0 to 2 147 483 647 N is rounded to an integer before OCT N is evaluated A OCT 24 A 30 201 510 520 711 720 To convert a numeric expression to a string
32. files and each of them is identified by its key index number The valid key numbers are from 1 to 3 The length of the record in the DBF file is limited to 255 bytes 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 the specific data record in the IDX file ADD_RECORD 201 510 520 711 720 Purpose To add a record to the specified DBF file Syntax ADD_RECORD file data Remarks file is an integer in the range of 1 to 3 1 to 5 for 7xx indicating which DBF file to be accessed data is a character string which the user intends to add to the specified DBF file Usage ON COM 1 GOSUB HostCommand HostCommand Cmd READ_COM 1 Cmaldentifier LEFT Cmd 1 DBFNum VAL MID Cmd 2 1 CardID RIGHT Cmd LEN Cmd 2 IF Cmdldentifier THEN ADD_RECORD DBFNum CardID ELSE 89 DEL_RECORD Purpose Syntax Remarks Usage EMPTY FILE Purpose Syntax Remarks Usage 201 510 520 711 720 To delete the record pointed by the file pointer in the specified DBF file DEL_RECORD file index file is an integer in the range of 1 to 3 1 to 5 for 7xx indicating which DBF file to be accessed index is an integer in the range of 1 to 3 indicatin
33. manufacturing date kernel version library version and information of the user s application program 2 Using CipherLab BASIC Compiler 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 There are five menus on the menu bar i e File Edit Config Compile and Help and each menu provides several commands items This chapter discusses the function and operation for each command item 2 1 File Menu Six commands are provided on this menu 1 New Function To create a new BASIC program Operation Click File on the menu bar and select New or type Ctrl Nj or click the Nevv icon on the tool bar Open Function To open an existing BASIC program Operation Click File on the menu bar and select Open or type 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 or type Ctrl S or click the Save icon on the tool bar Save As Function To save the current editing BASIC program with a new name Operation Click File on the menu bar and select Save As to pop up the Save As window Enter a new file name and click Save button to save this program with the new file nam
34. once the switch is triggered The scanning continues until a preset scanning Time Out period is expired Unlike the Auto Off mode the scanner will continue to scan and the scanning period is re counted whenever there is a successful read 127 e Alternate Mode The scanner will start scanning once the switch is triggered The scanner will continue scanning until the switch is triggered again e Momentary Mode The scanner will be scanning as long as the switch is pressed e Repeat Mode The scanner is always scanning just like Continuous Mode But in this mode the switch acts like a re transmit button If the switch is triggered within 1 second after a good read the same data will be transmitted again without actually reading the barcode This re transmit button can be triggered as many times as the user desires as long as the time between each triggering does not exceed 1 second This scan mode is most useful when the same barcode is to be read many times e Laser Mode This is the scan mode used most often on laser scanners The scanner will start scanning once the switch is pressed The scanning goes on until either a barcode is read or the switch is released e Test Mode The scanner is always scanning and will decode repeatedly even with the same barcode e Aiming Mode By selecting this mode the user needs to trigger twice to decode That is the first trigger is for aiming only while the second trigger will truly
35. read a transaction record from the default transaction file Syntax A GET TRANSACTION DATAR N Remarks A is a string variable to be assigned with the transaction data N26 is a numeric expression indicating the ordinal number of the record to be read from the first transaction file Usage tag WHILE TRANSACTION_COUNT gt 0 TransactionData GET TRANSACTION DATA WRITE_COM 1 TransactionData DEL_TRANSACTION_DATA 1 WEND GET_TRANSACTION_DATA_EX 711 720 Purpose To read a transaction record from the specified transaction file Syntax A GET TRANSACTION DATA EX file N Remarks A is a string variable to be assigned with the transaction data file26 is an integer in the range of 1 to 6 indicating which transaction file to access The command GET_TRANSACTION_DATA_EX 1 works the same as the command GET TRANSACTION DATAS N26 is a numeric expression indicating the ordinal number of the record to be read from the first transaction file Usage ja WHILE TRANSACTION_COUNT gt 0 TransactionData GET_TRANSACTION_DATA_EX TransFile WRITE_COM 1 TransactionData DEL_TRANSACTION_DATA_EX TransFile 1 WEND SAVE_TRANSACTION 201 510 520 711 720 Purpose To save append a transaction record to the default transaction file Syntax SAVE TRANSACTION data Remarks data is a string to be saved in the first default transaction file Usage ON READER 1 GOSUB BerData 1 BerData 1 Dat
36. 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 Usage FILL_RECT 1 1 20 20 LOCATE 201 510 520 711 720 Purpose To move the cursor to the specified position on the LCD Syntax LOCATE row col Remarks row is the new row position of the cursor col is the new column position of the cursor Usage LOCATE 1 1 Move cursor to the top left of the LCD PRINT 201 510 520 711 720 Purpose To display data on the LCD display Syntax PRINT expression expression Remarks expression may be numeric or string expression 72 Usage SELECT_FONT Purpose Syntax Remarks Usage SET VIDEO MODE Purpose Syntax Remarks Usage SHOW IMAGE Purpose Syntax Remarks The position of each printed item is determined by the punctuation used to separate the items in the list In the list of expression a comma causes the next character to be printed after the last character vvith a blank space A semicolon causes the next character to be printed immediately after the last value F the list of expressions terminates without a comma or a semicolon a carriage return is printed at the end of the line LOCATE 1 1 PRINT STRING 20 clear whole li
37. the string to be assigned to DATE The user has the responsibility to check the format and contents Usage DATE 20000103 Today DATE PRINT Today Today 20000103 DAY_OF_WEEK 520 711 720 Purpose To get the day of the week Syntax A DAY OF WEEK Remarks A is an integer variable to be assigned with the result A value of 1 to 7 represents Monday to Sunday respectively Usage 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 Wednesday RETURN HIDE_CALENDAR Purpose Syntax Remarks Usage SHOW_CALENDAR Purpose Syntax Remarks Usage 201 510 520 To hide the calendar which is displayed on the LCD by the SHOW_CALENDAR command HIDE_CALENDAR This is the opposite of the SHOW_CALENDAR command SHOW_CALENDAR 1 1 1 ON READER 1 GOSUB BerData_1 Ber Data 1 HIDE CALENDAR BEEP 2000 5 Data GET READER DATASI1 PRINT Data 201 510 520 To show the calendar on the LCD SHOW_CALENDAR mode y_pos x_pos mode may be 1 2 or 3 It defines the format of the calendar to be shown 1 yyyy mm dd hh mm ss 2 mm dd yyyy hh mm ss 3 dd mm yyyy hh mm ss y_pos is an integer which indicates the row number where the calendar to be displayed x_pos is an integer which indicates the column number where the calendar to be displayed SHOW_CALENDAR
38. zarr AE EAE are lea ina dodhur cee kt d lume ANE aa hedhi oo 64 4 13 Keyboard Commands ki nana ane seen eee eee eee eee eee eee eee eee eee eee eee 66 414 LOD Commands nia ase sesi de sd 70 4 14 1 Graphic Display s Store za ceteris son Cent eee hene ndi ede 70 4 14 2 Special Fonts Files asist duk aa EST si sh sek Ri 70 4 15 Battery Commands icles nai RE Aa des kd st NR byte dh os 75 4 19 Gommunication POMS kani sd cati iranian dr d sh THER Hae 76 4 16 1 RS 232 Communication S aaa aaa aaa neneve ipen ee eee eee eee ENO eee eee ever 76 4 16 2 RS 485 Communications aaa geio nanen eee eee epte eee eee 80 AAT File Manipulalion s den inde ini tat eee dt eee tina 84 4 17 1 DAT Files 5220299522 vedit edi de de dd dd de de dd rnz 84 4 17 2 DBF Fil s and IDX FiloS i rinin ibe haa teed away de it ave hene ht 89 4 17 3 Error GOd 2 iis once ein dm e t nd TEE A 95 4 18 MEMON nse i THT de de ee 96 4 19 Debug Commands eesin vin koblst hot lume A dhan ut Pio kk dame olen od ected 97 4 20 Reserved Host Commands aa aaa aaa nana ae ieena e e ee eee eee reze eee eee ere 99 5 Sample Programs au idea ie suedi vendase dd derdhe dr a N A eaa AEN e 102 oT 201TEST AL BAS scsi ete eae dd 102 52 LOTES ue BAS i AE e geal aa dea Gases AEN 104 SS E AEE A N AREER 106 5 4 STOAC TOO BAS katin p suar she shtese die v ne teeta gh eee e ara eTa 108 55 LAM AOO BA TT 114 Appendix Ac Version lt a LT 121 Appendix B Flash Writer serein Pipi
39. 0 UPDATE_RECODE 93 UPDATE_TRANSACTION 88 UPDATE_TRANSACTION_EX 88 V VAL 33 34 variables 13 VERSION 46 VOL 59 W WAIT 62 Wedge Setting 53 Alphabets Case 54 Capital Lock Auto Detection 54 Capital Lock Status 54 Digit Transmission 55 Digits Position 54 Inter Character Delay 55 KBD Terminal Type 53 Shift Capital Lock Keyboard 55 WHILE WNED 28 WRITE_COM 79 80
40. 1 1 1 ON READER 1 GOSUB BerData_1 Ber Data 1 HIDE CALENDAR BEEP 2000 5 Data GET READER DATASI1 PRINT Data 61 TIMES Purpose Syntax Remarks Usage TIMER Purpose Syntax Remarks Usage WAIT Purpose Syntax Remarks Usage 201 510 520 711 720 To set or get the current time TIME X To set the current time Y TIME To get the current time X is in the form of Ahmmss Y is a valid string variable The BASIC Compiler and its Run time Engines do not check the format and contents of the string to be assigned to TIME The user has the responsibility to check the format and contents CurrentTime TIME assign the current time to CurrentTime TIME 112500 set the system time to 11 25 00 201 510 520 711 720 To return the number of seconds since the terminal is powered on A amp TIMER A8 is a long integer variable to be assigned with the result TIMER is a read only function The system timer cannot be set by using the TIMER function StartTime amp TIMER Loop IF EndTime amp lt gt TIMER THEN EndTime amp TIMER TimerElapsed amp EndTime amp StartTime amp CLS PRINT TimerElapsed amp IF TimerElapsed amp gt 100 THEN GOTO NextStep END IF GOTO Loop NextStep 201 510 520 711 720 To put the system on hold for the specified time duration During this period the system will be running in a special low power consumption
41. 10 520 711 720 Purpose To move the file pointer with respect to the specified DBF and IDX to the specified position Syntax MOVE_TO file index record_number Remarks file is an integer in the range of 1 to 3 1 to 5 for 7xx indicating which DBF file to be accessed index is an integer in the range of 1 to 3 indicating which IDX file to be accessed If it is not specified then the default IDX file which keeps the original data sequence will be used record_number is a positive integer indicating the ordinal number of the record where the file pointer is moved to 92 Usage MOVE_TO_NEXT MOVE TOI 1 20 201 510 520 711 720 Purpose To move the file pointer one record forward with respect to the specified DBF and IDX Syntax MOVE TO NEXT file I index Remarks file is an integer in the range of 1 to 3 1 to 5 for 7xx indicating which DBF file to be accessed index is an integer in the range of 1 to 3 indicating which IDX file to be accessed If it is not specified then the default IDX file which keeps the original data sequence will be used Usage MOVE_TO_NEXT 1 1 MOVE_TO_PREVIOUS 201 510 520 711 720 Purpose To move the file pointer one record backward with respect to the specified DBF and IDX Syntax MOVE TO PREVIOUS file T index Remarks file is an integer in the range of 1 to 3 1 to 5 for 7xx indicating which DBF file to be accessed index is an int
42. 13 B 2 2 _ Array Vanables sesh ee eden ee Le nt tee et ee 13 3 3 Expression and Operators aaa aaa aaa ne eee eee eee eee A eee eee eee eee eee 14 3 3 1 AsSsignment Op ratorsiii sis st dd se 14 e Aritihmetic OPShator seri sa bandes t n epsh e ha ea bn pine ia dhena ibn 14 3 3 3 Relational Operator 2 NSN STR nenen eee eee nene eee eee eee ee eee eee 14 3 3 4 1LogicaliOperalori sessasscottisiscosesii ses shn esse c bn 15 34 Operator Precedent as air sido dd hodh ho 16 3 5 Labels atu e e e tt e 17 30 Rc seoueesdscupergatcccned septeretscoteesdtcctersateos 18 Sof ProgramMinG Style iiss ties 2A oea eA hon adm Mie ben na ide fies 19 4 BASIC Commands sai an vii mi ses desht ne dee rete eee e e deve eee ene FS 20 4 1 General ComMandS aaia erinrar reann AAEE e EAEE b sh 21 4 2 Commands for Decision Structures sese eee eee e e e 24 4 3 Commands for Looping Structures aaa aaa ins nn i EE iken er z eee eee eee S942419 ere 27 4 4 Commands for String Processing aaa anen ee 29 4 4 1 Combining Strings esrar ae tii edie e O ieee 29 442 Gomparihg StrinGS s eci scstotsssosshen sidhe d bohet 29 44 3 Getting the Length of a Sing sees eee eee ne eee eee eee eee eper eee 29 44 4 Searching tor Strings ac nude ek i je e iaa 30 4 4 5 Retrieving Part Of Strings nana aaa nanen even ee eee ee eee netet veren eee 30 4 4 6 Converting for Strings aisis iite nene ee eee rreze eee eee TATEA NEATE n E 32 44 7 Creating Strings of Repeating
43. 520 Purpose To activate the DIGIN Event Trigger which executes a specific subroutine when a digital input changes its state Syntax ON DIGIN number GOSUB SubLabel Remarks number is a positive integer indicates the digital input port For 201 and 510 it can be 1 or 2 For 520 it can be from 1 to 4 SubLabel is the name or line label of the subroutine to be called when the event is triggered Usage Si ON DIGIN 1 GOSUB DI 1 DI 1 CLS PRINT DI 1 is changed OFF DIGIN 1 RETURN ON ESC GOSUB 201 510 520 711 720 Purpose To activate the ESC Event Trigger which executes a specific subroutine when the key ESC is pressed Syntax ON ESC GOSUB SubLabel Remarks SubLabel is the name or line label of the subroutine to be called when the event is triggered Usage ON ESC GOSUB Key_Esc Key_Esc OFF ESC ON ESC GOSUB Key_Esc RETURN ON HOUR_SHARP GOSUB 201 510 520 711 720 Purpose To activate the HOUR_SHARP Event Trigger which executes a specific subroutine when the system time is on the hour Syntax ON HOUR SHARP GOSUB SubLabel Remarks SubLabel is the name or line label of the subroutine to be called when the event is triggered Usage 1 ON HOUR_SHARP GOSUB OnHourAlarm OnHourAlarm CurrentTime TIME Hour VAL LEFT CurrentTime 2 FOR 1 TO Hour BEEP 800 10 0 10 WAIT 100 NEXT RETURN ON ENQUIRY GOSUB 201 510 520 Purpose To activate the INQUIRY Event Trigger whi
44. ACKUP_BATTERY New RAM_SIZE New ROM_SIZE New FREE_MEMORY New CODE_TYPE New DAY_OF_WEEK 10 Ver 1 31 Jul 14 1999 Modified If no index file is created for a DBF file the related settings such as Offset and Key Length will be set to 0 11 Ver 1 32 Aug 14 1999 New SET_COM_TYPE ComPort Type 121 12 Ver 1 33 Sep 07 1999 e New SET_WEDGE Parameter e New SEND VVEDGE Data 13 Ver 1 34 Oct 15 1999 e New Selection of Target Machine is added e New Communication baud rate is up to 115200 bps for 520 and 7xx terminals 14 Ver 1 40 Nov 02 1999 e Modified Supports up to 5 DBF files and up to 3 IDX files for each DBF file 15 Ver 1 50 Dec 03 1999 e Modified Supports up to 6 transaction files for 7xx terminals e New UPDATE_RECORD_EX File Index Data e New UPDATE_TRANSACTION_EX File Record Data e New SAVE_TRANSACTION_EX File Data e New GET_TRANSACTION_DATA_EX File Record e New EMPTY_TRANSACTION_EX File e New DEL_TRANSACTION_DATA_EX File Record e New TRANSACTION_COUNT_EX File 16 Ver 1 53 Jan 07 2000 e New Supports new scan mode Aiming Mode 17 Ver 1 54 Jan 14 2000 e New SMC_SIZE e New SMC_FREE_MEMORY 18 Ver 1 55 Feb 01 2000 e Modified A compilation bug is fixed 19 Ver 1 60 Feb 18 2000 e New ALPHA LOCK e New GET ALPHA LOCK e New SHIFT LOCK e New GET SHIFT LOCK e New KEY CLICK e New FILL RECT e New CLR_RECT e Ne
45. AR K IRR I KARRI IR IIIA IBAA II III KIKI III IKI III III IIIA IBIAS II III III III III III IRI kkk Routine BcrData 2 Purpose To get data from the reader port 2 and show it on the LCD Return Call CheckType BcrData 2 BEEP 4750 5 LED 1 1 2 BerData GET READER DATAS 2 GOSUB CheckType 102 CLS PRINT BerData LOCATE 2 1 PRINT BerType RETURN VIKA Ae e KIRK IKI IIIA IIIA III IIIB III IKI III III III IK IIIA III IK k e ke ke ke k III III III III IRE Routine CheckType Purpose To check the type of the barcode Return BerType Call CheckType IF CODE_TYPE A THEN BerType Code 39 ELSE IF CODE_TYPE B THEN BerType Italy Pharma code ELSE IF CODE TYPE C THEN BerType CIP 39 ELSE IF CODE TYPE D THEN BerType Industrial 25 ELSE IF CODE TYPE E THEN BerType Interleave 25 ELSE IF CODE TYPE F THEN BerType Matrix 25 ELSE IF CODE TYPE G THEN BerType Codabar NW7 ELSE IF CODE TYPE H THEN BerType Code 93 ELSE IF CODE TYPE P THEN BerType Code 128 ELSE IF CODE_TYPE J THEN BerType UPCE no Addon ELSE IF CODE TYPE K THEN BerType UPCE w Addon 2 ELSE IF CODE_TYPE L THEN BerType UPCE w Addon 5 ELSE IF CODE TYPE M THEN BerType EAN8 no Addon ELSE IF CODE TYPE N THEN BerType EAN8 w Addon 2 ELSE IF CODE_TYPE O
46. ART NETWORK ENABLE READER 1 ENABLE READER 2 ON READER 1 GOSUB BerData 1 ON READER 2 GOSUB BerData 2 Junk GET_READER_DATA 1 Junk GET READER DATAS 2 IKKKKKAKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Main VOL BUZ_VOL BACKLIT BACK_LIT BEEP 4750 5 0 5 4750 5 0 5 4750 5 CLS PRINT PROMPT1 LOCATE 2 1 PRINT PROMPT2 LOCATE 2 14 WAIT 400 CURSOR 0 LED 4 1 0 CLS SHOW_CALENDAR 1 1 1 BEEP 4750 5 IF STATION_ID 1 AND TRANSACTION_COUNT gt 0 THEN OutBuffer GET_TRANSACTION_DATA 1 DEL_TRANSACTION_DATA 1 WRITE_COM 1 OutBuffer END IF GOTO Loop VK KK IK RIKI KIKI IIR IIR IIIA IIIA III IIR IIIB KIA III IK III IKI III IK IIIA IKI III III III k k kkk kk kk Routine BerData 1 Purpose To get data from the reader port 1 and show it on the LCD Return Call SaveData i CleanScreen ON TIMER 1 2 sec BcrData_1 OFF TIMER 1 BEEP 4750 5 LED 1 1 2 BerData GET READER DATAS 1 LOCATE 2 1 106 PRINT LOCATE 2 1 PRINT Data BerData GOSUB SaveData ON TIMER 1 200 GOSUB CleanScreen RETURN VIR K IKI I KAR KIRA IIR IIR IRI ke IKI IIIA III FRIAR IIIA III IKI IKI IKI III IIR II III III III III k kkk k IK kk kk kk Routine BerData_2 Purpose To get data from the reader port 2 and show it on the LCD Return Call SaveData i CleanScreen ON TIMER 1 2 sec BcrData_2 OFF TIMER 1 BEEP 4750 5 LED 1 1 2 BerData GET READER DATAS 2 LOCATE 2 1 PRINT LOCATE 2 1 PRINT Da
47. ATA 1 IF FIND RECORD 1 1 Data THEN DIGOUT 1 1 100 ELSE PRINT Invalid Card ID END IF GET_DIGIN 201 510 520 Purpose To read the digital input state Syntax A GET_DIGIN number Remarks number is a positive integer indicates the digital input port For 201 and 510 it can be 1 or 2 For 520 it can be 1 to 4 The current state of the specified digital input port 0 Low or 1 High will be returned Usage IF GET_DIGIN 1 THEN PRINT Digital Input 1 is High 63 4 12 LED Command Terminals 201 510 520 711 and 720 provide different numbers of LEDs which can be used to show the system status This section describes the command concerining the LEDs LED Purpose Syntax Remarks 201 510 520 711 720 To set the LEDs LED number mode duration number is a positive integer indicates the LED number Number of LEDs provided depends on the type of the terminal 201 GOOD READ Green GOOD READ Green POWER Red 2 4 510 i 520 i H RR Co paa 711 720 Red LED Usage mode may be 1 2 or 3 It indicates the digital output mode The values of the mode and their interpretation are listed below Mode Interpretation Turn on the LED for the specific duration and then go back off Turn off the LED for the specific duration and then go back on 3 Flash the LED with a specific period indefinitely The flashing period equals 2Xdura
48. Characters eee ee e e 34 4 5 Commands for Event TAPPING serran ieren nsara eee eneve e eee eee eee veze eee eee eee ere 35 4 5 1 e RE 35 45 2 Lockand UNIOCK ana vu vesin e e ee 44 4 6 System Commands arcessere ia CLR T NCE eee eee A TRO eee ee eee eee Car 45 AT Reader GoOmmands si zi mis ndoqi abcess ndoshta pee ena eek v dd ta PEE shes dh 47 4 8 Keyboard Wedge Commands c ececceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeaeeeeeeeaeeeeeeeaaeeeseneees 53 4 8 1 Definition of the WedgeSetting array eee ee e e 53 4 8 2 KBD Terminal Ty pe TTT 53 4 8 3 Capital Lock Auto Detection aaa cece cents cece eee einer enha Xa A Y eee Bd 4 8 4 Capital Lock Status Setting aaa eee e e 54 4 8 5 Alphabets Case ices ceded vdes se aes sce bone K pet wed eed eda ae daa Led dans fea een eee 54 4 8 6 DigitsiPosilion nudos dd dd de dd ed 54 4 8 7 Shift Capital Lock Keyboard ina eee eee 55 4 8 8 Digit TransmisSSi ON aaa nn eee eee eee eee peer eee eee eee eee tee eee 55 4 8 9 Inter Character Delay nana aaa ananas eee neve neve vene ve vere ee teren ee veren 55 4 8 10 Composition of Output String aaa aaa akr e eee EEE AA eee eee 55 4 8 11 Special Note on DEC VT220 320 420 for 201 only aaa aaa ee ananasi 56 AiO BUZZO suren sr kod ht da ne de A INR 58 4 10 Calendar and Timer Commands sss essere eee e eee enen eee eee eee eee eee eee eee eee 60 411 Digital VO Commands aaa aaa aaa rs saya CS 02 ee eee eee eee eee NAO eee eee eee 63 4 12 gt LEDs GOommana
49. CipherLab BASIC Compiler User s Manual Ver 2 02 Copyright 2000 Syntech Information Co Ltd CIPHER SYNTECH INFORMATION CO LTD Head Office 8F No 210 Ta Tung Rd Sec 3 Hsi Chih Taipei Hsien Taiwan Tel 886 2 2643 8866 Fax 886 2 2643 8800 e mail support cipherlab com tw http www cipherlab com tw TABLE OF CONTENTS S T iv 1 Development ENvironmeN aaa aaa nanen nenen T a ipen enet eee tehe 1 1 1 DEK CONOIS ss nn hh hd sho 1 122 System R quirements sime ca nan kush kie bute a me lige t e eme dd Pt entice 2 1 98 Development FIOW cero qart si a te qty e ee 3 1 3 1 Download Run time Engine sss ss sse sese sese ee ereenn 3 1 3 2 Edit and Compile the BASIC PrOGTAM u sese eee 4 1 3 3 Download the BASIC Object Files sese eee eee eee 4 1 4 BASIC Run time Engine TTT 5 2 Using CipherLab BASIC Compiler sese ee ee ee ee e ee eee 8 2 1 PilS IM Oise fic 225 tanec faatee sea taceeed lead de ces ni ei 8 2 2 Edit MENU vinin edeme eee a neve e i adet 8 2 3 do oh deed debe ethene eee dean hearted 9 24 Compile MARU pasonin ish i bn L Eo he eni 10 2 5 Help Mecenes de Sen hd dh jr dt vent A Ve 11 3 Basics of CipherLab BASIC Language aaa aaa nana e 12 Bedi SE 12 3 1 1 SUING sd vie vi tel eee i bene ete Dna ie i eee 12 Sule NUMONIC sm Sortie he cebu cuba accteeeen at T E ys sibemesteee EE T E 12 Bis WANMADIOS ed se NDA the ied ates ue ed ho en hh devs 13 3 2 1 Variable Names and Declaration Characters eee eee
50. EN_COM 1 ON COM 1 GOSUB HostCmd ENABLE READER 1 Junk GET_READER_DATA 1 IKKKKKAKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Main BACKLIT BACK_LIT BEEP 2000 20 0 10 2000 10 0 10 2000 10 LOCATE 1 6 PRINT PROMPT1 LOCATE 2 4 PRINT PROMPT2 WAIT 400 CURSOR 0 114 IF LoginFlag 1 THEN END IF OFF KEY 1 ON KEY 2 GOSUB Logout ON KEY 3 GOSUB ChgPasswd ON READER 1 GOSUB ReadData OFF READER 1 OFF KEY 2 OFF KEY 3 ON KEY 1 GOSUB Login Junk INKEY Junk GET_READER_DATA 1 GOTO Loop VIR e IKK I KARRI IKR KIKI IK IR KIA IIIA III III IIR IIIB RII III III KIKI III IK e k e ke ke k III III KIKI kk k k kk k Routine Login Purpose To log in a new user Return LoginFlag 1 login succeeds 0 login fails Errorindex A login succeeds B login fails invalid password C login fails invalid ID Call ClearLCD on timer 1 ForceToLogout on timer 2 WriteToFile VIKA ke RIK IR KIKI KIKI e e IRI II IIIA III III III IK III IKI III IKI IIIB IKI I IIIA III III IIIA III III III IRE Login BEEP 3000 10 0 10 3000 10 OFF TIMER 1 CLS LOCATE 1 1 PRINT User ID INPUT_MODE 1 INPUT UserlD IF FIND_RECORD 1 1 UserlD 1 THEN Loop_Login Login_Succeed END IF LOCK User GET_RECORD 1 1 UNLOCK UserPasswd MID User 6 6 IF UserPassvvd THEN GOTO Login_Succeed BEEP 3000 10 0 10 3000 10 LOCATE 2 1 PRINT Password INPUT_MODE 2 INPU
51. ER 1 and or READER 2 event On the other hand since LOCK is not called in BcrData_2 any new coming READER 1 and READER 2 event will interrupt the ongoing BcrData_2 and therefore may affect the expected results UNLOCK 201 510 520 711 720 Purpose To release all activated event triggers held by the LOCK command Syntax UNLOCK Remarks Usage Please refer to command LOCK 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 CHANGE_SPEED 711 720 Purpose To change the CPU running speed Syntax CHANGE SPEED NS6 Remarks N is a numeric expression in the range of 1 to 5 N 1 1 16 speed N 2 1 8 speed N 3 Quarter speed N 4 Half speed N 5 Full speed When the system is not heavy loaded such as waiting for data input it is suggested to change the CPU running speed to a lower speed to reduce the power consumption Usage CHANGE_SPEED 3 DEVICE_ID 711 720 Purpose To get the serial number of the terminal Syntax A DEVICE_ID Remarks A is a string variable to be assigned with the result A string of the terminal s serial number will be returned Usage PRINT S N DEVICE_ID GET_STATION_ID 201 510 520 Purpose To get the station ID of the target terminal Syntax A GET_STATION_ID Remarks AYo is an integer variable to be assigned with the station ID of the terminal U
52. ET READER DATAS 2 HIDE CALENDAR CLS PRINT Data BerData GOSUB SaveData ON TIMER 1 200 GOSUB Show Timer RETURN IKKKKKKKKKEKKKKKKKKKKKKKKKKKKAKKKKKKKKKKKKKEKKKKAKKKKKEKKKKKKKKKKKKKEKKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Routine SaveData Purpose To save data to the transaction file Return Call SaveData Data Date TIME BerData SAVE_TRANSACTION Data RETURN T k k e e ke Ae e e e k ke ke e H e e e ke ke He e e e e e ke e H k e e ke ke H k e e ke ke H k e k ke ke e H k e ke ke ke F k e e ke ke k k e e ke ke H k k e IK k e ke ke ke k ke e ke k k kk k kk k k k kkk k k kkk Routine Show Timer Purpose To clean the screen and show timer Return Call T e k e ke ke A e e IR KIKI e ke ke He e e e e ke ke H e k e e ke ke F k e e ke ke F k k e ke ke e e k e ke ke F k k e ke IK k e e ke k H k ek e ke IK k eke ke k k k eke ke k k k kk kk k k kkk k k kk k Show Timer OFF TIMER 1 SHOW_CALENDAR 1 1 1 VK KK IK RIK IRR I KIARA IK II IIIA IRI I III IKI e ke ke k e III III III III III IKI IK III IKI III k k kk k k k k k kkk k k IRE Routine ParseCmd Purpose To parse the host commands Return Call ParseCmd HostCmd READ_COM 1 IF HostCmd READ THEN IF TRANSACTION_COUNT gt 0 THEN OutBuffer GET_TRANSACTION_DATA 1 ELSE OutBuffer OVER END IF ELSE IF HostCmd REMOVE THEN DEL_TRANSACTION_DATA 1 IF TRANSACTION_COUNT gt 0 THEN OutBuffer _NEXT ELSE OutBuffer
53. FREE_MEMORY 720 Purpose To get free memory size of the Smart Media Card in bytes Syntax A amp SMC_FREE_MEMORY Remarks A8 is a long integer variable to be assigned with the result Usage PRINT SMC free memory SMC_FREE_MEMORY SMC_SIZE 720 Purpose To get the memory size of the Smart Media Card in Kilo bytes Syntax A SMC SIZE Remarks A is an integer variable to be assigned with the result Usage PRINT SMC memory size SMC_SIZE 96 4 19 Debug Commands Command START_DEBUG will write the activities happening on the system to the specified COM port This command is very useful when the user wants to monitor the gstem or diagnose the problem When the command START_DEBUG is executed the system will send a series of messages to the specified COM port until the command STOP_DEBUG is executed The following are sample debug messages received when executing the sample program 510AC_100 BAS Please refer to section 5 4 for the source code of the program and to Appendix F for a description of the debug messages L 7 T 0 L 42 T 0 ADD_RECORD 1 10001Justin Jan 083009301 13013001 130150018002000 ON_NET 316 L 8 T 0 L 43 T 0 L 9 T O ON_ENQUIRY 128 ASGN 2 L 10 T 0 GOTO 68 ASGN 3 L 68 T 0 L 11 T 0 L 69 T 0 ASGN CipherLab 510 L 70 T 0 L 12 T 0 GOTO 68 ASGN 510AC_100 BAS L 13 T 0 L 69 T 0 EVENT 16 L 25 T 0 L 79 T 1 ARY 1 L 80 T 1
54. For example ON KEY 1 GOSUB KeyF1 Key F1 PRINT F1 is pressed RETURN The command RETURN marks the end of the subroutine and tells the processor to return to the caller A subroutine has to be appended at the end of the main BASIC program A subroutine can be defined with or without a pair of brackets For example SUB Subroutine 1 PRINT Subroutine1 is executed END SUB SUB Subroutine2 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 a syntax error while compiling A subroutine in BASIC can be recursive meaning it can call itself or other subroutines that in turn call the first subroutine The following sample program contains a recursive subroutine Factorial to calculate the value of n n factorial PRINT Please enter a number 1 13 INPUT N FactResult 1 Fact N GOSUB Factorial PRINT N FactResult Loop GOTO Loop Factorial IF Fact lt 1 THEN RETURN FactResult FactResult Fact Fact Fact 1 GOSUB Factorial RETURN 18 3 7 Programming Style Following are the guidelines used in writing programs in this manual and also in the sample programs hese guidelines are recommended for program readability but they are not compulsory e Reserved word
55. HOUR_SHARP Event Trigger which executes a specific subroutine when the system time is on the hour Syntax OFF HOUR_SHARP Remarks Usage OFF HOUR_SHARP OFF ENQUIRY 201 510 520 Purpose To terminate the INQUIRY Event Trigger which executes a specific subroutine when the master station is inquired by a slave station Syntax OFF ENQUIRY Remarks Please refer to section 4 16 2 for the RS485 related commands Usage ON ENQUIRY GOSUB Inq a OFF ENQUIRY inq GET_INQUIRY ON ENQUIRY GOSUB Inq RETURN OFF KEY 201 510 520 711 720 Purpose To terminate the FUNCTION KEY Event Trigger which executes a specific subroutine when a function key is pressed Syntax OFF KEY number Remarks number is a positive integer between 1 to 12 It indicates the function key of the keyboard Usage 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 OFF MINUTE_SHARP 201 510 520 711 720 Purpose To terminate the MINUTE SHARP Event Trigger which executes a specific subroutine when the system time is on the minute Syntax OFF MINUTE_SHARP Remarks Usage OFF MINUTE_SHARP OFF NET 201 510 520 Purpose To terminate the NET Event Trigger which executes a specific subroutine when data is received from the RS485 port Syntax OFF NET Remarks Please refer to section 4 16 2 for the use of the RS485 commands Usage ON NET GOSUB NetCommand NetCommand OFF NE
56. Input a numeric variable PRINT Number INPUT_MODE 201 510 520 711 720 Purpose To set the display mode of the input data Syntax INPUT_MODE mode Remarks mode may be 1 2 or 3 1 The input characters will be displayed on the LCD 2 will be displayed instead of the characters typed in 3 Nothing will be displayed on the LCD Usage LOCATE 1 1 INPUT_MODE 1 INPUT Login LOCATE 2 1 INPUT_MODE 2 INPUT Password NUM_LOCK 201 510 520 Purpose To set the Num Lock status of the external AT keyboard Syntax NUM_LOCK status Remarks status may be 1 or 0 0 Num Lock is ON 1 Num Lock is OFF Usage NUM_LOCK 1 SHIFT_LOCK 720 Purpose Forces the shift lock status to be on or off Syntax SHIFT_LOCK status Remarks status may be 1 or 0 0 unlock meaning the shift status is off 1 lock meaning the shift status is on Usage SHIFT_LOCK 1 69 4 14 LCD Commands This section describes the commands related to the LCD display 4 14 1 Graphic Display A 20 characters X 2 lines LCD display is supported by terminals 201 and 510 Since the LCD display is not a graphic display the 201 and 510 cannot show graphic image on the LCD and also the font size is fixed to 6X8 pixels A 240X64 pixels graphic display is used on 520 and 128X64 pixels graphic display is used on 711 and 720 These are able to show graphics and select different font sizes A coordinates system is used in the cursor movement stat
57. KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK VERSION 510AC_100 BAS START_DEBUG 1 1 1 2 1 ADD_RECORD 1 10001Justin Jan 083009301 13013001 130150018002000 for test tkkkkkkkkkk Constants kkkkkkkkkk BUZ_VOL 2 BACK LIT 3 PROMPT1 CipherLab 510 PROMPT2 510AC_100 BAS CONNECT1 CIPHERLAB CONNECT2 SYNTECH INPUT_TIME_LENGTH 17 DATA_LENGTH 52 5 digit ID 15 digit Name 32 digit Time 8X4 pairs ID_LENGTH 5 NAK NAK OVER OVER _NEXT NEXT prefixed with an underline to distinguish from the reserved keyword NEXT DONE DONE NOMATCH NO MATCH DIM MSG_OK 4 DIM MSG_NG 6 108 MSG OK MSG OK l OKGood Morning MSG_OK 1 R You Later 3 OKWelcome Back 5 MSG_OK 4 MSG_NG 1 MSG_NG 2 MSG_NG MSG_NG OKHave A Nice Day NGInvalid Entry Time NGinvalid Entry Time NGinvalid Entry Time NGinvalid Entry Time NGinvalid Entry Time NGinvalid Employee ID 2 1 2 3 4 5 MSG_NG MSG_NG 6 STATION_ID GET_STATION_ID tkkkkkkkkkk Initialization kkkkkkkkkk SET_COM 1 1 1 2 1 COM1 38400 no parity 8 no handshake OPEN_COM 1 START NETWORK ON NET GOSUB ParseCmd ON ENQUIRY GOSUB Verification ENABLE READER 1 ENABLE READER 2 Junk GET_READER_DATA 1 Junk GET_READER_DATA 2 ON READER 1 GOSUB BerData 1 ON READER 2 GOSUB BerData 2 ConnectFlag
58. M GOSUB 39 ON DIGIN GOSUB 40 ON ENQUIRY GOSUB 41 ON ESC GOSUB 40 ON HOUR_SHARP GOSUB 41 139 ON KEY GOSUB 41 ON MINUTE_SHARP GOSUB 42 ON NET GOSUB 42 ON READER GOSUB 43 ON TIMER GOSUB 43 ON GOSUB 25 ON GOTO 25 OPEN_COM 77 operator precedence 16 P PRINT 72 Pseudo Keyboard 127 R Read Redunancy 126 READ COM 77 80 READ NET 82 Reader 47 READER SETTING 49 RECORD COUNT 93 relational operator 14 REM 22 REPLY 82 RESTART 45 RIGHTS 31 ROM_SIZE 96 RS 232 Communications 76 RS 485 Communications 80 Run time Engine 3 5 Run time Error 122 S SAVE TRANSACTION 86 SAVE TRANSACTION EX 87 Scan Mode 125 Aiming Mode 126 Alternate Mode 126 Auto Off Mode 125 Auto Povver Off Mode 125 Continuous Mode 125 Laser Mode 126 Momentary Mode 126 Repeat Mode 126 Test Mode 126 SELECT FONT 73 SEND VVEDGE 57 SET COM 78 SET COM TYPE 78 SET PRECISION 22 SET RTS 79 SET STATION ID 46 SET VIDEO MODE 73 SET VVEDGE 57 SGN 23 SHIFT LOCK 69 SHOVV CALENDAR 61 SHOVV IMAGE 73 SMC FREE MEMORY 96 SMC SIZE 96 START DEBUG 96 START_NETWORK 83 Station ID 80 STOP BEEP 58 STOP DEBUG 96 STOP_NETWORK 83 STR 33 string 12 STRING 34 subroutine 18 TIME 62 Time Out 126 Timer 60 TIMER 62 Transaction Files 10 TRANSACTION COUNT 87 TRANSACTION COUNT EX 87 TRIM_LEFT 31 TRIM RIGHT 31 UCASES 33 UNLOCK 44 14
59. N HalfHourAlarm BEEP 800 30 WAIT 100 RETURN ON NET GOSUB 201 510 520 Purpose To activate the NET Event Trigger which executes a specific subroutine when data is received from the RS 485 port Syntax ON NET GOSUB SubLabel Remarks SubLabel is the name or line label of the subroutine to be called when the event is triggered Usage ON NET GOSUB NetCommand NetCommand OFF NET NetCmd READ_NET 42 ON READER GOSUB 201 510 520 711 720 Purpose To activate the READER Event Trigger which executes a specific subroutine when data is received from the reader ports Syntax ON READER N GOSUB SubLabel Remarks N can be 1 or 2 for terminals 201 510 and 520 N is 1 for terminals 711and 720 SubLabel is the name or line label of the subroutine to be called when the event is triggered Usage ON READER 1 GOSUB BcrData_1 BerData 1 OFF READER 1 BEEP 2000 5 Data GET_READER_DATA 1 ON TIMER GOSUB 201 510 520 711 720 Purpose To activate the TIMER Event Trigger which executes a specific subroutine when the system runs out the time duration that was specified by the user Syntax ON TIMER N duration GOSUB SubLabel Remarks N is an integer between 1 to 5 indicating the ordinal number of timer duration is specified in units of 10 ms SubLabel is the name or line label of the subroutine to be called when the event is triggered Up to five timers can
60. N event GOSUB has to be called ON READER 1 GOSUB BerData 1 ON READER 2 GOSUB BerData_2 ON KEY 1 GOSUB KeyData 1 IF BACKUP BATTERY lt BATTERY LOVVY THEN OFF ALL BEEP 2000 30 CLS PRINT Backup Battery needs to be replaced Loop GOTO Loop END IF 201 510 520 711 720 To terminate the COM Event Trigger which executes a specific subroutine when data is received from the COM ports OFF COM N N is a positive integer indicates the COM port For fixed terminals 201 510 and 520 it can be 1 or 3 For portable terminals 711 and 720 it can be 1 or 2 ON COM 1 GOSUB HostCommand HostCommand 1 OFF COM 1 REM disable the trapping during data processing ON COM 1 GOSUB HostCommand RETURN 201 510 520 To terminate the DIGIN Event Trigger which executes a specific subroutine when the specified digital input changes its state OFF DIGIN number number is a positive integer indicates the digital input port For 201 and 510 it can be 1 or 2 For 520 it can be from 1 to 4 36 Usage S ON DIGIN 1 GOSUB DI 1 DI 1 CLS PRINT DI 1 is changed OFF DIGIN 1 RETURN OFF ESC 201 510 520 711 720 Purpose To terminate the ESC Event Trigger which executes a specific subroutine when the key ESC is pressed Syntax OFF ESC Remarks Usage ON ESC GOSUB Key_Esc Key_Esc OFF ESC ON ESC GOSUB Key_Esc RETURN OFF HOUR_SHARP 201 510 520 711 720 Purpose To terminate the
61. OW THEN BEEP 2000 30 CLS PRINT Backup Battery needs to be replaced Loop GOTO Loop END IF 711 720 To get the voltage level of the main battery A MAIN BATTERY A is an integer variable to be assigned with the voltage level of the main battery The voltage level of main battery is returned in units of mili volt mV The main battery is the power source for the system operation The main battery would be considered as Battery Low when the MAIN_BATTERY is lower than 2200 mV That means the basic system operations may operate yet some functions consuming high power may be disabled BATTERY_LOW 2200 CheckMainBattery IF MAIN BATTERY lt BATTERY_LOW THEN BEEP 2000 30 CLS PRINT Main Battery needs to be recharged Loop GOTO Loop END IF 75 4 16 Communication Ports There are three communication ports on 201 510 amp 520 COM1 and COMB3 are for RS 232 communications COM2 is for RS 485 communications There are two communication ports on 7xx terminals namely COM1 and COM2 The user has to set up the communication type for the COM ports before they can be used COM1 could be used for direct RS 232 or docking port COM2 could be used for any of the following Serial IR IrDA or RF port The user needs to specify which type of interface is to be used but can use the same commands to open close read and write the data through to the different interfaces The communication related com
62. RD_EX N1 N2 A data Indicating the command UPDATE TRANSACTION EX is processed N UPDATE_TRANSACTION_EX N A lis the number of the transaction file A is the new data V AL A Indicating the command VAL is processed aow a the command VERSION is processed A is the character string VERSION A o be written as the version information VOL N Indicating the command VOL is processed WAIT N Indicating the command WAIT is processed WRITE NET Indicating the command WRITE_NET is processed KOR laea the logical operation XOR is processed WRITE_COM N A Indicating the command WRITE_COM is processed 137 Index ABS 21 ADD_RECORD 89 ALPHA_LOCK 66 arithmetic operator 14 array 13 ASC 32 assignment operator 14 BACKLIT 70 BACKUP_BATTERY 75 Barcode Setting 10 123 2 of 5 Code 123 Codabar 124 Code 39 123 EAN 13 125 EAN 8 125 MSI 124 Phamacode 123 Plessey 124 UPCA 125 UPCE 124 Battery 75 BEEP 58 Buzzer 58 Calendar 60 CAP_LOCK 66 CHANGE_SPEED 45 CHR 32 CLOSE COM 76 CLR KBD 66 CLR_RECT 70 CLS 71 CODE TYPE 47 COM DELIMITER 76 Communication Ports 76 compile 10 constant 12 CPU running speed 45 CURSOR 71 CURSOR_X 71 CURSOR Y 72 DAT 84 DATES 60 DAY OF VVEEK 60 DBF 10 89 Debug 97 Debug Message 130 Decision Structures 24 DEL RECORD 90 DEL TRANSACTION DATA 84 138 DEL TRANSACTION DATA EX 84 DEVICE_ID 45 Digital I O 63 DIGO
63. RECISION function A VALR 123 45 PRINT A A REM A 123 45 4 4 7 Creating Strings of Repeating Characters STRING Purpose Syntax Remarks Usage 201 510 520 711 720 To return a string containing the specified number of the requested character A STRING N X A STRING N J A is a string variable to be assigned with the result N is a numeric expression h the range of O to 255 indicating the number of the character J96 is a numeric expression in the range of O to 255 indicating the ASCII code of a character X may be a string variable or string constant IDX_LENGTH 20 Data Name STRING IDX_LENGTH LEN Name ADD RECORDXI1 Data Padding with space if the length of Nameg is less than IDX_LENGTH 4 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 program control to an appropriate subroutine polling and trapping With event polling the BASIC program explicitly checks for any events that happen at particular points in its execution For example the following statements cause the program to loop back and forth until any key pressed by the user Loop KeyData INKEY IF KeyData THEN GOTO Loop Polling is usefu
64. REMOVE2 REM to delete a record from the 2 transaction file TR 201 510 520 711 720 Purpose To get current system time Syntax TR Remarks A string indicating the current system time will be returned to the host computer Return yymmddhhnnss yyyymmddhhnnss if the command is processed successfully where yy last two digits of the year 201 510 yyyy year 520 71 1 720 mm month dd day hh hour in 24 hour format nn minute ss second NAK if any format error occurs Usage TR TW 201 510 520 711 720 Purpose To set new system time Syntax TW yymmddhhnnss TW yyyymmddhhnnss where yy last two digits of the year 201 510 yyyy year 520 711 720 mm month dd day hh hour in 24 hour format nn minute ss second 100 Remarks Return Usage Purpose Syntax Remarks Return Usage There is no station ID required The master terminal will keep the system time synchronized among all terminals OK if the command is successfully processed NAK if any format error occurs TW991201103000 for 201 510 TW19991201103000 for 520 7111 720 201 510 520 To get the on line station IDs X The master will return all the station IDs on the RS 485 network to the host computer This command is useful for system maintenance to see if the RS 485 communication is properly working or not aa bb pp if the command is successfully processed where aa bb pp are all two digit station ID
65. ReplyMsg Name UNLOCK RETURN Eventi IF CurrentTime gt VAL MID OrgData 21 4 AND CurrentTime lt VAL MID OrgData 25 4 THEN ReplyMsg MSG_OK 1 ProcessFlag 1 ELSE ReplyMsg MSG_NG 1 ProcessFlag 0 END IF RETURN IF CurrentTime gt VAL MID OrgData 29 4 AND CurrentTime lt VAL MID OrgData 33 4 THEN ReplyMsg MSG_OK 2 ProcessFlag 1 ELSE ReplyMsg MSG_NG 2 ProcessFlag 0 END IF RETURN IF CurrentTime gt VAL MID OrgData 37 4 AND CurrentTime lt VAL MID OrgData 41 4 THEN ReplyMsg MSG_OK 3 ProcessFlag 1 ELSE ReplyMsg MSG_NG 3 ProcessFlag 0 END IF RETURN Event4 IF CurrentTime gt VAL MD OrgData 45 4 AND CurrentTime lt VAL MID OrgData 49 4 THEN ReplyMsg MSG_OK 4 ProcessFlag 1 ELSE ReplyMsg MSG_NG 4 ProcessFlag 0 END IF RETURN Event5 ReplyMsg MSG_NG 5 ProcessFlag 0 RETURN VARKER IKARIA KIRK IIR I III IK III I IIIA III III III RII III III III III III IKI IKI III III III k kk kkk kk Routine VerifyData Purpose To verify data Return Call SaveData VerifyData Ans INQUIRY BcrData 1000 Timeout 5 sec IF Ans THEN BEEP 4750 10 0 10 4750 10 MsgBuffer No Connection LogFlag A ELSE IF LEFT Ans 2 NG THEN BEEP 4750 10 0 10 4750 10 MsgBuffer RIGHT Ans LEN Ans 2 LogFlag B ELSE IF LEFT Ans 2 OK THEN BEEP 4750 5 MsgBuffer
66. Specifies the parity of the 2 Odd Parity COM port 3 Even Parit Data 1 7 Data Bits Specifies the data bits of 2 8 Data Bits the COM port Handshake 1 No Handshake Specifies the method of 2 CTS RTS flow control for the COM 3 XON XOFF port Usage SET_COM 1 1 1 2 1 COM1 38400 N 8 No handshake for 201 SET_COM_TYPE 711 720 Purpose To set the communication types for the COM ports Syntax SET COM TYPE Comport Type Remarks This function needs to be called before opening a COM port Avaliable Type 1 direct RS 232 2 docking via communication cradle 2 3 serial IR via Serial IR Transceiver 4 standard IrDA 5 RF communication Usage SET_COM_TYPE 2 3 set COM 2 to IR communication 78 SET_RTS Purpose Syntax Remarks Usage WRITE_COM Purpose Syntax Remarks Usage 201 510 520 711 720 To set the CTS level for the specified communication port SET_RTS N State N is a numeric expression indicating which communication port to set the CTS level for State96 may be 1 or 0 indicates that the RTS state to be Mark or Space respectively SET_RTS 1 1 set COM1 RTS to Mark 201 510 520 711 720 To send data string to the host through the specified communication port WRITE COMS N Data N is a numeric expression indicating which communication port the data is to be sent to Data is the character string to be sent
67. T NetCmd READ NET ON NET GOSUB NetCommand RETURN OFF READER 201 510 520 711 720 Purpose To terminate the READER Event Trigger which executes a specific subroutine when data is received from the reader ports Syntax OFF READER N Remarks N may be 1 or 2 for terminals 201 510 and 520 N is 1 for terminals 711and 720 Usage ON READER 1 GOSUB BerData 1 BerData 1 OFF READER 1 BEEP 2000 5 Data GET_READER_DATA 1 CLS PRINT Data OFF TIMER 201 510 520 711 720 Purpose To terminate the TIMER Event Trigger which was specified by the ON TIMER GOSUB command Syntax OFF TIMER N Remarks N is an integer between 1 to 5 It indicates the number of the timer that was specified by the user Usage ON TIMER 1 200 GOSUB ClearScreen TIMER 1 2 sec ClearScreen OFF TIMER 1 CLS RETURN ON COM GOSUB 201 510 520 711 720 Purpose To activate the COM Event Trigger which executes a specific subroutine when data is received from the COM ports Syntax ON COM N GOSUB SubLabel Remarks NY is a positive integer indicates the COM port For fixed terminals 201 510 and 520 it can be 1 or 3 For portable terminals 711 and 720 it can be 1 or 2 SubLabel is the name or line label of the subroutine to be called when the event is triggered 39 Usage ON COM 1 GOSUB HostCommand HostCommand 1 OFF COM 1 ON COM 1 GOSUB HostCommand RETURN ON DIGIN GOSUB 201 510
68. T Password IF Password THEN GOTO Loop Login IF Password UserPasswd THEN LoginFlag 1 BEEP 3000 30 LOCATE 3 1 PRINT Login succeeded ON TIMER 1 200 GOSUB ClearLCD TIMER 1 2 sec ON TIMER 2 60000 GOSUB ForceToLogout TIMER 2 10 min Errorindex A GOTO Exit_Login BEEP 2000 10 3000 10 2000 10 3000 10 LOCATE 3 1 PRINT Invalid Password Errorlndex B END IF BEEP 2000 10 3000 10 2000 10 3000 10 LOCATE 2 1 PRINT Invalid ID Errorlndex C LoginFlag 0 115 Exit_Login Data GOSUB WriteToFile ON TIMER 1 200 GOSUB ClearLCD TIMER 1 2 sec RETURN VIR e ke ke A e e k ke ke H k e e k ke ke II e ke ke He e e e ke ke e H k e e ke ke He k e e ke ke H e k e e ke ke He k IIIA k k ke ke ke H k k ee ke k k k k k ke III eke k k k k k k kk k k k kkk k k kkk Routine Logout Purpose To log out the current user Return LoginFlag 0 logout succeeds Errorindex D logout succeeds Call ClearLCD on timer 1 ForceToLogout on timer 2 Logout IF LoginFlag 0 THEN RETURN BEEP 3000 10 0 10 3000 10 OFF TIMER 1 OFF TIMER 2 CLS LOCATE 1 1 PRINT User ID UserlD LOCATE 2 1 PRINT Press 9 to Logout Loop_Logout B INKEY IF B THEN GOTO Loop_Logout ELSE IF B 9 THEN Data Errorlndex D GOSUB WriteToFile LoginFlag 0 Errorlndex 0 ScanFlag 0 UserlD Password n NewPassword TempData PreviousReco
69. TAS is processed N is the GET_READER_DATA N number of the reader port Indicating the command GET_READER_SETTING is processed N is the GET_READER_SETTING N setting number Indicating the command GET_RECORDS is processed N1 is the number of the DBF file N2 is the number of the IDX file Indicating the command GET_READER_NUMBER is processed N1 is GET_RECORD_NUMBER N1 N2 he number of the DBF file N2 is the number of the IDX file GET SHIFT LOCK Indicating the command GET SHIFT LOCK is processed GET STATION ID Indicating the command GET STATION ID is processed Indicating the command GET TRANSACTION DATA is processed NY is GET TRANSACTION DATAS NE he ordinal number of the record to be read Indicating the command GET TRANSACTION DATA EXis processed GET TRANSACTION DATA EXS NIY N1 is the number of the transactin file N2 is the ordinal number of the N2 record to be read Indicating the program branches to a subroutine N is the line number of GOSUB N he first line of the subroutine GOTON GT N1 N2 Indicating the decision IF N1 gt N2 is processed HES HIDE CALENDAR INKEYS AS INPUT Indicating the command INPUT_MODE is processed N is the setting for INPUT MODE N he input mode Indicating the command INQUIRY is processed A is the inquiry INQUIRY A N message N is the setting for the timeout GET_RECORD N1 N2 I I I I I I lt ee a ae io
70. THEN BerType EAN8 w Addon 5 ELSE IF CODE TYPE P THEN BerType UPCA EAN13 no Addon ELSE IF CODE_TYPE Q THEN BerType EAN13 w Addon 2 ELSE IF CODE TYPE R 7 THEN BerType EAN13 w Addon 5 ELSE IF CODE_TYPE S THEN BerType MSI ELSE IF CODE TYPE T THEN BerType Plessey ELSE IF CODE TYPE U THEN BerType Code ABC ELSE IF CODE TYPE a THEN BerType ISO Track 1 ELSE IF CODE_TYPE b THEN BerType ISO Track 2 ELSE IF CODE_TYPE c THEN BerType ISO Track 1 and 2 ELSE IF CODE TYPE d THEN BerType ISO Track 2 and 3 ELSE BerType END IF RETURN HHHHHHHHH End of Program HHHH 103 5 2 201TEST_2 BAS IKKKKKKKKKEKKKKKKKKKKKKKKKKKKAKKAKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Program BASIC Sample Program 201TEST_2 BAS Target Machine 201 Description The terminal reads data from the reader ports and shows it on the LCD for a period of time then saves it to the transaction file The saved data can be retrieved by the host PC The system time is E shown when the terminal is not reading data and it is adjustable by an RS232 command from the host PC VERSION 201TEST_2 BAS START_DEBUG 1 1 1 2 1 tkkkkkkkkkk Constants kkkkkkkkkk BUZ VOL 2 BACK LIT 3 PROMPT1 CipherLab 201 PROMPT2 201TEST_2 BAS INPUT_TIME_LENGTH 17 NAK
71. UT 63 DIM 21 DISABLE KBD 66 DISABLE PSEUDO KBD 67 DISABLE READER 47 dovvnload 10 E EMPTY FILE 90 EMPTY TRANSACTION 85 EMPTY TRANSACTION EX 85 ENABLE KBD 67 ENABLE PSEUDO KBD 67 ENABLE READER 48 Error Code 95 Event Triggers 35 EXIT 27 F File Manipulation 84 FILL RECT 72 FIND RECORD 91 Flash VVriter 121 Font Files 70 FOR NEXT 27 FREE MOMERY 96 G GET ALPHA LOCK 68 GET CTS 77 GET DIGIN 63 GET FILE ERROR 95 GET INQUIRY 81 GET HEADER DATAR 48 GET READER SETTING 48 GET_RECORD 91 GET RECORD NUMBER 92 GET SHIFT LOCK 68 GET STATION ID 45 GET TRANSACTION DATAS 86 GET TRANSACTION DATA EX 86 GOTO 21 H HEX 32 HIDE CALENDAR 61 Host Commands 97 CLEAR 97 READ 97 REMOVE 98 TR 98 TW 98 X 99 IDX 89 IF THEN ELSE 24 IF THEN END IF 26 INKET 68 INPUT 69 INPUT_MODE 69 INQUIRY 81 INSTR 30 INT 22 KEY_CLICK 58 Keyboard 66 Keyboard Wedge 53 L label 17 LCASES 32 LCD 70 LED 64 LEFT 30 LEN 29 LOCATE 72 LOCK 44 logical operator 15 Looping Structures 27 MAIN_BATTERY 75 Memory 96 MID 30 MOVE_TO 92 MOVE_TO_NEXT 93 MOVE_TO_PREVIOUS 93 N Negative Barcode 126 NUM_LOCK 69 numeric 12 OCT 33 OFF ALL 36 OFF COM 36 OFF DIGIN 36 OFF ENQUIRY 37 OFF ESC 37 OFF HOUR SHARP 37 OFF KEY 38 OFF MINUTE_SHARP 38 OFF NET 38 OFF READER 39 OFF TIMER 39 ON CO
72. a GET READER DATASI1 PRINT Data SAVE TRANSACTION Data IF GET FILE ERROR lt gt 0 THEN PRINT Transaction not saved RETURN 86 SAVE_TRANSACTION_EX 711 720 Purpose To save append a transaction record to the specified transaction file Syntax SAVE TRANSACTION EX file96 Remarks file96 is an integer in the range of 1 to 6 indicating which transaction file to access The command SAVE TRANSACTION EX 1 works the same as the command SAVE TRANSACTION Usage ON READER 1 GOSUB BerData 1 BerData 1 BEEP 2000 5 Data GET_READER_DATA 1 PRINT Data SAVE_TRANSACTION_EX TransFile Data IF GET_FILE_ERROR lt gt 0 THEN PRINT Transaction not saved RETURN TRANSACTION_COUNT 201 510 520 711 720 Purpose To get the total number of transaction records saved in the default first transaction file Syntax A TRANSACTION_COUNT Remarks A is an integer variable to be assigned with the number of the transaction records Usage ie DataCount DataCount TRANSACTION COUNT CLS PRINT DataCount transaction data is saved RETURN TRANSACTION COUNT EX 711 720 Purpose To get the total number of the transaction records saved in the specified transaction file Syntax A TRANSACTION COUNT EX file Remarks A is an integer variable to be assigned with the number of the transaction records file is an integer in the range of 1 to 6 indicating which transaction file to access The c
73. a beeper sequence in progress Usage BEEP 2000 0 ON KEY 1 GOSUB StopBeep PRINT Press F1 to stop the beeper StopBeep STOP BEEP RETURN Purpose Syntax Remarks Usage 201 510 To set the volume of the beeper VOL level level an integer in the range of 0 to 3 indicates the volume level from Min to Max of the beeper VOL 0 The beeper volume is set to minimum level 59 4 10 Calendar and Timer Commands This section describes the calendar and timer related commands The system date and time are kept by the calendar chip and they can be retrieved from or set to the calendar chip by the DATE and TIME functions A backup rechargeable battery keeps the calendar chip running even when power is turned off Note that the system time variable TIMER is maintained by CPU timers and has nothing to do with this calendar chip Accuracy of this time variable depends on the CPU clock and is not suitable for precise time manipulation Also it is reset to 0 upon power up cold start Up to five timers can be set by the ON TIMER GOSUB command for the TIMER Event Trigger DATE 201 510 520 711 720 Purpose To set or to get the current date Syntax DATE X To set the current date YE lt DATES To get the current date Remarks X is in the form of yyyymmdd Y is a valid string variable The BASIC Compiler and its Run time Engines do not check the format and contents of
74. ach row is represented by the least significant bit of the second byte in each row Following is an example of the CipherLab company logo and the string variable icon is used to store the bitmap data icon_1 chr icon_2 chr 0 chr 0 chr 0 chr 0 chr 0 chr 248 chr 255 chr 7 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 21 4 chr 201 chr 59 chr 250 chr 142 chr 5 icon_8 chr 48 chr 80 chr 74 chr 72 chr 122 chr 109 chr 5 icon_9 chr 16 chr 80 chr 74 chr 72 chr 122 chr 109 chr 5 icon_10 chr 16 chr 208 chr 249 chr 59 chr 186 chr 139 chr 5 icon_11 chr 48 chr 84 chr 72 chr 24 chr 58 chr 104 chr 5 icon_12 chr 96 chr 86 chr 72 chr 40 chr 186 chr 107 chr 5 icon_13 chr 192 chr 83 chr 200 chr 75 chr 130 chr 139 chr 5 a icon 14 chr 0 chr 0 chr 0 chr 0 chr 254 chr 255 chr 7 chr 0 chr 0 chr 254 chr 255 chr 1 chr 0 chr 0 chr 254 chr 255 chr 1 icon_15 chr 0 chr 0 icon_16 chr 0 chr 0 2 0 56 1 icon_1 2 1 56 1 icon 2
75. ader port EQU N1 N2 Indicating the decision IF N1 N2 is processed Evente indicating the DIGIN 1 EVENT happens EVENT leans the TIMER 1 EVENT happens Eventa leans the TIMER 5 EVENT happens EVENT Indicating the READER 2 EVENT happens eventas leai the FUNCTION 1 EVENT happens Eventi indicating the FUNCTION 5 EVENT happens Evenren 0 leans the FUNCTION 10 EVENT happens EVENTIGO EVENT 31 Indicating the ESC EVENT happens EXP N1 N2 Indicating an exponentiation is processed FALSE N Indicating the IF statement or the WHILE statement is processed FILL_RECT Indicating the command FILL_RECT is processed Indicating the command FIND_RECORD is processed N1 is the number lof the DBF file N2 is the number of the IDX file A is the key string to be FIND_RECORD N1 N2 A ound FREE_MEMORY Indicating the command FREE_MEMORY is processed 133 GET ALPHA LOCK Indicating the command GET ALPHA LOCK is processed Indicating the command GET CTS is processed N is the number of the GET_CTS N ICOM port GET DEVICE ID Indicating the command GET DEVICE ID is processed Indicating the command GET DIGIN is processed N is the number of GET DIGIN N he COM port GET FILE ERROR Indicating the command GET FILE ERROR is processed GET INQUIRY S Indicating the command GET INQUIRYS is processed Indicating the command GET READER DA
76. adj tn e ea a de t de dd 123 Appendix C Run Time Error Table aaa sese 124 Appendix D Barcode Setting a Ne ST aand R HLAHAR eee eee eee 125 D 1 Symbology Parameters TT 125 D 1 1 GOJ S I ison ash telat cal sh na ahaa Es E T T E 125 D 1 2 Italy French Phamacode nana aaa nanen ee ATR eee eee rene 125 D 1 3 Industrial Interleave 1 Matrix 2 Of B 125 D 1 4 Godabar asi padi dh 126 D 1 5 nekea shporta dhen din i e 126 D 1 6 PIGSSOY A TAE T 126 D 1 7 UPGE dh hd AN SE 126 D 1 8 ENN cele et a ETRE ar ART AEE RE ERa e 127 D 1 9 PANTS BUR GA i AAE ELE T 127 D 2 Scanner Parameters voet dina d YKS oo RS VR YER RN DOST A ieee 127 D 2 1 Scan MOO mesire rres ziente ce geht dh Year end a eka veered aac een lias 127 D 2 2 Read RedundanGy sive su ndih deh oR Ta Tiad TRER Lagda 128 D 2 3 TNOU E sa da ova detet de or di dt pe e e l ot dyer os 128 D 2 4 Negative Barcode zu sasise siti vidhte n r Geant ode dh eh bie 128 Appendix E Pseudo Keyboard iii aaa nana nenen enen eee EE eee 129 Appendix F Debug Messages dan aaa nenen eee pete 132 Ti CT dr od e ede she bet hh e Re hr ts d ha bat S 138 Preface CipherLab BASIC Compiler provides users with a complete programming environment to develop application programs for the CipherLab 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 the master set up
77. al as if they come from a real keyboard A set of pseudo keyboards can be found in Appendix E Usage ENABLE PSEUDO_KBD INPUT String1 BEEP 2000 5 DISABLE PSEUDO_KBD PRINT String1 GET_ALPHA_LOCK 520 711 720 Purpose To get alpha lock status Syntax A GET_ALPHA_LOCK Remarks A is an integer variable to be assigned with the alpha lock status The current alpha lock status 0 unlocked or 1 locked will be returned Usage Alpha_lock GET_ALPHA_LOCK GET_SHIFT_LOCK 720 Purpose To get shift lock status Syntax A GET_SHIFT_LOCK Remarks A is an integer variable to be assigned with the shift lock status The current shift lock status 0 unlocked or 1 locked will be returned Usage Shift_lock GET_SHIFT_LOCK INKEY 201 510 520 711 720 Purpose To read a character from the built in keypad and or the external AT keyboard Syntax X INKEY Remarks XE is a string variable that is assigned with the character read Usage PRINT Initialize System Y N Loop KeyData INKEY IF KeyData THEN GOTO Loop ELSE IF KeyData Y THEN GOTO Initialize INPUT 201 510 520 711 720 Purpose To take input from keypad and store the data 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 Usage INPUT String1 Input a string variable PRINT String INPUT Number
78. and CURSOR_Y is processed pares Indicating the system date is inquired DATI Indicating the system date is updated A is the new system date N Indicating the command DEL_RECORD is processed N1 is the number DEL_RECORD N1 N2 lof the DBF file N2 is the number of the IDX file DEL TRANSACTION DATA Indicating the command DEL TRANSACTION DATA is processed Indicating the command DEL TRANSACTION DATA EXis processed DEL TRANSACTION DATA EX NY IN is the number of the transaction file DIGOUT N1 N2 N3 Indicating the command DIGOUT is processed DISABLE_KBD Indicating the command DISABLE KBD is processed DISABLE_PSEUDO_KBD Indicating the command DISABLE PSEUDO KBD is processed Indicating the command DISABLE READER is processed N is the DISABLE _READER N number of the reader port DIV N1 N2 Indicating a division is processed Indicating the command EMPTY_FILE is processed N is the number of EMPTY_FILE N he DBF file EMPTY TRANSACTION Indicating the command EMPTY_TRANSACTION is processed Indicating the command EMPTY TRANSACTION EX is processed N is EMPTY _TRANSACTION_EX N he number of the transaction file 132 E E A DAY_OF_WEEK Indicating the command DAY_OF_WEEK is processed ENABLE_KBD Indicating the command ENABLE KBD is processed ENABLE PSEUDO KBD Indicating the command ENABLE PSEUDO KBD is processed ee i the command ENABLE READER is processed N is the ENABLE _READER N number of the re
79. be any sequence of characters The BASIC compiler will ignore whatever follows the REM or until end of the line REM This is a comment This is a comment too 201 510 520 711 720 To set the precision of the decimal points for printing real number expressions SET_PRECISION N N26 is a numeric expression in the range of 0 to 6 The precision is set to two digits by default PI 3 14159 PRINT PI PI result PI 3 14 by default SET_PRECISION 6 PRINT PI Pl result PI 3 141590 SET_PRECISION 2 PRINT PI PI result PI 3 14 22 SGN Purpose Syntax Remarks Usage 201 510 520 711 720 To return an indication of the mathematical sign or of the given numeric expression A SGN N A is an integer variable to be assigned with the result N is a numeric expression If N gt 0 SGN N returns 1 lf N 0 SGN M returns 0 If N lt 0 SGN N returns 1 A SGN 100 A 1 B SGN 1 5 B 1 23 4 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 1 Execute one of several alternative statements within the decision structure itself 2 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 Th
80. be set in a BASIC program Be sure the timer IDs are different Otherwise the latter created timer will overwrite the former one Usage ON TIMER 1 200 GOSUB ClearScreen TIMER 1 2 sec ClearScreen OFF TIMER 1 CLS RETURN 43 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 new coming 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 LOCK and UNLOCK commands can be used to hold off new events LOCK 201 510 520 711 720 Purpose To hold all activated event triggers until they are released by the UNLOCK command Syntax LOCK Remarks Command LOCK can prevent the nesting of event triggers All the activated event triggers will be disabled until UNLOCK is called Usage ON READER 1 GOSUB BerData_1 ON READER 2 GOSUB BerData 2 BerData_1 LOCK BEEP 2000 5 Data GET_READER_DATA 1 GOSUB AddNewData UNLOCK RETURN BerData 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 Ber Data 2 respectively In BcrData_1 the command LOCK disables all the activated event triggers so that the subroutine BerData 1 would not be interrupted by a new coming READ
81. cating the result of the last file manipulation A value other than 0 indicates error GET FILE ERROR Purpose Syntax Remarks Usage 201 510 520 711 720 To get the error code of the previous file manipulation command A GET FILE ERROR A is an integer variable to be assigned with the error code If there is no error O will be returned Possible error code and its interpretation is listed below Error Code Interpretation 10 No free memory for file extension For other errors such as invalid file ID will cause a run time error ADD_RECORD 1 Data IF GET_FILE_ERROR 10 THEN ErrorMessage No free file space END IF 95 4 18 Memory This section describes the commands concerning the flash memory SRAM and the Smart Media Card SMC FREE MOMERY 201 510 520 711 720 Purpose To get the size of free data memory SRAM in bytes Syntax A amp FREE MEMORY Remarks A8 is a long integer variable to be assigned vvith the result Usage PRINT Free memory FREE MEMORY RAM_SIZE 711 720 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 with the result Usage PRINT SRAM size RAM SIZE ROM SIZE 711 720 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 with the result Usage PRINT Flash size ROM_SIZE SMC_
82. ch executes a specific subroutine when the master station is inquired by a slave station Syntax ON ENQUIRY GOSUB SubLabel Remarks SubLabel is the name or line label of the subroutine to be called when the event is triggered Please refer to 4 16 2 for the RS 485 related commands Usage ON ENQUIRY GOSUB Inq Inq OFF ENQUIRY Ing GET_INQUIRY ON ENQUIRY GOSUB Inq RETURN ON KEY GOSUB 201 510 520 711 720 Purpose To activate the FUNCTION KEY Event Trigger which executes a specific subroutine when a function key is pressed on keyboard Syntax ON KEY number GOSUB SubLabel Remarks number is a positive integer between 1 to 12 1 to 9 for 711 It indicates the function key of the keyboard SubLabel is the name or line label of the subroutine to be called when the event is triggered Usage ON KEY 1 GOSUB On_Shift Al ON KEY 2 GOSUB Off_Shift On_ Shift Mode IN RETURN Off_ Shift Mode OUT RETURN ON MINUTE_SHARP GOSUB 201 510 520 711 720 Purpose To activate the MINUTE_SHARP Event Trigger which executes a specific subroutine when the system time is on the minute Syntax ON MINUTE SHARP GOSUB SubLabel Remarks SubLabel is the name or line label of the subroutine to be called when the event is triggered Usage ts ON MINUTE_SHARP GOSUB CheckTime CheckTime CurrentTime TIME Hour VAL MID CurrentTime 3 2 IF Hour 30 THEN GOSUB HalfHourAlarm RETUR
83. counter startvalue is a numeric expression which is the initial value for the loop counter endvalue is a numeric expression which is the final value for the loop counter step is a numeric expression to be used as an increment decrement of the loop counter The step is 1 by default If the loop counter ever reaches or beyond the endvalue the program execution continues to the statement following the NEXT statement The Statement block will be executed again otherwise DataCount TRANSACTION_COUNT FOR Counter 1 TO DataCount Data GET_TRANSACTION_DATA Counter WRITE_COM 1 Data NEXT 201 510 520 711 720 To provide an alternative exit for looping structures such as FOR NEXT and WHILE WEND statements EXIT EXIT can appear anywhere within the loop statement 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 27 WHILE WEND Purpose Syntax Remarks Usage 201 510 520 711 720 To repeat the execution of a block of statements while a certain condition is TRUE WHILE condition Statement Block WEND 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 b
84. dicating the logical operation NOT is processed Indicating the command NUM LOCK is processed N is the Num Lock NUM LOCK NY status OCT A OFF ALL Indicating the command OCTS is processed Indicating the command OFF ALL is processed Indicating the command OFF COM is processed N is the number of the IOFF_COM N ICOM port Indicating the command OFF DIGIN is processed N is the number of the OFF_DIGIN N digital input port OFF ENQUIRY OFF ESC Indicating the command OFF ENQUIRY is processed Indicating the command OFF ESC is processed OFF HOUR SHARP Indicating the command OFF HOUR SHARRP is processed OFF KEY OFF MINUTE SHARP Indicating the command OFF KEY is processed Indicating the command OFF MINUTE_SHARP is processed OFF NET Indicating the command OFF NET is processed Indicating the command OFF READER is processed N is the number of OFF READER NY he reader port Indicating the command OFF TIMER is processed N is the number of OFF_TIMER N he timer Indicating the command ON COM GOSUB is called N1 is the umber of ION_COM N1 N2 he COM port N2 is the line number of the subroutine to branch to Indicating the command ON DIGIN GOSUB is called N1 is the line ION_DIGIN N1 N2 number of the digital input port N2 is the subroutine to branch to Indicating the command ON ENQUIRY GOSUB is called N is the line ON ENQUIRY NY6 number of the subroutine to branch to Indicatin
85. directory are listed below 1 BC This directory contains the BASIC Compiler and the BASIC programs Bc exe the BASIC Compiler Bc hlp the on line help file for the BASIC Compiler Bc cnt the content file of the BASIC on line help Synload exe the download program to download the Basic object files syn and ini to the CipherLab terminals BASIC source files bas of the sample programs 201TEST_1 bas 201TEST_2 bas 201TEST_3 bas 201TEST_4 bas 510AC_100 bas 711AM_100 bas System initialization files ini of the sample programs 201TEST_1 ini 201TEST_2 ini 201TEST_3 ini 201TEST_4 ini 510AC_100 ini 711AM 100 ini BASIC object files syn of the sample programs 201TEST 1 syn 201TEST 2 syn 201TEST 3 syn 201TEST_4 syn 510AC_100 syn 711AM_100 syn 2 DOWNLOAD This directory contains a download program the BASIC Compiler Run time Engines and the special font files e Dovvnload exe the download program to download the Motorola S format object file shx to the CipherLab terminals via RS 232 or standard IrDA port e Irload exe the download program to download the Motorola S format object file shx to the CipherLab terminals via Serial IR Transceiver e BASIC Run time Engines for different terminals BC201 shx BC510 shx BC520 shx English version BC520 SC shx Simplified Chinese version BC520 TC shx Traditional Chinese version BC711 shx BC720 shx English version BC711 JP shx BC720
86. e Print Function To print the current editing BASIC program Operation Click File on the menu bar and select Print or type Ctrl P or click the Print icon on the tool bar Exit Function To quit the BASIC Compiler Operation Click File on the menu bar and select Exit or type Alt F4 2 2 Edit Menu Seven commands are provided here to facilitate editing of the BASIC source code 1 2 Undo Function To abort the previous editing command or action Operation Click Edit on the menu bar and select Undo or type Ctrl Z or click the Undo icon on the tool bar Cut Function To cut a paragraph off the text and keep it in the clipboard The paragraph will be cleared Operation Drag the cursor to select the paragraph to be cut off This paragraph will turn to reverse colour Click Edit on the menu bar and select Cut or type Ctrl X or click the Cut icon on the tool bar Copy Function To copy a paragraph from the text and keep it in the clipboard Operation Select the paragraph to be copied Click Edit on the menu bar and select Copy or type Ctrl C or click the Copy icon on the tool bar Paste Function To paste a paragraph from the clipboard into the text This paragraph will be inserted into the text Operation Move the cursor to the location where the paragraph will be inserted and click the left button on the mouse
87. e BASIC source code and download again 1 4 BASIC Run time Engine The BASIC Run time Engines work as the interpreters of the BASIC commands The CipherLab terminals have to be preloaded with the BASIC Run time Engines to run the BASIC programs Each model of terminal has its own Run time Engine to drive its specific hardware features The Run time Engines are named as BCXXX shx where XXX is the model of the target terminal For example BC201 shx is the BASIC Compiler Run time Engine for CipherLab 201 terminal The BASIC Run time Engine also provides the function for the user to configure the terminal With the Run time Engine preloaded the terminal can be set to the System Mode In the System Mode the user can set up the system settings such as the system clock and download the user program Entering System Mode as well as its contents differ between the fixed and portable terminals 1 201 510 520 After the user s BASIC program is downloaded the user can set the BASIC Compiler Run time Engine to the System Mode by scanning the master setup barcode or magnetic card The default value of the master setup barcode magnetic card is 1234567890 The setup barcode can be printed with all possible symbologies However the decodability of the symbology selected has to be enabled in the user s BASIC program and also the options of the symgology should be taken into account For example if the opt
88. e IF THEN ELSE ENDIF statement can be used anywhere the ON GOSUB GOTO statement can be used The major difference between the two is that ON GOSUB GOTO evaluates a single expression and then executes different statements or branches to different parts of the program based on the result In contrast a block IF THEN ELSE ENDIF can evaluate completely different expressions Moreover the expression given in the ON expression GOSUB GOTO statement must evaluate to a number within the range 1 to 255 while the expression in IF THEN ELSE ENDIF statement can only evaluate to either a TRUE or FALSE condition IF THEN ELSE 201 510 520 711 720 Purpose To provide a decision structure for single line conditional execution Syntax IF condition THEN action ELSE action2 Remarks condition is a logical expression action is a BASIC statement Usage IF Data1 gt Data2 THEN Temp Data1 ELSE Temp Data2 IF THEN ELSE IF ELSE JEND IF 201 510 520 711 720 Purpose To provide a decision structure for a multiple line conditional excution Syntax IF conditioni THEN statementblock1 ELSE IF condition2 THEN Statementblocka ELSE StatementblockN END IF Remarks condition is a logical expression Statementblock can be multiple lines of BASIC statements Usage IF LEFT String1 1 A THEN PRINT String1 is leaded by A ELSE IF LEFT String1 1 B THEN PRINT
89. e elements of an array are subscripted with an integer expression The first element of an array is subscripted with 1 In CipherLab BASIC the maximum number of dimensions for an array is 2 and up to 32 767 elements per dimension is allowed while compiling 13 3 3 Expression and Operators An expression may be a string or numeric constant or a variable or it may combine constants and variables with operators to produce a single value Operators perform mathematical or logical operations or values The operators provided by CipherLab BASIC Compiler may be divided into four categories namely Assignment Operator Arithmetic Operators Relational Operators and Logical Operators 3 3 1 Assignment Operator CipherLab BASIC Compiler supports an assignment operator For example a Length 100 b Pl 3 14159 c Company Syntech Information Co Ltd 3 3 2 Arithmetic Operator The arithmetic operators are 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 es O fee 14 3 3 4 Logical Operator Logical operators perform tests on multiple relations and Boolean operations The logical operator returns a bit wise result which is either True not zero or False zero h an expression logical operations are performed after arithm
90. e repeated Otherwise the execution continues with the statement following the WEND statement WHILE TRANSACTION_COUNT gt 0 Data GET TRANSACTION DATAS 1 WRITE_COM 1 Data DEL TRANSACTION DATA 1 VVEND 28 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 255 4 4 1 Combining Strings Two strings can be combined with the plus operator The string following the plus operator is appended to the string preceding the plus operator For example Data DATES TIMES EmployeelD SAVE_TRANSACTION Data 4 4 2 Comparing Strings Two strings can be compared wth the relational operators cf 3 3 3 A single character is greater than another character if its ASCII value is greater For example the ASCII value of the letter B is greater than the ASCII value of the letter A so the expression B gt A is true When comparing two strings BASIC looks at the ASCII values of corresponding characters The first character where the two strings differ determines the alphabetical order of the strings For example the strings aaabaa and aaaaaaaa are the same up to the fourth character in each b and a Since the ASCII value of b is larger than that of a the expression aaabaa gt aaaaaaaa is true
91. ead with the reader ports disabled To enable barcode and magnetic card decoding function the reader ports have to be enabled by the ENABLE READER command Usage ENABLE READER 1 ON READER 1 GOSUB Ber 1 Ber_1 Data GET_READER_DATAS 1 RETURN GET_READER_DATA 201 510 520 711 720 Purpose To get the data read from the specified reader port Syntax A GET READER DATAR N Remarks A is a string variable to be assigned with the result N may be 1 or 2 for terminals 201 510 and 520 N is 1 for terminals 711and 720 Usually the user uses ON READER GOSUB command to trap the event the data is transmitted to the terminal through the reader port and then uses GET_READER_DATA command in a subroutine to get the reader data Usage ON READER 1 GOSUB ReadData_1 ReadData_1 Data GET READER DATAS 1 RETURN GET READER SETTING 201 510 520 711 720 Purpose To get the value of the specified parameter of the barcode settings Syntax A GET HEADER SETTING NS6 Remarks A is a string variable to be assigned with the result N is the number of the parameter cf READER_SETTING Usage Setting1 GET_READER_SETTING 1 IF Setting1 1 THEN PRINT Code 39 readability is enabled ELSE PRINT Code 39 readability is disabled END IF 48 READER_SETTING 201 510 520 711 720 Purpose Syntax Remarks To set the value of the specified parameter of the barcode settings READER SETTING NY J
92. ectFlag OFF TIMER 2 ConnectFlag 1 ON TIMER 2 500 GOSUB ClearConnectFlag RETURN T k e e e ke Ae e e e e e ke He He e e e ke ke He e e e e ke ke He H k k e e ke H k e e ke IK e k e ke ke ke H k k e ke ke k e k e e ke ke H k k e ke ke k e k eke ke k k k kk e ke k k k k keke k k kk kk k k k kk kkk k k Routine ClearConnectFlag Purpose To clear the connect flag Return Call tkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk ClearConnectFlag OFF TIMER 2 ConnectFlag 0 RETURN HHHHHHHHH End of Program THH 113 5 5 711AM 100 BAS IKKKKKKKKKEKKKKAKKEKKKKKKKKKKAKKAKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Program Archive Manager Target Machine 711 Description This is a sample Basic program illustrates the use of the Basic statements for 711 terminals After power on user needs to press F1 to login his ID before reading data The user IDs in DBF1 can be inserted deleted by RS 232 commands from the host computer The user s IDs and passwords b has to be matched with the records in DBF1 for a successful login However the password is not required for the first time login User can press F3 to define change his password E User can press F2 and then key 9 to logout d User will be forced to logout IF no action is taken in 10 min i Only labels terminated with A or B can be accepted others will l r
93. ed String1 11025 John Thomas Accounting Manager String2 Title RIGHTS String1 LEN String1 INSTR String1 String2 201 510 520 711 720 To return a copy of a string with leading blank spaces stripped away A TRIM_LEFT X A is a string variable to be assigned with the result X is a string that may contain some space characters at the beginning 1 TRIM_LEFT Hello World S1 Hello World 201 510 520 711 720 To return a copy of a string with trailing blank spaces stripped away A TRIM_RIGHT X A is a string variable to be assigned with the result X is a string that may contain some space characters at the end S2 TRIM_RIGHT Hello World 7 S2 Hello World 4 4 6 Converting for Strings Several commands are available for converting strings to uppercase or lowercase letters and converting strings to numbers and numbers to strings ASC 201 510 520 711 720 Purpose To return the decimal value of the ASCII code of the first character of a given string Syntax A ASC X Remarks A is an integer variable to be assigned with the result X is a character string Usage A ASC John Thomas A 74 CHR 201 510 520 711 720 Purpose To return the character with the given ASCII value Syntax A CHR N Remarks A is a string variable to be assigned with the result N is a numeric
94. edge_1 CHR 1 terminal type PCAT US VVedge 2 CHR 1 auto detection disabled capital lock off case sensitive use numeric key pad to transmit digits Wedge_3 CHR 5 inter char delay 5 ms WedgeSetting VVedge 1 Wedge_2 VVedge 3 SET_WEDGE WedgeSetting 49 Buzzer This section describes the beeper related commands BEEP 201 510 520 711 720 Purpose To make beeper sounds according to the specified beeper sequence Syntax BEEP freq duration freq duration Remarks freq must be an integer that indicates the value of beep frequence Hz Suitable frequency for the beeper ranges from 1 kHz to 6 kHz duration must be an integer that indicates the value of beep duration Beep duration is specified in units of 10 ms Up to eight frequency duration pairs can be assigned in a BEEP command If the value of the frequency is 0 the beeper will not beep during the time duration Usage ON READER 1 GOSUB BcrData_1 BerData 1 BEEP 2000 10 0 10 2000 10 RETURN KEY CLICK 520 711 720 Purpose To enable disable the key click sound Syntax KEY _CLICK status Remarks status may be 1 or 0 0 disable the key click sound 1 enable the key click sound The key click is enabled by default Usage KEY_CLICK 0 REM disable the key click STOP BEEP 201 510 520 711 720 Purpose To terminate the beeps Syntax STOP BEEP Remarks The STOP BEEP statement terminates the beep immediately if there is
95. eger in the range of 1 to 3 indicating which IDX file to be accessed If it is not specified then the default IDX file which keeps the original data sequence will be used Usage MOVE_TO_PREVIOUS 1 1 RECORD_COUNT Purpose Syntax Remarks Usage UPDATE_RECORD Purpose Syntax Remarks 201 510 520 711 720 To get the total number of the records in the specified DBF file A RECORD_COUNT file A is an integer variable to be assigned with the number of the records in the DBF file file is an integer in the range of 1 to 3 1 to 5 for 7xx indicating which DBF file to be accessed TotalRecord_1 RECORD_COUNT 1 201 510 520 711 720 To update the record pointed by the file pointer vvith respect to the specified DBF and IDX UPDATE RECORBD file index data file is an integer in the range of 1 to 3 1 to 5 for 7xx indicating which DBF file to be accessed index is an integer in the range of 1 to 3 indicating which IDX file to be accessed data is the character string to replace the old data 93 Usage ON COM 1 GOSUB HostCommand HostCommand Cmd READ_COM 1 Cmadldentifier LEFT Cmd 1 DBFNum VAL MID Cmd 2 1 IDXNum VAL MID Cmd 3 1 CardID RIGHT Cmd LEN Cmd 3 IF Cmdldentifier 8 THEN UPDATE_RECORD DBFNum IDXNum CardID ELSE 94 4 17 3 Error Code Command GET_FILE_ERROR returns the error code which is a number indi
96. em The common debug messages are listed as follows ABS N Indicating the command ABS is processed ADD N1 N2 Indicating an addition is processed Indicating the command ADD_RECORD is processed N is the number ADD RECORD NY A of the DBF file A is the data to be added to the DBF file Indicating the command ALPHA LOCK is processed NY is the Alpha ALPHA LOCK NY Lock status AnD lndeating the logical operation AND is processed ARY NI Indicating an N element array is declared ASC A Indicating the command ASC is processed Indicating that the value A is assigned to the variable A could be an ASGN A integer long integer character string or any type BACKLIT N Indicating the command BACKLIT is processed N is the backlight status BACKUP_BATTERY Indicating the command BACKUP_BATTERY is processed BEEP indicating the command BEEP is processed BEEP Indicating the command CAP_LOCK is processed N is the Cap Lock CAP LOCK NY status Indicating the command CHANGE SPEED is processed N is the CHANGE SPEED NYS selection of the speed ICHR N Indicating the command CHR is processed Indicating the command CLOSE_COM is processed NY is the number of CLOSE_COM N he COM port CLR_RECT Indicating the command CLR_RECT is processed cs indicating the command CLS is processed CODE TYPE Indicating the command CODE TYPE is processed CURSORX Indicating the command CURSOR_X is processed CURSORY Indicating the comm
97. ements to determine the position of the cursor The coordinates of the top left position are assigned with 1 1 For 201 and 510 the coordinates of the bottom right postion are assigned with 20 1 However for 520 711 and 720 the coordinates of the bottom right position depend on the font size 4 14 2 Special Font Files Besides the standard font terminals 520 711 and 720 can display special characters such as the Oriental language characters providing that those font files have been downloaded to the terminals CipherLab provides users four special font files to display Japanese Simplified Chinese and Traditional Chinese characters Font files e Font jp shx Japanese Characters Font File 16X16 e Font sc shx Simplified Chinese Characters Font File 16X16 e Font tc shx Traditional Chinese Characters Font File 16X16 e Font sd shx Simplified Chinese Characters Font File 12X12 BACKLIT 201 510 520 711 720 Purpose To set the background intensity of the LCD Syntax BACKLIT status Remarks status may be 0 1 2 or 3 It indicates the intensity of the LCD backlit from darkest to brightest Usage BACKLIT 3 CLR_RECT 711 720 Purpose To clear a rectangle area Syntax CLR RECT KY y size XY size yYo Remarks x is the x coordinate of the upper left point of the rectangle area y is the y coordinate of the upper left point of the rectangle area size x99 is the width of the rectangle area in pixels
98. end the above string through the keyboard wedge intergace Data_1 CHR 65 CHR 194 CHR 1 CHR 53 CHR 192 CHR 41 Data_2 CHR 9 CHR 50 CHR 195 CHR 65 CHR 66 Data_3 CHR 196 CHR 49 CHR 228 CHR 50 CHR 196 CHR 49 Data_4 CHR 196 CHR 51 DataString Data_1 Data_2 Data_3 Data_4 SEND_WEDGE DataString 4 8 11 Special Note on DEC VT220 320 420 for 201 only Because the DEC VT220 320 420 is using RS 232 to communicate between DEC and its keyboard the following two lines must be included into the program if this keyboard type is selected SET_COM 1 5 1 2 1 SET_COM 2 5 1 2 1 OPEN_COM 1 OPEN_COM 2 These lines must be executed immediately after the WedgeSetting is initialized Please note that the 7xx terminal cannot send wedge data to DEC VT220 320 420 56 SEND_WEDGE Purpose Syntax Remarks Usage SET_WEDGE Purpose Syntax Remarks Usage 201 711 720 To send data to the host via keyboard wedge interface SEND_WEDGE DataString DataString is the data string to be sent through the keyboard wedge interface DataString CHR 9 TESTING CHR 9 Tab TESTING Tab SEND_WEDGE DataString 201 711 720 To configure the keyboard wedge interface SET_WEDGE WedgeSetting VVedgeSetting is a 3 element character array describing the characteristics of the keyboard wedge interface W
99. er can press 7 and 9 at power on to enter the System Menu and then select 6 Download to download the new program Alternatively the user can press 7 and 1 at power on to enter the Kernel Menu and select 1 Program Download to download the new program The Flash Writer is not needed for 7xx terminals Download exe is a Windows based program to download the Motorola S format object file Shx to the CipherLab terminals via RS 232 or IR Transceiver After the target terminal is set to the Download Mode and the connection between the host PC is properly established the user can execute this program on the host PC to download the Run time Engine or any other Shx files to the terminal After the Run time Engine is downloaded successfully the message Ready for BASIC Download will be shown on the LCD of the terminal 1 3 2 Edit and Compile the BASIC Program The BASIC Compiler bc exe comes with a text editor where users can edit their BASIC programs Please refer to the next chapter for general information of the operation By default the text edited with the editor would be saved as a BASIC source bas file The system settings defined in the configuration menus including Target Machine Master Card ID COM port settings transaction file settings DBF settings barcode settings would be saved as a system initialization ini file with the same name when the basfile is sa
100. erminal will delete all the data of the transaction file For 7xx terminals there are up to 6 transaction files User can specify which transaction file is to be erased Return OK if the command is successfully processed NAK if any format error occurs Usage CLEAR3 REM to delete data of the 3rd transaction file READ 201 510 520 711 720 Purpose To read the top record of the transaction file Syntax READ READN for 7xx terminals only where Nis in the range of 1 to 6 Remarks The target terminal will return the top data of the transaction file back to the host computer For 7xx terminals there are up to 6 transaction files User can specify which transaction file is to be read Return OVER if there is no data in the transaction file x X if the command is successfully processed where x x is the data string NAK if any format error occurs Usage READ1 REM to read a record from the first transaction file REMOVE 201 510 520 711 720 Purpose To remove one record from the top of the transaction file Syntax REMOVE REMOVEN _ for 7xx terminals only where Nis in the range of 1 to 6 Remarks The target terminal will remove one record from the top of the transaction file For 7xx terminals there are up to 6 transaction files User can specify which transaction file is to be removed Return NEXT if the command is processed successfully OVER if no more data to be removed NAK if any format error occurs Usage
101. es to the host computer Command READ_NET is used for the master and the slaves to receive the messages from the host computer The message sent by the host computer must be in a format of ssx x where is the command identifier ss is a two digit station ID of the destination terminal 00 for broadcasting and x x is the message to be sent Let s take the system shown in the diagram as an example Master Slave ID 1 ID 5 START NETWORK START NETWORK ON ENQUIRY GOSUB Inq ON NET GOSUB NetCmd ON NET GOSUB NetCmd sin i S1 INQUIRY ABC 200 Inq S1 abc Tx M1 GET_INQUIRY lO1xyz M1 205ABC NetCmd WRITE_NET M1 S2 READ METS REPLY abc S2 XYZ elie RETURN Tx Syl NetCma I05XYZ nS READ NETT M2 xyz RETURN The BASIC command INQUIRY ABC 200 on the slave will copy the inquiry identifier and its station ID 05 and the data ABC to the RS 485 output buffer and wait for the response for 1 second The data string in the RS 485 output buffer will be transmitted when the slave is polled by the master and it will trigger the INQUIRY Event on the master On the master the received data is assigned to M1 and then sent to the host PC by the command WRITE_NET M1 So the string 205ABC will be sent to the host PC Then the master calls REPLY abc to reply the slave s inquiry The string
102. esult in the Invalid Data error message Once label A is scanned label B with the same data is required for a successful match reading Scanning the same label twice will result in the Wrong label error message All results will be recorded to DBF2 The supervisor can read all records or only records related to a certain user by RS 232 commands Please refer to routine HostCmd for details COM Port Settings 38400 baud 8 data bits no parity no handshake 1 stop bit Function Keys F1 FN 1 login F2 FN 2 logout F3 FN 3 change user s password Database Files DBF1 xxxxxpp pp DBF2 yyyymmddhhnnssxxxxxrizz zzj xxxxx 5 digit user ID pp pp length undefined user password yyyy year mmdd date hhnnss time r Error Index defined in routines ReadData Login Logout and ForceToLogout 0 successful match 1 wrong label 2 invalid data A successful login B fail to login invalid password C fail to login invalid ID D logout E forced to logout ZZ ZZ scanned data if available Se ee ee ee ee ee VIERA A e IR KIKI IK IRI I III IK IRI II KIKI IR III IKI III IRIE I IIIA IKI IK III KI III III III k k kkk k k kkk VERSION 711AM 100 BAS START_DEBUG 1 1 1 2 1 tkkkkkkkkkk Constants kkkkkkkkkk PROMPT1 CipherLab 711 PROMPT2 Archive Manager tkkkkkkkkkk Initialization kkkkkkkkkk SET_COM 1 1 1 2 1 COM1 38400 no parity 8 no handshake OP
103. etic and relational operations Logical negation IF NOT A B Logical and IF A B AND C D 15 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 order of precedence from highest to lowest Where several operators appear together they have equal precedence Type of Operation Symbol Multiplicative MOD Additive Logical AND NOT OR XOR 16 3 5 Labels Line labels are used to represent some special lines in the BASIC program They can be either integer numbers or characters strings A valid integer number for the line label is in the range of 1 to 32 767 A character string label can have up to 49 characters If the string label has more than 49 characters it will be truncated to 49 characters long A character string label that precedes a program line must have a colon between label and the program but an integer label doesn t For example GOTO 100 100 PRINT This is an integer label GOTO Label2 Label2 PRINT This is a character string label 17 3 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 called by a GOSUB command
104. eturn Call WriteToFile Data DATES TIME UserlD Errorlndex Data ADD_RECORD 2 Data RETURN VAR K IKK I KARRI e IKI He e KIBAKI IIIA KIB III III IK IIIB III III IKI IIB III IIR IIH III IIIA III III IIIA Routine ClearLCD Purpose To clear the data which have been shown on the LCD for the duration defined by timer 1 Return Call Clearl CD OFF TIMER 1 CLS RETURN HHH end of program 120 Appendix A Version History 1 Ver 1 00 Nov 1997 2 Ver Ver Ver Ver First release 1 10 Jun 09 1998 Modified Selection of Target Machine is canceled Target machine is automatically determined by the Run time Engine New The On line Help is added 1 22 Dec 01 1998 New The RETURN of a subroutine can be appended with a label 1 24 Feb 26 1998 New CURSOR N New ON ESC GOSUB Subname New OFF ESC 1 26 Mar 22 1999 Modified UPCE no addon gt UPCE Modified EAN 8 no addon gt EAN 8 Modified EAN 13 no addon gt EAN 13 amp UPCA Config 1 27 Mar 30 1999 New GET TRANSACTION DATAS NY New DEL TRANSACTION DATA NY6 New SET VEDIO MODE NYS New SHOW_IMAGE x y size_x size yYe Image New SELECT_FONT N New CHANGE_SPEED N 1 28 Apr 20 1999 New Download via Serial IR Transceiver for 7xx terminals 1 29 Apr 30 1999 New COM_DELIMITER N C 1 30 Jun 01 1999 New DEVICE_ID New MAIN_BATTERY New B
105. g test 4 Battery Main Backup 5 Test Buzzer LCD amp LED KBD 6 Download RS 232 Docking IR IrDA 7 Version Version Info To test the reading performance of the scanner The following are the default enabled symbologies in this mode Code 39 Industrial 25 interleave 25 Codabar Code 93 Code 128 UPCE UPCE with ADDON 2 UPCE with ADDON 5 EAN8 EAN8 with ADDON 2 EAN8 with ADDON 5 EAN13 EAN13 with ADDON 2 EAN13 with ADDON 5 Other symbologies must be enabled through programming To show the voltage of the main battery power To show the voltage of the backup battery To test the buzzer with different Frequency Duration Press the ENTER key to start stop the test To test LCD display and LED indicator Press ENTER key to start stop the test To test the rubber keys Press a key and the result will be shown on the LCD display Note that the FN key of 711 should be used in conjunction with numeric keys To download the user program via the RS 232 port The transmission speed can be up to 115200 bps To download the user program via communication cradle To download the user program via serial IR transceiver The transmission speed can be up to 115200 bps To download the user program via standard IrDA The transmission speed can be up to 115200 bps To show version information including hardware version serial number of the terminal
106. g the command ON ESC GOSUB is called N is the line number ON ESC NYS of the subroutine to branch to Indicating the command ON GOSUB is called N is the line number of the ON GOSUB NY subroutine to branch to Indicating the command ON GOTO is called N is the line number of the ON GOTO NY6 subroutine to branch to Indicating the command ON HOUR SHARP GOSUB is called N is the ON HOUR SHARP Ne6 line number of the subroutine to branch to Indicating the command ON KEY GOSUB is called NY is the line number ON KEY NY of the subroutine to branch to Indicating the command ON MINUTE SHARP GOSUB is called NY is the ON MINUTE SHARP N line number of the subroutine to branch to Indicating the command ON NET GOSUB is called N is the line number ION_NET N lof the subroutine to branch to Indicating the command ON READER GOSUB is called N1 is the number of the reader port N2 is the line number of the subroutine to ION_READER N1 N2 branch to Indicating the command ON TIMER GOSUB is called N1 is the number ON TIMER N1Y N2yo of the timer N2 is the line number of the subroutine to branch to Indicating the command OPEN COM is processed N1 is the number of OPEN COM NT 96 he COM port bp lean the logical operation OR is processed PRINT A Indicating the command PRINT is processed 135 RAM_SIZE Indicating the command RAM_SIZE is processed Indicating the command READ_COMS is processed N is the numbe
107. g which IDX file to be accessed If it is not specified then the default IDX file which keeps the original data sequence will be used 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 DBF1 IDX 1 Dx2 011 231 011 231 043 010 120 117 043 010 120 117 043 010 067 150 067 150 067 150 120 117 011 231 Then DEL_RECORD 1 wil delete 067 150 DEL_RECORD 1 1 will delete 120 117 DEL_RECORD 1 2 will delete 011 231 ON COM 1 GOSUB HostCommand HostCommand Cmd READ_COM 1 Cmaldentifier LEFT Cmdf 1 DBFNum VAL MID Cmd 2 1 IDFNum VAL MID Cmd 3 1 CardID RIGHT Cmd LEN Cmd 3 IF Cmdldentifier THEN DEL_RECORD DBFNum IDFNum ELSE 201 510 520 711 720 To remove all the records from the specified DBF file EMPTY_FILE file file is an integer in the range of 1 to 3 1 to 5 for 7xx indicating which DBF file to be accessed ON COM 1 GOSUB HostCommand HostCommand Cmd READ_COM 1 Cmaldentifier LEFT Cmdf 1 90 FIND RECORD Purpose Syntax Remarks Usage GET_RECORD Purpose Syntax Remarks DBFNum VAL MID Cmd 2 1 IDFNum
108. ge of 1 to 255 Optional offset N sets the position for starting the search XF Y may be a string variables string expressions or string constants If Y is found in X INSTR returns the position of the first occurrence of Y in X from the starting point lf Nis larger than the length of X or if X is null or if Y cannot be found INSTR returns 0 If Y is null INSTR returns N or 1 if Nis not specified Usage String1 11025John Thomas Accounting Manager String2 EmployeeName MID String1 6 INSTR String1 String2 6 The employee s name starts at the sixth character 4 4 5 Retrieving Part of Strings Several commands are provided to take strings apart returning pieces of a string either from the left side the right side or the middle of the target string LEFT 201 510 520 711 720 Purpose To retrieve a given number of characters from the left side of the target string Syntax A LEFT X N Remarks A is a string variable to be assigned with the result N is a numeric expression in the range 0 to 255 X may be a string variables string expressions or string constants If Nis larger than the length of X the entire string X will be returned If Nis zero the null string with length 0 is returned Usage String1 11025John Thomas Accounting Manager EmployeelD LEFT String1 5 MID 201 510 520 711 720 Purpose To retrieve a given nu
109. ger or an integer expression The DIM statement sets all the elements of the specified arrays to an initial value of zero or empty string Note the maximum allowable number of dimensions for an array is 2 Usage DIM A 10 B 20 C 30 10 GOTO 201 510 520 711 720 Purpose The GOTO statement branches unconditionally out of the normal program sequence to a specified line number or line label Syntax GOTO LineNumber LineLabel Remarks LineNumber is the interger number in front of a line LineLabef is the string label of a line to branch to Usage Loop GOTO Loop GOSUB 201 510 520 711 720 Purpose To call the specified subroutine Syntax GOSUB SubName SubLabel Remarks SubName is the name of a subroutine SubLabef is the line label of a subroutine Usage GOSUB Dolt INT Purpose Syntax Remarks Usage REM Purpose Syntax Remarks Usage SET_PRECISION Purpose Syntax Remarks Usage GOSUB Done SUB Dolt PRINT Now I ve done it END SUB Done PRINT Now you ve done it RETURN 201 510 520 711 720 The INT function returns the largest integer that is less than or equal to the given numeric expression A INT N A is an integer variable to be assigned with the result Nis a numeric expression A INT 2 86 Ae 8 B INT 2 86 B 2 201 510 520 711 720 To insert explanatory remarks in a program REM remark remark remark may
110. gth Fixed Length 2 1 Interleave 25 Code Length Limitation in Max Min Length Format 0 Interleave 25 Code Length Limitation in Fix Length Format nterleave 25 Max Code Length Fixed Length 1 Interleave 25 Min Code Length Fixed Length 2 1 Matrix 25 Code Length Limitation in Max Min Length Format 0 Matrix 25 Code Length Limitation in Fix Length Format Matrix 25 Max Code Length Fixed Length 1 Matrix 25 Min Code Length Fixed Length 2 1 MSI Code Length Limitation in Max Min Length Format 0 MSI Code Length Limitation in Fix Length Format MSI 25 Max Code Length Fixed Length 1 MSI Min Code Length Fixed Length 2 Scan Mode for Scanner Port 1 Auto Off Mode Continuous Mode Auto Power Off Mode Alternate Mode Momentary Mode Repeat Mode Laser Mode Test Mode Aiming Mode can Mode for Scanner Port 2 Auto Off Mode Continuous Mode Auto Power Off Mode Alternate Mode Momentary Mode Repeat Mode AWN H ODMUOnNDARWN O 51 6 Laser Mode 7 Test Mode 8 Aiming Mode Scanner Time out Duration in seconds for Scanner Port 1 Scanner Time out Duration in seconds for Scanner Port 2 Usage READER_SETTING 1 1 Code 39 readability is enabled 52 4 8 Keyboard Wedge Commands Terminals 201 711 and 720 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 Wedge Sett
111. gy Parameters D 1 1 Code 39 e Transmit Start Stop This parameter specifies whether the start stop characters of Code 39 are included in the data being transmitted e 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 e Transmit Checksum If this parameter is enabled the checksum character vvill be included in the data being transmitted s Code 39 Full ASCII User can check the box to read Full ASCII Code 39 D 1 2 Italy French Phamacode e Transmit Checksum If this parameter is enabled the checksum character vvill be included in the data being transmitted D 1 3 Industrial Interleave Matrix 2 of 5 e Start Stop Selection This parameter provides the readability of all 2 of 5 symbology variants For example flight tickets actually use an Industrial 2 of 5 barcode but with Interleave 2 of 5 start stop In order to read this barcode the start stop selection parameter of Industrial 2 of 5 should set to Interleave 25 e Verify Checksum If this parameter is enabled the target terminal will perform checksum verification when decoding these barcodes If the checksum is incorrect the barcode will not be read e Transmit Checksum If this parameter is enabled the checksum character vvill be included in the data being transmitted 125 D 1 4 D 1 7 Le
112. ines are programs being preloaded on the CipherLab terminals to execute the BASIC object files They must exist in the terminals before the BASIC object files are downloaded For detailed information of the BASIC Run time Engines please refer to the relevant section To download the Run time Engine and or any other programs the target terminal needs to be set to the Download Mode first to receive the new program For fixed terminals such as 201 510 and 520 the program is downloaded via the RS 232 port For the 7xx portable terminals the program is downloaded via RS 232 Docking IR or IrDA port The ways to set to the Download Mode for different models of terminals may be somewhat different They are discussed separately below 1 201 510 The way to set 201 510 to the Download Mode depends on the existing program The COM port properties for download are defined by the existing program as well User should refer to the existing program to find out how to download a new program For the 201 with ben shx the 201 standard program user can scan the setup barcode to enter the Setup Menu and then toggle the menus to enter the Download Mode The new program can be downloaded through C2 or AUX 232 port with the COM port properties as 38400 bauds no parity 8 data bits and CTS RTS handshaking For the 510 with 510T amp A_150 shx the 510 standard program user can power on the terminal with the keys 3
113. information About A message box containing ownership declaration and version information will be shown upon selecting this menu item 11 3 Basics of CipherLab BASIC Language 3 1 Constants Constants are the actual values that BASIC uses during execution There are two types of constants string and numeric 3 1 1 String A string constant is a sequence of up to 255 alphanumeric characters or symbols enclosed in double quotation marks Examples of string constants are a Hello b 20 000 00 c 12 Students 3 1 2 Numeric Numeric constants are positive or negative numbers Numeric constants in BASIC cannot contain commas There are three types of numeric constants that can be used in CipherLab BASIC Compiler a Integer Constants whole numbers between 32 768 and 32 767 Integer constants do not have decimal points b Real Number Constants positive or negative real numbers i e numbers that contain decimal points c Long Integer Constants whole numbers between 2 147 483 648 and 2 147 483 647 12 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 Before a variable is assigned a value its value is assumed to be undefined 3 2 1 Variable Names and Declaration Characters Fol
114. ing variable to be assigned with the response from the master Inquiry is the inquiry string to be sent to the master Timeout is an integer that indicates the time duration of the inquiry It is specified in units of 5 ms If no response is received after the time duration has expired a NULL string will be returned ON READER 1 GOSUB BerData_1 BerData 1 BEEP 2000 5 BerData GET_READER_DATA 1 Response INQUIRY BcrData 81 READ NET 201 510 520 Purpose To read messages from the host computer Syntax A READ NET Remarks A is a string variable to be assigned with the message from the host computer The message sent by the host computer must be in a format of ssx x where is the command identifier ss is a two digit station ID of the destination terminal 00 for broadcasting and x x is the message to be sent Usage ON NET GOSUB NetCmd NetCmd LOCK HostCmd READ_NET UNLOCK RETURN REPLY 201 510 520 Purpose To enable the master station to send a response string to the inquiry Syntax REPLY Reply Remarks Reply is a character string to be sent back to the inquiry originator Usage ON ENQUIRY GOSUB Verfication Verfication LOCK InqString GET_INQUIRY InqData RIGHTS IngString LEN InqString 3 strip off the station ID and the inquiry identifier 2 FOR I 1 TO 10 WRITE_NET InqData WAIT 100 wait 0 5 sec Response
115. ings Command SET_WEDGE is used to configure these parameters 4 8 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 WedgeSetting Wedge_1 Wedge_2 VVedge 39 The functions of the parameters Wedge_1 Wedge_2 and Wedge_3 are described in the following subsections Parameter Bit Description Wedge_1 KBD Terminal Type e da 0 disable capital lock auto detection pm D iaon OOOO 0 capital lock off VVedge 2 5 1 ignore alphabets case PM LO Jonas are casa senstie Wedge_2 4 3 00 normal 10 digits are at lower position 1 digits are at upper position VVedge 2 2 1 100 normal 10 capital lock keyboard 11 shift lock keyboard VVedge 2 1 use numeric key pad to transmit digits 0 use alpha numeric key to transmit digits 4 8 2 KBD Terminal Type The first element determines which type of keyboard wedge is applied The possible value is listed as follows 0 Natasa nor anens E PCAT PS55 002 82 003 82 EJ i e a a o poreo o S S e peoe e pesos TJ RRR 53 For example if the terminal type is PCAT US then the first element of the WedgeSetting can be defined as Wedge_1 CHR 1 4 8 3 Capital Lock Auto Detection If Capital Lock Auto Detection is enabled the SEND _WEDGE function ca
116. ion Transmit Start Stop of Code 39 is selected a barcode with the value 1234567890 printed in Code 39 would not be able to set the Run time Engine to the System Mode because the barcode will be interpreted as 1234567890 The BASIC Compiler Run time Engine on 201 510 520 allows the user to configure several system settings or to update the embedded BASIC program The first item of the setup menu will be shown on the LCD as soon as the master setup barcode magnetic card is read The items are listed as follows 1 Station ID To setup the station ID of the terminal Enter 2 digits from the numeric keys Press Esc or F2 to abort the change of the setting 2 Com1 Baud To setup the baud rate of COM1 Press F1 to select the value Esc or F2 to abort the change of the setting Default 9600 3 Com1 Parity To setup the parity of COM1 Press F1 to select the value Esc or F2 to abort the change of the setting Default None 4 Com1 Data Bit To setup the data bit of COM1 Press F1 to select the value Esc or F2 to abort the change of the setting Default 8 5 Com1 Flow To setup the flow control method of COM1 Press F1 to select the value Esc or F2 to abort the change of the setting Default None 6 Com3 Baud To setup the baud rate of COM3 Press F1 to select the value Esc or F2 to abort the change of the setti
117. is is the counter command of START_DEBUG Usage STOP_DEBUG 98 4 20 Reserved Host Commands Usually terminals on the RS 485 network use the command READ NET to receive commands from the host computer and they need to have functions in the BASIC program to process the received host commands The host commands have a special format ssx x where I is the command identifier ss is a two digit station ID of the destination terminal 00 for broadcasting and x x is the message to be sent After calling START NETWORK in BASIC program user can issue a set of reserved RS 232 commands from the host computer to the master to inquire the on line station IDs to read remove the data of the transaction file or to adjust the system time With the reserved RS 232 commands the command identifier I and the station ID are not needed because these commands will be sent to the master and processed by the master only The user s BASIC program does not need to do any processing because they will be processed by the background routines of the BASIC run time Please note that each reserved RS 232 command is ended with a carriage return can be changed by the COM_DELIMITER command If any format error occurs the master would echo NAK CLEAR 201 510 520 711 720 Purpose To erase all the data of the transaction file Syntax CLEAR CLEARN for 7xx terminals only where Nis in the range of 1 to 6 Remarks The target t
118. l when the occurrence of the event is predictable in the flow of the program But if the time of the occurrence of the event is not predictable trapping becomes the better alternative because the program will not be paused by the looping statements For example the following statements cause the program rerouting to the Key_F1 subroutine when the key F1 is pressed at anytime ON KEY 1 GOSUB Key Fi Key Fi This section describes the different events the CipherLab BASIC can trap and the related commands 4 5 1 Event Triggers There are 10 different events that can be trapped They are listed and described as follows 1 COM Event a signal is received from the COM port 2 DIGIN Event a digital input port changes its state 3 INQUIRY Event an inquiry is sent to the master station 4 ESC Event the key ESC is pressed 5 HOUR_SHARP Event the system time is on the hour 6 KEY Event a function key is pressed 7 MINUTE_SHARP Event the system time is on the minute 8 NET Event a net command is received from the RS485 port 9 READER Event a barcode or magnetic card data is decoded 10 TIMER Event an activated timer is time out 35 OFF ALL Purpose Syntax Remarks Usage OFF COM Purpose Syntax Remarks Usage OFF DIGIN Purpose Syntax Remarks 201 510 520 711 720 To disabled all the event triggers OFF ALL All the event triggers will be disabled To resume the event trigger the command O
119. les associated with this file structure These two types of files are called DBF files and IDX files A DBF file has a fixed record length structure This is the file that stores the data records members whereas the associated IDX files are the files that keep the information of the position of each record stored in the DBF file but they are re arranged sorted according to some specific key values Besides the IDX files explicitly created by the user the BASIC run time also maintains a default IDX file which keeps the original data sequence A library would be a good example to illustrate how DBF and IDX files work When you are trying to find a specific book in a library you always start from the index The book can be found by looking into the index of book title writer publisher ISBN number etc All these indexes are sorted in ascending order for easy lookup according to some specific information of books book title writer publisher ISBN number When the book is found in the index it will tell you where the book is actually stored As you can see the books kept in the library are analogous to the data records stored in the DBF file and the various indexes are just its associate IDX files Some information in the data records the book title writer publisher and ISBN number is used to create the IDX files A BASIC program can have up to 3 DBF files 5 DBF files for 7xx Each DBF file can have up to 3 associated IDX
120. lization e Test To test the data memory For 256 KB SRAM it takes about 15 seconds to complete the test Note that this is a destructive memory test and the contents of RAM will also be cleared 2 Setting e Clock To set new date and time e Backlit To set the intensity of LCD backlight and the duration for staying on Default High intensity the LCD backlightlight will switch off after 20 seconds e Speed To set CPU running speed There are five speeds available Full speed 1 2 speed 1 4 speed 1 8 speed and 1 16 speed which need about 39mA 22mA 12mA 7mA and 5mA respectively during normal operation without scanning or data transmission If high speed operation is not required selecting low CPU speed will save battery power Default Full speed e Auto Off Set the time required for auto power off This value is applied when the unit is idle If this value is set to zero this function will be disabled Default 10 minutes e Power On There are two possible selections Program Resume which starts from the program being used during the last session before the last power off and Program Restart which starts with a new program Default Program Resume e Station ID Set station ID number for the terminal This ID number is used to identify the terminal when it is transmitting data in a cradle that is connected with other cradles Default 1 e Key Click To enable disable key click sound Default Enable 3 Reader Readin
121. lowing are the rules for variable names and declaration characters a b d e 3 2 2 A variable name must begin with a letter A through Z The remaining characters can be letters numbers and or underscores The last character can be one of these type declaration characters i integer i 2 bytes 32 768 to 32 767 ii amp long 4 bytes 2 147 483 648 to 2 147 483 647 iii real number i 4 bytes iv string v nothing default 2 bytes 32 768 to 132 767 The variable name cannot be a BASIC reserved word Variable names are not case sensitive Array Variables An array is a group or table of values referenced by the same variable name Each element in an array is referenced by an array variable that is subscripted with an integer or an integer expression a An array variable name has as many dimensions as there are subscripts in the array For example i A 12 would reference a value in a one dimension array ii 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 i DIM IntegerA 20 Declare an integer array with 20 elements ii DIM SringB 100 Declare a string array with 100 elements iii DIM RealC 10 Declare a real number array with 10 elements iv DIM Tb 5 5 Declare a two dimension integer array with 5X5 elements v ArrayD i 1 j Th
122. m If this parameter is enabled the checksum character will be included in the data being transmitted EAN13 amp 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 Transmit UPCA System Number If this parameter is enabled the UPCA system number will be included in the data being transmitted Transmit UPCA Checksum If this parameter is enabled the UPCA checksum character will be included in the data being transmitted Scanner Parameters The user can define the scanner parameters for reader ports 1 and 2 Since the 7xx terminals support only one reader port the settings for reader port 2 will be ignored if the target is a 7xx terminal D 2 1 Scan Mode Auto Off Mode The scanner will start scanning once the switch is triggered The scanning continues until either a barcode is read or a preset scanning period Time Out has expired This is the default scan mode Continuous Mode The scanner is always scanning but will just decode the same barcode once To read the same barcode the barcode must be taken away from the scanning line and back again Auto Power Off Mode The scanner will start scanning
123. mands are divided into different types and are described separately as follows 4 16 1 RS 232 Communications 1 Baud Rate One out of 8 baud rates can be selected 520 7xx 115200 76800 57600 38400 19200 9600 4800 2400 201 510 38400 19200 9600 4800 2400 1200 600 300 2 Data Bits 7 or 8 3 Parity Even Odd or None 4 Stop bit 1 5 Flow Control RTS CTS XON XOFF or None CLOSE_COM 201 510 520 711 720 Purpose To disable the specified communication port Syntax CLOSE_COM N Remarks N is a numeric expression indicating which communication port is to be disabled Usage CLOSE_COM 3 COM_DELIMITER 201 510 520 711 720 Purpose To change the delimiter of COM port sending amp receiving string Syntax COM_DELIMITER N C Remarks N is a numeric expression indicating which communication port is to be set For 201 510 only COMS is valid C in the range of 0 to 255 stands for the ASCII code of the delimiter character If it is negative no delimiter will be applied Usage COM_DELIMITER 3 10 REM use Line feed as delimiter GET_CTS Purpose Syntax Remarks Usage OPEN_COM Purpose Syntax Remarks Usage READ COM Purpose Syntax Remarks Usage 201 510 520 711 720 To get the CTS level from the specified communication port A GET CTS N A is an integer variable to be assigned with the result N is a numeric expression indicating which communicati
124. mber of characters from anywhere in the target string Syntax A MID X N M Remarks A is a string variable to be assigned with the result 30 Usage RIGHT Purpose Syntax Remarks Usage TRIM_LEFT Purpose Syntax Remarks Usage TRIM_RIGHT Purpose Syntax Remarks Usage N and M are numeric expressions in the range 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 Mh character If Mis omitted or if there are fewer than M characters to the right of the Nth character all rightmost characters beginning with the Mh character are returned f Mis equal to zero or if Nis greater than the length of X then MID returns a null string String1 11025John Thomas Accounting Manager String2 EmployeeName MID String1 6 INSTR String1 String2 6 The employee s name starts at the sixth character 201 510 520 711 720 To retrieve a given number of characters from the right side of the target string A RIGHTS X N A is a string variable to be assigned with the result N is a numeric expression in the range 0 to 255 X may be a string variable string expression or string constant If Nis larger than the length of X the entire string X will be returned If Nis zero the null string with length 0 is return
125. mmand SET_PRECISION is processed N is the N numerical precision Indicating the command SET_RTS is processed N1 is the number of the ISET_RTS N1 N2 ICOM port N2 is the RTS status Indicating the command SET_STATION_ID is processed N is the new ID N station ID Indicating the command SET VIDEO MODE is processed N is the N ideo mode selected Indicating the command SET_WEDGE is processed A is the character ISET_WEDGE A array for the Wedge Settings Indicating the command SHIFT_LOCK is processed N is the shift lock ISHIFT_LOCK N status N14 N2 NS SHOW IMAGE SIGN NP SMC_SIZE START_NETWORK STOP STOP_BEEP STOP NETWORK TAS NM N SUBIN N24 Indicating the stack s level When the program branches to a subroutine he 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 N happens TIMES Indicating the system time is inquired 136 D D Q S 9 8 e p Q Ja JJ S 12 3 19 D u mo D m Q D Q Z SET_STATION ID SET VIDEO MODE RE D D 4 lt T Z E 2 GO J A m Q E E m Z te Q Z J een one the command TRANSACTION_COUNT_EX is processed N is TRANSACTION COUNT EX NY6 he number of the transaction file Indicating the command UPDATE_RECORD_EX is processed N1 is the number of the DBF file N2 is the number of the IDX file A is the new UPDATE_RECO
126. n automatically detect the capital lock status of keyboard when the keyboard type selected is PCAT all available languages PS2 30 PS55 or Memorex Telex If this is the case the SEND_WEDGE function will ignore the capital lock status setting and perform auto detection when transmitting data If Capital Lock Auto Detection is disabled the SEND WEDGE function will transmit alphabets according to the setting of the capital lock status If the keyboard type selected is neither PCAT PS2 30 PS55 nor Memorex Telex the SEND_WEDGE function will transmit the alphabets according to setting of the capital lock status even though the auto detection setting is enabled To enable Capital Lock Auto Detection add 128 to the value of the second element of WedgeSetting Wedge_2 4 8 4 Capital Lock Status Setting To send alphabets with correct case upper or lower case the SEND_WEDGE function must know the capital lock status of keyboard when transmitting data Incorrect capital lock setting will result in different letter case A becomes a and a becomes A To set Capital Lock ON add 64 to the value of the second element of WedgeSetting VVedge 29 4 8 5 Alphabets Case The setting of this bit affects the way the SEND VVEDGE function transmits alphabets The SEND_WEDGE function can transmit alphabets according to their original case case sensitive or just ignore it If ignoring case is selected the
127. nd 2 Syntax Describes the command syntax according to the following conventions a CAPS BASIC keywords are indicated by capital letters b Itatlics Items in tatlics represent variable information to be supplied by the user c Square brackets indicate optional parameters d U Braces indicate an item may be repeated as many times as necessary e Vertical bar indicates alternative option 3 Remarks Supplies additional information in detail regarding correct command usage 4 Usage Illustrates various ways of using the statement and highlights applicable and unusual modes of operation The types of terminals that support the specified BASIC command are listed to the right of the title bar of the command 20 4 1 General Commands This section describes the commands that are not confined to any specific hardware features ABS 201 510 520 711 720 Purpose The ABS function returns the absolute value of a numeric expression Syntax A ABS N Remarks A is a numeric variable to be assigned with the absolute value of a numeric expression N is a numeric expression its result can be interger or real number Usage TimeDifference ABS Time1 Time2 DIM 201 510 520 711 720 Purpose To specify the maximum values of variable subscripts and to allocate storage accordingly Syntax DIM Array range range Array range range Remarks Array is an array variable range can be an inte
128. nd counts which would be updated periodically An easy way to see if the system is working properly 10 The RS 232 port has been fixed to 38400 N 8 11 Download program code from PC 12 After downloading is completed turn off the terminal 13 Straight up the handle and remove the flash chip from the socket 14 Put the flash chip back into the terminal 15 Power on the terminal to start the new program 123 Appendix C Run Time Error Table E Not an Lvalue 124 Appendix D Barcode Setting The CipherLab terminals support the decodability of several barcode symbologies including Code 39 Italy phamacode French phamacode Industrial 2 of 5 Interleave 2 of 5 Matrix 2 of 5 Codabar MSI Plessey Code 93 UPCE UPCE w Addon 2 UPCE w Addon 5 EAN 8 EAN 8 w Addon 2 EAN 8 w Addon 5 EAN 13 amp UPCA EAN 13 w Addon 2 EAN 13 w Addon 5 Code 128 and so on The BASIC Compiler provides the user a menu driven interface to configure the decodability of these barcode symbologies and also the scanner behavior On the Barcode Setting window the user can check the box in front of a barcode type to enable the decodability with respect to the barcode type For some of the supported barcode symbologies the user may click the Config button to do more configurations such as enable disable the checksum verification This appendix describes these symbology parameters and scanner parameters D 1 Symbolo
129. ne LOCATE 1 1 A 5 PRINT A square is A A 520 711 720 To select different font size for the LCD display SELECT_FONT font font may be 1 2 or 3 1 font size 6X8 2 font size 8X16 3 font size 16X24 for 520 only Note that the 16X24 font size is not available for terminals 711 and 720 SELECT_FONT 2 520 711 720 To set the display mode for the LCD SET_VIDEO_MODE mode mode may be 0 or 1 0 normal mode 1 reverse mode SET_VIDEO_MODE 1 PRINT CipherLab 520 This string will be printed in reverse mode 520 711 720 To show a bitmap on the LCD display SHOW_IMAGE x y size_x size_y image x is the x coordinate of the upper left point of the image y is the y coordinate of the upper left point of the image size x96 is the width of the image in pixels size_y is the height of the image in pixels image is a string containing the bitmap data of the image The user needs to allocate a string variable to store the bitmap data for the image The string begins with the top row of pixels Each row begins with the leftmost pixels Each bit of the bitmap represents a single pixel 73 Usage of the image If the bit is set to 1 the pixel is marked and if it is 0 the pixel is unmarked The first pixel in each row is represented by the least significant bit of the first byte in each row If the image is wider than 8 pixels the ninth pixel in e
130. ng Default 9600 7 Com Parity To setup the parity of COM3 Press F1 to select the value Esc or F2 to dort the change of the setting Default None 8 Com Data Bit To setup the data bit of COM3 Press Fi to select the value Esc or F2 to abort the change of the setting Default 8 9 Com3 Flow To setup the flow control method of COM3 Press Fi to select the value Esc or F2 to abort the change of the setting Default None 10 Setup Master ID To setup the ID of the master setup card by scanning the new master setup card Press Esc or F2 to abort the change of the setting 11 Basic Download To download new BASIC program via RS 232 port The COM port properties are fixed to 38400 no parity 8 data bits no handshake 12 Erase Program To erase the existing BASIC program Press Enter key to rotate through the options on the LCD The user can scan the master setup card again or just turn the unit off and on to reboot the terminal The new settings will be activated after reboot 7XX Pressing the 7 9 and POWER keys simultaneously will enable the 7xx terminals to enter the System Mode which provides the following options 1 Memory e Size Information Includes the SRAM Data memory size and FLASH Program memory size in kilobytes e Initialize To initialize the data memory RAM Note that the contents of RAM will be cleared after memory initia
131. ngth 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 If Max Min Length is selected the maximum length and the minimum length must be specified The target terminal will only accept those barcodes with lengths that fall between max min lengths specified Codabar Start Stop Character User can select no start stop characters or one of the four different start stop character pairs i e abcd abcd abcd tn e ABCD ABCD and ABCD TN E to be included in the data being transmitted MSI Checksum Verification User can select one of the three kinds of checksum calculations i e Single Modulo 10 Double Modulo 10 and Modulo 11 amp 10 to verify MSI code If the checksum character is incorrect the barcode will not be read Checksum Transmission This parameter specifies how the checksum is to be transmitted User can select from Last digit not transmitted Transmitted and Last 2 digits not transmitted Length Qualification Because of the weak structure of the MSI code it is possible to make a short scan error To
132. ogram HHHH 107 5 4 510AC_100 BAS IKKKKKKKKKKKKKKAKKKKKKKKKKKKKKKKEKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKKKKKKKKKKKKK Program BASIC Sample Program 510AC 100 BAS 7 Target Machine 510 pa Description This is an access control program for 510 User can download data to DBF1 on the master by using the predefined RS 232 commands 7 The format of each record of the DBF1 is like b xxxxxyyyyyyyyyyyyyyyaabbccddeeffgghhiijjkkllmmnnoopp where XXXXX 5 digit employee ID i y y 15 digit employee name aabbccdd the period of time for sign in Z eeffgghh the period of time for lunch break p iijjkkll the period of time for return from lunch break mmnnoopp the period of time for getting off The commands for the host to manage the master such as to adjust the timer or the modify DBF1 are listed as follows assuming the station ID of the master is 01 101 TIMER to inquire the current system time 101 TIMER yymmddhhnnss to set the current system time I01 xx pp to add a record to the DBF1 where xx pp is a 52 digits data for the employee please refer to the above description ig 101 xx pp to remove a record from the DBF 1 1012ALL to list all the records of the DBF1 101CIPHERLAB to tell the master that the connection is still alive When an employee ID is read the terminal will check if it is connected to
133. ommand TRANSACTION_COUNT_EX 1 works the same as the command TRANSACTION_COUNT 87 Usage DataCount_1 DataCount TRANSACTION COUNT EX 1 CLS PRINT DataCount data in transaction file 1 RETURN UPDATE_TRANSACTION 201 510 520 711 720 Purpose To update a transaction record in the default first transaction file Syntax UPDATE_TRANSACTION N data Remarks N26 is a numeric expression indicating the ordinal number of the transaction record to be updated data is the character string to replace the old data Usage a UpdateTransaction UPDATE_TRANSACTION Num NewData RETURN UPDATE TRANSACTION EX 711 720 Purpose To update a transaction record in the specified transaction file Syntax UPDATE TRANSACTION EX file N data Remarks file is an integer in the range of 1 to 6 indicating which transaction file to access The command UPDATE TRANSACTION EX 1 N Datat works the same as the command UPDATE TRANSACTION NY Data N is a numeric expression indicating the ordinal number of the transaction record to be updated data is the character string to replace the old data Usage UpdateTransaction_1 UPDATE_TRANSACTION_EX 1 Num NewData RETURN 4 17 2 DBF Files and IDX Files The other file structure supported 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 fi
134. on port the user intends to get the CTS level for The return value is 1 if the CTS is in Mark state or 0 if the CTS is in Space state A GET_CTS 1 201 510 520 711 720 To enable the specified communication port OPEN_COM N N is a numeric expression indicating which communication port is to be enabled OPEN_COM 1 201 510 520 711 720 To read data from the specified communication port A READ COMP N A is a string variable to be assigned with the data N is a numeric expression 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 ON COM 1 GOSUB HostCommand HostCommand Cmd READ_COM 1 Cmaldentifier LEFT Cmdf 1 DBFNum VAL MID Cmd 2 1 IDFNum VAL MID Cmd 3 1 CardID RIGHT Cmd LEN Cmd 3 IF Cmdldentifier THEN DEL_RECORD DBFNum IDFNum ELSE TI SET_COM 201 510 520 711 720 Purpose To set parameters for the specified communication port Syntax SET COM NY Baudrate Parity Data Handshake Remarks 1 3 N Indicates which COM port is to be set Baudrate Specifies the baud rate of 1 38400 bps 1 115200 bps the COM port 2 19200 bps 76800 bps 3 9600 bps 57600 bps 4 4800 bps 38400 bps 5 2400 bps 19200 bps 6 1200 bps 9600 bps 7 600 bps 4800 bps 8 300 bps 2400 bps Parity 1 No Parity
135. ostCmd 5 1 AND LEN HostCmd INPUT_TIME_LENGTH THEN DATE MID HostCmd 6 6 TIME MID HostCmd 12 6 OutBuffer DONET ELSE IF LEN HostCmd 4 THEN OutBuffer DATE TIMES END IF Cmadldentifier LEFT HostCmd 1 Empld MID HostCmd 2 5 IF Cmdldentifier AND LEN HostCmd DATA_LENGTH 1 THEN IF FIND RECORD 1 1 Empld 1 THEN UPDATE_RECORD 1 1 RIGHT HostCmd LEN HostCmd 1 DEL_RECORD 1 1 ADD_RECORD 1 RIGHT HostCmd LEN HostCmd 1 ELSE ADD_RECORD 1 RIGHT HostCmd LEN HostCmd 1 END IF 112 OutBuffer DONE ELSE IF Cmdldentifier AND LEN HostCmd ID_LENGTH 1 THEN IF FIND RECORD 1 1 Empld 1 THEN DEL_RECORD 1 1 OutBuffer DONE ELSE OutBuffer NOMATCH END IF ELSE IF HostCmd ALL THEN MOVE_TO 1 1 1 Temp Loop_Find OutBuffer GET_RECORD 1 1 IF OutBuffer Temp THEN GOTO End_Find ELSE IF OutBuffer lt gt THEN WRITE_COM 1 OutBuffer Temp OutBuffer MOVE_TO_NEXT 1 1 END IF GOTO Loop_Find End_Find OutBuffer OVER ELSE IF HostCmd CONNECT1 THEN OutBuffer CONNECT2 GOSUB SetConneciFlag ELSE OutBuffer NAK END IF END IF WRITE_NET OutBuffer UNLOCK RETURN VARKER RIK IR KIKI IIIA KIBAKI IIR III II IRI IIIA KI IIR e k e ke ke ke H k IKI III III III III IKI IKI III III k k Routine SetConnectFlag Purpose To set the connect flag Return Call ClearConnectFlag on TIMER2 5 sec SetConn
136. pon a successful scan Syntax A CODE_TYPE Remarks A is an integer variable to be assigned with the result The following list shows the possible values of the CODE_TYPE spass LT Code 39 65 A EANB8 with Addon 2 78 N Italy Pharma code EAN8 with Addon 5 O P 66 79 CIP 39 67 C EAN13 no Addon 68 81 P Industrial 25 EAN13 with Addon 2 Interleave 25 69 E EAN13 with Addon 5 82 R TE 8515 Codabar NW7 71 G 84 T Code 93 72 H JCode ABC 85 U Code128 73 1 ISO Track 1 97 a UPCE no Addon 74 J ISO Track 2 98 b UPCE with Addon 2 75 K ISO Track 1 and 2 99 c UPCE with Addon 5 76 L ISO Track 2 and 3 100 d EAN8 no Addon 77 M JIS Il Usage Sh CheckCodeType IF CODE_TYPE 65 THEN BerType Code 39 ELSE IF CODE_TYPE 66 THEN BerType Italy Pharma code END IF PRINT Code Type BerType RETURN DISABLE READER 201 510 520 711 720 Purpose To disable the reader ports of the terminal Syntax DISABLE READER N Remarks N may be 1 or 2 for terminals 201 510 and 520 N is 1 for terminals 711and 720 Usage DISABLE READER 1 47 ENABLE READER 201 510 520 711 720 Purpose To enable the reader ports of the terminal Syntax ENABLE READER N Remarks N may be 1 or 2 for terminals 201 510 and 520 N is 1 for terminals 711and 720 The reader ports are disabled by default With the 201 510 520 only the Master Setup Card can be r
137. 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 If Max Min Length is selected the maximum length and the minimum length must be specified The target terminal will only accept MSI code with lengths that fall between max min lengths specified Plessey Convert to UK Plessey If this parameter is enabled the target terminal will change each occurrence of the character A to character X in the code Checksum Transmission If this parameter is enabled the checksum characters two characters will be transmitted together with data UPCE Convert to UPCA If this parameter is enabled the read UPCE barcode will be expanded into UPCA and the next processing will follow the parameters configured for UPCA Transmit System Number If this parameter is enabled the system number will be included in the data being transmitted 126 D 2 Transmit Checksum If this parameter is enabled the checksum character vvill be included in the data being transmitted EAN8 Convert to EAN 13 If this parameter is enabled the EAN 8 read vvill be expanded into EAN 13 and the next processing will follow the parameters configured for EAN 13 Transmit Checksu
138. r of READ_COM N he COM port READ _NET Indicating the command READ_NETS is processed Indicating the command READER_SETTING is processed N1 is the T N1 N2 setting number N2 is the value of the setting Indicating the command RECORD_COUNT is processed N is the N number of the DBF file REPLY A Indicating the command REPLY is processed A the message to reply Indicating the command RETURN is processed N is the line number to RETURN N return if it is not null RIGHT A Indicating the command RIGHT is processed ROM SIZE Indicating the command ROM SIZE is processed Indicating the command SAVE TRANSACTION A is the data to be SAVE TRANSACTION AS saved Indicating the command SAVE_TRANSACTION_EX N is the number of ISAVE_TRANSACTION_EX N A he transaction file A is the data to be saved Indicating the command SELECT_FONT is processed N is the selection ISELECT_FONT N of the font size Indicating the command SEND VVEDGE is processed A is the character ISEND_WEDGE A string be sent Indicating the command SET_COM is processed N1 is the number of ISET_COM N1 N2 N3 N4 N5 ne COM port N2 N3 N4 N5 are the settings of the COM port Indicating the command SET COMM TYPE is processed N1 is the SET COMM TYPE N1 N2 number of the COM port N2 is the type of the COM port Indicating the command SET CURSOR is processed N is the cursor ISET_CURSOR N status Indicating the co
139. rd TempRecord CLS LOCATE 2 10 PRINT Bye BEEP 3000 30 ON TIMER 1 200 GOSUB ClearLCD TIMER 1 2 sec LOCATE 3 1 PRINT Go back to work BEEP 2000 20 ON TIMER 1 200 GOSUB ClearLCD TIMER 1 2 sec ON TIMER 2 60000 GOSUB ForceToLogout TIMER 2 10 min END IF RETURN IKKKKKAKKKEKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKEKKKKKKKKKKKKKKKKKKAKKKKKKKKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Routine ChgPasswd Purpose To change the user s password Return LoginFlag 0 system error Call ClearLCD on timer 1 L ForceToLogout on timer 2 ChgPassuvd IF LoginFlag 0 THEN RETURN BEEP 3000 10 0 10 3000 10 OFF TIMER 1 OFF TIMER 2 CLS LOCATE 1 1 PRINT User ID UserlD LOCATE 2 1 PRINT Enter new password LOCATE 3 1 Loop_ChgPasswd1 116 INPUT MODE 2 INPUT NewPassword1 IF NewPassword1 THEN GOTO Loop_ChgPasswd1 CLS LOCATE 1 1 PRINT User ID UserlD LOCATE 2 1 PRINT Please enter again LOCATE 3 1 Loop_ChgPasswa2 INPUT_MODE 2 INPUT NewPassword2 IF NewPassword2 THEN GOTO Loop_ChgPasswd2 IF NewPassword1 NewPassword2 THEN LOCK IF FIND RECORDI1 1 UseriD 1 THEN A UserlD NewPassword1 DEL_RECORD 1 1 ADD_RECORD 1 A BEEP 3000 30 LOCATE 4 1 PRINT New password saved BEEP 2000 10 3000 10 2000 10 3000 10 LOCATE 4 1 PRINT System Error LoginFlag 0 END IF UNLOCK BEEP 2000 10 3000 10 2000 10 3000 10 CLS LOCATE 1 1 PRINT U
140. readability of negative barcodes 128 Appendix E Pseudo Keyboard Pseudo keyboard is not a real keyboard but a special set of barcodes When the pseudo keyboard is enabled the user can scan the barcodes of the pseudo keyboard instead of making keystrokes on the real keyboard The BASIC Run Time Engines will interpret a scan of the barcode x to the keystroke x where x is a printable character ASCII 20 126 the barcode KA AL to F1 F12 the barcode M to Enter the barcode AN to Back Space and the barcode KO to Esc Please note that all the barcodes need to be printed in Code128 A set of the pseudo keyboard is printed as follows F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Enter Backspace Esc Space lU n lH lH amp i l lh lH MIL S T lH lI lI lH 129 0 4 8 lt IU D TN H IU L ILI P MANN T X 1 5 9 ML A KANN E lH I lH M n Q lN U lM Y 2 6 gt Il B OI F OMI J M N Tn R n v Z 130 i 3 lM 7 IU i 2 lI C I G IM K lI 0 n S I W lW L d h I p t x MUNIN MU a MUMIN e I i MN m mL q mH u lN y OI I i KAM b MNN f KANNI j lI n MN r DU Vv OI Z 131 MU I T C MU g VIM k lI o KANNI S KANI W l Appendix F Debug Messages Debug messages indicate the activities happening on the syst
141. s above but also provide a way to transmit combination key status or even direct scan codes This is done by inserting some special command codes in the output string A command code is a character whose value is between OxCO and OxFF Dly Delay 100 ms Digits of Numeric Key Pad CR Enter key on the numeric key pad 55 OxCO Indicates that the next character is to be treated as scan code Transmit it as it is no translation required OxCO 0x01 Send next character with Shift key OxCO 0x02 Send next character with left Ctrl key OxCO 0x04 Send next character with left Alt key OxCO 0x08 Send next character with right Ctrl key OxCO 0x10 Send next character with right Alt key OxCO 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 SEND_WEDGE function 0x41 OxC2 0x01 0x35 OxCO 0x29 0x09 0x32 OxC3 0x41 0x42 OxC4 0x31 OxE4 0x32 0xC4 0x31 0xC4 0x33 Please note that the scan code 0x29 is actually a space for PCAT Alt 12 is a form feed character and Alt 13 is an Enter The break after Alt 12 is necessary if omitted the characters will be treated as Alt 1213 instead of Alt 12 and Alt 13 The following instructions can be called in the BASIC program to s
142. s and symbolic constants appear in uppercase letters PRINT 510 Demo Program BEEP 800 30 0 5 800 15 0 5 800 15 e Variable names are in lowercase with an initial capital letter if variable names are combined with more than one part other capital letters may be used to make it easier to read ProcessFlag 0 Temp GET RECORDS G 1 e Line labels are used instead of line numbers ON READER 2 GOSUB GetSlotReader 19 4 BASIC Commands This chapter provides detailed descriptions for the commands supported by the CipherLab BASIC Compiler Besides the commands commonly used in traditional versions of BASIC several additional commands that deal with specific hardware features of the CipherLab terminals are supported These commands are called within the users BASIC programs to perform a wide variety of tasks including communications LCD buzzer scanner file manipulation etc They are categorized and described in this chapter by their functions or the resources they work on Some commands are postfixed with a dollar sign that means a string is returned with the command The compiler will accept these commands with or without the dollar sign However the dollar sign will be postfixed to these commands in this manual and the sample program The description for each BASIC command consists of four parts Purpose Syntax Remarks and Usage which are listed below 1 Purpose Briefly explains the purpose of the comma
143. sage StationID GET STATION ID RESTART 201 510 520 711 720 Purpose To restart the system Syntax RESTART Remarks The RESTART command terminates the execution of the BASIC program and restart it over again Usage SET STATION 10 Purpose Syntax Remarks Usage VERSION Purpose Syntax Remarks Usage HostCommand READ COM 1 IF HostCommand RESTART THEN RESTART ELSE 201 510 520 To assign the station ID of the target terminal SET_STATION_ID N Neo is the station ID assigned to the terminal For 201 510 520 it is used as the identification number for the RS 485 network A valid value is in between 1 to 99 SET_STATION_ID 1 711 720 To vyrite the version information to the system VERSION Version The user can use this command to write the version information such as the program name and date to the system The information written can be checked from the Version submenu of the System Menu Note that this command must be on the first line of the program or it will be ignored and the string for the version information cannot exceed 15 characters VERSION CipherBASIC 2 0 4 7 Reader Commands The CipherLab terminals are able to read barcode magnetic card data from the reader ports This section describes the BASIC commands that are related to the reader ports of the terminals CODE_TYPE 201 510 520 711 720 Purpose To get the type of symbology being decoded u
144. ser ID UserlD LOCATE 2 1 PRINT Not matched END IF ON TIMER 1 200 GOSUB ClearLCD TIMER 1 2 sec ON TIMER 2 60000 GOSUB ForceToLogout TIMER 2 10 min RETURN IKKKKKAKKKEKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKEKKAKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Routine ForceToLogout Purpose To force the current user to logout IF no action in 1 min Return LoginFlag 0 logout succeeds T Errorindex E forced to logout Call WriteToFile ForceToLogout BEEP 3000 30 OFF TIMER 1 OFF TIMER 2 Errorindex E Data GOSUB WriteToFile CLS LoginFlag 0 RETURN VERA KK IKARIA KIB KIKI IIIA IIIA k e III IIIA III IKI IIIA III III k k e e IIIA III II III III III k k kkk k k kkk Routine HostCmd Purpose To process the commands from the host computer j XXXXX gt insert new user ID or rewrite old ID XXXXX gt delete old user ID List gt list all user IDs XXXXX gt inquire a certain user s record All gt list all records lt gt move the DBF2 pointer to previous 5 gt move the DBF2 pointer to next Read gt read the record pointed by the pointer Remove gt delete the record pointed by the pointer where xxxxx means 5 digit user ID 117 Return Call Ikkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk HostCmd ComCommand READ_COM 1 IF ComCommand
145. size_y is the height of the rectangle area in pixels Usage CLR_RECT 1 1 20 20 CLS 201 510 520 711 720 Purpose To clear the LCD display Syntax CLS Remarks After executing this command whatever is showing on the LCD display will be erased and the cursor will be moved to 1 1 Usage ON TIMER 1 200 GOSUB ClearScreen TIMER 1 2 sec ClearScreen OFF TIMER 1 CLS RETURN CURSOR 201 510 520 711 720 Purpose To turn on off the cursor of the LCD display Syntax CURSOR status Remarks status may be 0 or 1 0 cursor is OFF 1 cursor is ON Usage CURSOR 0 CURSOR_X 201 510 520 711 720 Purpose To get the current x coordinate of the cursor Syntax X CURSOR_X Remarks X is an integer variable to be assigned with the column position of the cursor Usage ON READER 1 GOSUB BcrData_1 BerData 1 BEEP 2000 5 Data GET READER DATASI1 Pre XY CURSOR X Pre_Y CURSOR Y LOCATE 8 1 PRINT Data LOCATE Pre_Y Pre XY RETURN 71 CURSOR_Y 201 510 520 711 720 Purpose To get the current y coordinate of the cursor Syntax Y CURSOR Y Remarks Y is an integer variable to be assigned with the row position of the cursor Usage ON READER 1 GOSUB BerData 1 BerData 1 BEEP 2000 5 Data GET_READER_DATAS 1 Pre_X CURSOR_X Pre_Y CURSOR_Y LOCATE 8 1 PRINT Data LOCATE Pre_Y Pre_X RETURN FILL_RECT 711 720 Purpose To fill a rectangular area Syntax FILL_RECT x y
146. start to decode After first trigger the scanner will keep on scanning for one second so that the user may take aim But the user must press the second trigger within this period default of one second otherwise it will be reset and the user has to take aim again This mode is used when two barcodes are printed too close together so that users ensure they read the correct barcode D 2 2 Read Redundancy This parameter is used to specify the level of reading security If No Redundancy is selected one successfully decoded barcode will make the reading valid and induce the READER Event If Three Times is selected it will take four consecutive successful decodes of the same barcode to make the reading valid The more redundancy the user selects the higher the reading security but the slower the reading speed The user must compromise between reading security and decoding speed D 2 3 Time Out This parameter is the scanning period between 0 to 255 seconds for Auto Off Mode and Auto Power Off Mode If the scanning period is expired the scanner will stop scanning D 2 4 Negative Barcode Normally barcodes are printed with the color of the bars darker than that of the spaces But for negative barcodes they are printed in the opposite sense just like negative films The spaces of the negative barcodes are printed with a color darker than that of the bars User can check the box of Read Negative Barcode to enable the
147. sure about the selection 4 8 8 Digit Transmission This setting instructs the SEND WEDGE tnction which group of keys are used to transmit digits whether to use the digit keys on top of the alphabet keys or use the digit keys on the numeric keypad To set Use Numeric Keypad to Transmit Digits add 2 to the value of the second element of WedgeSetting Wedge_2 4 8 9 Inter Character Delay A 0 to 255 ms inter character delay can be added before transmitting each character This is used to provide some response time for PC to process keyboard input For example to set the inter character delay to be 10 ms the third element of the WedgeSetting can be defined as Wedge_3 CHR 10 4 8 10 Composition of Output String The keyboard wedge character map is shown below Each character in the output string is translated by this table wnen SEND_WEDGE function transmits data _ 00 10 120130 40 50 60 70 180 oj F2 jsplolejpi pp o aj INS TES ji JAJQjAlq JO 2 DLT F4 2 B R B r JO 3 Home F5 j3jejs c se 4 End Fe sjajpiTIDI t jo 5 Up F7 TSTS TET UTE u 6 Down F8 8Je FIVJEJ v 16 7 Left F9 7 G WIG w jo 8 BS moj 8IHIxKIHI x 9 HT Fit o i ty ity jo AT LF map IJIZIsIzt B Right ESC KIT IK C PgUp Exec lt L L D CR GRT TTM TTM T E PgDn T N TNT T FU Fi 1712101 101pyj The SEND_WEDGE function can not only transmit simple characters a
148. ta BerData GOSUB SaveData ON TIMER 1 200 GOSUB CleanScreen RETURN IKKKKKKKKKKKKKKEKKKKKKKKKKKKKKKKKKKKKKKKKKAKKKKKEKKEKKKKKKKKKKEKKEKKKKKKKAKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Routine SaveData Purpose To save data to the transaction file Return Call SaveData IF STATION_ID lt 10 THEN Data 0 STR STATION_ID DATE TIME BcrData ELSE Data STR STATION_ID DATE TIME BcrData END IF SAVE_TRANSACTION Data RETURN T k ke A H e k e ke ke Ae A e e e ke ke e He e e e ke ke He e e e e ke He He e e e k ke ke e k e e ke ke ke He k k e ke ke H k k e e ke ke H k k e ke k IK k k ke ke ke k k k kk k k k k k k kek k k k kkk k k k kkk kk kk Routine CleanScreen Purpose To clean the screen Return Call tkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk CleanScreen OFF TIMER 1 LOCATE 2 1 PRINT RETURN IKKKKKKKKKKKKKKAKKAKKKKKKKKKKEKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKAKKKKKKKKKKKKKEKKKKKKKKKKKKKKKKKKKKKKKKK Routine ParseCmd Purpose To parse the host commands Return Call ParseCmd HostCmd READ_COM 1 IF LEFT HostCmd 4 TIME THEN IF MID HostCmd 5 1 AND LEN HostCmd INPUT_TIME_LENGTH THEN DATE MID HostCmd 6 6 TIME MID HostCmd 12 6 OutBuffer DONE ELSE OutBuffer DATE TIMES END IF ELSE OutBuffer NA K END IF WRITE_COM 1 OutBuffer RETURN HHHHHHHHH End of Pr
149. taly Pharmacode Check Character 27 1 Transmit CIP39 Check Character Do DO NOT Transmit C139 Ghose Character 28 1 Verify Interleave 25 Check Digit Z oino NoT very merear 28 Chock Dgt 0 DO NOT Transmit Interleave 25 Check Digit 30 1 Verify Industrial 25 Check Digit Z 0i poor very insta 25 Check Di 31 1 Transmit Industrial 25 Check Digit LT Jo DO NOT Transmit usta 25 Check dige 0 DO NOT Verify Matrix 25 Check Digit 33 1 Transmit Matrix 25 Check Digit L Jo DO NOT Trarert mariz 25 Check bit 34 Select Interleave25 Start Stop Pattern 0 Use Industrial25 Start Stop Pattern 5 6 1 Use Interleave25 Start Stop Pattern 2 Use Matrix25 Start Stop Pattern 3 Select Industrial25 Start Stop Pattern 0 Use Industrial25 Start Stop Pattern 1 Use Interleave25 Start Stop Pattern 2 Use Matrix25 Start Stop Pattern 3 Select Industrial25 Start Stop Pattern 0 Use Industrial25 Start Stop Pattern 1 Use Interleave25 Start Stop Pattern 2 Use Matrix25 Start Stop Pattern 3 Codabar Start Stop Character 0 abcd abcd 1 abcd tn e 2 ABCD ABCD 3 ABCD TN E 3 L 0 DO NOT Transmt Godabar aristo 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 5 6 7 8 40 MSI Check Digit Transmission 0 the last Check Digit is not transmitted 1 both Check Digits are transmitted 2 both Check Digits
150. the backend application by checking if the host PC keeps sending 101 CIPHERLAB r to the master consistently If yes it will let the back end application to verify the ID otherwise the master will verify the ID according to the downloaded DBF1 The program will first verify the ID and then check the last event of the ID If there is no last event k recorded on the same day the program will assume the employee is coming for the first event i e to sign in If the ID is read within the 7 scheduled period of time it will shows a greeting message on the LCD otherwise it will show an error message on the LCD All the data read will be saved in the transaction file with the station ID date time and a log flag The log flag A indicates there was no connection between the master and the slave when data was read B indicates the data is an invalid data C indicates the data is a valid data D indicates any communication error User can use the reserved host commands to retrieve those data DBF2 is used to save the last event for each ID read The format of each record of the DBF2 is like xxxxxyymmddA where XXxxx 5 digit employee ID yymmdd date of the last event A the last event The DBF2 is on the master and is only used by the master to verify the data User does not access to DBF directly x x x x x x x x x x x x x x AKKKKAKKKKKKKKKKKKKKKKAKKKKKKKKKKKKKEKKKKKKKKKKEKKE
151. the file pointer of the specified IDX file A GET RECORDS file index A is a string variable to be assigned with the record 91 file is an integer in the range of 1 to 3 1 to 5 for 7xx indicating which DBF file to be accessed index is an integer in the range of 1 to 3 indicating which IDX file to be accessed If it is not specified then the default IDX file which keeps the original data sequence will be used Usage ON READER 1 GOSUB BcrData_1 BerData 1 BEEP 2000 5 ID GET READER DATA IF FIND RECORD DBFNum IDXNum ID 1 THEN Data GET_RECORD DBFNum IDXNum ltem MID Data IDLeng 1 ItemLeng Note RIGHT Data LEN Data IDLeng ltemLeng LOCATE 1 1 PRINT ID Data LOCATE 2 1 PRINT Item Item LOCATE 3 1 PRINT Note Note ELSE GET_RECORD_NUMBER 201 510 520 711 720 Purpose To get the ordinal number of the record pointed to by the file pointer of the specified DBF file and IDX file Syntax A GET RECORD NUMBER file I index Remarks A is an integer variable to be assigned with the number file is an integer in the range of 1 to 3 1 to 5 for 7xx indicating which DBF file to be accessed index is an integer in the range of 1 to 3 indicating which IDX file to be accessed If it is not specified then the default IDX file which keeps the original data sequence will be used Usage A GET_RECORD_NUMBER 1 1 MOVE_TO 201 5
152. then click Edit on the menu bar and select Paste or type Ctrl V or click the Paste icon on the tool bar Delete Function To delete a paragraph from the text This paragraph will not be kept in the clipboard Operation Select the paragraph to be deleted Click Edit on the menu bar and select Delete or press the Del key Select All Function To select all the contents of the text Operation Click Edit on the menu bar and select Select All or type Ctrl A All the contents of the text will turn to reverse colour Find Function To find a special letter symbol word or paragraph in the text Operation Click Edit on the menu bar and select Find or type Ctrl F or click the Find icon on the tool bar to pop up the Find window Enter the key word to be found in the text and then click the Find button 2 3 Config Menu Seven items are provided for the user to define the system settings 1 4 Target Machine Function To set the type of the target machine Operation Click Config on the menu bar and select Target Machine and then scroll through the items in the Target Machine window to set the target machine The selection d the target machine will affect the number of transaction files the available baud rate of the COM port and whether the user can create the DBF files on the Smart Media Card Master Card ID Function To
153. tion duration is an integer number which specifies the time duration in units of 10 ms A value of 0 in this argument will keep the LED in the specific state indefinitely ON READER 1 GOSUB BerData 1 BerData 1 BEEP 2000 5 LED 11 1 5 GOOD READ LED for 520 Data GET READER DATASI1 65 4 13 Keyboard Commands Terminals 510 520 711 and 720 provide the built in keypads for data input The user can also use external AT keyboards for 201 510 and 520 terminals This section describes the keyboard related commands ALPHA_LOCK 520 711 720 Purpose Forces the alpha input status to be on or off Syntax ALPHA_LOCK status Remarks status may be 1 or 0 0 unlock meaning alpha input status is off 1 lock meaning alpha input status is on Usage ALPHA_LOCK 1 CLR_KBD 201 510 520 711 720 Purpose To clear the keyboard buffer Syntax CLR_KBD Remarks By calling this function the data that is still queued in the keyboard buffer will be cleared Usage CLR_KBD ON KEY 1 GOSUB KeyData_1 CAP_LOCK 201 510 520 Purpose To set the Caps Lock status for the external AT keyboard Syntax CAP_LOCK status Remarks status may be 1 or 0 0 Caps Lock ON 1 Caps Lock OFF Usage CAP_LOCK 1 DISABLE KBD 201 510 520 711 720 Purpose To disable the built in keypad and or the external AT keyboard Syntax DISABLE KBD Remarks Once executed the keyboard input functionality will be disabled Usage ENABLE KBD
154. ut a number 1 9 INPUT Num CLS ON Num GOSUB 100 100 100 200 200 300 400 400 400 100 PRINT Number 1 3 is inputed RETURN 200 PRINT Number 4 5 is inputed RETURN 300 PRINT 6 is inputed RETURN 400 PRINT Number 7 9 is inputed RETURN IF THEN END IF 201 510 520 711 720 Purpose To provide a decision structure for a conditional excution vvith multipule lines of actions Syntax IF conditioni THEN actiont action2 END IF Remarks condition is a logical expression action is a BASIC statement Usage IF Data1 gt Large THEN BEEP 800 30 Large Data1 PRINT Current Largest Number is Data1 END IF 26 4 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 In CipherLab BASIC two kinds of looping structures FOR NEXT and WHILE WEND can be used Command EXIT can be used for an alternative way to exit from both FOR NEXT and WHILE WEND loops Both FOR NEXT and WHILE WEND statements can be nested up to 10 levels FOR NEXT Purpose Syntax Remarks Usage EXIT Purpose Syntax Remarks Usage 201 510 520 711 720 To repeat the execution of a block of statements for a specified number of times FOR N startvalue TO endvalue STEP step Statement Block NEXT N N is an integer variable to be used as a loop
155. ved The ni file should be treated as part of the BASIC program and should be included when the BASIC program is distributed If the BASIC program compiles with no errors a BASIC object file syn with the same name is generated The ini file and the syn file are the two files to be downloaded to the terminal The ini file contains the system settings while the syn file contains the BASIC object code 1 3 3 Download the BASIC Object Files The user can use the BASIC Compiler or another download utility such as Synload exe to download acompiled BASIC program Synload exe provides only the download function of the BASIC Compiler Using the Synload exe program is provided to enable system developers to provide the end user with an easy method for reloading terminals Both the ini and syn files will be downloaded to the target terminal Please note that if the ni file is missing the BASIC Compiler will download the default settings instead and this may cause errors in its execution In contrast to the BASIC Compiler Synioad exe will not process the download if the ini file is missing and an error message will be shown on the monitor After the BASIC object file is downloaded the target terminal will reboot itself to execute the BASIC program If any run time error occurs an error message will be shown on the LCD screen Please refer to Appendix C for a list of run time errors If the program is not running as desired modify th
156. w VERSION 20 Ver 2 00 Apr 20 2000 e Modified On line Help 122 Appendix B Flash Writer The 201 510 Flash Writer is an extension board to provide the download function when the existing program does not support download function and or the existing program is corrupted A step by step operation procedure is listed as follows Turn OFF the power of the terminal Remove the flash memory from the terminal PCB Connect the end of the flat cable to the flash memory socket on the terminal PCB The RED wire should connect to pin 1 of the socket Insert the flash memory into socket U2 Press the handle to hold it tight There is a single wire with hooker on the flash writer Connect the hooker to any pin of JP7 for 201 or JP1 for 510 Connect the RS 232 cable to PC For 201 use COM1 C2 or COM3 Aux 232 For 510 use COM1 phone jack or COM3 D 25P Make sure that all connections have been correctly connected Turn on the flash writer the yellow LED will light A short beep will be activated if everything is working fine and the display will show 3 02032007 00001 where s N the located flash address which depends on the pin connected for 201 1to3 for510 4to7 e 02032007 first 4 digits can be ignored similar to N as just described Last 4 digits show the type of the flash memory 2007 SGS Thompson 28F101 01A7 AMD 28F010 ABCD AMD 29F010 89B4 Intel 28F010 e 00001 5 digits system seco
157. will pop up the Output window and show the line numbers and the error messages of the errors found If the compilation is successful the message Build successfully do you want to download the program will be shown on the screen Click the Yes button if you want to download the program For downloading operation please refer to the Download command Download Function To download a compiled BASIC program to the target terminal Operation Click Compile on the menu bar and select Download to pop up the Open window Select the BASIC object file syn to be downloaded and then click Open Select the correct COM port properties and then click OK to download For 7xx terminal the user may select to download the BASIC program via Serial IR transceiver Please note that the associated system initialisation file ini has to be in the same directory as the BASIC object file otherwise the default system settings will be downloaded instead 10 2 5 Help Menu Three items are provided on this menu 1 Contents By selecting this item Windows Help manager will be invoked and a table of contents for the BASIC online documentation will be displayed The user may click on any listed item for more detailed information Index By selecting this item the help file index will be shown User can either type in a string for searching or directly click on the listed index for viewing further
158. xpression determining how many transaction records to be deleted and how to delete 84 If NY is a positive integer the specified number of records will be deleted from the top of the transaction file i e the oldest records will be deleted If N is a negative integer the specified number of records will be deleted from the bottom of the transaction file i e the latest records will be deleted Usage se PRINT Discard the latest transaction Y N Loop KeyData INKEY IF KeyData THEN GOTO Loop ELSE IF KeyData Y THEN DEL_TRANSACTION_DATA_EX TransFile 1 END IF EMPTY_TRANSACTION 201 510 520 711 720 Purpose To remove all the transaction data from the default transaction file Syntax EMPTY_TRANSACTION Remarks This command will only have an effect on the first default transaction file Usage zgj PRINT Remove all the transaction data Y N Loop KeyData INKEY IF KeyData THEN GOTO Loop ELSE IF KeyData Y THEN EMPTY_TRANSACTION END IF EMPTY_TRANSACTION_EX 711 720 Purpose To remove all the transaction data from a specified transaction file Syntax EMPTY TRANSACTION EX file Remarks file96 is an integer in the range of 1 to Gindicating which transaction file the command is to affect The command EMPTY TRANSACTION EX 1 works the same as the command EMPTY TRANSACTION Usage EMPTY TRANSACTION EX 6 85 GET_TRANSACTION_DATA 201 510 520 711 720 Purpose To
Download Pdf Manuals
Related Search
Related Contents
Référentiel de certification des logiciels d`aide à la prescription ManualsLib - Makes it easy to find manuals online! 取扱説明書 ホワイト・シルバーから選べるカラー消火器。 Rock-Ola Mystic User Manual Utilisation du réseau sans fil avec Windows Préambule Ce mode d N8104-101 高速回線ボード(PCI ユニバーサル対応) 取扱説明書 CFP 2/4/8 User Manual MAINTENANCE Copyright © All rights reserved.
Failed to retrieve file