Home

PDT 1100 Terminal Programmer`s Guide

image

Contents

1. CODE39 No read data length specified N o check digit CODE93 No read data length specified CODE128 No read data length specified N ote Specifying the Code 128 also enables EAN 128 Specifying O ptions in the OPEN BAR Statement You may also specify the options below for each bar code type in theopen Bar statement e Check digit Read data length e Start stop character only for NW7 e Start character flag only for universal product codes Supplemental code only for universal product codes 8 6 Files Bar Code Buffer The bar code buffer stores input bar code data Itis occupied by one operator entry job and can contain up to 99 characters Check whether the bar code buffer stores bar code data using the Eor IN a Loc functions or the wart statement The InPuT and LINE INPUTH statements and the 1nputs function reads bar code data stored in the buffer into a string variable Programming for Bar Code Device Use the INPUTH Or LINE INPUT Statement or the inputs function to read bar code data from the bar code buffer into a string variable Code Mark The marxs function allows you to check the code type and the length of the bar code data This function returns a total of three bytes one byte for the code mark denoting the code type and two bytes for the data length Multiple Code Reading Activate the multiple code reading feature which reads more than one bar code type whi
2. Figure M 20 Transmission Message formed with Ir Protocol In the above figure DLE SOH DLE STX and DLE ETX are text control characters as described in 2 Control Characters An ID denotes the ID number of the receiver station expressed by two bytes A serial number is expressed by a five digit decimal number starting from 00001 to 32767 and identifies data texts For the CRC 16 refer to 6 CRC M 24 Communications N ote You can usethe control characters for expressing Ds serial numbers or text data Transmission Control Sequences Following is a typical message transmission sequence supported by the Ir protocol This sequence example does not include transmission errors or negative responses Establishment of Data Link Phase 1 Data Transmission Phase 2 Release of Data Link Phase 3 Sending Receiving Station Station A DLE ENQ and IDM gt y lt DLE ACK and IDs A D S D E C L o Heading Text 7 R gt E H D E x C lt DLE ACK and IDs D S I a D EIC L T nee Data Text1 L T R gt E X D E X C lt DLE ACK and IDs D Sji DE C L T pi Data Text n 1 L T R gt E xD Number E x c lt DLE ACK and IDs D S 1 f D EC Serial LT Data Textn L gt T R gt E XD Number E xIc y lt DLE ACK and IDs A DLEEOT and IDs gt lt DLE ACK and
3. hh mm 11 53 T PDT 1100 Terminal Programmer s Guide Syntax 2 Setting the system time TIMES sets the system time specified by time Theformat of time is the same as that in syntax 1 Example TIMES 13 35 45 Setting the wake up time TIMES sets the wake up time specified by time The format of time is the same as that in syntax 1 Thecalendar clock is backed up by the battery For the system date refer to the DATES function Set bit 2 of port 8 to 1 with the our statement before executing this function to return the current wake up time or set a specified wake up time For the wake up function refer to Appendix H Programming N otes Execution Error Error code M eaning 05h Parameter out of range time is out of range Reference Functions DATES 11 54 Function Reference TIMEA TIMEB TIMEC Function Name TIM ER A TIM ER B TIM ER C Type 1 0 Function Description Returns the current value of a specified timer or sets a specified timer Syntax Syntax 1 Retrieving the current value of a specified timer IMEA IMEB IMEC Syntax 2 Setting a specified timer IMEA count IMEB count IMEC count where count A numeric expression which returns a value from 0 to 32 767 Notes Syntax 1 TIMEA TIMEB Or TIMEC returns the current value of timer A B or C respectively as a 2
4. If prompt is followed by a comma theinstruction displays the prompting message with no question mark or space LINE INPUT data a data 10 72 Statement Reference Thecursor shape specified by the most recently executed LOCATE instruction takes effect Even after execution of the CURSOR OFF instruction the LINE INPUT instruction displays the cursor e Data entered by the user echoes back to theLCD To assign it to stringvariable press the ENT key This also causes also a line feed If you type no data and press the EN T key a LINE INPUT instruction automatically assigns a null string to stringvariable e When echoed back data is displayed on the LCD press the Clear key to erase all displayed data or BS key to erase the last character entered If no data is displayed pressing Clear or BS has no effect String data is the maximum string length of stringvariable O verflowed data is ignored e Thesizesof prompting message literals echoed back literals and cursor depend upon the screen mode and the display font size If the standard size font is selected they appear in standard size if the small size font is selected they appear in small size Syntax Error Error Code and Message Meaning error 71 Syntax error INPUT is missing Neither a comma or semicolon follows prompt prompt is not a string constant stringvariable has a numeric variable A semicolon imme
5. OPEN COM O pens a communications device file PRINT Outputs data to a communications device file XFILE Transmits a designated file according to the specified communications protocol Functions Definitions BCCS Returns a block check character BCC of a data block EOF Tests whether the end of a device I O file has been reached ETX M odifies the value of a terminator ET X for thePDT 1100 protocol also returns the current value of a terminator INPUT Returns a specified number of characters read from the keyboard or from a device file LOC Returns the current position within a specified file LOF Returns the length of a specified file SOHS M odifies the value of a header SOH for the PDT 1100 protocol also returns the current value of a heade STXS M odifies the value of a header ST X for the PDT 1100 protocol also returns the current value of a header K 8 Quick Reference for Statements and Functions Commenting a Program Statements Definitions REM Declares the rest of a program line to be remarks or comments Manipulating Numeric Data Functions Definitions ABS Returns the absolute value of a numeric expression INT Returnsthe largest whole number lessthan or equal to the valueof a given numeric expression Manipulating String Data Functions Definitions ASC Returns the ASCII code value of a gi
6. 35864070 eps Figure M 22 Phase 1 with repeated transmission of DLE ENQ and IDmTransmission M 26 Communications Note You may modify the number of iterations of a sequenceof DLE ENQ and ID m for the sending station The default is 60 times at 0 5 second intervals For details refer to the SET LINKUP TIME screen in System M ode p 52 and the xrrze statement given on XFILE on page 10 130 Abnormal termination of phase 1 Abort of phase 1 If the sending station receives no sequence of DLE ACK and IDs from the receiving station after sending a sequence of DLE ENQ and IDm 60 times in succession it sends a sequence of DLE EOT and ID m to the receiving station 0 5 seconds from the 60th sequence of DLE EN Q and IDm then aborts the message transmission Sending Station DLE ENQ and IDm 1 0 5 second _ DLE ENQ and IDm I 1 I I Pee Abnormal Termination Receiving Station Figure M 23 Abort of Phase 1 35864071 eps Note The receiving station s default timeout is 30 seconds You may modify the timeout length on the SET LINKUP TIME screen in System M ode or by using the xrrze statement refer to X FILE on page 10 130 M 27 M PDT 1100 Terminal Programmer s Guide S Phase 2 Data Transmission Normal phase 2 T he sending station first sends a transmission block containing the heading text Each time the sending station receives a sequence of DLE
7. Format of a Program Line A program line consists of the following elements label statement statement comment Labels A label is placed at the beginning of a program line to identify lines Labels which designate jump destinations can be used to transfer control to any other processing flow like program branching They can be omitted if unnecessary Labels differ from line numbers used in the general BASIC languages they do not determine the execution order of statements Write a label beginning in the first column of a program line To write a statement following a label place one or more separators spaces or tabs between the label and the statement As shown below using a label in the rr statement block can eliminate the coro statement which should usually precede a jump destination label IF a 1 THEN Check ELSE 500 ENDIF Check and 500 are used as labels For detailed information about labels refer to Labels on page 4 6 4 1 M PDT 1100 Terminal Programmer s Guide S Statements A statement is a combination of functions variables and operators according to the syntax A group of the statements is a program Statements can come in two types executable and declarative statements Executable statements These cause the Interpreter to process programs by instructing the operation to be executed Declarative statements These manage the memory allocation for variables and handle comments
8. GET Statement Name Get Type Filel O Statement Description Reads a record from a data file Syntax GET 4 filenumberl recordnumber where filenumber numeric expression which returns a valuefrom 1 to 16 recordnumber A numeric expression which returns a value from 1 to 32 767 Notes GET reads the record specified by recordnumber from the data file specified by filenumber and assigns the data to the field variable s specified by the FIELD statement filenumber is the file number of a data file opened by the OPEN statement Ifa data file having no record is specified an execution error occurs e Thefirst record in a data file is counted as 1 IfnOo recordnumber is specified the GET instruction reads a record whose number is one greater than that of the record read by the preceding GET instruction If no recordnumber is specified in the first GET instruction after opening of a file the first record numbered 1 in the file is read recordnumber should be equal to or less than the number of written records If it is greater an execution error occurs Ifa GET instruction without recordnumber is executed after occurrence of an execution error caused by an incorrect record number in the preceding GET instruction then the new GET instruction reads the record whose record number is one greater than that of the latest record correctly read 10 48 Statement Reference e Ifa GE
9. Syntax CLS Notes CLS Clears the liquid crystal display LCD screen and returns the cursor to the upper left corner of the screen Thects instruction does not affect the screen mode or the character attribute the normal or reversed display but it turns off the cursor Execution of the cLs instruction when the system status is displayed on the LCD clears the VRAM area assigned to the system status area of the LCD but does not erase the system status displayed 10 17 D PDT 1100 Terminal Programmer s Guide Statement Name Common Type Declartive Statement Description Declares common variables for sharing between user programs Syntax COMMON commonvariabl el commonvariable where commonvariable A non array integer variable a non array real variable a non array string variable an array integer variable an array real variable or an array string variable Notes COMMON defines common variables for sharing them when one program chains to another Common variables defined by COMMON are effective as long as programs chained by the CHAIN statement are running A COMMON instruction can appear anywhere in a source program All of the variable name type quantity and definition order of the common variables used in the current program should be identical with those in the chained to programs If not variables having indefinite values are passed Up to two dimensional array variables can b
10. statement except for the universal product codes then the INPUT instruction can read bar codes of up to 99 digits To read bar codes of 40 digits or more definea sufficient string variable length beforehand N otes for entering numeric data Valid characters include 0 to 9 a minus sign and a period in correct numeric data form INPUT statement accepts only numeric data from the first character up to correctly formed character as valid data If no valid data is found the INPUT instruction assigns zero to variable If the INPUT instruction reads alphabetical characters with a numeric variable it assigns zero to variable When reading Code 39 bar codes special care should be taken Syntax Error Error Code and Message Meaning error 71 Syntax error filenumber iS missing Execution Error Error Code Meaning 06 34 36 3A The operation result is out of the allowable range numeric variableis out of range Bad file name or number filenumber of an unopened file specified Improper file type i1enumber of a file other than device 1 0 files specified File number out of the range Example INPUT fileNo dat 10 59 T PDT 1100 Terminal Programmer s Guide Reference Statements OPEN BAR OPEN COM CLOSE and LINE INPUT Functions INPUTS 10 60 Statement Reference KEY Statement Name Key Type O Statement Description Assigns a string o
11. statement to control whether the reading confirmation LED lights in green default light and whether the beeper beeps default no beep on successful decodes For setting details refer to OPEN BAR on page 10 87 H 6 Programming Notes Controlling Reading Confirmation LED If the open Bar statement activates the reading confirmation LED in green the our instruction cannot control the LED via output port 1 refer to Appendix D 1 0 Ports when the bar code device file is opened If the statement deactivates the reading confirmation LED the out instruction can control the LED even when the bar code device file is opened enabling auser program to check the value of a scanned bar code and turn on the green LED when the bar code has been read successfully e g the user program can interpret bar code data valued from 0 to 100 as correct data auser program to turn on the red LED when the bar code is read Controlling the Beeper If the beeper is activated it beeps once for 100 ms at the frequency of 4337 Hz equivalent to setting frequency to 2 in the BEEP statement when a bar code is read successfully APLINT PD3 Program File If a program file named APLIN T PD3 is stored in the PDT 1100 the System M ode initiation sequence pressing the PW key with the SF and 1 keys held down does not start System M ode but executes that program This allows you to enteran ID number at the start of System M ode
12. 8 11 M PDT 1100 Terminal Programmer s Guide S 8 12 Chapter 9 Event Polling and Error Event Trapping Overview BASIC 3 0 supports event polling error trapping and event trapping Event Polling Causes programs to monitor the input devices for occurrence of events Error Trapping Traps an execution error and handles it by interrupt If an execution error occurs when this trapping ability is disabled the Interpreter terminates the current user program while showing the error message Event of Keystroke Trapping Traps a particular keystroke caused by pressing a specified function key to handle it by interrupt Event Polling Programming Sample The program below shows an event polling example which monitors the bar code reader and the keyboard for occurrence of events This example uses the zor and inKeys functions to check the data input for the bar code reader and the keyboard respectively OPEN BAR AS 1 CODE A loop 9 1 MA PDT 1100 Terminal Programmer s Guide S WAIT 0 3 IF NOT EOF 1 THEN GOSUB barcod ENDIF kS INKEYS IF k lt gt THEN GOSUB keyin ENDIF GOTO loop barcod BEEP LINE INPUT 1 dat PRINT dat RETURN keyin RETURN Listed below arethel O devices which event polling can monitor Table 9 1 I O Devices 1 0 Devices M onitor M eans Events Keyboard INKEYS function Input of one character from the keyboard Bar code EOF or Loc func
13. Function Name Block Check Character Type String Function Description Returns a block check character BCC of a data block Syntax BCCS datablock checkt ype where datablock A string expression checktype A numeric expression which returns a value from 0 to 2 Notes BCCS calculates a block check character BCC of datablock according to the block checking method specified by checkt ype and returns the BCC checktype is 0 1 or 2 which specifies SUM XOR or CRC 16 respectively as described below Table 11 1 Block Checking Method and Description checktype Block No of BCC Generative checking chars for polynomial method BCC 0 SUM 1 Lowest one byte of the sum of all character codes contained in a datablock 1 XOR 1 One byte gained by X ORing all character codes contained in a datablock 2 CRC 16 2 Two bytes gained from the cyclic redundancy X26 x x 1 check operation applied to bit series of all characters in datablock with the bit order in each byte inverted 11 4 Function Reference BCCS performs block checking and generates a BCC for a data block Execution Error Error code M eaning 05h Parameter out of range checktype is out of range T PDT 1100 Terminal Programmer s Guide CHKDGT Function Name CH ecK DiGiT Type String Function Description Returns a check digit of bar code data Syntax CHKDGTS barcodedata CDt ype where
14. Thetransmission control characters listed below are used to compose transmission control sequences in phases 1 through 3 Table M 5 Transmission Control Characters Symbol Value M eaning Function DLE EOT 1004h End Of Transmission Releases a data link Phase 3 Requests abort of transmission Phase 2 DLE ENQ 1005h Enquiry Requests establishment of a data link Phase 1 Prompts the receiver to respond to the sent text Phase 2 DLE ACK 1006h Acknowledge Acknowledgment response to DLE ENQ Phase 1 Acknowledgment response to text Phase 2 Acknowledgment response to DLE EOT Phase 3 DLE NAK 1015h Negative N egative acknowledgment response to DLE ENQ Acknowledge Phase 1 N egative acknowledgment response to text Phase 2 WACK 1038h Wait For Requests suspension of data reception during erasure Acknowledge of the flash ROM Transparency ThePDT 1100 uses thetransparent mode which allows the control characters and codes e g STX ETX SOH and DLE to betransmitted as normal data in the transmission texts To transmit a DLE as normal data type DLE DLE per DLE M 22 Text Control Characters Communications Thetext control characters are used to format transmission texts In the Ir protocol they includethe following headers and a terminator Table M 6 Text Control Characters Symbol Value M eaning Function DLE SOH 1001h Start Of Heading Indic
15. Valid literals include 0 to 9 a minus sign and a period They should bein correct numeric data form If not INPUT statement accepts only numeric data from the first literal up to correctly formed literal as valid data If no valid data is found the INPUT instruction assigns a zero to variable A plus sign can be typed in but is ignored in evaluation of the entered data The effective length of string data is the maximum string length of variable Overflowed data is ignored Thesizes of prompting message literals echoed back literals and cursor depend upon the screen mode In the single byte AN K mode they appear in single byte code size Both the screen mode and the display font size determine the sizes of prompting message literals echoed back literals and cursor If the standard size font is selected they appear in standard size if the small size font is selected they appear in small size Statement Reference Syntax Error Error Code and Message Meaning error 71 Syntax error Neither a comma nor semicolon follows prompt prompt iS not a string constant Execution Error Error Code M eaning 06h The operation result is out of the allowablerange numeric variableis out of range Reference Statements LINE INPUT and LOCATE Functions INKEYS and INPUTS 10 57 T PDT 1100 Terminal Programmer s Guide INPUT Statement Name Input Type Filel O Statement Description
16. filenumber A numeric expression which returns a valuefrom 1 to 16 Notes EOF tests for an end of a file designated by i1enumbex and returns 1 true if no data remains or 0 false if any data remains File Type Returned Value End of file Condition Communications device file 1 true N o data remains in the receive buffer 0 false M ore than one character remains in the receive buffer Bar code device file 1 true No data remains in the bar code buffer 0 false Any data remains in the bar code buffer filenumber should be the file number of an opened device file TheEor function cannot be used for data files Specifying a data file number for fi lenumber Causes an execution error 11 16 Function Reference Execution Error Error code M eaning 34h Bad file name or number i1enumber of an unopened file specified 36h Improper file type i1enumber of a data file specified 3Ah File number out of range Reference Statements INPUT LINE INPUT OPEN BAR and OPEN com Functions INPUTS LOC and LOF 11 17 T PDT 1100 Terminal Programmer s Guide Function Name ERror Line Type Error H andling Function Description Returns the current instruction location of the program where an execution error occurred Syntax ERL Notes ERL returns the current instruction location of the program where an execution error occurred most recently TheE RL functio
17. xvii MA PDT 1100 Terminal Programmer s Guide This warranty is provided to the original owner only and is not transferable to any third party It shall not apply to any product i which has been repaired or altered unless done or approved by Symbol ii which has not been maintained in accordance with any operating or handling instructions supplied by Symbol iii which has been subjected to unusual physical or electrical stress misuse abuse power shortage negligence or accident or iv which has been used other than in accordance with the product operating and handling instructions Preventive maintenance is the responsibility of customer and is not covered under this warranty Wear items and accessories having a Symbol serial number will carry a 90 day limited warranty N on serialized items will carry a 30 day limited warranty Warranty Coverage and Procedure During the warranty period Symbol will repair or replace defective products returned to Symbol s manufacturing plant in the US For warranty servicein N orth America call the Symbol Support Center at 1 800 653 5350 International customers should contact the local Symbol office or support center If warranty service is required Symbol will issuea Return M aterial Authorization N umber Products must be shipped in the original or comparable packaging shipping and insurance charges prepaid Symbol will ship the repaired or replacement product fraght and insurance prepaid in N
18. OFh String length out of range the returned value of the stringlength exceeds the allowable range Example DEF FNappenas a b 128 C CS C FOR i 1 TO b CS C aS NEXT FNappend C END DEF PRINT FNappend AB 3 ABABAB 10 36 Statement Reference Statement Name DIM ension Type Memory Control Statement Definition Declares and dimensions arrays also declares the string length for a string variable Syntax DIM arraydeclarationl arraydeclaration where arraydeclaration numericvariable subscript DIM n1 12 DIM n2 5 6 stringvariable subscript stringlength DIM s1 2 DIM s2 2 6 DIM s3 4 16 DIM s4 5 3 30 subscript For one dimensional integerexpression For two dimensional integerexpression integerexpression Where integerexpression is a numeric expression which returns a value from 0 to 254 stringlength An integer constant which has a value from 1 to 255 which indicates the number of characters Notes DIM declares array variables and dimensions the arrays that a program utilizes 10 37 T PDT 1100 Terminal Programmer s Guide A DIMinstruction can appear anywhere before the first use of the array in a source program H owever to prevent errors place all your DIM instructions together near the beginning of the program and not in the program execution loops e Up to 2 dimensional array variables can be declared In declaring an array
19. The data file name should be a The number of data texts Every data field should be 1 to maximum of 12 characters and should be 0 to 32767 If 254 digits If less than 2 digits consists of FILE NAME less than 5 digits the the upper blank byte are filled and EXTENSION The FILE NAME upper blank bytes are with zero 0 should be 1 to 8 characters The filled with zeros 0 If a data field is 100 to 199 digits EXTENSION should not be PD3 0 to 19 are given if it is 200 to FN3 and EX3 and may be omitted lf the data name isless e number of fields 254 digits PO to U4 are given together with a period ae i ahs the should be 1 to 16 itis OX O 720x P alo dd less than 2 digits the Hy A 21X Q upper blank byte are filled ES aut characters a wees teas we with zero 0 18X H 24X T 19X l 25X U Figure M 18 HeadingT ext M 19 M PDT 1100 Terminal Programmer s Guide S To transfer a data file containing a data field s of 100 digits or more usethe Windows based Transfer Utility The M S DOS based Transfer Utility does not support transmission of data fields exceeding 99 digits Data Text Data Field 1 Data Field 2 Data Field n Example of Contents Every data field should be 1 to 99 digits in length If a data field is less than the maximum digits the lower blank bytes are filled with space characters Figure M 19 Data Text Thetotal length of all data fields plus the
20. barcodedata and CDtype String expressions Notes CHKDGTS calculates a check digit CD of barcodedata according to the calculation method specified by CDt ype and returns it as one character string CDtype S A I Mor N which specifies the bar code type and the corresponding calculation method as listed below CDtype Bar Code Type Calculation M ethod A EAN and UPC M OD 10 M odulo arithmetic 10 I ITF Interleaved 2 of 5 MOD 10 M odulo arithmetic 10 M Code 39 M 0D 43 M odulo arithmetic 43 N N W 7 Codabar M OD 16 M odulo arithmetic 16 CDtype may bein lowercase 11 6 Function Reference When CDtypeisA EAN or UPC this function identifies the EAN or UPC of barcodedata depending upon the data length number of digits as listed below Data length of barcodedata Universal Product Codes 13 EAN 13 or UPC A 8 EAN 8 7 UPC E If the data length is a value other than 13 8 and 7 this function returns a null string e To check that the CD is correct pass a CD suffixed barcodedata to a CHKDGTS as shown below If the returned value is equal to the CD the CD data is suitable for the barcodedata Sample coding IF CHKDGTS 49400458 A 8 THEN e To add a CD to bar code data pass barcodedata followed by a dummy character to a CHKDGTS as shown below T hereturned value will becomethe CD to be replaced with the dummy character Sample coding PRINT 4940045 CHKDGTS 4940045 0 A
21. byte integer Syntax 2 TIMEA TIMEB Or TIMEC sets the count time specified by count count isa numeric value in units of 100 ms When executed the Interpreter starts a specified timer counting down in increments of 100 ms equivalent to 1 until the timer value becomes 0 11 55 T PDT 1100 Terminal Programmer s Guide Execution Error Error code M eaning 05h Parameter out of range count is a negative value 06h The operation result is out of the allowable range count is greater than 32 167 11 56 Function Reference VAL Function Name VALue Type String Function Description Converts a string into a numeric value Syntax VAL stringexpressi on where stringexpression A string expression which represents a decimal number Notes VAL converts the string specified by stringexpression into a numeric value If stringexpressionis nonnumeric VAL returns the value 0 PRINT VAL ABC 0 If stringexpressioncontains a nonnumericin midstream VAL converts the string until it reaches the first character that cannot be interpreted as a numeric PRINT VAL 1 2E 3ABC 1 200000000E 3 The sTR function has the opposite capability to VAL Reference Functions asc and STR 11 57 Appendix A Error Codes and Error Messages Introduction This Appendix specifies all error codes and their meanings Execution Errors Table A
22. drivename should precede program filename drivename iS A or B for the RAM or flash ROM respectively If drivename is omitted the default drive A applies Syntax Error Error Code and Message Meaning error 3 missing No double quote precedes or follows programfilename Or drivename programfilename error 71 Syntax error programfilename Ol drivename programfilename S not enclosed in double quotes Execution Error Error Code 02h 07h 35h 41h Reference Statements 10 12 M eaning Syntax error programfilename or drivename programfilename isin incorrect syntax or the extension is not PD 3 Insufficient memory space the first program uses too many variables File not found the file specified by programfilename does not exist File damaged APLOAD COMMON and KPLOAD Statement Reference CLFILE Statement Name Clear FILE Type Filel O Statement Description Erases the data stored in a data file Syntax CLFILE filenumber where filenumber A numeric expression which returns a valuefrom 1 to 16 Notes CLFILE erases data in the data file specified by i1enumber and resets the number of written records in the directory to zero Thememory area freed by CLFILE can be used for other data files or user program files User programs can no longer refer to the erased data Syntax Error Error Code and Message M eaning error 71 Syn
23. e An identifier should not start with a numeral or the character string rx If starting with an en the character string is treated as a function identifier defined by the per FN statement Examples of identifiers a abcdef al al2345 Reserved Words Reserved words are keywords to be used in statements functions and operators For the list of reserved words refer to Appendix B Reserved Words e A reserved word cannot be used by itself for a label name a variable name or other identifiers but can be included within them The following identifiers for example 4 7 MA PDT 1100 Terminal Programmer s Guide are improper since they use reserved words input and key as is without modification input 3 key 1 e A reserved word can be used for a data file name as shown below OPEN input AS 1 Chapter 5 Data Types Constants A constant is a data item that does not change during program execution Constants are classified into two types string constants and numeric constants Constant Example String constants apo 123 N umeric constants Integer constants In decimal notation 123 4567 In hexadecimal notation amp HFFF amp h1A2B Real constants 123 45 67 8E3 String Constants A string constant is a character string enclosed in double quotation marks Its length should be a maximum of 255 characters The character string should not contai
24. set the condensed System M ode used for maintenance of user programs To terminatethe APLIN T PD3 file use the EnD or power orF statement When terminating the file with the Exp statement start System M ode by setting the port 6000h as listed below Port No Bit assignment Controls the following 6000h 0 0 Does not start System Mode default 1 Starts System Mode Modifying PW Key Depression M odify the time the PW key must be depressed for the unit to turn off from 0 1 to 25 5 seconds in increments of 0 1 ms by setting bits 0 to 7 on port 6030h to 1 to 255 amp h00 to amp hFF The default is 5 0 5 second H 7 M PDT 1100 Terminal Programmer s Guide 7 CODE128 Reading CODE128 bar codes are read in the following manner Thestart stop characters and check digits are not transmitted to the bar code buffer When a code comprised only of special characters FN C characters CODE A CODE B and CODEC characters and SHIFT character is read the data is not transmitted to the bar code buffer FNC characters are processed as explained below 1 FNC1 A FNC1 placed in the first or second position after the start character is not transmitted to the bar code buffer Any other FN C1 characters are converted into GS characters 1Dh before they are transmitted to the bar code buffer When the first character right after the start character is FN C1 thisisa EAN 128 code whose code mark is iWi 2 FNC2 IfaFNC2 characte
25. 10 10 Statement Reference CHAIN Statement Name Chain Type Flow Control Statement Description Transfers control to another program Syntax Syntax 1 CHAIN programfilename Syntax 2 CHAIN drivename programfilename where programfilename and drivename programfilename A string expression Notes CHAIN transfers control to a program specified by programfilename That is it terminates the current program first program and closes all files being opened Then it initializes environments for the chained to user program second program and executes it programfilename is an executable object program compiled by the Compiler and has the extension PD3 as shown below The extension PD 3 cannot be omitted CHAIN progl PD3 Download an executable object program second program to the PDT 1100 before the CHAIN instruction is executed e You can pass variables from the current program to the chained to program second program with the common statement 10 11 s T PDT 1100 Terminal Programmer s Guide User defined fonts loaded by the APLOAD and KPLOAD statements and the setting values assigned by the KEY statement and COUNTRYS function remain effective in chained to programs Theon ERROR GOTO statement cannot trap errors while showing the error code 07h which means Insufficient memory space that occurred during initialization of chained to programs
26. 2 484441 Inside Italy 39 02 484441 Outside Italy Latin America Sales Support 7900 Glades Road Suite 340 Boca Raton Florida 33434 USA 1 800 347 0178 Inside United States 1 561 483 1275 O utside United States N etherlands N ederland Symbol Technologies Kerkplein 2 7051 CX Postbus 24 7050 AA Varsseveld N etherlands 315 271700 Inside N etherlands 31 315 271700 Outside N etherlands About This Guide M exico M xico Symbol Technologies M exico Ltd Torre Picasso Boulevard M anuel Avila Camacho No 88 Lomas de Chapultepec CP 11000 M exico City DF M exico 5 520 1835 Inside M exico 52 5 520 1835 Outside M exico N orway N orge Symbol Technologies Trollasveien 36 Postboks 72 1414 Trollasen Norway 66810600 Inside N orway 47 66810600 Outside N orway If you purchased your Symbol product from a Symbol Business Partner contact that Business Partner for service Related Publications PDT 1100 Terminal Product Reference Guide p n 70 35864 X X PDT 1100 Quick Reference Guide p n 70 35861 X X PDT 1100 Terminal Transfer Utilities G uide p n 70 36368 X X PDT 1100 Extension Library Programmer s Guide p n 70 36556 X X Warranty Symbol Technologies Inc Symbol manufactures its hardware products in accordance with industry standard practices Symbol warrants that for a period of twelve 12 months from date of shipment products will be free from defects in materials and workmanship
27. Default Denmark D England E France F Germany G Italy l Japan J D efault N orway N Spain S Sweden W Refer to COUNTRY on page 11 11 cou 23 24 40 5B 5C 5D 5E 60 7B 7C 7D 7E 7F Ce el yer eI be J A la ja _ zA Tle cs A 0 a JO B _ o h f ala b eni E a fi 1 J gt J xn l le fo l Pt i IN l A x E J JO A U ja ja jo J TRYS countrycode C3 M PDT 1100 Terminal Programmer s Guide S Note Empty boxes in the table are assigned the same characters as the default in Character Set on page C 1 Display Mode and Letter Size Character Frame and Letter Size in Single Byte AN K M ode Display font size Character frame Letter size W xH W xH Standard size 6x8 5x7 Small 6x6 5x5 Generating Small Font Patterns Single byte ANK characters To display single byte AN K characters in the small font small font patterns stored in flash ROM areused and no condensation occurs The Interpreter condenses patterns loaded by the APLOAD statement as follows 123456 lO o __ 2m n gt EEN 3M EHU E n 4 SOOO o E a 5 SEE
28. Fs Fe F7 Fs Pw Bs c SF 36099020 eps Figure 7 L The PDT 1100 Keypad 7 3 M PDT 1100 Terminal Programmer s Guide 7 Activating the alphabet input function with OUT statement Use the OUT statement to activate or deactivate the alphabet input function by setting bit 0 of port 5to 1 activate or O deactivate OUT 5 1 The default alphabet input function is deactivated Entering alphabetic characters from the keypad 1 Find the key that is assigned to the alphabetic character you want and check the position of the character Left Center or Right relative to the three characters assigned to that key 2 Designate the character position using the trigger switch and then pressing the key Press the trigger switch to cycle through the shift guidance blocks Left Center and Right on the LCD as shown below Left Center Right The shift guidance block appears on the top or bottom line depending upon the current cursor position That is if the cursor lies on any of the lower lines the shift guidance block appears on the top line if it lies on any of the upper lines the block appears on the bottom line The shift guidance block appears only while the trigger switch is held down therefore press the key while holding down the trigger switch To enter an N character for example use the trigger switch to display the block Center
29. IF THEN ELSE END IF SELECT CASE END SELECT WHILE WEND Nested Structure Block structured statements allow you to write nesting programs as shown below FOR i 1 TO 10 FOR 3 2 TO 10 STEP 2 PRINT i j k NEXT 3 NEXT i N esting subroutines as shown below is also possible GO aaa PR GO bbb PR 3 2 SUB aaa U I S U INT TURN bbb Program Structure Jumping Into O ut of Statement Blocks It is not recommended to jump control from a main routine or subroutines into or out of the middle of significant statement blocks using the coro statement Statement Blocks Jump into Jump out Subroutine X X Error event handling routine X X Block format user defined function X X Block structured statement X z X To be avoided An execution error may ocur z N ot recommended although no execution error results N esting may cause an execution error It is possible to jump control out of the midst of block structured statements using the coro statement except for FOR NEXT Jumping the control out of the midst of FoR NExT statement block by the coto statement does not directly result in an execution error although it may eventually if repeated The program below for example should be avoided FOR I 0 TO 10 IF I 5 THEN GOTO AAA ENDIF NEXT I AAA Note Frequent or improper use of coro statements in a program decreases debugging effic
30. as the referred to line Fatal Error Error Code and Message Meaning fatal error 30 Cannot No included fileis found find include file XXX fatal error 31 Cannot Included files are nested nest include file 10 138 Chapter 11 Function Reference Introduction This chapter provides detailed descriptions of the functions used to program the PDT 1100 11 1 T PDT 1100 Terminal Programmer s Guide Function Name ABSolute Type Numeric Function Description Returns the absolute value of a numeric expression Syntax ABS numericexpressi on Notes ABS returns the absolute value of numericexpression The absolute value is the magnitude of numericexpression regardless of sign e g both ABS 12 34 and ABS 12 34 are equal to 12 34 Ifareal number is entered this function returns a real number if an integer number is entered an integer number is returned 11 2 Function Reference ASC Function Name ASCii code Type String Function Description Returns the ASCII code value of a given character Syntax ASC stringexpression Notes ASC returns the ASCII code value of the first character of stringexpression which is an integer from 0 to 255 For the ASCII character codes refer to Appendix C Character Sets If stringexpressionisa null string this function returns the value 0 Reference Functions CHRS T PDT 1100 Terminal Programmer s Guide BCC
31. keynumbex backlightkeynumbex Of M keynumberiS out of range Examples Syntax 1 KEY 1 a KEY 2 F CHRS 13 KEY 37 wa 10 64 Statement Reference Syntax 2 KEY 1 BL60 Reference Statements ON KEY GOSUB KEY ON and KEY OFF 10 65 T PDT 1100 Terminal Programmer s Guide KEY ON and KEY OFF Statement Name Key On and K ey Off Description Enables or disables keystroke trapping for a specified function key Syntax KEY keyn umber fonJoFF where Type 1 0 Statement keynumber A numeric expression which returns a value from 1 to 31 33 and 38 Notes Appendix E Key Number Assignment on the Keyboard 10 66 KEY ON enables keystroke trapping for a function key specified by keynumbez Refer to Between execution of statements the Interpreter checks whether a function key specified by the KEY ON statement is pressed or not If the key is pressed the Interpreter transfers control to the event handling routine defined by an on KEY GOSUB statement before the KEY ON instruction If a function key assigned a null string by the xey statement ON statement the keystroke trap takes place If you specify a function key which has been defined asthe L ON statement then no keystroke trap takes place Keystroke trapping has priority over the INKEYS function When a program waits for the keyboard entry by the INPUT or INPUTS function pressing a function ke
32. oa 10 74 COC uae e E ed n 11 35 LOCATE icing yayra etae ia 6 10 76 O AE E E 11 37 Logical Operators oooo omo 6 4 Low Battery Warning H 2 M MARK ta ara aos 11 39 memory control statement DIM retas cara arcos 10 37 ERASE a O A E 10 41 memory management function 11 22 Memory Map cece eee ee ee F 1 Memory Occupation 5 4 MIDS 3c a Roa eat 11 41 M odulo Operation MOD 6 3 M onitoring by the INP Function 7 12 Monitoring by the WAIT Statement 7 13 multiple code cece eee eee 8 7 N National Character Sets C 3 Nested Structure auauua aaa 3 2 Non Array Integer Variables 5 4 Non Array Real Variables 5 5 Non Array String Variables 5 3 NOT Operator cece eee 6 5 notational conventions xiv NULL Character or String Assignment 7 8 Numeric Constants 0000 5 1 numeric function 00 00 c eee 11 2 numeric operation function 11 32 Numeric Variables oo ooo oo 5 4 O ON rd nio a 10 82 ON ERROR GOTO 10 78 ON KEY GO SUB 10 82 ON GOSUB and ON GOTO 10 80 ON GOSUB and ON GOTO 10 80 OPEN st scat et ee ran 10 84 OPENS BAR o a a A ta 10 87 OPEN COM a a tai 10 95 OPEN COM cra oa 10 95 Operator Precedence ccc eee oo 6 1 Operators sunt A iana tae bata a
33. the transmission results in an abnormal end Sending Receiving Station Station DLE EOT and ID Occurrence Of An Error To phase 3 Figure M 27 Phase 2 with a sequence of DLE EOT and IDs Phase 2 with repeated transmission of DLE ENQ and IDs due to no response or invalid response If the sending station receives no response or an invalid response from the receiving station after a transmission block is sent it resends a sequence of DLE ENQ and IDs every 0 5 seconds up to 59 times If the sending station receives a sequence of DLE ACK andIDs during this time it continues the subsequent message transmission Sending Receiving Station Station Data Text m 0 5 second LE ENQ and IDs 0 5 second LE ENQ and IDs DLE ACK and IDs 35864075 eps Figure M 27 Phase 2 with repeated transmission of DLE ENQ and IDs M 31 M PDT 1100 Terminal Programmer s Guide S Abnormal termination of phase 2 Abort of phase 2 If the sending station receives no sequence of DLE ACK and IDs from the receiving station after sending a sequence of DLE ENQ and IDs 59 timesin succession it sends a sequenceof DLE EOT and IDsto thereceiving station 0 5 seconds after the 59th sequence of DLE ENQ and IDs and then aborts this transmission Sending Receiving Station Station 0 5 second __ DLE ENQ and IDs 0 5 secong _ PHE ENQ and IDs 0 5 second DLE ENQ and IDs 59 DLE EOT an
34. 05h 07h 34h 36h 3Eh 41h 42h 43h Reference Statements 10 112 M eaning Parameter out of range either i1enumber Or recordnumberis out of range Insufficient memory space Bad file name or number i1enumber of an unopened file specified Improper file type i1enumber of a file other than communications device files specified A PUT instruction executed without a FIELD instruction File damaged File write error writing onto a read only file attempted N ot allowed to access data in flash ROM OPEN and GET Statement Reference READ Statement Name Read Type 1 O Statement Description Reads data defined by DATA statement s and assigns them to variables Syntax READ variabl el variable where variable A numeric or string variable Notes EAD reads as many data values as necessary from data stored by DATA statement and assigns them one by one to each variable in the READ instruction Y If the data type of a read value does not match that of the corresponding variable the following operations take place so that no error occurs The READ instruction converts the numeric data into the string data type and then assigns it to the string variable Statement example DATA 123 READ a PRINT a Output 123 If the string data is valid as numeric data the READ instruction converts the string data into the numeric data type and then assigns it to the numeric
35. 1 English 6 7 0 Sleep Timer 4 0 to 255 8 0 Wake up function 0 Deactivates 1 Activates 2 TIMES function 0 Selectsthe 1 Selects the system time wake up time D 4 Table D 2 Output Port Assignments Continued 1 0 Ports Eh 0 System status indication 0 OFF 1 ON Fh 7 0 Re read prevention enabled tim 0 to 255 10h 24Fh 7 0 VRAM 2 0 OFF 1 ON 6000h 0 Initiation of system mode 1 0 Not initiate 1 Initiates 6020h 0 LCD Backlight 1 0 TurnsOFF 1 Turns ON 6021h 7 0 LCD Backlight ON duration 4 0 to 255 6030h 7 0 Effective held down time of power 1 to 255 key 2 6060h 7 0 Communications protocol 13 0 PDT 1100 1 PDT1100Ir protocol protocol 6061h 7 0 ID lower byte 14 0 to 255 6062h 7 0 ID upper byte 14 0 to 255 6070h 0 Output pulse width of IR beam 0 1 63 us 1 3 16 bit time 6080h 0 Display font size 16 0 Standard size 1 Small size 1BASIC 3 0 represents the bit order by the exponent of each binary digit in the byte For example bit 0 means LSB bit 7 means M SB 2 The reading confirmation LED is controllable only when the bar code device file is closed If the file is open the out statement is ignored If the confirmation LED is set to OFF in the OPEN Bar statement a user program can control the reading confirmation LED although the bar code device file is open 3 Lower four bits bit 3 to bit 0 in this byte control the co
36. 10 137 flow control statement CAL a 10 9 CHAIN socias addon 10 11 EN Dose cesta ia 10 40 FORA NEXT treated rdaaia 10 45 GOSUB Cercs as de ata 10 50 GOTO nic ea 10 52 IF THEN ELSE ENDIF 10 53 ON GOSUB and ON GOTO 10 80 RETURN sicacaie a deen batas do 10 120 SELECT CASE END SELECT 10 123 WHILE WEND 10 128 FORA NEXT ie ose C05 Shee tit aetna OM 10 45 Function KeyS cece eee eee 7 8 G GET ihn tate eis a Blea eee 10 48 Global Variables and Local Variables 3 2 GOSUB tote ee ee de 10 50 COTO AA a Ee AE dt 10 52 H Handling User Programs 3 4 handshaking 00 0000 ee eeu M 2 Hardware ge eee ee eee 2 1 Index HEX ti A ee eae 11 24 horizontal parity 0 008 M 3 horizontal parity checking M 17 l ID epore radiata M 35 Identifiers oo eee eens 4 7 Rules for Naming Identifiers 4 7 IF THEN ELSE ENDIF 10 53 Included Files oooooooooooo 3 5 information service 0 005 XV IKE Soci atta ake bs aa te aa 11 25 IN Pipa ioe Meat deen again tare caren 11 26 INP Function ccc cree eee 7 12 9 2 INPUT tenet tne treater cage ie dene 10 55 Input from the Keyboard 7 3 INPUT ict eae algas 10 58 INPUT St rn oda 11 28 INSTR a A 11 30 integer constants o ocooococoo oo 5 1 Interpreter oc ce eee 1 5 IR Protocol ce cece ee eee M 21 IR protocol
37. 108 PUT rima tas ta da ados 10 111 READ is A A AA Ata A AAA AAA AAA UT iz 10 113 REM tai a A e ELIO WAN a WADE EEES O E SACA eg 10 115 RESTO RE rin a ii ate a AAA A A ate wae a 10 117 RESUME monaco aa ir a a a 10 118 RETURN ra A Ra Satara ld ce A EA dow ace EA A E 10 120 SCREENS ana E A e e al AE e e der ee nl 10 121 SELECT CASE EN D SELECT nnana a ica alas 10 123 WA ena ana ri arcos Mad cet e Aen 10 126 WHILE WENDES oca A AA a Swat a AIA 10 128 vii M PDT 1100 Programmer s Guide S XEM e EN SS EA A A alte Bo ten ont ata ASA 10 130 SINCLUDE cocos ia os rr Qi pa A Ra E Dc o E ata ea REA 10 137 Chapter 11 Function Reference INTO UCI A A EA A cha lca ce ai ae ae 11 1 gt A A A cri Oe A O 11 2 AS A E II ARA ONIN AOR EA A DIA 11 3 DOCG nad anche bad e distal 11 4 CRDi A es weeds AE lose esa en O 11 6 O shave cleats asses Gusts eta mods ntane toe AE aa die PEIE tatoos da hee a 11 9 COUNTRY S cease A Se agate ood ieee tae ON ence gaa ah ae 11 11 CSREING gare couse ner auras E OO 11 13 DATES AA AAA AA 11 14 A A A O RR PTA A A att ett Gaba 11 16 A al ds ta de ir 11 18 E sab nie ace e ELE e ld e UU e LS 11 19 A A A case 11 20 A A a ae oe ceca us A A 11 22 HEX Gi ares at ae aon celta ses ita dni Nt 11 24 A beta se apa bia Minas eect cae ase Be AET AR aca Bal Stet 11 25 E E A A Naan agin maha tae A Me 11 26 UN PU Seis dace tite A A Su aaa la eer 11 28 A A E E ES RAS 11 30 O 11 32 E A A A O A haw Mastered eathets 11 33 A A
38. 123 Output 123 If the number specified by expression has more digits than the number of digit positions specified by the extra digits before the decimal point aretruncated and those after the decimal point are rounded Statement example PRINT USING 7 1234 56 Output 234 6 Specifies the position of the decimal point If the number specified by expression has fewer digits than the number of digit positions specified by after the decimal point the insufficient digits appear as zeros Statement example PRINT USING 123 Output 123 000 Displays the sign of the number If is at the beginning of the format string the sign appears before the number specified by expression if is at the end of the format string the sign appears after the number If the number specified by expression is a positive number or zero it is preceded or followed by a space instead of a sign Statement example PRINT USING 123 Output 123 stringformat isa formatting string consisting of e and or amp s each of which causes a special printing effect as described below Displays the first character of the stringexpression Statement example PRINT USING ABC Output A Displays the entire stringexpression Statement example PRINT USING ABC Output ABC 10 109 TO PDT 1100 Terminal Programmer s Guide amp amp Displays the first n 2 characters of the stringexpress
39. 49400458 When cDtypeis 1 ITF the length of barcodedata must be an even number of two or more digits If not this function returns a null string e To check that the CD is correct pass a CD suffixed barcodedata to a CHKDGTS as shown below If the returned value is equal to the CD the CD data is suitable for the barcodedata Sample coding IF CHKDGTS 123457 1 7 THEN e To add a CD to bar code data pass barcodedata followed by a dummy character to a CHKDGTS as shown below Thereturned value becomes the CD to be replaced with the dummy character Sample coding PRINT 12345 CHKDGTS 12345 4 0 I 123457 When CDtype is M Code 39 the length of barcodedata must be two or more digits not including start and stop characters If not this function returns a null string T PDT 1100 Terminal Programmer s Guide To check that the CD is correct pass a CD suffixed barcodedata to a CHKDGTS as shown below If the returned value is equal to the CD the CD data is suitable for the barcodedata Sample coding IF CHKDGTS CODE39W M W THEN To add aCD to bar code data pass barcodedata followed by a dummy character to a CHKDGTS as shown below T hereturned value will become theCD to be replaced with the dummy character Sample coding PRINT CODE39 CHKDGTS CODE39 0 M CODE 39w When CDtypeisN N W 7 the length of barcodedata must bethree di
40. 7 CODE A While you hold down thetrigger switch theillumination LED lights and the PDT 1100 can read a bar code even if the bar code device file is closed Y ou cannot scan another bar code until the entered bar code data is read out from the bar code buffer Auto off mode F OPEN BAR F AS 7 CODE A When you press the trigger switch the illumination LED comes on The LED goes off when you release the switch or when the PDT 1100 completes bar code reading H olding down the M keys lights the illumination LED for up to 5 seconds While the illumination LED ison the PDT 1100 scans the bar code until it is read successfully or the bar code device file is closed The LED turns off after 5 seconds and theM key must be pressed again to read a bar code Oncea bar codeis read successfully you cannot scan another bar code until the entered bar code data is read out from the bar code buffer Alternate switching mode A OPEN BAR A AS 7 CODE va Pressing the trigger switch turns on theillumination LED Even if the switch is released the illumination LED remains on until a bar code is read successfully the bar code device 10 88 Statement Reference file is closed or a switch is pressed again While the illumination LED is on the PDT 1100 can read a bar code Pressing the trigger switch toggles the illumination LED on and off Oncea bar codeis read successfully you cannot scan another bar cod
41. 8 910111213141516 eer Position Data File N Number of Data t Ne o Texts Contained Example of 5 bytes Ai Contents MA STER DAT 100592 0 100 BT Every data field should be 1 to 254 digits If itis less than 2 The data file name is a maximum of 12 characters digits the upper blank byte is in length and it consists of FILE NAME filled with zero 0 and EXTENSION The FILE NAME should be 1 to 8 characters The EXTENSION should be other than PD3 FN3 and EX3 and it may be omitted together with a period The number of fields should be 1 to 16 If it is less than 2 digits the upper blank byte is filled with zero 0 If the data name is less than 12 characters the The number of data lower blank bytes are filled texts should be 0 to with space characters 32767 If it is less than 5 digits the upper blank bytes is filled with zeros 0 Figure M 33 Data Text Format Heading Text Data Field 1 Data Field 2 Data Field n Example of Contents T 1 0 0 9 1 S 1 2 3 J 9 2 0 2 1 4 1 3 2 5 l Every data field should If field is Kanth be 1 to 99 digits a data field is less than the maximum digits the lower blank bytes are filled with space characters Figure M 34 Data Text Format Data Text M 37 S M PDT 1100 Terminal Programmer s Guide Note Thetotal length of all data fields plus the number of the character count bytes plusthe number of the fields sh
42. 87 DEF missing error 88 To missing error 89 INPUT missing error 90 missing error 91 Improper initial value for integer variable A 8 Appendix B Reserved Words Table B 1 lists reserved words keywords of BASIC 3 0 These words must not be used as a variable name or label name Table B 1 Reserved Words ABS COMMON ERROR AND CONT ETB APLOAD COUNTRY ETX AS CSRLIN EXIT ASC CURSOR F FIELD BCC DATA FN BEEP DATE FOR CALL DEF FRE CASE DEFREG G GET CHAIN DIM GO CHKDGT ELSE GOSUB CHR END GOTO CLFILE EOF H H EX CLOSE ERASE l IF CLS ERL INCLUDE CODE ERR INKEY INP ON SOH B 1 M PDT 1100 Terminal Programmer s Guide S Table B 1 Reserved Words C ontinued INPUT OPEN STEP INSTR OR STR INT OUT STX K KEY P POS T THEN KILL POWER TIME KPLOAD PRINT TIMEA L LEFT PRINT TIMEB LEN PUT TIMEC LET R READ TO LINE RECORD U USING LOC REM V VAL LOCATE RESTORE W WAIT LOF RESUME WEND M MARK RETURN WHILE MID RIGHT X X FILE MOD S SCREEN XOR N NEXT SEARCH NOT SELECT 0 OFF SEP B 2 Appendix C Character Sets Character Set Thefollowing table lists the character set which thePDT 1100 can display on theLCD screen It is based on the ASCII codes S M PDT 1100 Terminal Programmer s Guide Lower 4
43. ACK and IDs from the receiving station it sends a transmission block containing the data texts as shown below When a sequence of DLE ACK and IDs is received in responseto the last transmission block data text n the sending station proceeds to Phase 3 If a transmission message contains no data text the sending station transmits the heading text only Sending Receiving ation Heading Text Station DLE ACK and IDs Data Text 1 DLE ACK and IDs Data Text n 1 Data Text n DLE ACK and IDs To phase 3 35864072 eps Figure M 24 Normal Phase 2 Phase 2 with suspension of data reception for erasure of the flash RO M If the receiving PDT 1100 needs to erase the flash ROM for receiving downloaded files it sends a sequence of WACK and IDs to the sending station to suspend data transmission W hen the sequence of WACK and IDs are received the sending station stops the data transmission until a response M 28 Communications comes from the receiving station If no response comes within one minute the sending station sends a sequence of DLE EOT and IDs and aborts the current transmission Sending Station H Eeo aR eading Text WACK and IDs pa DLE ACK and IDs ata Text 1 DLE ACK and IDs pecs Receiving Station H gt Start Of Erasur gt 3 End Of Erasure 35864073 eps Figure M 25 Phase 2 with suspension of data recep
44. An apostrophe which may be replaced for keyword REM can begin in thefirst column When following any other statement an apostrophe requires no colon as a delimiter You can branch to a REM statement labelled by the coro or Gosus statement The control is transferred to the first executable statement following the REM statement 10 115 T PDT 1100 Terminal Programmer s Guide Syntax Error Error Code and Message Meaning error 2 Improper label REM begins in the first column of a program line name redefinition variable name or reserved word used Reference Statements SINCLUDE 10 116 Statement Reference RESTORE Statement Name Restore Type I O Statement Description Specifies a pata statement location where the rean statement should start reading data Syntax RESTORE labe1 Notes RESTORE specifies a DATA statement location where the READ statement should start reading data according to label designating the DATA statement e You can specify DATA statements in included files If label option is omitted the default label is a DATA statement appearing first in the user program Syntax Error Error Code and Message M eaning error 81 Must be DATA label is nota DATA statement statement label Reference Statements DATA and READ 10 117 T PDT 1100 Terminal Programmer s Guide RESUME Statement Name Resume Type Error Control Statement Descri
45. IDs IDm ID of sending station IDs ID of receiving station 35864069 eps Figure M 21 Ir Protocol Transmission Message M 25 M PDT 1100 Terminal Programmer s Guide F Data transmission may accidentally involve various types of errors The Ir protocol is designed to recover from those errors as frequently as possible What follows is the Ir protocol for phases 1 through 3 Phase 1 Establishment of Data Link Normal Phase 1 The sending station transmits a sequence of DLE EN Q and IDm sending station s ID to the receiving station Upon receipt of a sequence of DLE ACK and IDs receiving station s ID from the receiving station the sending station shifts to phase 2 Sending Receiving station DLE ENQ and IDm Station DLE ACK and IDs To phase 2 Figure M 22 Normal Phases Phase 1 with repeated transmission of DLE EN Q and ID m due to no response or invalid response If the sending station receives no response or any invalid response from the receiving station in response to the sent sequence of DLE ENQ and IDm it iterates sending of the sequence at 0 5 second intervals up to 60 times If the sending station receives a sequence of DLE ACK and IDs before sending the sequence of DLE ENQ and IDm 60 times it shifts to phase 2 Sending DLE ENQ and IDm Receiving Station a 0 Station 0 5 second DLE ENQ and 0 5 second ee a DLE ACK and ID To phase 2
46. K 8 Commenting a Program saasaa K 9 M anipulating Numeric Data 6 tte K 9 M anipulating String Data aaa aaa K 9 Defining User Created Functions 00 cee tetas K 10 Specifying Included Files ooooooooororor K 10 Appendix L Unsupported Statements and Functions Appendix M Communications Basic Communications Specifications 0 6 cee M 1 Sd A M 1 Optical Interface Communications Range 0 ceed M 2 Transmission Code and Bit Order 0 kt tte eed M 2 RESPONSE Meth cion a ieee daily Rae kes wat ee Se A al gee M 2 Vertical Parity osos ana ead a da Peeled a AA eae M 2 BCC for H orizontal Parity Checking aoaaa M 3 IRSPROTOCOL it Ra a OR aged NA O a A TTNA M 4 Communications Parameters 0 2 00 cee ete M 5 IN System Mod ii a AA adun este hahaa M 5 Communications ProtocolS 0 cee tte M 6 ARONO E o ares eS Se ae Mee etek O A o oes M 6 IR PROTOCO Nacio a RA a Ss ial apie Set eters M 21 OVANIE Wania akna anie 0 8 Binds Sah dee e eaae atin et a tease IAN E Maes daa M 21 xi M PDT 1100 Programmer s Guide S xii About This Guide ThePDT 1100 Programmer s Guide provides general instructions for programming the PDT 1100 terminal The chapters are set up as follows Chapter 1 Software O verview surveys the software structure of the PDT 1100 introduces the programs integrated in the ROM and the language features of BASIC 3 0 Chapter 2 D evelopment Environment and
47. N ote For the adjustment of the beeper volume refer to the PDT 1100 U ser s M anual Controlling and Monitoring the I Os Controlling by the our Statement The out statement controls the input and output devices I O s below Refer to Appendix D 1 0 Ports out Statements 1 0 Devices OUT 1 h02 Turns the reading confirmation LED green 1 OUT 1 h01 Turns the reading confirmation LED red 1 OUT 1 amp h00 Turns off the reading confirmation LED OUT 2 amp h01 Turns RS RTS signal ON 2 OUT 2 amp h00 Turns RS RTS signal OFF 2 OUT 3 amp hXX XX 00 to 07 Sets the LCD contrast OUT 4 amp h01 Sets the English message version OUT 6 amp hXX XX 00 to OF Sets the sleep timer OUT 8 amp h01 Turns on the wake up function 7 10 I O Facilities out Statements 1 0 Devices OUT 8 h00 Turns off the wake up function OUT 8 h04 Sets the wake up time or reads the preset time OUT amp hE amp h01 Turns on the system status indication 3 OUT amp hE amp h00 Turns off the system status indication 3 OUT amp h0010 amp hXX Xx 00 to FF Outputs to the VRAM 4 amp hO24F amp hxx XX 00 to FF OUT amp h6020 amp h01 Turns on the LCD backlight OUT amp h6020 amp h00 Turns off the LCD backlight OUT amp h6021 amp hXX XX OO toFF Sets the LCD backlight ON time lThe reading confirmation LED
48. Procedures describes the hardware software and procedures required for developing programs Chapter 3 Program Structure summarizes the basic structure of programs Chapter 4 Basic Program Elements describes the format of a program line usable characters and labels Chapter 5 Data Types covers data which the program can handle by classifying them into data types constants and variables Chapter 6 Expressions and O perators surveys the expressions and operators to be used for calculation and for handling character strings Chapter 7 1 0 Facilities defines 1 O facilities and describes output from the LCD input from the keyboard and control for the timer beeper and other 1 O s by the statements and functions Chapter 8 Files describes data files and device files Chapter 9 Event Polling and Error E ventT rapping describes the event polling and two types of traps error traps and event of keystroke traps supported by BASIC 3 0 Chapter 10 Statement Reference describes the statements available in BASIC 3 0 including the error codes and messages Chapter 11 Function Reference describes the functions available in BASIC 3 0 including error codes and messages xiii S M PDT 1100 Terminal Programmer s Guide Appendix A Error Codes and Error M essages lists the error codes and messages Appendix B Reserved Words lists the reserved words for BASIC 3 0 Appendix C Character Sets lists the character sets A
49. STOP ON STCOM GOSUB MKDS MKIS MKS PRINT PRINT USING RSET WRITE ON STOP GOSUB STOP OFF STOP ON L 1 a PDT 1100 Terminal Programmer s Guide For graphics and color control CIRCLE DRAW WIDTH COLOR LINE WINDOW CONSOLE POINT CSRLIN PSET For I O control DEFUSR POKE PEEK VARPTR For mathematical functions and trigonometric functions ATN COS EXP For others CDBL CINT CLEAR COPY DEF DBL DEF SNG DEF INT L 2 LOG SCNG SIN FIX IF GOTO LPOS OCT OPTION BASE RANDOMIZE RND SQR TAN SGN STRINGS SWAP TAB WRITE Appendix M Communications Basic Communications Specifications The following table lists the communications specifications for the PDT 1100 and a host computer via the CRD 1100 optical interface or direct connect interface cable Table M 1 Communications Specifications Communications Port Optical Interface Direct connect Interface Synchronization Start stop Transmission Speed 2400 9600 19200 38400 300 600 1200 2400 4800 57600 or 115200 bps 9600 19200 or 38400 bps Character Length 8 bits 7 or 8 bits Transmission Bit O rder LSB Least significant bit first Response M ethod ACK NAK response Vertical Parity None Even odd or none Transparency Transparent or non transparent mode Stop Bit Length 1 bit 1 or 2 bits Synchronization For accurate data transaction synchronizethe tra
50. Statement Reference Where integerconstant is a value from 0 to 254 numericinitialvaluedefinition For one dimensional numeri cconstantl numericconstant DEFREG n6 3 9 8 7 6 For two dimensional KE numericconstant numericconstant numericconstant numericconstant a DEFREG n7 1 2 10 11 12 13 14 15 stringinitialvaluedefinition For one dimensional stringconstantl stringconstant DEFREG s35 3 Nate bc wiae 45 For two dimensional stringconstantl stringconstant stringconstantl stringconstant wa DEFREG s4 1 1 a b c 1 stringlength An integer constant from 1 to 255 Notes D EFR EG defines non array or array register variables A DEFREG nstruction can appear anywhere in a source program Up to 2 dimensional array variables can be defined For both non arraystringvariableand arraystringvariable the string length can be specified 10 25 s T PDT 1100 Terminal Programmer s Guide Defaults stringlength for non array variables 40 characters stringlength for array variables 20 characters The memory area for register variables is allocated in user program files in the memory Register variables therefore are always updated An uploaded user program for example contains the updated register variables if defined Thetotal number of bytes allowable for register variable
51. Syntax 1 Defining a numeric function DEF FN functionnamel dummyparameterl dummyparameter expression Syntax 2 Defining a string function DEF FN funct ionname dummyparameter dummyparameten stringlength l expression Syntax 3 Calling the function FN funct ionname realparameter realparameter where functionname For numerics functionnamez Integer function name functionname Real function name For strings functionnames Character function name wherethe FN can be lowercase dummyparameter A non array integer variable a non array real variable or a non array string variable stringlength An integer constant having a valuefrom 1 to 255 expression and f realparameter A numeric or a string expression 10 29 T PDT 1100 Terminal Programmer s Guide Notes DI EF FN creates a user defined function Definition of a user defined function should preceed a calling statement of the user defined function in a source program You cannot define the same function name twice The DEF FN statement should not be defined in the block structured statements FOR NEXT IF THEN ELSE END IF SELECT CASE END SELECT and WHILE WEND in the error handling routine event handling routine or in the ne DEF FN functions cannot be recursive Thetypeof functionname should match that of the function definition expression In defining a character function you can spe
52. Syntax error The data type on the right and left hand sides does not correspond That is the variable on the left hand side is numeric but the expression on the right hand side is a string or vice versa Execution Error Error Code M eaning 06h The operation result is out of the allowable range OFh String length out of range in a string assignment the string length of the evaluated result on the right hand side exceeds the maximum length of the string variable on the left hand side 10h Expression too long or complex 10 71 T PDT 1100 Terminal Programmer s Guide LINE INPUT Statement Name Line Input Type O Statement Description Reads input from the keyboard into a string variable Syntax LINE INPUT prompt stringvariable where prompt A string constant stringvariable A string variable Notes When execution reaches a LINE INPUT instruction the program waits for the user to enter data from the keyboard and shows a prompting message specified by prompt After entering data pressthe ENT key Then the LINE INPUT instruction assigns the data to stringvariable A LINE INPUT statement cannot assign a numeric variable An INPUT statement can prompt isa prompting message displayed on the LCD If prompt is followed by a semicolon the LINE INPUT instruction displays the prompting message followed by a question mark and a space LINE INPUT data a data
53. T to protocolspec in the XFILE statement XFILE d2 dat T G 4 Handling Space Characters in Downloading Thefigure below shows how the space characters in thetail of a data field are handled as data inthePDT 1100 Host Computer Field 1 Field 2 Field 3 denotes a space character Downloading a data file PDT 1100 Field 1 Field 2 Field 3 q L4 q D Ls pi T y Jae l tallo 1 by Lofts fg O is the count byte of a significant data length in a field 36099026 eps M PDT 1100 Terminal Programmer s Guide S G 6 Appendix H Programming Notes Sleep Timer The sleep timer feature interrupts program execution if the PDT 1100 receives no input within the specified length of time minimizing power consumption When input is received the PDT 1100 resumes the interrupted program execution Use the our statement to set the sleep timer within the range from 0 to 25 5 seconds in increment of 100 ms The default setting is 1 second The sleep timer does not work in the following cases o gt gt o e While a communications device file is opened by an open com statement During execution of a search function When a TIMEA TIMEB Or TIMEC function returns a nonzero value When the bar code device file is opened by the open Bar statement under any of the following conditions With the continuous re
54. TIMEC function 1 Set to 0 INP 0 AND amp h80 CS CTS signal status 1 ON 0 OFF 1 The rnp function monitors the trigger switch status only when the trigger switch function is assigned to a key M1 M2 M3 o0rM 4 2 Using the rnp function monitors the CS CTS signal status only when the direct connect interface is selected and its interface port 3 pole plug mini stereo jack is arranged so that the receive data signal RD is functionally regarded as CS signal Note The NP function also checkstheLCD contrast VRAM data system status indication and message version English or Japanese 7 12 I O Facilities M onitoring by the WAIT Statement The wart statement monitors the input and output devices 1 0 s below Unlike the rnp function the wart statement makes the I O devices idle while no entry occurs saving power consumption and increasing the battery service life Refer to Appendix D I O Ports Table 7 3 WAIT Statement and I O Devices WAIT Statement 1 0 Devices WAIT 0 amp hO1 Keyboard buffer status WAIT 0 amp h02 Bar code buffer status WAIT 0 amp h04 Trigger switch status 1 WAIT 0 amp h08 Receive buffer status WAIT 0 amp h10 TIMEA function WAIT 0 amp h20 TIMEB function WAIT 0 amp h40 TIMEC function WAIT 0 amp h80 CS CTS signal status 2 1 The wart function monitors the trigger switch status only when the trigger switch function is assigned to a
55. XFILE d2 dat T Space codes in the tail of a data field are handled as 20h in file reception 10 132 Timeout length Statement Reference Specify the timeout length when a link is to be established from 1to 9 Table 10 4 Timeout Length for xrILE Set value Downloading Uploading PDT 1100 protocol PDT 1100 Ir protocol 1 30 sec Retries of ENQ 10 times Retries of ENQ 60 times 2 60 sec Retries of ENQ 20 times Retries of ENQ 120 times 3 90 sec Retriesof ENQ 30 times Retries of ENQ 180 times 4 120 sec Retries of ENQ 40 times Retries of ENQ 240 times 5 150 sec RetriesofENQ 50times Retries of ENQ 300 times 6 180 sec Retries of ENQ 60 times Retries of ENQ 360 times 7 210 sec Retries of ENQ 70 times Retries of ENQ 420 times 8 240 sec Retries of ENQ 80 times Retries of ENQ 480 times 9 No timeout No timeout No timeout Example XFILE d2 dat 2 In file reception the timeout length is 60 seconds in file transmission the maximum number of ENQ retries is 20 when the PDT 1100 protocol is used A communications device file should be opened before execution of the XFILE instruction refer to OPEN COM on page 10 95 A data fileto be transmitted should be closed beforehand To transfer a file using the PDT 1100 Ir protocol or multilink protocol set the PDT 1100 sID from 1 to FFFFh Specifying zero 0 to theID resultsin an ex
56. a fatal error it outputs the error message to the main window BASIC Compiler for Win File Compile Editor Help Compiling the test TEST SRC fatal error 30 Cannot find include file XX X 36099010 eps Figure 2 8 Fatal Error Screen ERRORLEVEL The Windows based Compiler does not support the errorLEvEL function 2 13 M PDT 1100 Terminal Programmer s Guide S O utputting Error M essages and Variables Size if selected TheCompiler outputs error messages if any and variables size if selected to the X XX ERR file After compilation if the XX X ERR file has been made the Compiler automatically opens the file by the preset editor The default editor is the notepad exe provided with Windows Using an editor with the tag jump function allows you to efficiently correct the source program file which caused an error For details about the tag jump function refer to the user s manual of the editor E o e File Editor Search Help print itt TEST SAC error dot mining ddd TEST SRC G error 713 Syntacanmr 36099013 eps Figure 2 9 TEST ERR Screen Compiling O ptions Specifying the check box option in the Compiling O ptions dialog box causesthe Compiler to output the specified debug information or list files For details refer to Generating a User Program on page 2 12 Table 2 2 List of Compiling O ptions Available Compiling Description O ptions Debug Outputs a debug in
57. aa _ _W B Bo 6m E gt E A i Milo gt 8 G 36099021 eps Figure C 1 Condensed ANK Characters The Interpreter ORs adjacent horizontal rows 2nd and 3rd rows and 5th and 6th rows to produce a single row each O ther rows are displayed as is In the figure shown above rows marked with O are displayed as is adjacent rows without O are condensed into a single row C4 Appendix D I O Ports Input Ports A user program uses the wart statement or tne function to monitor the hardware status through theinput ports BASIC 3 0 defines port asa byte Thetable below lists the input ports and their monitoring function in the PDT 1100 Table D 1 Input Port Assignments Port No Bit Assignment 1 M onitors the following 0 0 Keyboard buffer 0 No data 1 Data stored 1 Bar code buffer 0 No data 1 Data stored 2 Trigger switch 0 OFF 1 ON 3 Receive buffer 0 No data 1 Data stored 4 Value of TIMEA function 0 Nonzero 1 Zero 5 Value of TIMEB function 0 Nonzero 1 Zero 6 Value of TIMEC function 0 Nonzero 1 Zero 7 CS CTS signal 3 0 OFF orfileclosed 1 ON 3 3 0 LCD contrast level gt 0 to 11 0 Lowest 11 Highest 4 0 M essage version gt 0 Japanese 1 English D 1 S M PDT 1100 Terminal Programmer s Guide Table D 1 Input Port Assignments Continued 8 0 Wake Up function 0 Deactivat
58. and numeric variables each of which is subclassified into non array and array types Classification of Variables Example String variables N on array type ab3 Array type One dimensional e 10 Two dimensional gh 1 3 N umeric variables Integer variables N on array type a Array type One dimensional e 10 Two dimensional fg 2 3 Real variables N on array type a bcd Array type One dimensional e 10 Two dimensional fg 2 3 Declare array variables in pim common and DEFREG statements The pim statement should precede statements that access the array variable BASIC 3 0 can handle array variables up to two dimensional The subscript range for an array variable isfrom 0 to 254 String Variables A string variable consists of 1 through 255 characters Non Array String Variables Format non array string variables with an identifier followed by a dollar sign as shown below Syntax identifiers Example a bcd123 5 3 M PDT 1100 Terminal Programmer s Guide S The default number of characters for a non array string variable is 40 Array String Variables Format array string variables with an identifier followed by a dollar sign and a pair of parentheses as shown below Syntax identifiers subscriptl subscript Example a 2 bed123 1 3 where a pair of parentheses indicates an array The default number of characters for an array strin
59. application of valuable program resources If you describea INCLUDE statement at the beginning of source programs for example same user defined functions or subroutines may be shared by those source programs filename isa file to be included e If the specified filename does not exist in compiling a source program a fatal error occurs and compilation terminates e Do not place characters including a space between and INCLUDE and between single quotes and filename e Asshown below if any character except for space or tab is placed between REM and SINCLUDE in Syntax 1 or between a single quote and SINCLUDE in Syntax 2 the program line is regarded as a comment line and the INCLUDE instruction does not execute 10 137 T PDT 1100 Terminal Programmer s Guide s REM xxx SINCLUDE mdlprgl SRC e Before specifying included files debug them carefully SINCLUDE instructions cannot be nested Program lines in included files are not output to the compile list If a compilation error occurs in an included file the error message shows the line number where the SINCLUDE statement is described Symbols defined in included files are not output to the symbol list Ifa program linein an included file refers to a variable user defined function or others defined outside the included file the program line number where the SINCLUDE statement is described is output to the cross reference list
60. automatic powering off Valid operations Entry by pressing any key Bar code reading by pressing the trigger switch Data transmission Data reception Specified time length Length of time specified by the POWER statement in the user program If not specified in theprogram three minutes applies the battery voltage level becomes low Low battery If the voltage level of the battery cartridge or that of the alkaline cells drops below the specified level the PDT 1100 displays the low battery warning message on the LCD and powers itself off If the resume function is activated in System M ode only the execution of the END POWER OFF Or POWER 0 statement can terminate a running user program Other cases above merely turn off the power so turning it on again resumes the program 2 17 M PDT 1100 Terminal Programmer s Guide S 2 18 Chapter 3 Program Structure Statement Blocks A statement block is a significant set of statements also called program routine The following types of statement blocks are available in programming the PDT 1100 Subroutines A subroutine is a statement block called from the main routine or other subroutines by the GOSUB statement Using the RETURN statement passes control from the called subroutine back to the statement immediately following the cosus statement in the original main routine or subroutine Error Event H andling Routines An error or event handling routine is
61. bits Upper 4 bits 0 21314156 7 0 _o0o e jp 1 1 A Q Ja q 2 4 2 B UR b or 3 gt 3 IC S Je Js 4 4 4 ID IT id It 50M 5 E JU e ju 6 7 8 6 F V If lv 71 7 G W ig w 8 Bs 18 IH X jh x 9 _ 19 Jl JY fi y Al J Z j fz B K ik 4 cl lt LN fl 4 D cR M i jm E gt IN Jn i FI 1 JO Jo la Bs isa backspace code cr is a Carriage return code c isa cancel code u iS a space code C2 Character Sets Note You can assign user defined fonts to codes from 80h to 9Fh with APLOAD Statement Refer to aPzO0AD statement in Chapter 10 Note Characters assigned to codes 20h to 7Fh are default national characters when the English message version is selected in the SET DISPLAY menu in the System M ode Use the countrys function to switch to other national characters see N ational Character Sets on page C 3 Refer to CO UNTRY on page 11 11 National Character Sets Use the countrys function to switch characters assigned to codes 20h to 7Fh of the character set table in Character Set on page C 1 to a national character set The default national character set is America code A or Japan codeJ depending on whether the English or Japanese message version is selected on the SET DISPLAY menu in System M ode Listed below are national characters different from the defaults Country Country Code America A
62. by the Compiler 1 From the Editor menu choose set Editor BASIC Compiler for Win File Compile Editor Help Figure 2 5 Editor Menu The set Editor dialog box appears as shown below Figure 2 6 Set Editor DialogBox 2 IntheCommand Line box type the filename of the editor If the editor is not located in the current directory or working directory type the directory name If you don t know the filename of the editor or the directory name choose the Browse button in the Set Editor dialog box to display the Browse dialog box Select the appropriate filename from the list and choose the OK button Generating a User Program Use the same procedure as the Windows based Compiler Refer to Screen Shown During Execution of the Compiler on page 2 10 Error M essages TheCompiler may detect two types of compilation errors syntax errors and fatal errors The contents of the error output is the same as for the Windows based Compiler 2 12 Development Environment and Procedures Syntax Errors If the Compiler detects a syntax error it outputs the error message to the XXX ERR file opened by the editor preset by the Set Editor command in the Editor menu Thetotal number of the detected syntax errors appears on the main window BASIC Compiler for Win File Compile Editor Help Compiling the test TEST SRC 0002 Error Statement Compiled End 36099010 eps Figure 2 7 Syntax Error Screen Fatal Errors If the Compiler detects
63. created function definition statement o ooooo 10 29 DEF FN ENDDEF 10 33 User defined Functions 5 6 V VAL miring da ica dado a A tE 11 56 Variables iia atada 5 3 vertical parity o o ooooooooooooo M 2 W WAIT mao ladra 10 126 WAIT Statement oooomo o 7 13 WHILE WEND 0005 10 128 WHILE WEND 10 128 Work Drivedesignation 2 15 Work Variables 0 00 00 cee eee 5 5 Xx AFLE anta ae 10 130 XOR Operator ee eee eee eee 6 7 Z SINCLUDE ccoo aa 10 137 Tell Us What You Think We d liketo know what you think about this M anual Pleasetake a moment to fill out this questionaire and fax this form to 631 738 3318 or mail to Symbol Technologies Inc OneSymbol Plaza M SB 4 Holtsville NY 11742 1300 Attn Technical Publications M anager IMPORTANT If you need product support please call the appropriate cus tomer support number provided Unfortunately we cannot provide customer support at the fax number above User s M anual Title please include revision level How familiar were you with this product before using this manual O Very familiar 7 Slightly familiar N otat all familiar Thank you for your input We value your comments
64. cursor refer to the Pos function Reference Statements LOCATE and SCREEN Functions POS 11 13 T PDT 1100 Terminal Programmer s Guide DATES Function Name DATE Type I O Function Description Returns the current system date or sets a specified system date Syntax Syntax 1 Retrieving the current system date DATES Syntax 2 Setting the current system date DATES date where date A string expression Notes Syntax 1 DATES returns the current system date as an 8 byte string The string has the format below yy mm dd where yy is the lower two digits of the year from 00 to 99 mmis the month from 01 to 12 and da is the day from 01 to 31 Syntax 2 DATES sets the system date specified by date The format of date is the same as that in syntax 1 Example date 90 10 12 e Theyear yy must be the lower two digits of the year otherwise the system does not compensate for leap years 11 14 Function Reference e Thecalendar clock is backed up by the battery For the system time refer to the TIMES function Execution Error Error code M eaning 05h Parameter out of range date is out of range Reference Functions TIMES 11 15 T PDT 1100 Terminal Programmer s Guide EOF Function Name End Of File Type Filel O Function Description Tests whether the end of a device I O file has been reached Syntax EOF 4 fil enumber where
65. dese a Hace cae da Dak ie dane A H 5 M emory Areas Required for User ProgramS 0 0 cece tees H 5 Retained Contents of Flash ROM 1 eect tte H 6 Wakeup FUNCOM ares nr aa a eee te Rd la AA AA H 6 LED and Beeper Controliin 0 cae e eq RAA AE H 6 Controlling Reading Confirmation LED ooococcccccccor tae H 6 Controlling the Beeper ccoo ica A RE A A Steel H 7 APLINT PD3 Program Flia ti a E AAA wot ath ee anes H 7 M odifying PW Key Depression oocooccoccccoocr eens H 7 CODEIZ8 Reading ai A A tals eit Sad ae A H 8 Field Length Restriction 0 aaa H 8 Appendix I Backlight Function Appendix J Program Samples Writing a FUNCION s oiadi ea on etn J 1 Testing the Written Function assas J 3 Appendix K Quick Reference for Statements and Functions Controlling Program FW aiii dE Pal atin dared dt Sida a eds K 1 Handling Errors eies a A AE OM te oe Gee id ede Re ee K 2 Defining and Allocating Variables 2 co ccc eee K 2 Controlling the LCD Sereen trating ey ee ae eae a teow aye diene hae Ben eget q K 3 Controlling the Keyboard Input 0 6 eee K 4 Beep ING ii dane A E A Sy Dyed A AAA K 4 M anipulating System Date Current Time Or TIMES 0 eee ete eens K 5 Contents Communicating with I O S 0 ieee tees K 5 Communicating with Bar Code Device suasanae a K 6 M anipulating Data Files and User Program Files aaan aaa K 7 Communicating with Communications Devices saasaa te
66. digits If only max no digits is omitted the PDT 1100 can only read the number of digits specified by mini no digits cD acheck digit Specifying a c causes the Interpreter to check bar codes with M OD 10 The check digit is included in the number of digits startstop startstop specifies the normal or short format of the start stop characters Specify N for the normal format specify s for the short format If startstop is omitted the PDT 1100 can read start stop characters in either format Up to eight readcodes can be specified If you specify more than one condition to a same read code all are valid The sample below causes the PDT 1100 to read both 6 and 10 digit ITF codes OPEN BAR AS 1 CODE 1I 6 I 10 10 93 T PDT 1100 Terminal Programmer s Guide Syntax Error Error Code and Message Meaning error 71 Syntax error Thenumber of the specified read codes exceeds eight Execution Error Error Code M eaning 02h Syntax error readcode is missing 05h Parameter out of the range readcode is not correct 37h File already open 3Ah File number out of the range 45h Device files prohibited from opening concurrently opening the bar code device file and the optical interface of the communications device file concurrently attempted 10 94 Statement Reference OPEN COM Statement Name Open Com Type Filel O Statement Description O pens a communications device fi
67. error File XXX ERR in the directory where the source program is located A syntax error is detected Error message Fatal error Source line Address information Debug information M ain Window FileX XX ADR inthedirectory where the source program is located Label Address information File XXX LBL in the directory where the source program is located Variable Intermediate language information FileX X X SYM inthedirectory where the source program is located A fatal error is detected The Debug information file check box is selected in the Compiling O ptions dialog box Address Source list Symbol table Cross reference Sizes of variables XXX represents a source program filename File XXX LST in the directory where the source program is located The Address source List check box is selected in the Compiling O ptions dialog box TheSymbol tablecheck box is selected in the Compiling Options dialog box File X X X ERR in the directory where the source program is located TheX Cross reference check box is selected in the Compiling O ptions dialog box TheVariablesize check box is selected in the Compiling Options dialog box 2 11 M PDT 1100 Terminal Programmer s Guide S Displaying the Compile Result Files XXX ERR Set the editor to display the XX X ERR files generated
68. illuminates green when the PDT 1100 successfully scans a bar code If the bar code device file has already been opened with theoPEN BAR statement the OUT statement cannot turn on the reading confirmation LED Close the bar code device file as follows CLOSE OUT 1 1 2The PDT 1100 cannot control the RS RTS signal This signal is ignored if turned on 3 This setting cannot affect the setting made in System M ode 4 Setting graphic data and addresses to the VRAM using the our statement enables you to output graphics to the LCD The data value ranges from h10 to h24F The data is designated by bit 7 LSB to bit O M SB If the bit is 1 the corresponding dot on the LCD turns on 7 11 M PDT 1100 Terminal Programmer s Guide 7 Monitoring by the INP Function The rnp function monitors the input and output devices 1 0 s as listed below Refer to Appendix D 1 0 Ports Table 7 2 Input and Output Devices INP Functions 1 0 Devices Value M eaning INP 0 AND amp h01 Keyboard buffer status 1 Data present 0 N o data INP 0 AND amp h02 Bar code buffer status 1 Data present 0 N o data INP 0 AND amp h04 Trigger switch status 1 1 Being pressed 0 Being released INP 0 AND h08 Receive buffer status 1 Data present 0 N o data INP 0 AND amp h10 TIMEA function 1 Set to 0 INP 0 AND amp h20 TIMEB function 1 Set to 0 INP 0 AND amp h40
69. in file The Windows based Compiler does not support the w option available in the Windows version Designating the Work Drive and Directory Designate the work driveand directory of the Compiler by setting the Windows environmental variables If you don t designate them the Compiler creates a directory according to the priority below 1 Inthe directory set in the Twp 2 Inthedirectory set in the temp The Windows version does not refer to this environmental variable 3 Inthedirectory wherethe Compiler is located if no work drive or directory has been set in both the twp and teme or if invalid values have been specified in them During compilation the Compiler creates a work filein the directory as defined above After compilation it erases the work file 2 15 M PDT 1100 Terminal Programmer s Guide 7 Downloading Ir Transfer Utility C Ir Transfer Utility E Ir Transfer Utility C E transfers user programs and data files e g master files between the PDT 1100 and the connected Windows personal computer It has the following functions e Downloading extension programs e Downloading programs Downloading data e Uploading programs Uploading data For operations of Ir Transfer Utility C E refer to the PDT 1100 Terminal Transfer Utility Guide Setting up the PDT 1100 Before downloading user programs initializethe RAM and flash ROM if the error message below appe
70. index variable error 55 Incorrect use of SELECT CASE END SELECT error 56 Incomplete control structure SELECT CASE END SELECT error 57 Incorrect use of WHILE WEND error 58 Incomplete control structure WHILE WEND error 59 Incorrect use Of DEF FN EXIT DEF END DEF error 60 Incomplete control structure DEF FN END DEF error 61 Cannot use DEF FN in control structure error 62 Operator stack overflow error 63 Inside function definition error 64 Function redefinition error 65 Function definitions exceed 200 error 66 Arguments exceed 50 error 67 Total arguments exceed 500 error 68 Mismatch argument type or number error 69 Function undefined error 70 Label redefinition error 71 Syntax error error 72 Variable name redefinition error 73 Improper string length error 74 Improper array elements number error 75 Out of space for register variable area A 7 S MA PDT 1100 Terminal Programmer s Guide Table A 3 Syntax Errors Continued Error Code M essage error 76 Out of space for work common variable area error 77 Initial string too long error 78 Array symbols exceed 30 for one DIM statement error 79 Record number out of range 1 to 32767 error 80 Label undefined error 81 M ust be DATA statement label error 82 missing error 83 Y missing error 84 I missing error 85 missing error 86 y missing error
71. key entry wend endif wend end def Testing the Written Function while 1 Infinite loop a fnbarkey 1 A 15 DL F4 and SFT F4 as escape characters print if a lt gt D and a lt gt L then print Data a else print ESC a key push endif wend end J 3 M PDT 1100 Terminal Programmer s Guide S Appendix K Quick Reference for Statements and Functions Controlling Program Flow Statements Definitions CALL Calls an FN 3 function CHAIN Transfers control to another program END Terminates program execution FOR NEXT Defines a loop containing instructions to be executed a specified number of times GOSUB Branches to a subroutine GOTO Branches to a specified label IE THEN ELSE END IF Conditionally executes specified statement blocks depending upon the evaluation of a conditional expression ON GOSUB Branches to one of specified labels according to the value of an expression ON GOTO Branches to one of specified labels according to the value of an expression RETURN Returns control from a subroutine or an event handling routine for keystroke interrupt SELECT CASE END SELECT Conditionally execute a statement block depending upon the value of an expression WHILE WEND Continues to execute a statement block as long as the conditional expression is true MA PDT 1100 T
72. la 233 466 932 1864 3729 si 246 493 987 1975 3951 e Thesubsequent instruction proceeds immediately after the BEEP instruction even if the beeper is still sounding Ifa second BEEP instruction occurs while the beeper is still sounding the first BEEP is cancelled and the second BEEP instruction executes Syntax Error Error Code and Message Meaning error 71 Syntax error Thenumber of parameters or commas exceeds the limit Execution Error Error Code M eaning 05h Parameter out of range 10 7 TO PDT 1100 Terminal Programmer s Guide Example BEEP bon boff counts helz BEEP bon boff count BEEP bon boff helz BEEP bon count helz BEEP boff count helz BEEP bon boff BEEP bon count BEEP boff count BEEP bon helz BEEP boff helz BEEP count helz BEEP bon BEEP boff BEEP count BEEP helz BEEP 10 8 Statement Reference CALL Statement Name Call Type Flow Control Statement Description Calls an FN 3 function Syntax Syntax 1 CALL filename functionnumber data data Syntax 2 CALL drivename filename functionnumber data datal where filename and drivename filename A string expression functionnumber An integer constant data A String variable or a numeric variable Notes CALL calls a function specified b
73. number is expressed by two bytes lower byte on port 6061h and upper byte on port 6062h The setting range is from 1 to FFFFh Set thelD number to 1234h as follows OUT amp h6061h amp h34 Sets 34h to the lower byte of the ID OUT amp h6062h h12 Sets 12h to the upper byte of the ID 15 For data transmission via the optical interface this bit sets the output pulse width of IR beam in accordance with the IrDA physical layer IrDA SIR 1 0 The default width is 1 63 US 16 If you set this bit to O standard size characters are displayed as follows W x H Single byte AN K mode 6 dots x 8 dots If the value of this bit is 1 small characters are displayed as follows W x H Single byte AN K mode 6 dots x 6 dots D 7 M PDT 1100 Terminal Programmer s Guide S D 8 Appendix E Key Number Assignment on the Keyboard Key Number Assignment The keys on the PDT 1100 keyboard are assigned numbers as shown bdow N on shift mode Shift mode 2 ME HG Me f 17 18 19 21 22 23 25 26 27 28 29 1 2 3 4 9 10 1 12 5 6 7 38 13 14 15 16 A E li 24 20 35864090 eps 35864090 eps E 1 M PDT 1100 Terminal Programmer s Guide S Figure E 1 Key Number Assignments Default Data Assignment The default data assignme
74. number of the character count bytes the number of thefields should be 255 bytes or less W hen you transfer five 50 digit 50 byte fields for example the total length of all data fields is 250 50 x 5 bytes and the number of the character count bytes is 5 The total is 255 so you can transfer the file M 20 Communications IR Protocol O verview ThelR protocol is the communications procedure for the serial infrared link which is used to transmit files between the PDT 1100 and a host or between the PDT 1100s It adopts the response method using ACK NAK codes Thelr protocol can be used also for communications through the direct connect interface The IR protocol is composed of a defined set of the control character sequences including the following three phases Phase 1 Establishment of data link the sending station confirms that the receiving station is ready to receive data Phase 2 Data transmission the sending station transmits data to the target receiving station Phase 3 Release of data link the sending station confirms that transmitted data has been correctly received by the receiving station If yes the sending station terminates the data transmission and releases the data link M 21 M PDT 1100 Terminal Programmer s Guide 7 Control Characters The control characters are classified into two groups transmission control characters and text control characters Transmission Control Characters
75. of backlight ON time specified by onduration Refer to Appendix Backlight Function 10 62 Statement Reference backlightkeynumber is a key number assigned to a particular function key R efer to Appendix E Key Number Assignment on the Keyboard Pressing the specified backlight function on off key activates or deactivates the backlight function e Specifying zero 0 or 32 to backlightkeynumber is ignored e Pressing the M 1 key key number 33 while holding down the shift key functions as the backlight on off control key by default If pressed together with the Shift key any numerical key can operate as a function key onduration is the length of time in seconds from when the backlight is turned on until it turns off Pressing the trigger switch or any key except for the backlight function on off key while the backlight is on resets the counter of onduration to the specified time length and restarts counting down Specifying of BLO disables the backlight function Specifying of BL255 keeps the backlight on e A function key defined as the LCD backlight function on off key cannot be used to enter string data If you issue more than one key statement the last statement takes effect That is if you define more than one key as the backlight function on off key as shown below only the function key numbered 8 operates as the backlight function on off key and the length of backlight ON time is 15 seconds KEY 5 B
76. of operators available Table 6 5 String O perators O perations Character String O perators Examples Concatenation Plus sign a b Comparison Equal a b lt gt gt lt N ot equal a lt gt b a gt lt b gt lt lt gt lt gt Greater or less a gt b as gt b 6 7 M PDT 1100 Terminal Programmer s Guide 7 Concatenation of Character Strings The process of combining character strings is called concatenation and is executed with the plus sign The example below concatenates the character strings as and bs aS Work1 b dat PRINT as bS Workl dat Comparison of Character Strings Therelational operators comparetwo character strings according to character codes assigned to individual characters In the example below the expression al lt b1 returns the value of true to output 1 al ABCO01 b1 ABCO02 PRINT al lt b1 6 8 Chapter 7 1 0 Facilities Facilities for the LCD Registering U ser defined Fonts The APLOAD or kPLOAD statement registers up to 32 user defined fonts for thesingle byte AN K mode Usethis registration facility to display special marks symbols and iconsto be used for guidance messages on the LCD screen Setting National Characters The countrys function displays currency symbols and special characters for the countries Refer to National Character Sets on page C 3 Reversing the Char
77. of range 45h File already open there was an attempt to open the bar code device file and the optical interface of the communications device file concurrently 10 98 Statement Reference OUT Statement Name Out Type O Statement Description Sends a data byte to an output port Syntax OUT portnumbex data where portnumber A numeric expression data A numeric expression which returns a valuefrom 0 to 255 Notes OUT sends a data byte designated by data to a port specified by portnumber portnumberisnota hardware port on the PDT 1100 but a logical port assigned by the Interpreter Refer to Appendix D I O Ports If bits not assigned a hardware resource are specified to portnumber or data they are ignored 10 99 T PDT 1100 Terminal Programmer s Guide Syntax Error Error Code and Message Meaning error 71 Syntax error portnumber is missing data is missing Execution Error Error Code M eaning 05h Parameter out of the range portnumber Or data is out of the range Example OUT 3 7 The above example sets the LCD contrast to the maximum Reference Statements WAIT Functions INP 10 100 Statement Reference POWER Statement Name Power Type O Statement Description Controls the automatic power off facility Syntax Syntax 1 Turning off the power according to the power off counter POWER counter Syntax 2 Turning off the power immediately POWER OFF 0 Syntax
78. on the LCD and press the 5 key During the above entry operation you can usethe Clear Backspace and numerical keys as usual Notes Displaying the shift guidance block Right when the status indication is set to ON overwrites the status indication with the shift guidance block Theactivated or deactivated state of the alphabet input function resumes The shift guidance block does not resume 7 4 I O Facilities User programs cannot distinguish between a character entered with the alphabet input function and the same character generated by pressing a function key assigned the character by the key statement Refer to Function Keys on page 7 7 In the example below the character A may beentered with the alphabet input function or by pressing the F1 key assigned A Theuser program does not distinguish between them KS INPUTS 1 IF K A THEN GOTO FUNC ENDIF To prevent this assign another character to the F1 key with the KEY statement and modify the judgement condition For example assign the character to the F1 key KEY 1 E K INPUTS 1 IF K 4 THEN GOTO FUNC1 ENDIF For details refer to KEY on page 10 61 and ON KEY GO SUB on page 10 82 Note T he alphabet input function does not influence the keystroke trapping which identifies keys according to their key numbers Alphabet Input Example Coding in a user program OUT by Activating the alphabet input function
79. progl PD3 COMMON a 10 b 3 c CHAIN prog2 PD3 prog2 PD3 COMMON a 10 b 3 c 3 4 Program Structure Since the common statement is a declarative statement no matter where it is placed in a source program the source program results in the same output Same object program if compiled Included Files Included files are separate source programs which may be called by the INCLUDE metacommand When INcLUDE metacommand is encountered in a source program the Compiler fetches the included file and compiles the main source program while integrating that fileto generate a user program Specify the name of an included file using the REM INCLUDE Or SINCLUDE In theincluded files describe any of the statements and functions except the REM SINCLUDE and S INCLUDE Storing definitions of variables subroutines user defined functions and other data to be shared by source programs into the included files promotes application of valuable program resources If a compilation error occurs in an included file it is indicated on the line where the included file is called by the 1ncLuDE metacommand in the main source program but detailed information of syntax errors detected in the included files and the cross reference list is not output Debug the individual included files carefully beforehand 3 5 M PDT 1100 Terminal Programmer s Guide S 3 6 Chapter 4 Basic Program Elements Structure of a Program Line
80. program execution and sounds the beeper for a second An END can appear anywhere in a source program When an END instruction occurs all files being opened close and the following operation takes place depending upon whether or not any application program user program or Easy Pack has been selected as an execution program to be run when the PDT 1100 is powered on in System M ode If an application program has been selected the PDT 1100 turns off the power after three seconds from the message indication of the Program end Ifan execution program has not been selected control passes to System M ode For System M ode refer to the PDT 1100 User s M anual If no END is placed at the end of a source program Compiler adds an intermediate language code of END to the end of the compiled program 10 40 Statement Reference ERASE Statement Name Erase Type Memory Control Statement Description Erases array variables Syntax ERASE arrayvariabl enamel arrayvariablename J where arrayvariablename An array numeric or string variable Notes ERASE erases an array variable s specified by arrayvariablename and frees the memory used by the array arrayvariablename is the name of an array variable already declared by the DIM statement If it has not been declared by DIM the ERASE statement is ignored After erasing the name of an array variable with ERASE you can use that name
81. s liability for damages to buyer or others resulting from the use of any product shall in no way exceed the purchase price of said product except in instances of injury to persons or property Some states or jurisdictions do not allow the exclusion or limitation of incidental or consequential damages so the preceding exclusion or limitation may not apply to you xviii Chapter 1 Software Overview Software Structure The structure of software for the PDT 1100 is shown in Figure 1 1 a user programs RAM or flash ROM Application programs Extension programs Flash ROM System System M ode programs y BASIC 3 0 Interpreter f Font Ta Drivers E pe Hardware 36099001 eps Figure 1 1 PDT 1100 Software Structure ThePDT 1100 hasflash ROM and RAM In flash ROM reside the drivers BASIC 3 0 Interpreter System M ode and font files Extension programs and user programs are stored in the user area of RAM or in the flash ROM when downloaded 1 1 M PDT 1100 Terminal Programmer s Guide S Note Unlike RAM the flash ROM requires no power for retaining stored files Therefore leaving the PDT 1100 with no battery cartridge or dry batteries loaded do not damage files stored in theflash RO M while it may damage files in the RAM Unlike RAM the flash ROM is limited in the following ways Thequantity of rew
82. single byte Reference Statements XFILE and OPEN com Functions ETX and sTx 11 48 Function Reference STR Function Name STRing Type String Function Description Converts the value of a numeric expression into a string Syntax STRS numericexpressi on where numericexpression A numeric expression Notes STRS converts the value of numericexpression into a string If numericexpressionis0 or positive STRS adds a leading space as shown bdow PRINT STR 123 LEN STRS 123 123 4 To delete the leading space use the MIDS function as shown below PRINT MIDS STR 123 2 LEN STR 123 123 4 If numericexpression is negative STRS adds a minus sign as shown below PRINT STRS 456 LEN STRS 456 456 4 Use sTR to write numeric data into a data file The vas function has the opposite capability to STRS 11 49 T PDT 1100 Terminal Programmer s Guide Reference Functions VAL 11 50 Function Reference STX Function Name Start of Text Type I O Function Description M odifies the value of a header sTx for the PDT 1100 protocol also returns the current value of a header Syntax Syntax 1 Changing the value of a header STXS stringexpression Syntax 2 Returning the current value of a header STX where stringexpression A string expression which returns a single byte character Notes Syntax 1 sTX modifies the value of a hea
83. tea ten ae a 10 24 DEF FN Single line form 0 ccc cee eee een eee eens 10 29 DEF FNA EN D DEF Block form rii fie cide te lia 10 33 DIM Hasbro e AO O 10 37 END a A A A A Aa Ea 10 40 oy nas alge a are td ie o e a do E AE E cd O e E 10 41 ELELD lt a do A a do o E ero 10 43 FOR NEXT sa a E A A AS ER ARAS A AA AA 10 45 GET La da So aa Ot SCs Pa sie Da Radia 10 48 GO SUB a A Week hy de BRR i AA Rea Rah ane en ba a eae 10 50 COTO rat a da A aera lar AS 10 52 IE THIENS ELSE ENDUE iii aca wee AA AAA a RN tae Anand a 10 53 INP TO sarita a RA O rata 10 55 A A E EE A E EEES A A aivitsa ab twats atlnote detour EEA gala 10 58 KEN Rake te tel te RS A tances eat care 10 61 KEY ON and KEY OFP isis a a wat a eee ee a ee ta a Ae Lins 10 66 CL a o de AS SO ee eR A MC O eRe UD Rh 10 68 LETS E A A st da A tara 10 70 EINEAN POT St Ae oda alta tae ances trola 10 72 EIN ETNPUTR Da A A A A A ne 10 74 LOCAT E ia RA A A aw RN A EA A Aa 10 76 ON ERROR GO TO cama a oa A a Mare Hale Beas 10 78 ON GOSUB andON GOTO ccc cee eee eee eee eens 10 80 ON KEV GO SUB n ea yah Mien Wings oe a asta r aa otto ane ata th GU TN od han BN a 10 82 OPEN oen ached acaacd A are eae Sg tenia Ae ae BWA A RN aw Ren a 10 84 OPEN BAR rara TE aria tees aus annie 10 87 OPEN SCOM A A A A A a AS coat 10 95 QUITE a a e A a ee eet 10 99 OVW R a ta ici 10 101 PRIN Titan ae tc a a cda BO Sept cia ica eat ar 10 103 PRINTS a a as 10 106 PRINSTUSIN G 30540 na La e E et ee ee 10
84. tenet nna 6 4 Logical Operators ia need eh pip aa ae Rh oy Ohad ase A nace a 6 4 Function Operators tiras ates E A A a Rab cares dad Ns 6 7 SEFING O Peratons a Ae ets a Stone We Denes ot ea Pan dame a be 6 7 Chapter 7 I O Facilities Facilities forthe LCD vacios onret A A A wea ae 7 1 Input from the Keyboard 10 0 2 cece tte tte 7 3 Alphabet Input Function pesia 200 800 a ona eee dd 7 3 FUNCION KEYS A A shea ace a td aad ae AN anes 7 8 Keystroke Trapping cise saa ed aie dud Wie bie potter daa ee 7 9 Timer and Beep ef ria cit esc vince aa eo eo ete eect sok eo tases E E ew dead de AA eet 7 10 TIMOR FUNCELONS a Aa dea RAR 7 10 BEEP Statement iia a A A gator sg a Hele abn ca o 7 10 Controlling and M onitoringthe l OS o ocooocococcccccr 7 11 Controlling by the OUT Statement n a aaa 7 11 Monitoring by the INP Function 10 0 feet ee 7 12 Monitoring by the WAIT Statement o ooococcccocccr tee 7 13 M PDT 1100 Programmer s Guide F Chapter 8 Files File O WAV iii A e Was A vals Kite eee AE i 8 1 Data Files and Device l O Fil8S ooocooocococooor eae 8 1 Access Methods ii a o ates RA ti 8 1 Dat ll aii A A A A eee eee A RAE A a da 8 2 OVA A AA cade Ned 8 2 Naming let A TEER dee a he eeu asada 8 2 Structure of Data Files riure eee raced a e oa eed Ne Kb ae ele 8 3 Data File M anagement by Directory Information 000 0 cece eee 8 3 Programming for Data Files eres sikeee riui ea Ea a a a aa
85. the message transmission and releases the data link Sending DLE EOT and IDs 1 Receiving Station a 00 Station 0 5 second DLE EOT and IDs 0 5 second E EOT and IDs 3 DLE EOT and IDs 60 0 5 second ps Abnormal Termination 35864077 eps Figure M 29 Abort of Phase 3 M 33 M PDT 1100 Terminal Programmer s Guide S Phase 3 with timeout at the receiving station If the receiving station receives no subsequent text or normal sequence of DLE EOT and IDs within 30 seconds after sending a sequence of DLE ACK and IDs it sends a sequence of DLE EOT and IDs and aborts the transmission Sending C Receiving Station Station Data Text m DLE ACK and IDs 30 seconds DLE EOT and IDs Abnormal Termination 35864078 Figure M 30 Phase 3 with Timeout at the Receiving Station Aborting DataT ransmission Pressing the C key aborts data transmission IftheC key is pressed during downloading the PDT 1100 transmits a sequence of DLE EOT and IDs and aborts the file transmission If it is pressed during uploading the PDT 1100 transmits the current transmission block followed by a sequence of DLE EOT and IDs and aborts the file transmission CRC Thelr protocol supports CRC Cyclic Redundancy Check which uses the CRC 16 generating system to check data transmission A CRC character is suffixed to a sequence of DLE ETX of every transmission block M 34 Communic
86. to two dimensional When starting a user program stored in the flash ROM for the first time the Interpreter copies the register variables into the RAM so that both the flash ROM and RAM storethe register variables W hen modifying register variables the Interpreter changes those stored in theRAM When uploading a program file stored in theflash ROM using the xF 11E statement or System M ode the PDT 1100 uploads the program except for the register variablesin the flash ROM with the register variables stored in the RAM User defined Functions User defined functions are classified into three types integer functions real functions and character functions All start with an FN U ser defined Function Name Format Integer functions FN functionname Real functions FN functionname Character functions FN functionname Define a user defined function with the Der rn statement Setting Character String Length of Character Functions A character function may return 1 through 255 characters N ote that the default character string length results in the returned value of 40 characters If the returned value is always less than 40 characters use the stack efficiently by setting the actual required value smaller than the default as the maximum length because the Interpreter positions returned values on the stack during execution of user defined functions to occupy the memory area by the maximum length size To define a function which re
87. to 30 levels WHILE a WHILE b WHILE c WEND WEND WEND Syntax Error Error Code and Message Meaning error 26 Too many nesting levels error 57 Incorrect use WEND appears outside of the wHILE statement block of WHILE END error 58 Incomplete NO WEND corresponds to WHILE control structure Reference Statements FOR NEXT 10 129 T PDT 1100 Terminal Programmer s Guide X FILE Statement Name X file Type O Statement Description Transmits a designated file according to the specified communications protocol Syntax Syntax 1 XFILE filename protocolspec Syntax 2 XFILE drivename filename L protocolspec where filename and protocolspec and drivename filename String expressions Notes XFILE transmits a data file designated by filename or drivename filename between the PDT 1100 and thehost computer according to the communications protocol specified by protocolspec For types of protocol refer to the PDT 1100 User s M anual filename or drivename filename filename is a data file name For the format of data file names refer to an OPEN statement protocolspec protocolspec parameter can specify the following protocol specifications 10 130 Statement Reference Transmission direction Parameter omitted default Tran
88. variable Statement example DATA 123 READ b PRINT b Output 123 10 113 T PDT 1100 Terminal Programmer s Guide s If the string data is invalid as numeric data the READ instruction assigns the value 0 to the numeric variable Statement example DATA ABC READ c PRINT c Output 0 Thenumber of data values stored by the DATA statement must be equal to or greater than that of variables specified by the READ statement If not an execution error occurs e To specify the desired DATA statement location where the READ instruction should start reading data use the RESTORE statement Execution Error Error Code M eaning 04h Out of DATA DATA values remain to be read by the reap instruction Reference Statements DATA and RESTORE 10 114 Statement Reference REM Statement Name Rem Type Declarative Statement Description Declares the rest of a program line to be remarks or comments Syntax Syntax 1 REM comment Syntax 2 comment Notes REM causes the rest of a program lineto betreated as a programmer s remark or comment for thesake of the program readability and future program maintenance The remark statements are non executable Difference in description between Syntax 1 and Syntax 2 Thekeyword REM cannot begin in the first column of a program line W hen following any other statement REM should be separated from it with a colon
89. xPos XxCSRLIN LOCATE 2 Reference Functions CSRLIN and Pos 10 77 T PDT 1100 Terminal Programmer s Guide ON ERROR G OTO Statement Name On E Description Enables error trapping Syntax ON ERROR GOTO label Notes rror Goto Type Error Control Statement ON ERROR GOTO enables error trapping so asto pass control to the first line of an error handling routine specified by Zabel if an error occurs during program execution Usea RESUME statement in an error handling routine to a specified program location Assigning zero 0 to Zabel disables error trapping If ON ERROR GOTO 0 is executed outside the error handling routine any error displays a regular execution error code and terminates the program If ON ERROR GOTO 0 is executed inside the error handling routine the Interpreter displays the regular execution error code and terminates the program You cannot trap errors which may occur during execution of the error handling routine The occurrence of such an error displays an execution error code and terminates the program e You can use on 10 78 ERROR GO TO instead of on ERROR GOTO Syntax Error Error Code and Message Meaning error 71 Syntax error label has not been defined label is missing Reference Statements RESUME Functions ERR and ERL Statement Reference 10 79 T PDT 1100 Terminal Programmer s Guide ON GOSUB and ON GOTO Statem
90. 00 eens E 2 Appendix F Memory Area Memory Mid Dis sa tea A caus mana a tl ano Doe ted eel area art F 1 ROMS ROM tocante Ot ach dha o att a eg ed F 2 RN Aa Wace Dagiti F 2 Memory Management 0 0 0c ccc ete eee eens F 2 Battery Backup Of M emory 0 0 ee eee F 2 Memory Space Available for Variables 0 0 tetas F 3 Appendix G Handling Space Characters in Downloading Space Characters as Padding Characters 0 0 cece cee ete ene nee n eens G 1 Space CharactersasData ooococccccocc G 2 Example toed dir oo G 3 EX AIM Zi a A A AR A la a ARO G 3 ExaMple 3eicvawds cae ek Riva We Ech wha heed oe ae ye Wk gee PI ee G 4 M PDT 1100 Programmer s Guide S Appendix H Programming Notes Sleep TIM O A A A AAA H 1 Resume O O hee Sok IS A ee ora ee Daina a vila tytn Geek os H 2 Low Battery Warning asusa auaa H 2 Selecting a Communications Device File oooocccooocococo H 3 Prohibited Simultaneous Operations 1 0 ek tees H 3 Controlling the LCD Backlight naaa a H 3 Keyboard Keypad sereset ar ri her a A a a Helle a ale Bake RES H 3 RN e A a a Oye ot oh olla i ARISA EA AE ARAA EA AAA H 4 RS CS CONO oyeee aaa a A E As H 4 Supplemental COdeS 0 ee ee nee en eee nee e teen ees H 4 Blast ROM sae vies Menta Ac otter Syne han eam aaa a Rate Moet nade cee an deat deta R H 4 Storing Elio aa ela ae ed elas ae LA ele rad H 5 A aad ee na htt Wea ee ee lee A d Sugars H 5 Specifying Filesi merie
91. 1 35 T PDT 1100 Terminal Programmer s Guide Execution Error Error code M eaning 34h Bad file name or number i1enumber of an unopened file specified 3Ah File number out of range 3Eh A pur Or cer instruction executed without a FIELD instruction no FIELD instruction is found Reference Statements OPEN Functions EOF and Lor 11 36 Function Reference LOF Function Name Location Of file Type Filel O Function Description Returns the length of a specified file Syntax LOF i1enumber where filenumber A numeric expression which returns a valuefrom 1 to 16 Notes LOF returns the length of a data file or communications device file specified by filenumber Depending upon thefiletype the content of the returned value differs as listed below File type Returned value Data file Number of written records Communications device file Number of bytes of unoccupied area in the receive buffer If you specify the bar code device file an execution error occurs 11 37 T PDT 1100 Terminal Programmer s Guide Execution Error Error code M eaning 34h Bad file name or number i1enumber of an unopened file specified 36h Improper file type i1enumber of a bar code device file specified 3Ah File number out of range 3Eh A put or cer instruction executed without a FIELD instruction no FIELD instruction is found Reference Statements GET INPUT LINE INPUT LOCATE OPEN and OPEN c
92. 1 lists the execution errors codes and their meanings Table A 1 Execution Errors Error Code M eaning 00h Internal system error 01h NEXT without FOR 02h Syntax error 03h RETURN without GOSUB 04h Out of DATA no DATA values remain to be read by the READ instruction 05h Parameter out of range 06h Operation result is out of the allowable range 07h Insufficient memory space too many nesting levels etc 08h Array not defined 09h Subscript out of range an array subscript is out of the array or the array is referenced by different dimensions A 1 S MA PDT 1100 Terminal Programmer s Guide Table A 1 Execution Errors Continued Error Code M eaning 0Ah Duplicate definition an array is defined twice OBh Division by zero 0Ch CASE and END SELECT without SELECT 0Dh END DEF Or EXIT DEF instruction executed outside the DEF EN statement block OFh String length out of range 10h Expression too long or complex 14h RESUME without error RESUME instruction occurs before the start of an error handling routine 1Fh Function number out of range in CALL statement 32h File type mismatch 33h Received text format not correct 34h Bad file name or number an instruction uses the file number of an unopened file 35h File not found 36h Improper file type instruction attempts an operation that conflicts with the fil
93. 3 Disabling the automatic power off facility POWER CONT where counter A numeric expression which returns a value from 0 to 32 767 Notes POWER counter turns off the power after the length of time specified by counter counteristhe valuein seconds of the power off Following is a sample program for turning off power 4800 seconds after execution of POWER instruction POWER 4800 If no POWER instruction is issued the default counter value is 180 seconds If any of the following occurs while the power off counter is counting the counter is reset to the preset value and starts counting again Any key is pressed Thetrigger switch is pressed 10 101 T PDT 1100 Terminal Programmer s Guide s ThePDT 1100 sends or receives data via a communications device file If a communications device file is closed this operation does not reset the power off counter Execution of POWER OFF Or POWER 0 immediately turns off the powe Theexecution of POWER OFF Or POWER 0 deactivates the resume function if preset POWER CONT disables the automatic power off facility Execution Error Error Code M eaning 05h Parameter out of range counter is out of range 10 102 Statement Reference PRINT Statement Name Print Type O Statement Description Displays data on the LCD screen Syntax PRINT datal CR LFcontrol where data A numeric or string expression CR LFcontr
94. 32767 In assignments or operations from integer to real the type converted real has higher accuracy 5 7 M PDT 1100 Terminal Programmer s Guide 7 Syntax realvariable integerexpression In the above case the Interpreter applies the type conversion to the evaluated resultant of the integer expression before assigning the real value to the real variable Therefore a in the following program results in the value of 184 5 a 123 1 5 Type Conversion Examples Thefollowing examples show the type conversion from real to integer Assignment of Real Expressions to Integer Variables When assigning the value of the real expression right side to the integer variable left side the Interpreter carries out type conversion Syntax integervariable realexpression Example b 123 45 where bs becomes 123 Operands for an Arithmetic O perator MOD Before executing the mop operation the Interpreter converts operands into integers Syntax realexpression MOD realexpression Example 10 5 MOD 3 4 where the result becomes identical to 11 Mop 3 Operands for Logical O perators AND OR NOT and XOR Before executing each logical operation the Interpreter converts operands into integers Syntax NOT realexpression realexpression anp or xor realexpression Example 10 6 AND 12 45 where the result is identical to 11 AND 12 5 8 Data Types Parameters for Functions If parameters i and j of the functions below ar
95. 8 Constan rt deta 5 1 control characters M 6 M 22 Controlling and M onitoring the I Os 7 11 Controlling by the OUT Statement 7 11 conventions notational oocoooooooooo xlv COUNTRY cece 11 11 CRcode 2 5 4 5 10 58 10 108 CRG tai dot der M 34 CRC operation aoaaa aaaea M 35 Creating a source program 2 2 CSRIN akan aio 11 13 CURSOR leones ria 10 20 cyclic redundancy check M 34 D DIA TAS orsa taar ton sor need cach a 10 22 Data File M anagement 8 3 Data Files and Device I O Files 8 1 data link establishment phase M 2 Data Retrieval o o o o oo ooooo 8 5 Gata tekt e a wes M 20 data text format a n aana M 37 data transmission M 2 M 11 M 28 Data Types 0 cece eee 5 1 DATES tate Stace 11 14 Declarative Statement COMMON 0065 10 18 DATA pa a tes Rot coeds Me minty 10 22 DERREG decae reais jot agar on 10 24 declarative statement 10 115 DEFEN aras tna t 10 29 Index 2 DEF FN Single line form 10 29 DEF FN ENDDEF 10 33 DEF FN END DEF Block form 10 33 DEER EGY aat DU e 10 24 Developing Procedures 4 2 2 Development Environment 2 1 Required Hardware 2 1 Required Software 2 2 Development Environment and Procedures 2 1 DIM e adas 10 37 direct
96. 8 4 Bar Code Device ecg hed A a ae lack 8 6 Opening the Bar Code Device by OPEN BAR Statement 00 0 0 cece eee eee 8 6 Programming for Bar Code Device aaau eee eee 8 7 Communications Device sasas aaa 8 8 Hardware Required for Data Communications aaa saaa 8 8 Programming for Data Communications a a aaaea 8 9 Overview of Communications Protocols s a a a anaa 8 9 Ele Transter ToO Se dt wa a e e A AA E A ee Se 8 11 Chapter 9 Event Polling and Error Event T rapping OVGRVIOW reaa a A A A E aa a a Sida 9 1 EEN ets hein A A E AEE E ME ay 9 1 Error trappings nysa ai ni e a aA 9 1 Event of Keystroke Trapping 2 eta 9 1 Event Polling tc vanes A ea esl cach totale ey 9 1 Programming Sample 9 1 Error krappi ngia tessa o a Mont a ici 9 3 Programming for Trapping Errors 1 ee tees 9 3 Event of Keystroke Trapping 0 eee eee 9 4 Programming for Trapping Keystrokes 2 0 eee ee 9 4 Chapter 10 Statement Reference INTO UC Oi A veal eae nea Re leona ab wedded A WM bdo dae 10 1 APEDADA SAA A a E O Ar MI Be A en ae A eS ps Ad 10 2 BEE ri a ad a 10 5 CA Lan A O a a e A we ee EA LAA 10 9 CHAIN A A A Ai 10 11 CUE E socia A A A A AA A a 10 13 CLOSE orador a bread ad 10 15 EE a A ad AE E be A AAA N 10 17 COMMON a A O e IS TA alate Sue Ne A Ea 10 18 vi Contents CURSOR att a A A RE ical ew a ea eee 10 20 DATA ett tone Lakin uot a dysine aa a o 10 22 DEFREG Sic A A cal ee nd eae east ta WR a
97. 8h The file name is different from that in the receive header 3Bh The number of records is greater than the defined maximum value 40h ID not set 46h Communications error a communications protocol error has occurred 47h Abnormal end of communications or termination of communications by the Clear key Clear key has aborted the file transmission Example The sample below transmits a data file by adding a serial number and horizontal parity checking and then displays the serial number on the first line of the screen CLOSE OPEN d0 dat AS 1 10 135 TO PDT 1100 Terminal Programmer s Guide FIELD 1 10 AS A 20 AS BS L LOF 1 CLOSE LOCATE 1 1 PRINT 00000 RIGHTS 00000 MIDS STRS 1 2 5 LOCATE 1 1 OPEN COM 19200 N 8 1 AS 8 XFILE d0 dat SPM CLOSE 8 Before file transmission After file transmission 00000 00100 00100 00100 Reference Statements OPEN and OPEN com 10 136 Statement Reference INCLUDE Statement Name Include Type Filel O Statement Description Specifies an included file Syntax Syntax 1 REM SINCLUDE filename Syntax 2 SINCLUDE filename Notes SINCLUDE reads a source program specified by filename into the program line following the SINCLUDE linein compilation Storing definitions of variables subroutines user defined functions and other data to be shared by source programs in the included files promotes
98. AS 1 CODE A Communications Device Hardware Required for Data Communications ThePDT 1100 uses an IR beam to communicate with a host computer having an IR port To communicate with the host computer having no IR interface port the following hardware is required PDT 1100 Host computer Optical communications cradle CRD 1100 RS 232C interface cable Note No cradle is required if the PDT 1100 and the host computer are directly connected with each other via the direct connect interface For the communications specifications refer to the PDT 1100 User s M anual 8 8 Files Programming for Data Communications Setting the Communications Parameters Use the open com statement to set the communications parameters For Optical Interface Communications Parameters Effective Setting Default Transmission speed bps 115200 57600 38400 19200 9600 or 2400 9600 Parameters other than the transmission speed are fixed Character length 8 bits Parity N one Stop bit length 1 bit since the physical layer of the unit s optical interface complies with the IrDA SIR 1 0 For Direct C onnect Interface Communications Parameters Effective Setting Default Transmission speed bps 38400 19200 9600 4800 2400 1200 600 or 300 9600 Character length 7 or 8 bits 8 bits Parity N one even or odd None Stop bit length 1 or 2 bits 1 bit Overview
99. CK D ata Transmission i Phase 2 i S E B T Serial Number Data Text n 1 Tlo gt x x C lt ACK S n E B y Serial Number Data Text n T c gt x x C W lt ACK Release of Data A Link FON gt Phase 3 y lt ACK 35864053 eps Figure M 5 Sample Transmission Control Sequence M 9 M PDT 1100 Terminal Programmer s Guide 7 Errors may occur during data transmission The protocol recovers from these errors as frequently as possible Following is the protocol for errors during phases 1 through 3 Phase 1 Establishment of Data Link Normal phase 1 T he sending station transmits an EN Q to the receiving station When an ACK is received the receiving station the sending station shifts to phase 2 ENQ Receiving Sending Station Station a To phase 2 35864054 eps Figure M 6 Normal Phase Phase 1 with iterated EN Q transmission dueto no response or invalid response f the sending station receives no response or any invalid response from the receiving station in response to an ENQ it resends an ENQ at three second intervals up to 10 times If it receives an ACK during this time it proceeds to phase 2 Sending Receiving Station ENQ Station 3 seconds ENQ 3 seconds ENQ Leese et To phase 2 Figure M 7 Phase 1 with Repeated ENQ Transmission Communications Note You may modify the number of ENQ iterations Refer to
100. D f lt 4 THEN WHILE i gt 10 OR k lt 0 IF NOT p THEN barcod INP 0 AND h02 Following are the four types of logical operators available Operations Logical O perators Precedence Logical N egation NOT 1 Logical multiplication AND 2 Logical addition OR 3 Exclusive logical addition XOR 4 6 4 Expressions and Operators Oneor more spaces or tab codes should precede and follow the Not AND OR and xor operators In the logical expressions or operands the logical operator first carries out the type conversion to integers before performing the logical operation If the resulting integer value is out of the range of 32768 to 432767 an execution error occurs If an expression is equal to 0 zero or 1 the logical operation returns 0 or 1 as shown bdow PRINT 0 OR NOT 0 1 If an expression contains logical operators with arithmetic and relational operators the logical operators are given lowest priority NOT Operator The nor operator reverses data bits by evaluating each bit in an expression and setting the resultant bits according to the truth table below Syntax NOT expression Table 6 1 TruthT able for nor Bit in Expression Resultant Bit 0 1 1 0 For example not 0 1 true The not operation for an integer has the returned value of negative 1 s complement Theor X for instant is equal to X 1 6 5 M PDT 1100 Terminal Programmer s Gui
101. Declarative statements available in BASIC 3 0 are listed below REMor single quotation mark ls DATA COMMON DEF REG You can describe multiple statements in one program line by separating them with a colon Comments Comments make programs easier to understand An apostrophe or rem can begin a comment Apostrophe An apostrophe can begin in the first column of a program line to describe a comment When following any other statement a comment starting with an apostrophe requires no preceding colon as a delimiter comment PRINT abc comment REM The rem cannot begin in the first column of a program line W hen following any other statement a comment starting with rem requires a preceding colon 4 2 Basic Program Elements REM comment PRINT abc REM comment Program Line Length and Maximum Number of Lines Terminate a program line with a CR code by pressing the carriage return key The allowable line length is 512 characters excluding a CR code and the maximum number of lines in a source program is 9 999 Use one of the following methods however to write a program line of up to 8192 characters In the samples below J denotes a CR code entered by the carriage return key e Extend a program line with an underline _ and a CR code IF a OR aS AN D b lt c 4 AND EOF d THEN Extend a program line with a comma and a CR code FIELD 1 13 as
102. ENGR rca ta ce at a o Ps OO O O O A Eh ae xvii Chapter 1 Software Overview Software UC it A A A A A A AS Teme A 1 1 System PrograMS ico A A Fe ek ene Rene 1 2 Application Programs isc A oe nae ena ed 1 3 Overview of BASIC Diao artis e aa a a 1 3 BASI Droit rc er AO es UOC TO e tr EA te A Pea ate af runt uence eB 1 3 OUT ni a a AA Os A a E E E Sea dan da ete 1 3 Compilation and Program Execution oooocoocccocco eee 1 4 Compiler and Interpreter o oooooococooorr ete 1 4 Compiling and Interpreting Example 0 0 0c cece eee 1 5 Chapter 2 Development Environment and Procedures Overview of Development Environment 0 0 0 ccc cece eee 2 1 Required HardWare es icc ii a A PO ee A ea data deel be 2 1 Required Softwa eri so ea A ven atin EA dare Gea ee eet 2 2 Overview of Developing Procedures 6 0 ccc tte 2 2 Developing Procedures tc a id eae oe 2 2 Functions of the Compilare ceerde niasin cainnean E ERE 2 3 Developing Procedure Fl0W oooooococoocrco eee 2 3 M PDT 1100 Programmer s Guide S Writing of a Source Program sie id ae wee A BANA A iva Sac 2 4 Writing a Source Program Using Editor 0 cece cette 2 4 Rules for Writing a Source Program 6 eee 2 4 Compiling in Windows 0 ccc ete 2 6 Setting up the Compiler 2 6 cee ett 2 6 Starting the Compilar Mine nE a a alee SEE ae aa GA San 2 7 Reading in the Initialization File aaa ke eee 2 7 Operating Procedure fo
103. ET SYSTEM screen Note The Interpreter erases the file in flash ROM when the subsequent downloading operation is carried out Since the Interpreter erases data in units of 128 kilobytes it temporarily copies the data containing the file to be deleted 128 kilobytes into RAM and then returns files not to be deleted into flash ROM If the RAM does not have sufficient space for the data a system error or execution error occurs Specifying Files Includethe drive name when specifying a filein user programs Thedrivenameisa for RAM and s for flash ROM If no drive name is specified the default drive A RAM applies Specify files with the following statements CALL CHAIN KILL OPEN and XFILE Example OPEN B DATA1 DAT AS 1 This example opens the file named pata1 part stored in flash ROM Memory Areas Required for User Programs If you store a user program in flash ROM the area for its register variables is also reserved in flash ROM When starting the program for the first time the Interpreter copies the register variables stored in flash ROM into RAM wherethe user program uses them If RAM does not have sufficient area for storing the register variables an execution error occurs When H 5 M PDT 1100 Terminal Programmer s Guide S uploading a program file stored in flash ROM the PDT 1100 combines the program excluding register variables in flash ROM with the register variables stored in RAM R
104. Execute the Compiler using one of the following methods e Inthe Select File dialog box click the run button e From the Compile menu choose the run command Whileholding down the Ctrl key press the G key e Inthe Compiling O ptions dialog box click the Run button e Click the compile start button M4 in the tool bar El Note f the compiling options have been set you can easily start the Compiler by theWindows drag and drop method that is dragging a file to be compiled in File M anager onto the Compiler icon Screen Shown During Execution of the Compiler When compiling starts the mouse pointer turns into an hourglass shape until the process is complete BASIC Compiler for Win File Compile Editor Help Compiling the test TEST SRC 36099010 eps Figure 2 4 Compiler Dialog Box Output from the Compiler The Compiler outputs the following information as well as user programs object programs to the destination depending upon the conditions Enclosed by bold lines are descriptions exclusively applied to the Windows based Compiler 2 10 Development Environment and Procedures Table 2 1 Output from the Windows Compiler Output Destination Conditions User program object program Error message Syntax error File XXX PD3 in the directory where the source program is located W hen the specified source program has been normally compiled without a syntax error or fatal
105. INPUT data a Waiting for keystrokes Entering alphabet characters ND under the above user program 7 5 M PDT 1100 Terminal Programmer s Guide 7 1 Press the trigger switch data Left 2 Hold down thetrigger switch data Center 3 Without releasing the trigger switch press the 5 key data N Center 4 Release the trigger switch data N 5 Hold down thetrigger switch data N Left 7 6 I O Facilities 6 Without releasing the trigger switch press the 8 key data ND Left 7 Release the trigger switch data ND 8 Press the Enter key to complete the entry operation Function Keys The following operations cause the pressed key to act as a function key e Pressing a function key enters its default character control code value e Pressing a function key while holding down the Shift key e Pressing a numeric key while holding down the Shift key Use a key statement to reassign a value For the keyboard layouts key numbers and key assignments refer to Appendix E Key Number Assignment on the Keyboard Assigning a Character String to a Function Key Assign a desired character string up to two characters or a single control code to a function key using the key statement as shown below Example for characters KEY 1 AB Example for a c
106. K ACK Data Text n 1 ACK Data Text n ACK lo phase 3 35864057 eps Figure M 9 Normal Phase 2 Phase 2 with N AK If the sending station receives a N AK from the receiving station in response to a transmission block containing text data it sends that transmission block again immediately as shown Communications below If the sending station receives an ACK before receiving aN AK 10 times in succession it continues the subsequent message transmission Sending Data Text m Receiving Station T Station e al rel Figure M 10 Phase 2 with NAK If the sending station receives a NAK 10 times in succession or it fails to send a same transmission block it proceeds to phase 3 to terminate the message transmission Even if the Phase 3 terminates normally the transmission is aborted Sendin ivi g Data Text m 1 Receiving station m Station NAK Data Text m 10 Occurrence of an error To phase 3 35864059 eps Figure M 10 Phase 3 Termination M 13 M PDT 1100 Terminal Programmer s Guide F Phase 2 with EOT If the sending station receives an EOT anytime during phase 2 it proceeds to phase 3 to terminate the message transmission Even if the phase 3 terminates normally Sending i Receiving Station 1 Station gee Occurrence of an error To phase 3 Figure M 11 P
107. L40 KEY 8 BL15 Defining an M key as the trigger switch shift key or battery voltage display key KEY in syntax 3 defines an M key M 1 M 2 M 3 M 4 as the trigger switch shiftkey or battery voltage display key as well as assigning string data KEY 30 TRG M 1 key asthetrigger switch KEY 31 sFT M 2 key astheshift key KEY 30 BAT M 1 key asthe voltage display key Note If you issue KEY instructions specifying a same function key only the last KEY instruction takes effect The description below for example makes the function key numbered 3 operate as the backlight function on off key and the length of backlight ON time is 100 seconds 10 63 T PDT 1100 Terminal Programmer s Guide KEY 3 a KEY 3 BL100 The description below assigns string data a to the function key numbered 3 The default backlight function on off key the combination of M 1 key and shift key is restored KEY 3 BL100 KEY Sa a The description below defines the M 1 key as the trigger switch The default battery voltage display key combination of the ENT key and shift key is restored KEY 30 BAT KEY 30 TRG Syntax Error Error Code and Message M eaning error 71 Syntax error keynumber iS missing stringdata iS missing back lightkeynumber iS missing stringdata is a numeric expression Execution Error Error Code M eaning 05h Parameter out of range
108. LCD screen which moves the cursor to its home position in the top left corner PRINT CHRS amp h18 CR LFcont rol determines where the cursor is to be positioned after the PRINT instruction executes If CR LFcont rol is a comma the cursor moves to the column position of a least multiple of 8 plus one following the last character output Statement example PRINT 123 Output _123 If CR LFcontrol isa semicolon the cursor moves to the column position immediately following the last character output Statement example PRINT 123 Output 123 If neither a comma nor semicolon is specified to CR LFcontro1 the cursor moves to the first column on the next screen line 10 104 Statement Reference Statement example PRINT 123 Output 123 In the above cases the screen scrolls up so the cursor is always visible on the LCD screen To extend one program line to more than 512 characters in a single PRINT statement use an underline _ preceding a CR code instead of a comma Syntax Error Error Code and Message Meaning error 71 Syntax error data contains a comma or semicolon Reference Statements LOCATE SCREEN and PRINT USING 10 105 T PDT 1100 Terminal Programmer s Guide PRINT Statement Name Print Type Filel O Statement Description Outputs data to a communications device file Syntax PRINT filenumberl datal CR LFcontrol where filenumber A numeric expression
109. Ng dar eae a aie ie A acd e 11 34 A ce ea ent Se eae Me ne E Se rt ee ane ae ee ee re eee eee 11 35 AAA deena tee OO A Shee Ra Ot Ate A Re ree 11 37 MAG 2 ace aa Nasir AA ah teak ete ed 11 39 MIDS chet Stet oot hs Sansa o al eat cae CAR ante eRe 11 41 POSES Sei GUM Us ioe e qe he ae e o ait yA oe 11 43 A A BS Oe Nisin de cet 11 44 SEARG H A A O tale td betel ee ait de dad dt eh E 11 45 tor Stats acy tet ctr O pea wea og tara sg ues ew ranean et 11 47 STR Gor erat onan E e was A O 11 49 A Cee meade Wok Mea dengue AT 11 50 THE hc stele ats deeded tne eee A tage t Ne Ie are arenas Le Dah lode 11 52 T MEAMIMEBMIMEC roo aia oie atada 11 54 o Miata dd ida 11 56 Appendix A Error Codes and Error Messages viii Contents INTOdUC siii ia a ols Rae aca Ate RAG aia caia AE A 1 EXEcCUt ON EMOS das o ead at au de A A da aod ale ane A 1 EXE A a E aia A 3 SNIE A Aida A 5 Appendix B Reserved W ords Appendix C Character Sets Character SOR tse gM er sci te et AO O Ia erste C 1 National Character Sets oooocooococo eae C 3 Display M ode and Letter Size ttt eee C 4 Character Frame and Letter Size in Single Byte ANK Mode cece eee ee C 4 Generating Small Font Patterns nassau ce eee C 4 Appendix D I O Ports TMP UE PO RUS ati O AA A AAA AE AAA os D 1 QUtpuEP OS A A a E gek T Wa edhe aa D 4 Appendix E Key Number Assignment on the Keyboard Key Number Assignment 0 fcc eens E 1 Default Data Assignment 1 02
110. OAD amp H80 cp PRINT CHRS amp H80 cp 0 cp 1 cp 2 cp 3 cp 4 cp 5 Bitin each array element O O O O a O 0 LSB O O Oo E n a 1 O a E E E a 2 a a E E a a 3 O O E E m a 4 O O a E n O 5 O O O O O 6 O O O O O O 7 M SB Figure 10 1 Array Elements Reference Statements COMMON DEFREG DIM KPLOAD PRINT and SCREEN 10 4 Statement Reference Statement Name Beep Type 1 0 Statement Description Sounds the beeper Syntax BEEP onduration offduration repetitioncount frequency where onduration offduration and repetitioncount Numeric expressions each of which returns a value from 0 to 255 frequency A numeric expression which returns a value from 0 to 32 767 Notes BEEP sounds the beeper to the following specifications at the pitch of the sound in Hz specified by frequency during the length of time specified by onduration at the intervals of the length of time specified by offduration by the number of repetitions specified by repetitioncount Defaults onduration and offduration 1 100 msec repetitioncount 1 frequency 4337 Hz Same as when 2 is set to frequency 10 5 T PDT 1100 Terminal Programmer s Guide s Setting frequency to 0 1 or 2 produces the special beeper effects listed bdow Table 10 1 Beep Settings frequency Setting PDT 1100 Tone Statement example 0 1033 Hz Low pitched BEEP 0 1 2168 Hz M edium pitc
111. RETURN instruction in a subroutine returns control to the instruction immediately following the GOSUB that called the subroutine RETURN instruction in an event handling routinefor keystroke interrupt returns control to the program following the one where the keystroke trap occurred e No label designating a return location should be specified in a RETURN statement e You may specify more than one RETURN statement in a subroutine or an event handling routine Reference Statements GOSUB and ON KEY GOSUB 10 120 SCREEN Statement Reference Statement Name Screen Type I O Statement charaattribute A numeric expression which returns a value 0 or 1 Description Sets the screen mode and the character attribute Syntax Syntax 1 SCREEN screenmodel charaattributel Syntax 2 SCREEN charaattribute where screenmode and Notes SCREEN sets the screen mode and the character attribute of the LCD screen according to screenmode and charaattribute as listed below Screen mode screenmode SCREE Single byte ANK mode 0 SCREE default Character attribute charaattribute SCREE Normal display default 0 SCREE Reversed display 1 SCREE statement 0 statement 0 ak Atprogram start up the defaults single byte AN K mode and normal display are active 10 121 T PDT 1100 Terminal Programmer s Guide e Ifa parameter is omitted the corresponding screen mode or chara
112. Reads data from a device 1 0 file into specified variables Syntax INPUT filenumber variablel variable where filenumber A numeric expression which returns a value from 1 to 16 variable A numeric or string variable Notes INPUT reads data from a device I O file a communications device file or bar code device file specified by i1enumber and assignsit to variable filenumberisa number assigned to the device I O file when it was opened e Reading data from a communications device file An INPUT instruction reads data fields separated by CR codes or commas and assigns them to variable If more than one variable is specified in an INPUT statement the program waits until all of the specified variables receive data If an INPUT instruction reads data longer than the allowable string length it ignores only the overflowed data and completes execution causing no execution error e Reading data from a bar code device file An INPUT instruction reads the scanned data into the first variable If more than one variable is specified in an INPUT statement the program ignores the second and the following variables 10 58 Statement Reference If an INPUT instruction reads data longer than the allowable string length it ignores only the overflowed data and completes execution causing no execution error If the maximum number of digits has been omitted in the read code specifications of the OPEN BAR
113. SE statement executes and passes control to the first statement fol lowing the END SELECT If no executable statement follows a CASE control passes to the first statement following the END SELECT conditionalexpression numeric or string and tests must agree in type e Upto 10 levels of When using thes SELECT CASE END SELECT instructions can be nested SELECT a CASE 1 SELECT b CASE 3 PRINT a 1 b 3 END SELECT CASE 2 PRINT a 2 END SELECT ELECT CASE statement block with other block structured statements FOR NEXT IF THEN ELSE END IF and WHILE WEND you can nest them up to 30 levels Syntax Error Error Code and M essage error 26 error 55 Incorrect use of SELECT CASE END SELECT error 56 Incomplete control structure error 71 Syntax error 10 124 M eaning Too many nesting levels CASE CASE ELSE Of END SELECT Statement appears outside of the SELECT statement block NO END SELECT corresponds to SELECT conditionalexpression and tests do not agree in type Statement Reference Execution Error Error Code M eaning OCh CASE and END SELECT Without SELECT 10h Expression too long or complex too many levels of program nesting by SELECT Statement 10 125 T PDT 1100 Terminal Programmer s Guide WAIT State
114. String length out of range the returned value of the st ringlength exceeds the allowable range Example Example 1 DEF FNadd a b a b PRINT FNadd 3 5 8 Example 2 DEF FNappends a b 80 a b5 PRINT FNappends 123 AB 123AB 10 32 Statement Reference DEF FN END DEF Block form Statement Name DEFineFuN ction EN D Type User created Function Definition DEFine Statement Definition Names and defines a user defined function Syntax Syntax 1 Defining a numeric function DEF FN funct ionnamel dummyparameterl dummyparameter D Syntax 2 Defining a character function DEF FN charafunct ionname dummyparameter dummyparameter an stringlength Syntax 3 Exiting from the function block prematurely EXIT DEF Syntax 4 Ending the function block END DEF Syntax 5 Assigning a returned value FN functionname generalexpression yntax 6 Calling a function FN functi onname realparamet er realparamet er D where Same as for DEF FN Single line form Notes Creating a user defined function DEF FN END DEF creates a user defined function T he function definition block between DEF FN and END DEF sa set of some statements and functions 10 33 L T PDT 1100 Terminal Programmer s Guide Definition of a user defined function should preceed a calling statement of the user defined function in a source pr
115. T instruction without recordnumber is executed after execution of the preceding GET instruction specifying the last record the number of the written records then an execution error occurs Syntax Error Error Code and Message Meaning error 71 Syntax error filenumber iS missing Execution Error Error Code M eaning 34h Bad file name or number i1enumber of an unopened file specified 36h Improper file type fi lenumber of a file other than data files specified 3Ah File number out of range 3Eh A pur or GET instruction executed without a FIELD instruction 3Fh Bad record number no record to be read in a data file Example GET filNo RecordNo GET 4 GET 3 100 Reference Statements OPEN FIELD and PUT 10 49 T PDT 1100 Terminal Programmer s Guide GOSUB Statement Name Gosub Type Flow Control Statement Description Branches to a subroutine Syntax GOSUB label Notes GOSUB Calls a subroutine specified by label e Within the subroutine use a RETURN instruction to indicate the logical end of the subroutine and return control to the statement just after the Gosus that called the subroutine You may call a subroutine any number of times as long as the Interpreter allows the nest level and other conditions e Subroutines can appear anywhere in a source program H owever separate subroutines from the main program by for example placing them after the END or GOTO statement to prevent the m
116. This defines the M 2 key as the trigger switch 7 8 I O Facilities Keystroke Trapping You can trap the pressing of a particular key using the key oN KEY OFF and ON KEY GOSUB statements Note If you specify a function key defined as the LCD backlight function on off key trigger switch shift key or battery voltage display key for keystroke trapping no Keystroke trap takes place For details about the keystroke trapping refer to Chapter 9 Event Polling and Error Event Trapping Timer and Beeper Timer Functions Thetimer functions TIMEA TIMEB and TIMEC are available in BASIC 3 0 for accurate time measurement Use these timer functions for monitoring the keyboard waiting time communications timeout errors etc TIMEA 100 10 sec WAIT 0 amp H10 BEEP PRINT 10sec TIMEC 20 2 sec WAIT 0 amp H41 BEEP PRINT 2sec or Keyboard BEEP Statement The BEEP statement sounds a beeper and specifies the frequency of the beepe The example below sounds the musical scale of do re mi fa sol la ti and do READ readDat WHILE readDat gt 0 TIMEA 3 BEEP 2 readDat WAIT 0 amp h10 7 9 M PDT 1100 Terminal Programmer s Guide S READ readDat WEND DATA 523 587 659 698 783 880 987 1046 1 Specify the beeper frequency with value 0 low pitched 1 medium pitched or 2 high pitched FOR i 0 TO 2 TIMEC 20 BEEP i WAIT 0 amp h40 NEXT
117. Type I O Function Description Returns a byte read from a specified input port Syntax INP portnumber where portnumber A numeric expression which returns a value from 0 to 32 767 Notes INP reads one byte data from an input port specified by portnumber and returns the value For theinput port numbers refer to Appendix D 1 0 Ports It also reads the battery voltage level e Listed below are effective port numbers 0 3 4 8 10h to 24Fh Eh Fh 6010h 6011h 6040h 6060h 6061h 6062h 6070h 6080h e If you specify an invalid value to portnumber INP returns an indeterminate value 11 26 Execution Error Error code M eaning 05h Parameter out of range portnumber is out of range Reference Statements OUT and WAIT Function Reference 11 27 T PDT 1100 Terminal Programmer s Guide INPUTS Function Name INPUT file Type Filel O Function Description Returns a specified number of Syntax characters read from the keyboard or from a device file Syntax 1 Reading from the keyboard INPUTS numcharas Syntax 2 Reading from a device file INPUTS numcharas filenumber where numcharas A numeric expression which returns a value from 1 to 255 filenumber A numeric expression which returns a valuefrom 1 to 16 Notes INPUTS reads the number of characters specified by numcharas from the keyboard or from a device file specified by i1enumberx then returns the resulting st
118. XT Statement Name For Next Type Flow Control Statement Description Defines a loop containing instructions to be executed a specified number of times Syntax FOR controlvariable initialvalueTO finalvalue STEP increment NEXT controlvariabl el where controlvariable A non array numeric variable initialvalue finalvalue and increment N umeric expressions Notes FOR NI EXT defines a loop containing instructions called body of a loop to be executed by the number of repetitions controlled by initialvalue finalvalue and increment Process al 2 ing procedures The Interpreter assigns initialvalueto controlvariable The Interpreter checks terminating condition that is it compares the value of controlvariable against the finalvalue When the value of increment is positive If the value of controlvariable is equal to or less than the finalvalue go to step 3 If it becomes greater the finalvalue the program proceeds with the first line after the NExT instruction the loop is over When the value of increment is negative 10 45 s 10 46 T PDT 1100 Terminal Programmer s Guide If the value of controlvariable is equal to or greater than the finalvalue go to step 3 If it becomes less than the finalvalue the program proceeds with the first line after the NEXT instruction the loop is over The body of the loop executes and the NEXT instruction increases the va
119. a statement block to which program control passes when an error trap or event of keystroke trap occurs during program execution respectively The resume statement passes control from the error handling routine back to the desired statement The reTURN statement in the keyboard interrupt event handling routine returns control to the statement following the one that caused the interrupt Block Format User Defined Functions A user defined function comes in two formats one line format and block format both of which can be called from the main routine or subroutines Before calling user defined functions it is necessary to define those functions by per Fw statements 3 1 7 The block format user defined function M PDT 1100 Terminal Programmer s Guide has the same structure as a statement block Generally it should be placed at the beginning of a program before the main routine starts Global Variables and Local Variables Global variables may be accessed by the same variable s name from any statement in a complete program They include work variables register variables and common variables ividual statement blocks where each of them is used Local variables are valid only within ind A dummy argument defined by the DEF Block Structured Statement The statements listed below havethe statement block structure and are useful for structured programming FN statement is one of the local variables S FOR NEXT
120. ables register integer array error 21 Too many variables register float array error 22 Too many variables register string array error 23 Too many variables common integer array A 5 S MA PDT 1100 Terminal Programmer s Guide Table A 3 Syntax Errors Continued Error Code M essage error 24 Too many variables common float array error 25 Too many variables common string array error 26 error 27 error 28 error 29 error 30 error 31 error 32 error 33 error 34 error 35 Source line too long error 36 error 37 error 38 error 39 error 40 error 41 Value out of range for integer constant error 42 Value out of range for float constant error 43 Value out of range for integer constant hexadecimal expression error 44 Improper hexadecimal expression error 45 Symbol too long error 46 error 47 error 48 error 49 A 6 Error Codes and Error Messages Table A 3 Syntax Errors Continued Error Code M essage error 50 Incorrect use Of IF THEN ELSE ENDIF error 51 Incomplete control structure IF THEN ELSE ENDIF error 52 Incorrect use of FOR NEXT error 53 Incomplete control structure FOR NEXT error 54 Incorrect FoR
121. acheck digit Specifying a c causes the Interpreter to check bar codes with M OD 43 Thecheck digit is included in the number of digits OPEN BAR AS 1 CODE M 8 12C Code 93 1 Syntax L mini no digits max no digits where mini no digitsand minimum and maximum number of digits for bar codesto be read max no digits bythePDT 1100 in the range of 1 to 99 If both mini no digits and max no digits are omitted the default reading range is 1 to 99 digits If only max no digits is omitted the PDT 1100 can only read the number of digits specified by mini no digits OPEN BAR AS 1 CODE L 6 12 Code 128 x Syntax K mini no digits max no digits 10 92 Statement Reference where mini no digitsand minimum and maximum number of digits for bar codes to be read max no digits bythePDT 1100 in the range of 1 to 99 If both mini no digits and max no digits are omitted the default reading range is 1 to 99 digits If only max no digits is omitted the PDT 1100 can only read the number of digits specified by mini no digits OPEN BAR AS 1 CODE K 6 12 Standard 2 of 5 STF H Syntax H mini no digits max no digits CD startstop where mini no digitsand minimum and maximum number of digits for bar codes to be read max no digits by thePDT 1100 in the range of 1 to 99 If both mini no digits and max no digits are omitted the default reading range is 1 to 99
122. acters The screen statement reverses characters as listed below Indication SCREEN Statement Normal display SCREEN 0 Default Reversed display SCREEN 1 Reversed display sample Communications Error 7 1 M PDT 1100 Terminal Programmer s Guide S Note Blinking or underscoring is not available in reverse display Displaying the System Status ThePDT 1100 may display the system status the shift state of the keys at the right end of the bottom line of the LCD by the icon below Table 7 1 System Status Icon System Status Icon Description Shift state of the keys on the Appears when the keys are shifted keypad Theicon is 16 dots wide by 8 dots high You may turn the system status indication on or off on the SET DISPLAY menu in System M ode The default is ON For the setting procedure refer to the PDT 1100 User s M anual Use the out statement in user programs to control the system status indication also Refer to Appendix D 1 0 Ports Notes when the system status is displayed The following statements and functions cause different operations when the system status is displayed e cis statement The czs instruction clears the VRAM area assigned to the right end of the bottom line of the LCD but does not erase the system status displayed out statement If you use the out statement to send graphic data to the VRAM area assigned to the right end of the bottom line of the LCD
123. ading mode specified With the momentary switching mode or auto off mode specified and with the trigger switch held down With the alternate switching mode and the illumination LED on When any key is held down When theLCD backlight is on When the beeper is beeping When the PDT 1100 is updating data on the screen H 1 M PDT 1100 Terminal Programmer s Guide S Resume Function The resume function preserves the current status of a running application program user program or Easy Pack when thePDT 1100 is powered off and then resumesit when the PDT 1100 is powered on If you unintentionally turn off the PDT 1100 or the automatic powering off function turns it off turn on the PDT 1100 again to resume the previous screen and continue the program execution Theresume function is effective during data transmission in an application program but a few bytes of data may be lost Note Powering off the PDT 1100 does not escape from the current status of an executed program because the resume function does not initialize the variables or restart the PDT 1100 Disable the resume function in System M ode The resume function does not work after execution of System M ode or after the following instructions EnDinstruction POWER OFF instruction POWER 0 instruction Before you run System M ode store important information using register variables or other means or powering the PDT 1100 o
124. ain part of the program from falling into those subroutines A subroutine can call other subroutines Y ou can nest GOSUB instructions to a maximum of 10 levels When using the cosus statement together with block structured statements FOR NEXT IF THEN ELSE END IF SELECT CASE END SELECT and WHILE WEND you can nest them to a maximum of 30 levels 10 50 Statement Reference Syntax Error Error Code and Message Meaning error 71 Syntax error label has not been defined label is missing Execution Error Error Code M eaning 03h RETURN Without GosuB 07h Insufficient memory space too many nesting levels Reference Statements RETURN 10 51 T PDT 1100 Terminal Programmer s Guide GOTO Statement Name Goto Type Flow Control Statement Description Branches to a specified label Syntax GOTO label Notes GOTO unconditionally transfers control to a label specified by label e Inan IF instruction block you can omit GoTo immediately following THEN or ELSE as shown below IF a 0 THEN Lb11 ELSE Lb12 END IF GoTo allows you to branch anywherein your program However you should branch only to another line in a program module or subroutine at the same program level Avoid transferring control to a DEF FN block or other blocks at the different program level You can use Go To instead of GOTO Syntax Er
125. am Text Format Byte Position 3 2 3 4 5 6 7 8 910 1112 1314 15 16 17 Program File Name 12 bytes 5 bytes T T T T Number of Data Texts Contained Example of Contents The program file name is a maximum of 12 characters and consists of FILE NAME and EXTENSION The FILE NAME should be 1 to 8 characters The EXTENSION should be PD3 FN3 and EX3 may be available for future functional expansion The number of data texts is O to 32767 If less than 5 digits the upper blank bytes are filled with zeros 0 If the program file name is less than 12 characters the lower blank bytes are filled with space characters 35864064 eps Figure M 32 Program Text Format Heading Text 128 or 130 130 PEE E Byte 1 T o 3 4 T T T T T T T T T T T T T T T T T T T Position 128 bytes if extension is PD3 Program Data 130 bytes if itis FN3 or EX3 Example of oe SEENEN CSEE OENES E Llop 0 D 0 A 0 0 0 0 0 0 Contents h Object file compiled from a source program file having one of the extensions PD3 FN3 or EX3 If a program data field is less than the maximum digits the lower blank bytes filled with zeros 0 35864065 eps Figure M 33 Program Text Format Data Text M 36 Communications Data Text Format Number of Fields 2 bytes Length of Length of Data Field 1 Data Field n 2 bytes 2 bytes Byte 123 45 6 7
126. ant for no Or bars you don t need to pass the value as an argument The bars can pass a single type of bar code If two or more types are required directly describe necessary invariants def fnbarkeyS f no bar max esc while 1 a PDT 1100 Terminal Programmer s Guide open BAR as f no code bar wait 0 3 Wait for completion of bar code reading or key press if loc f no then beep Beep when bar code reading is completed fnbarkey inputS max f nos For displaying rt input max f no print rt fnbarkeyS rt close tf no exit def else close f no Receive only key entry ACTO So kb input 1 while kb lt gt if instr esc kb then Key designated in esc fnbarkey kb Then return the character exit def endif select kb case chr 13 fnbarkey rt exit def case chr 8 BS key if len rt then print chr 8 Erase one character rtS left rt len rt 1 endif case chr 24 Clear key while len rts Erase all characters entered print chr 8 rt left rt len rt 1 wend case else if len rt lt max then Check if only numeric data should be received print kbs Echo back srtS ano reS kbs else beep Exceeded number of characters error endif end select if rt then If input string is empty go back to the initial state kb W J 2 Program Samples else kb inputs 1 Subsequent
127. ars System error Contact your administrator Note the error drive DRIVE x This message appears in the following cases ThePDT 1100 is first powered on from the time of purchase ThePDT 1100 is powered on after being left without battery cartridge loaded for a long time Caution Initialization erases all programs and data stored in the RAM and flash ROM and resets the system calendar clock and communications parameters to their defaults Therefore set those reset parameters in System M ode be fore accessing the download menu For details about initialization and downloading refer to the PDT 1100 Terminal Product Reference Guide 2 16 Development Environment and Procedures Executing a User Program Starting To run a user program start System M ode and select the desired program in the Program Execution menu If you have selected a user program as an execution program in the Setting menu of System M ode the PDT 1100 runs the user program when powered on For the operating procedure of System M ode refer to the PDT 1100 User s M anual Execution The Interpreter interprets and executes a user program from the first statement to the next one by one Termination ThePDT 1100 system program terminates a running user program if the END POWER OFF Or POWER 0 Statement is executed in a user program e thepower switch is pressed no valid operations are performed within the specified time length
128. ast 400 kilobytes should be reserved in RAM asa work area e PDT 1100 terminal CRD 1100 Optical communications unit cradle not required if the PDT 1100 is directly connected with the personal computer via the direct connect interface RS 232C interface cable connects the CRD 1100 to the personal computer Note The RS 232C interface cable must have the connector and pin assignment required by the personal compute See the PDT 1100 Product Reference Guide for connector configuration and pin assignments of the CRD 1100 2 1 M PDT 1100 Terminal Programmer s Guide 7 Required Software e MSWindows O S Windows 95 NT 3 51 40 e Editor e BASIC 3 0 Compiler BHTC3W EXE Windows based BHTC3 MSG Error message file e Ir Transfer Utility C option TU3W EXE Windows based TU3C2W EXE Windows based e Ir Transfer Utility E option ITEW32 EX E Windows based Ir Transfer Utility C and IR Transfer Utility E download user programs to the PDT 1100 The BASIC 3 0 Compiler Ir Transfer Utility C and Ir Transfer Utility E areoptionally provided in a floppy disk Note Prepare Windows and editor versions operable with the personal computer on which user programs are to be developed For the manufacturers and models of Windows computers which support Ir Transfer Utility C and E refer to the PDT 1100 Terminal Transfer Utility Guide Overview of Developing Procedures Developing Procedures The program developing p
129. ata and then returnsthe record number wherethe search data is found Syntax SEARCH filenumber fieldvariable searchdata startrecord where filenumber A numeric expression which returns a value from 1 to 16 fieldvariable A non array string variable searchdata A string expression startrecord A numeric expression which returns a value from 1 to 32 767 Notes SEARCH searches a target field specified by fieldvariable in a data file specified by filenumber for data specified by searchdata and then returns the number of the record where the search data is found fieldvariableisa string variable defined by a FIELD statement searchdata is the data you are looking for startrecordisthenumber of a record where the search is to begin in a data file The search ends when all of the written records have been searched If you omit start record option the search begins at the first record of the data file Ifthe search data is not found SEARCH returns the value 0 A convenient usefor SEARCHIiS for example to search for a particular product name unit price or stock quantity in a product master file by specifying a bar code data to searchdata 11 45 T PDT 1100 Terminal Programmer s Guide e Since the search begins at a record specified by startrecord in a data file and finishes at the last record sort records in the data filein the order of frequency of use before executing of this func
130. atement are ignored Backlight OFF The backlight function is deactivated when the PDT 1100 is powered on With the OUT statement set port 6020h to 1 v Backlight ON With the OUT statement set 0 x to port 6020h If no key is pressed for the time length set to port 6021h the backlight goes Press any key off Y Backlight OFF The backlight function remains activated With the OUT statement set 0 to port 6020h Figure l 2 Setting Backlight Function via OUT Statement M PDT 1100 Terminal Programmer s Guide S Appendix J Program Samples Writing a Function Following is a sample function for receiving bar code and key entry Feature This function determines whether bar code data or keyed data is entered first and returns that data If pressing the Backspace key or Clear key empties the input string the function is ready to receive the subsequent bar code entry or key entry Returned value The function returns bar code or key entry received before the ENT key is pressed as a string Arguments f no Specifies the file number which opens the bar code device file Invariant allowed bars Specifies bar code reading Invariant allowed Ex M 10 20 max Specifies the maximum length of a returned string escs If a key s contained in this string is entered the function returns the key entry only Work kb and rt If you use an invari
131. ates the start of heading text Phase 2 DLE STX 1002h Start Of Text Indicates the start of data text Phase 2 DLE ETX 1003h End Of Text Indicates the end of data text Phase 2 In the Ir protocol you cannot change the values of the headers and terminator with the protocol functions in BASIC 3 0 M 23 M PDT 1100 Terminal Programmer s Guide 7 Format of Transmission Messages The PDT 1100 transmits data as units of a file First it transmits a heading text which includes thefileto betransmitted e g filename and the number of data texts Following the heading text it transmits the data text in the file A heading text and data text comprise a text In actual text transmission the text is divided into several blocks then a header terminator serial number receiver station s ID and CRC 16 Cyclic Redundancy Check are added to each block This procedure forms a transmission block A set of transmission blocks makes up one transmission message Shown below is an example of a transmission message formed with the Ir protocol Text Heading Text Data Text 1 Data Text 2 Data Text D S l D E C Transmission L oO Heading Text L T R Block E H p E X C 2 bytes TE Transmission D Ss Serial D E A Message L T Number Data Text 1 L T R ada E Xx D 5 bytes E X D S i Sena D EC Transmission L T Number Data Text 2 L T R Block E Xx D E XIc 34864068 eps
132. ations O perands for CRC 16 TheCRC generates CRC 16 from all bytes of a transmission block excluding DLE SOH or DLE STX characters which are at the head of a transmission block DLE character of DLE ETX and DLE character of DLE DLE in the text CRC operation TheCRC system generates CRC 16 as follows 1 It multiplies the polynomial formed by aligning all bits starting from the LSD of the first byte to the M SD of the last byte in a transmission block in descending order by X 16 2 Divide the polynomial by the generative polynomial X 16 X 15 X 2 1 The remainder is the value of CRC 16 Figure 3 X shows a data text transmission block and operands for CRC 16 generation l D S i D Cc iets Serial Data Text 4 L T R E X p E X C 35864079 eps Operand Operand Figure M 31 CRC 16 Data Text Transmission Block and Operands ID ID is a 2 digit hexadecimal designated in 0000h through FFFFh in 2 bytes 0000h is assigned to the host computer Any of 0001h through FFFFh is assigned to the PDT 1100 as follows Thesystem sets an ID when the PDT 1100 is initialized You may set an arbitrary ID in System M ode or by using the O UT statement in BASIC 3 0 Text Format Format text according to the standard of thelr CRD 1100 protocol before transmission Following are two types of the standard text formats for program files and data files M 35 EA PDT 1100 Terminal Programmer s Guide Progr
133. be used for data files PD3 FEN3 EX3 FLD 8 2 Files Structure of Data Files Record A data file is made up of a maximum of 32 767 records A record is a set of data in a data file and its format is defined by the rrELp statement The maximum length of a record is 255 bytes including the number of the character count bytes the number of the fields When transferring data files the PDT 1100 protocol PDT 1100 Ir protocol prefixes a character count byte in binary format to each data field Field A record is made up of oneor morefields Data within the fields are treated as character ASCII data Each field precedes a character count bytein binary format as described above Including that one byte the maximum length of a field is 255 bytes The following FIELD statement defines a record which occupies a 28 byte memory area 13 5 10 bytes for data and a 3 byte memory area for three character count bytes Totally this record occupies not a 28 byte area but a 31 byte area in the memory FIELD 2 13 AS bardat 5 AS keydat 10 AS dt 11 13 1 5 1 10 31 When a data fileis transmitted according to thePDT 1100 protocol thefollowing conditions should be also satisfied A record is made up of a maximum of 16 fields Themaximum length of a field is 254 bytes excluding a character count byte Data File Management by Directory Information The Interpreter manages data files using the directory information stored in the
134. below and returns the remainder Syntax expressionl MOD expression2 where one or more spaces or tab codes precede and follow the mop If these expressions include real values the mop first rounds them off to integers and then executes the division operation For example the mop treats expression 8 MOD 3 4 aS 8 MOD 3 and return the remainder 2 Overflow and Division by Zero Arithmetic overflow resulting from an operation or division by zero causes an execution error Such an error may be trapped by error trapping 6 3 M PDT 1100 Terminal Programmer s Guide S Relational O perators A relational operator compares two values and returns true 1 or false 0 Use the operation result to control the program flow Relational operators include the following Relational O perators M eanings Examples Equal to A B lt gt or gt lt N ot equal to A lt gt B lt Less than A lt B gt Greater than A gt B lt or lt Less than or equal to A lt B gt or gt Greater than or equal to A gt B If an expression contains both arithmetic and relational operators the arithmetic operator has priority over the relational operator Logical O perators A logical operator combines multiple tests and manipulates Boolean operands then returns the results For example it controls the program execution flow and tests the value of an INP function bitwise as shown below IF d lt 200 AN
135. ccoccnn ett tees 4 1 Program Line Length and M aximum Number of Lines ccc c eee eee eee eens 4 3 Usable Characters 2 cic ee ee eee ene een tent e tenes 4 3 Special Symbols and Control CodeS sssaaa saana 4 4 Lin a A a tl 4 6 Rules for naming labels ooooocooccoococr 4 6 Contents AA A O E AE EA AEEA ATANA 4 7 Rules for Naming Identifiers 00 ke rr 4 7 Reserved Words iei iie e A A W ace etal Sb ANd wads A aed ace Aia 4 7 Chapter 5 Data Types Constan tSu sina Sok a e ei SD a eich Se aN 5 1 String CONS eves ieee tate ea A A donde naka tedden dt Be 5 1 Numeric Constants wenden beecs Gave peed hee ee A oe Nd Eee 5 1 A OE 5 3 Types of Variables According to Format ccc cece ee a 5 3 Classification of Variables 0 0 ce tees 5 5 User defined FUNCtIONS ss gcc cee fe eee Ve ee ee de eu ee ya Ved ob ea din OE be 5 6 Setting Character String Length of Character Functions 00 0 cece eee eee eee 5 6 Dummy Arguments and Real Arguments 0 00 cee cette tees 5 7 TYPEC ON VEO in Semana AA wales Satna ea tears eS eck deo 5 7 Type Conversion Examples 0 ccc eae 5 8 Chapter 6 Expressions and Operators OVER VIGWE a a O RS RB eat es EA alga pte Ea sei do Pan 6 1 Operator Precedence scans reeves dhs See be Owe eek pee Wik eee a ee ue ys 6 1 Precio Ei ime ection WAG a tiny RAR A ae 6 1 MU A RN 6 3 Arithmeti Operators iii A A e ant aan ea O 6 3 Relational OperatorS o ocooccccccrrr
136. ce O ptical interface Direct connect interface Default interface Supports RS and CS Does not support RS and CS Communications device file name COM1 COM2 COM The default interface is an interface selected on the SET COM menu in System M ode For details refer to the PDT 1100 User s M anual ThePDT 1100 cannot open the optical interface and the bar code device file concurrently If you attempt to open them concurrently an execution error occurs com may be in lowercase as shown below OPEN Y 10 96 AS 8 Statement Reference baud The optical interface uses one of the following baud rates 115200 57600 38400 19200 9600 default or 2400 The direct connect interface uses one of the following baud rates 38400 19200 9600 default 4800 2400 1200 600 or 300 parity parity is a parity check This can be n none default even or o odd charalength charalength isa character length or the number of data bits and it can 8 default or 7 bits stopbit stopbit is the number of stop bits and can be 1 default or 2 bits RS CS RS CS enables or disables the RS CS control It can be 0 default 1 2 3 or 4 corresponding to the following functions Value of RS cs PDT 1100 Optical I F Direct connect I F 0 Ignored 1 Ignored 2 Ignored High RD is regarded as a high CS 3 Ignored Low RD isregarded as high CS 4 Ignored CS cont
137. cified register string variable is greater than its string length error 83 missing No closing parenthesis follows subscript error 84 missing No closing square bracket follows stringlength error 90 missing No opening brace precedes the initial value Execution Error Error Code M eaning 09h Subscript out of range an array referred to is different from a defined array in dimension Examples Example 1 Valid perrec statements DEFREG a e DEFREG b 100 c 10 d 2 4 10 DEFREG resis DEFREG a 2 1 2 DEFREG a 2 1 3 DEFREG a 2 3 DEFREG b 1 1 1 2 DEFREG b 1 1 1 2 DEFREG b 1 1 1 2 Example 2 Position of elements in an array DEFREG a 1 1 1 3 The elements of the above array have the following initial values M o p oP a Je ol w wW O O e 10 27 T PDT 1100 Terminal Programmer s Guide s DEFREG b 1 1 3 1 123 The elements of the above array havethe following initial values w w ovis Ww Example 3 perrec statements causing syntax errors DEFREG c 2 1 2 3 4 DEFREG d 2 1 2 DEFREG e 1 1 1 2 DEFREG 1 1 1 2 Reference Statements DIM 10 28 Statement Reference DEF FN Single line form Statement Name DEFine FuN ction Type User created Function Definition Statement Definition N ames and defines a user created function Syntax
138. cify the maximum stringlength If its specification is omitted the default value of 40 characters takes effect dummyparametex Which corresponds to the variable having the same name in the function definition expression is a local variable valid only in that expression Therefore if a variable having the same name as dummyparameter is used outside DEF FN statement or used as a dummyparameter of any other function in the same program it is treated independently expression describes some operations for the user defined function It should be within one program line including definition described left to the equal sign expression Can call other user defined functions You can nest DEF FN instructions to a maximum of 10 levels If variables other than dummyparameter s are specified in expression they is treated as global variables whose current values are available stringlength should be enclosed with a pair of square brackets FN functionname Calls a user defined function 10 30 Thenumber of realparameters should be equal to that of dummyparameters and the types of the corresponding variables used in those parameters should be identical If you specify a global variable in realparameter when calling a user defined function the user defined function cannot update the value of the global variable because all realparameters are passed not by address but by valu
139. ck dot The port number gives the dot column address If you use the out statement to send graphic data to the VRAM area assigned to the bottom line of the LCD when the system status is displayed on theLCD the data is written into that VRAM area but cannot be displayed on the bottom line of the LCD 10 Refer to APLINT PD 3 Program File on page H 7 11 If the backlight function is activated with the our statement the key statement specification is ignored For details refer to Appendix I Backlight Function If you set 0 to theON duration 6021h the backlight does not come on if you set 255 it stays on 12 You can set the time the power key must be held down to power off the PDT 1100 from 0 1 to 25 5 secondsin increments of 0 1 second The default is 5 0 5 second 13 Use the xF ILE statement to set the communications protocol type for transmitting files To transmit files via the direct connect interface or via the optical interface using the CRD 1100 set this port to 0 PDT 1100 protocol To transmit files between the PDT 1100 and IrDA compliant equipment e g personal computers having an IR interface port or an IrDA adapter or between the PDT 1100 and CRD 1100 optically set this port to 1 PDT 1100 Ir D 6 1 0 Ports protocol For the details about the communications protocols refer to the PDT 1100 Terminal Product Reference G uide 14 Y ou may set the PDT 1100 s ID number to be used for the PDT 1100 Ir protocol ThelD
140. connect interface 8 9 10 95 Displaying the System Status 7 2 Downloading the user program 2 2 DEIS et A ae tee este te ka 1 2 E END spatial godt oda E 10 40 BORD rea ed oa 11 16 ERASE sra ada DE 10 41 Error Codes and Error Messages A 1 error control statement 10 118 ON ERRORGOTO 10 78 Error Trapping saunaa aaa 9 1 9 3 error handling function 11 18 11 19 Error Event Trapping sssaaa 9 1 Error Event H andling Routines 3 1 establishment of data link M 10 M 26 ETA a a Ste 11 20 Event Polling cece eee 9 1 Event of Keystroke Trapping 9 1 Executing a User Program 2 17 Executing the user program 2 3 Execution Errors 00 0 eee eee eee A 1 Expressions and Operators 6 1 Extension Programs 00 1 2 F Fatal Errors ira ac A 3 fatal errors uuu ee 2 12 FIELD aiea tri 10 43 file 1 0 function ER hk Pte e ce E 11 16 INPUTS coso 11 28 LOG iin ata aaa 11 35 LOF rra ts a da 11 37 SEAR CH aaa aa 11 45 file 1 O Statement OPEN BAR oie 10 87 file 1 O statement GUILE orero resa a aa aii 10 13 CLOSE E E E AE 10 15 FIELD 25 as oa dai 10 43 A E E EEE 10 48 INPUT Y Ces ete arate ea 10 58 KILL Li de 10 68 LINE INPUT Foo ic 10 74 OPEN uta 10 84 OPEN COM cee eee 10 95 PRINTF sd fant dc 10 106 RUT others tect RR E E 10 111 SINCLUDE aaa ds
141. cter attribute does not change Execution Error Error Code M eaning 02h Syntax error 05h Parameter out of the range 10 122 Statement Reference SELECT CASE END SELECT Statement Name Select Case End Select Type Flow Control Statement Description Conditionally executes a statement block depending upon the value of an expression Syntax SELECT conditionalexpression CASE testl statementblock CASE test2 statementblock CASE ELSE statementblock END SELECT where conditionalexpression test1 and test2 A numeric or string expression Notes This instruction executes one of the statementblocks depending upon the value of conditionalexpression according to the steps below 1 SELECT evaluates conditionalexpressionand compares it with tests sequentially to look for a match 2 Whena match is found theassociated statementblock executes and passes control to the first statement following the END SELECT If no match is found the statementblock following the CASE ELSE executes and passes control to the first statement following the END SELECT If you include no CASE ELSE control passes to the first statement following the END SELECT 10 123 TO PDT 1100 Terminal Programmer s Guide Ifthe sELECT statement block includes morethan one case statement containing the same value of test only the first CA
142. d IDs Abnormal Termination Figure M 28 Abort of Phase 2 Phase 3 Release of Data Link N ormal phase 3 T he sending station transmits a sequence of DLE EOT and IDs to the receiving station W hen a sequence of DLE ACK and IDs is received from the receiving station the sending station terminates the message transmission normally and releases the data link Sending Receiving Station DLE EOT and IDs eri DLE ACK and IDs Normal Termination Figure M 28 Normal Phase 3 M 32 Communications Phase 3 with iterated transmission of DLE EOT and IDs due to no response or invalid response If the sending station receives no response or an invalid response from the receiving station after a sequenceof DLE EOT and IDsissent it resends the sequence every 0 5 seconds up to 60 times If the sending station receives a sequence of DLE ACK and ID s before sending the sequence of DLE EOT and IDs 60 times it terminates the message transmission normally and releases the data link Sending DLE EOT and IDs 1 Receiving Station Station 0 5 second ee dd ag DLE ACK and IDs Normal Termination Figure M 29 Phase 3 with RepeatedT ransmission of DLE EOT and IDs Abort of Phase 3 If the sending station receives no sequence of DLE ACK and IDs from the receiving station within 0 5 seconds after the 60th sequence of DLE EOT and IDs it aborts
143. de S AND Operator The ax operator AN Ds the same order bits in two expressions on either side of the operator then sets 1 to the resulting bit if both bits are 1 Syntax expressionl AND expression2 Table 6 2 TruthT able for anp Bit in Expression1 Bit in Expression2 Resultant Bit 0 0 0 1 0 1 0 1 1 1 1 OR Operator The or operator ORs the same order bits in two expressions on either side of the operator then sets 1 to the resulting bit if at least one bit is 1 Syntax expressionl OR expression2 Table 6 3 TruthTable for or Bit in Expression1 Bit in Expression2 Resultant Bit 0 0 0 0 1 1 1 0 1 1 1 1 6 6 Expressions and Operators XOR Operator The xor operator X ORs the same order bits in two expressions on either side of the operator then sets the resulting bit according to the truth table below Syntax expressionl XOR expression2 Table 6 4 TruthT able for xor Bit in Expression1 Bit in Expression2 Resultant Bit 0 0 0 1 1 1 0 1 1 1 0 Function O perators Thefollowing two types of functions are availablein BASIC 3 0 and work as function operators Built in Functions Already built in BASIC 3 0 e g ass and INT User Defined Functions Defined by DEF Fn statements in single line or block form String O perators A character string operator may concatenate or compare character strings Following are the types
144. de 6 3 optical interface 8 9 10 95 OR Operator cece ee eee 6 6 OWT se hc A O Rae as 10 99 OUT Statement 0 00 0 7 11 Program Chaining Program Line Length and M aximum N umber of Lines Program Structure program text format Programming N otes protocol functions reading confirmation Register Variables Relational O perators release of data link Required Hardware Reserved Words Reversing Characters 0 oo oooooo o SELECT CASE END SELECT service information Index Setting Character String Length of Character Functions 5 6 Setting up the Compiler 2 6 Small Font PatternS o o o ooo o C 4 Software ooo 2 2 software SITUCLU o ad heal ney eect 1 1 SO e tl as rae 11 47 Source Programs Writing a source program 2 4 Space Characters ccc eee eee G 1 Statement saiia ai sos Mes are ee eS 4 2 Statement BlockS cee eee eee 3 1 Statement Reference 0 4 10 1 Statements Declarative Statements 4 2 Executable Statements 4 2 String Constants ooocooocccocoo o 5 1 String function oooooocococo ooo 11 4 ASE 11 3 CHRD GOTS estaa ai ada a 11 6 CHAS radares 11 9 HEX S at Sian 11 24 INST Rocosas tig ea 11 30 EERI Site cei tiie tec ties tg lnea pense ps 11 33 LEN ade dE roo este 11 34 MIDS ita dla 11 41 RIGHTS corra da 11 44 STARS a A 11 49 MAIS a el e E de 11 56 String Variabl
145. der one of the text control characters which indicates the start of data text in the PDT 1100 protocol when a data file is transmitted by an XFILE instruction For the PDT 1100 protocol refer to the PDT 1100 User s M anual e STxs is called a protocol function e Theinitial value of a header STX is 02h Syntax 2 STXS returns the current value of a header 11 51 T PDT 1100 Terminal Programmer s Guide Execution Error Error code M eaning OFh String length out of range stringexpression is more than a single byte Reference Statements XFILE and OPEN com Functions ETXS and SOHS 11 52 Function Reference TIMES Function Name TIME Type I O Function Description Returns the current system time or wake up time or sets a specified system time or wake up time Syntax Syntax 1 Retrieving the current system time or the wake up time TIMES Syntax 2 Setting the current system time or the wake up time TIMES time where time A string expression Notes Syntax 1 Retrieving the current system time TIMES returns the current system time as an 8 byte string The string has the format below hh mm ss where hh is the hour from 00 to 23 in 24 hour format mm is the minute from 00 to 59 and ss is the second from 00 to 59 Example CLS PRINT TIMES Retrieving the wake up time TIMES returns the wake up time as a 5 byte string The string has the format below
146. diately follows LINE INPUT Reference Statements INPUT and LOCATE Functions INKEYS and INPUTS 10 73 T PDT 1100 Terminal Programmer s Guide LINE INPUT Statement Name Line Input Type Filel O Statement Description Reads data from a device 1 0 fileinto a string variable Syntax LINE INPUT filenumber stringvariable where filenumber A numeric expression which returns a value from 1 to 16 stringvariable A string variable Notes LINE INPUT reads data from a device I O file a communications device file or bar code device file specified by filenumber and assigns it to stringvariable filenumber isa number assigned to the device I O file when it was opened A LINE INPUT statement cannot assign a numeric variable an INPUT statement can A LINE INPUT instruction reads all of the string literals preceding a CR code in a communications device file and assigns them to stringvariable The instruction does not read CR codes and LF codes which immediately follow a CR code If a LINE INPUT instruction reads data longer than the allowable string length before reading a CR code it ignores the overflowed data and completes execution with no execution error A LINE INPUT instruction reads the scanned data from a bar code device file into stringvariable If a LINE INPUT instruction reads data longer than the allowable string length it ignores the overflowed data and completes execution with no ex
147. directory of the hard disk 4 Create an appropriate group BHT_TOOL for example in Program M anage and then specify the program item icon BHTC3W that represents the BASIC 3 0 Compiler BHT_TOOL MA Ef BHTCS w 36099002 eps Figure 2 1 BHT TOOL group 2 6 Starting the Compiler In Program Manager doubleclick the program item icon BHTC3W intheBHT_TOOL group The main window BASIC Compiler for Win appears ES carpinteria Ia From the File menu choose the Select File command to select a file to be compiled or execute the selected file From the Compile menu choose the Compiling O ptions or Run command to setthe options or execute the Compiler Development Environment and Procedures From the Help menu display the version o the BASIC 3 0 Compiler From the Editor menu choose the Set Editor or Edit command to select the editor you want to run or start the selected editor Menu bar Tool bar The tool bar contains the tool buttons which enable you to quickly carry out the functions by clicking them EN Immediately executes the Compiler if a filename is specified If no filename is specified you cannot choose this button EJ Starts the editor selected by the Set Editor command in the Editor menu O pens the Select File dialog box Reading in the Initialization File At start up Windows based Compiler reads in the initialization file named Batc3w INI from the direct
148. dividually in the PDT 1100 Functions Definitions CHKDGTS Returns a check digit of bar code data EOF Tests whether the end of a device I O file has been reached INPUTS Returns a specified number of characters read from the keyboard or from a device file LOC Returns the current position within a specified file MARKS Returns a bar code type and the number of digits of the bar code K 6 Quick Reference for Statements and Functions Manipulating Data Files and User Program Files Statements Definitions CLFILE Erases the data stored in a data file CLOSE Closes file s FIELD Allocates string variables as field variables GET Reads a record from a data file KILL Deletes a specified file from the memory OPEN Opens a file for I O activities PUT Writes a record from a field variable to a data file Functions Definitions LOC Returns the current position within a specified file LOF Returns the length of a specified file SEARCH Searches a specified data filefor specified data and then returns the record number where the search data is found K 7 S MA PDT 1100 Terminal Programmer s Guide Communicating with Communications Devices Statements Definitions CLOSE Closes file s INPUT Reads data from a device I O file into specified variables LINE INPUT Reads data from a device 1 O file into a string variable
149. dling routine return the same values 38A4h and 34h respectively Refer to Execution Errors on page A 1 Note After handling trapped errors by the error handling routine do not usethe Resume statement to pass control back to the main routine with the different stack level The return address from the user defined functions or sub routines are left on the stack causing an execution error due to stack overflow To prevent this transfer control to the routine which caused the interrupt in order to match the stack level then jump to another desired routine Programming for Trapping Errors To trap errors use the on ERROR GoTo statement to designate the error handling routine to which control is to be transferred if an execution error occurs by the label ON ERROR GOTO err01 ain routine 9 3 M PDT 1100 Terminal Programmer s Guide S err 01 Error handling routine PRINT NAY OPON KAX PRINT ERR HEXS ERL RESUME NEXT If an execution error occurs in the main routine the above program executes the error handling routine specified by label err01 in the ox error coro statement In the error handling routine the ERL and Err functions pinpoint the address where the error occurred and the error code respectively Note According to the error location and error code troubleshoot the programming error and correct it for proper error handling The resume statement may pass control from the error handli
150. ds no syntax error in the source program it translatesthe program into the intermediate language Interpreter The Interpreter which resides in the memory of the PDT 1100 interprets and executes the user program downloaded to the PDT 1100 statement by statement Compiling and Interpreting Example For example how will a short program consisting of only two statements cis and END be compiled downloaded and executed Source Program Example CLS END 1 TheCompiler compiles each of the cis and eno statements into a two byte character string in the intermediate language in an M S DOS disk file In this example the total four byte string is composed of 83 and 87 whose program is 8387 The compiled program should consist of ASCII characters text 0 9 and A F 2 Theuser downloads the four byte string 8387 using Transfer Utility C Upon receipt of thestring the PDT 1100 packs each two bytes into a single byte hexadecimal format 83h and 87h 3 Thelnterpreter interprets the first 83h as a CLS statement and 87h as an END statement 1 5 M PDT 1100 Terminal Programmer s Guide S 1 6 Chapter 2 Development Environment and Procedures Overview of Development Environment Thefollowing hardware and software are required for developing user programs Required Hardware A Windows personal computer with an RS 232C interface and at least 640 kilobyte RAM area is required When the Compiler is running at le
151. e Call by value Syntax Error Statement Reference W hen defining a user defined function Error Code and M essage error 61 Cannot use DEF FN in control structure error 64 Function redefinition error 65 Function definitions exceed 200 error 66 Arguments exceed 50 error 71 Syntax error M eaning The per FN statement is defined in other block structured statements such as For and iF statements Same function name defined twice funct ionname is an integer function name but expressionis a real type if functionname is a real function name and expression s an integer type no error occurs stringlength is out of range stringlength is not an integer constant When calling a user defined function Error Code and M essage error 68 Mismatch argument type or number error 69 Function undefined M eaning Thenumber of real parameters is not equal to that of the dummy parameters dummyparameter was an integer variable in defining a function but realparameter is a real type in calling the function if dummyparameter Was a real variable in defining a function and realparameter is an integer type then no error occurs Calling of a user defined function precedes the definition of the user created function 10 31 T PDT 1100 Terminal Programmer s Guide Execution Error Error Code M eaning 07h Insufficient memory space DEF FN instructions nested to more than 10 levels OFh
152. e Characters as Padding Characters A data file can be downloaded with System M ode or an xrtLE statement via a communications protocol which eliminates space characters padded in the tail of each data field The PDT 1100 has a new feature which treats such space characters as data For details refer to the end of this appendix The following figure shows how the space characters used as padding characters are eliminated Space characters between a and b and between b and cin field 3 are not padding characters G 1 a PDT 1100 Terminal Programmer s Guide Host Computer Field 1 Field 2 Field 3 1 2 3 4 A B C D a b C LI pes pay pe peajes denotes a space character Downloading a data file PDT 1100 Field 1 Field 2 Field 3 BE 1 EJs 1 Pj y s Y L Led 3 A A B C D a ad post O is the count byte of a significant data length in a field 36099022 eps Figure G 1 Padding Characters Elimination Space Characters as Data Special considerations must be made when treating space characters in the tail of a data field as data not as padding characters To usea search function to search for a field data containing space characters in its tail for instance use one of the following methods Handling Space Characters in Downloading Example 1 After downloading a data file fill the unused spaces in each field w
153. e IF statement which is not supported in BASIC 3 0 Morecomplex conditions can be tested since an IF statement block can contain more than one line for describing conditions You can describe as many statements or statement blocks as you want Sinceitis not necessary to put more than one statement in a line you can describe easy to read programs according to the logical structure making correction and debugging easy You can use ENDIF instead of END IF Syntax Error Error Code and Message Meaning error 26 too many nesting levels error 50 Incorrect use THEN iS missing of IF THEN ELSE END LE error 51 Incomplete END IF is missing control structure Example k INKEYS IF k lt gt THEN PRINT k END IF Reference Statements ON GOTO ON GOSUB DEF FN END DEF FOR NEXT SELECT CASE END SELECT and WHILE WEND 10 54 Statement Reference INPUT Statement Name Input Type I O Statement Description Reads input from the keyboard into a variable Syntax INPUT prompt variable where prompt A string constant variable A numeric or string variable Notes When execution reaches an INPUT instruction the program waits for the user to enter data from the keyboard and shows a prompting message specified by prompt After entering data press the ENT key Then the INPUT instruction assigns the typed da
154. e Information If you havea problem with your equipment contact the Symbol Support Centers Before calling havethe model number serial number and several of your bar code symbols at hand Call the Support Center from a phone near the scanning equipment so that the service person can try to talk you through your problem If the equipment is found to be working properly and the problem is symbol readability the Support Center will request samples of your bar codes for analysis at our plant If your problem cannot be solved over the phone you may need to return your equipment for servicing If that is necessary you will be given specific directions Note Symbol Technologies is not responsible for any damages incurred during shipment if the approved shipping container is not used Shipping the units improperly can possibly void the warranty If the original shipping container was not kept contact Symbol to have another sent to you Symbol Support Centers For service information warranty information or technical assistance contact or call the Symbol Support Center in United States Symbol Technologies Inc One Symbol Plaza Holtsville New York 11742 1300 1 800 653 5350 United Kingdom Symbol Technologies Symbol Place Winnersh Triangle Berkshire RG41 5TP United Kingdom 0800 328 2424 Inside UK 44 208 945 7529 Outside UK Canada Symbol Technologies Canada Inc 2540 M atheson Boulevard East M ississauga O
155. e defined Y ou can specify a subscript ranging from 0 to 254 for an array variable e Thetotal variable data size which can be passed between chained programs is 6 kilobytes including work variables Thesizeof an array data is equal to the element size multiplied by the number of elements You can specify the maximum string length within the rangefrom 1 to 255 to a string variable Thedefault length of a non array string variable is 40 Thedefault length of an array string variable is 20 10 18 Statement Reference Syntax Error Error Code and Message Meaning error 5 Variable name A same variable name is declared twicein a program redefinition error 73 Improper The length of a string variable is out of therange from 1 to 255 string length Execution Error Error Code M eaning 07h Insufficient memory space common statement defines too much data Example COMMON a b c d 2 3 e 4 5 Reference Statements CHAIN 10 19 T PDT 1100 Terminal Programmer s Guide CURSOR Statement Name Cursor Description Turns the cursor on and off Syntax CURSOR ON OFF Notes Type 1 0 Statement When a user program is initiated the cursor is set to OFF CURSOR ON turns on the cursor for keyboard entry operation by the INKEYS function CURSOR OFF turns off the cursor Thecursor size depends upon the screen mode the single byte AN K mode or two byte Kanji mode and the display fo
156. e type data file communications device file or bar code device file 37h File already open an OPEN instruction executed for the already opened file 38h File name is different from that in the receive header 39h Too many files 3Ah File number out of range 3Bh The number of records is greater than the defined maximum value 3Ch FIELD overflow FIELD instruction specifies the record length exceeding 255 bytes 3Dh FIELD statement specifies a field width which does not match that specified in file creation 3Eh PUT Or GET instruction executed without a FIELD instruction 3Fh Bad record number record number is out of range A 2 Error Codes and Error Messages Table A 1 Execution Errors Continued Error Code M eaning 40h Parameter not set ID not set 41h File damaged 42h File write error writing onto a read only file attempted 43h Not allowed to access data in flash RO M 45h Device files prohibited from opening concurrently 46h Communications error 47h Abnormal end of communications or termination of communications by Clear key 48h Device timeout n o CS signal has been responded within the specified time period Fatal Errors Table A 2 lists the fatal errors and their meanings Table A 2 Fatal Errors Error Code M essage fatal error 1 Out of memory fatal error 2 Work file1 O error fatal error 3 Object file 1 O error fata
157. e until the entered bar code data is read out from the bar code buffer Continuous reading mode c OPEN BAR C AS 7 CODE war ThePDT 1100 turns on the illumination LED until the bar code device file is closed regardless of the trigger switch While the illumination LED is on the PDT 1100 can read a bar code Once a bar code is read successfully the PDT 1100 cannot read the next bar code until the entered bar code data is read out from the bar codebuffer In each read mode when a bar code is scanned successfully the reading confirmation LED illuminates green for 500 ms unless the reading confirmation LED is deactivated The read bar code data is decoded and transferred to the bar code buffer The trigger switch function is assigned to the M keys If readmode is omitted the PDT 1100 defaults to the auto off mode LEDcont rol and beepercont rol The OPEN BAR statement can activate or deactivate the reading confirmation LED and beeper when a bar code is read successfully Describeparameters of readmode LEDcont rol and beepercont rol with no space in between readmode LEDcontrol and beepercont rol may be described in any order To deactivate the reading confirmation LED when a bar code is read successfully OPEN BAR L AS 7 CODE A To sound the beeper when a bar code is read successfully OPEN BAR B AS 7 CODE A readcode ThePDT 1100 supports the following bar codes
158. ecified Improper file type i1enumber of a file other than communications device files specified File number out of range OPEN 10 107 D PDT 1100 Terminal Programmer s Guide PRINT USING Statement Name Print Using Type O Statement Description Displays data on the LCD screen under formatting control Syntax Syntax 1 Displaying numbers PRINT USING numericformat expression CR LFcont rol expression Syntax 2 Displaying strings PRINT USING stringformat stringexpressionl CR LFcontrol stringexpression where numericformat a decimal point and or stringformat I and or amp CR LFcontrol A comma or a semicolon Notes PRINT USING displays a number or a character string specified by expression or stringexpression ON the LCD according to a format specified by numericformat or stringformat respectively To extend one program line to more than 512 characters in a single PRINT USING statement use an underline _ preceding a CR code instead of a comma numericformat is a formatting string consisting of decimal point and or each of which causes a special printing effect as described below Represents a digit position If the number specified by expression has fewer digits than the number of digit positions specified by it is padded with spaces and right justified 10 108 Statement Reference Statement example PRINT USING
159. ecution error Undefined letters if specified in protocolspec are ignored The specifications below produce the same operation The last timeout value becomes active RSPMT1 R S P M T 1 m p S 1 m t 1 ABCDEF GHIJKLMNOPORSTUVWXYZ1 10 133 T PDT 1100 Terminal Programmer s Guide s WAN 53462 WA If you transmit a data file with the same name as another file in the receiving station the new file replaces the old when the field structure is matched an execution error occurs when the field structure is not matched To receive a data file with the same name at the PDT 1100 delete the old file beforehand e Press the Clear key during file transmission to abort the execution of the XFILE instruction This issues an EOT code and displays an execution error 10 134 Statement Reference Syntax Error Error Code and Message Meaning error 3 missing No double quote precedes or follows filename or drivename filename error 71 Syntax error filename Of drivename filename is not enclosed in double quotes Execution Error Error Code M eaning 02h Syntax error filename is not correct 07h Insufficient memory space during file reception the memory runs out 32h File type mismatch the received file is not a data file 33h Received text format not correct 34h Bad file name or number filename of an unopened file specified 35h File not found 37h File already open 3
160. ecution error If the maximum number of digits is omitted in the read code specifications of the OPEN BAR statement except for the universal product codes then the INPUT 10 74 Statement Reference instruction can read bar codes of up to 99 digits To read bar codes of 40 digits or more define a sufficient string variable length beforehand Syntax Error Error Code and Message M eaning error 71 Syntax error INPUT is missing filenumber is missing prompt is not a string constant stringvariable has a numeric variable Execution Error Error Code M eaning 34h Bad file name or number i1enumber of an unopened file specified 36h Improper file type i1enumber of a file other than device I O files specified 3Ah File number out of range Example LINE INPUT f ileNo dat Reference Statements INPUT OPEN BAR OPEN com and CLOSE Functions INPUTS 10 75 D PDT 1100 Terminal Programmer s Guide LOCATE Statement Name Locate Description M oves the cursor to a specified position and changes the cursor shape Syntax Syntax 1 LOCATE column l rom cursorswitch Syntax 2 LOCAT Notes E cursorswitch where column row cursorswitch Type 1 0 Statement Standard size font Small font A numeric expression which returns a valuefrom 1 to 17 A numeric expression which returns a val
161. ed handshaking or data link establishment phase The sender sends a control code EN Q 05h to inquire if the receiver is ready to receive data and the receiver replies with a control code ACK 06h positive or NAK 15h negative to start data transmission Vertical Parity A vertical parity bit is a redundancy bit added to every character to be transmitted to check that data has been transmitted accurately The parity bit should be set to 1 or 0 depending upon the parity parameter setting to make the number of set bits in the character even or odd The receiver counts the number of set bits in the transmitted character code to Communications make sure that it has the selected number even or odd of set bits The vertical parity bit immediately follows the M SB M ost Significant Bit as shown below LSB MSB Vertical Parity Bit LSB MSB bO b1 b2 b3 b4 b5 b6 o7 Vertical Parity Bit 35864051 eps Figure M 2 Vertical Parity BCC for Horizontal Parity Checking ThePDT 1100 supports horizontal parity checking for every transmission block to check data transmission A horizontal parity byte called BCC Block Check Character is appended aftertheETX of every transmission block Every parity bit of BCC is set so that all set bits at the same bit level including a parity bit in the transmission block characters have an even number by binary addition excluding SOH STX and f
162. ed 1 Activated 1 Initiation of PDT 11007 0 Initiated by the 1 Initiated by the Power Key wake up function 2 TIMES function 0 System time 1 Wake up time selected selected Eh 0 ad Status Indication gt 0 OFF 1 0N Fh 7 0 Reread prevention 0 to 255 enabled time 10h 24Fh 7 0 VRAM 310 0 OFF 1 0N 6010h 7 0 Battery voltage level 11 0 to 255 6011h 0 Battery type 0 NiMH battery 1 Dry batteries cartridge 6040h 0 M Keyl 0 Released 1 Held down 6040h 1 M Key2 0 Released 1 Held down 6060h 7 0 Communications protocol 0 PDT 1100 1 PDT 1100 Ir 12 protocol protocol 6061h 7 0 ID lower byte 13 0 to 255 6062h 7 0 ID upper byte 3 0 to 255 6070h 0 Output pulse width of IR 0 1 63 us 1 3 16 bit time beam 6080h 0 Display font size 14 0 Standard size 1 Small size 1 BASIC 3 0 represents the bit order by the exponent of each binary digit in the byte For example bit 0 means LSB bit 7 means M SB 2 Only when the trigger switch function is assigned to an M key M1 M2 M3 orM4 a user program returns the ON OFF state of the switch D 2 1 0 Ports 3 During the direct connect interface operation a user program regards RD signal as CS signal when the returned value of CS is specified by RS CS control parameter in the OPEN COM statement as listed below OPEN COM statement Returned value of CS CTS OPEN COM 0 Always 1 OPEN COM 1 Always 1 OPEN COM 2 1 if RD sig
163. eee ee eee M 4 Ir Transfer Utility C o o o o o 2 16 1 0 Facilities oooooooomom 7 1 1 0 function COUNTRY 00 00 eee 11 11 CSREING acosino susie daly ainda 11 13 DATES ete arabe AS aoe a 11 14 ERX cuneate eee 11 20 INKEY nda ot erates 11 25 INP cise ictew a ae 11 26 MARKS ot eae atte dies 11 39 PO Sv aa 11 43 A sen 11 47 SUX cack cta eae 11 50 TIMEA TIMEB TIMEC 11 54 TIMES o ra A eg 11 52 HO POMS say dink aod elastase aptew nding elise D 1 1 0 statement APLOAD a ania dos 10 2 BEEP ua ita ai 10 5 Cant o caos 10 17 Index 3 S CURSO Ri setts add den 10 20 INPUT sacs tono in pinat re pe 10 55 OEY a Rica 10 61 KEY ON and KEY OFF 10 66 LINE INPUT occ 10 72 LOCATE ia ad od 10 76 ON KEY GOSUB 10 82 DU A E AE da 10 99 POWER uta rato bases 10 101 PR Tica taa 10 103 PRINT USING 10 108 READ cosa dar ee 10 113 RESTORE oc lets epa aeg 10 117 SCREEN ir eae 10 121 WAI aea ad ai 10 126 X PILE io a is 10 130 K EN oca 10 61 10 66 Key Number Assignment E 1 KEY ON and KEY OFF 10 66 Kel EL estates A RS 10 68 L label arni es snnss a yee kee eae dae 4 1 LCD Backlight 0 005 H 3 LCD Backlight Function 1 1 LCD Backlight Function On Off Key 7 8 LERES ot e aa coi ak 11 33 LEN lan 11 34 E a AN ARM E EA 10 70 MR cic cease tee eet 10 74 10 107 LINE INPUT ooo 10 72 LINE INPUT
164. ement or rnpuTS function can access data files To access data files use a put or cet statement The following statements and functions cannot be used for input and output into from data files Statements LSET and RSET Functions CVD CVI CVS MKD MKIS and Mks Note If the purstatement is executed for data files stored in the flash ROM an execution error error code 434 occurs 8 5 S Bar Code Device M PDT 1100 Terminal Programmer s Guide O pening the Bar Code Device by OPEN BAR Statement The open Bar statement opens the bar code device In this statement you may specify the following bar code types available in the PDT 1100 Table 8 2 Bar CodeT ypes Supported Supported Bar Code Types Default Settings Universal EAN 13 product codes FAN 8 UPC A UPC E No national flag specified Note The EAN 13 and UPC A bar codes may be wider than the readable area of the scan window For wider bars pull the scan window away from the bar code so that the entire bar code sin the illumination range of the LED N o double touch reading feature is supported Interleaved 2 of 5 ITF No read data length specified N o check digit Standard 2 of 5 STF No read data length specified N o check digit N o start stop character Standard data compression supported Codabar N W 7 No read data length specified N o check digit No start stop character
165. ent Name On Gosub and On Goto Description Branches to one of specified labels according to the value of an expression Syntax Syntax 1 ON expression GOSUB label label Syntax 2 ON expression GOTO label label where Type Flow Control Statement expression A numeric expression which returns a value from 1 to 255 Notes ON GOSUB Or ON GOTO block branches to a label in the label list according to the value of expression If expression has the value 3 for example the target label is the third in the label list f expression has the value 0 or a value greater than the number of labels in the label list executing the ON GOSUB Or ON GOTO block passes control to the subsequent statement with no execution error e You can specify any number of labels as long as a statement block does not exceed one program line 512 characters You can nest ON GOSUB instructions to a maximum of 10 levels When using the Gosus statement with block structured statements FOR NEXT IF THEN ELSE nest them to a ma ximum of 30 levels END IF SELECT CASE END S EL You can use ON GO TO instead of ON GOTO 10 80 ECT and WHILE WE IND you can Statement Reference Syntax Error Error Code and Message Meaning error 71 Syntax error label has not been defined label is missing Execution Er
166. er out of range characode is out of range Example e To output an ACK codeto a communications device file use CHRS amp HO6 The ASCII value for the ACK code is H06 PRINT 1 CHRS amp H06 e To display control codes from 8 08h to 31 1Fh refer to the program examples shown in the PRINT statement e To display double quotation marks around a string use CHRS 34 as shown bdow TheASCII value for a double quotation mark is 34 22h T PDT 1100 Terminal Programmer s Guide PRINT CHRS 34 bar code CHRS amp H22 bar code Reference Statements PRINT Functions ASC 11 10 Function Reference COUNTRY Function Name COUNTRY Type 1 O Function Description Sets a national character set or returns a current country code Syntax Syntax 1 Setting a national character set COUNTRY count rycode Syntax 2 Returning a country code COUNTRYS where countrycode A string expression a D E F G I J N S Or W Notes Syntax 1 COUNTRYS sets a national character set specified by count rycode The national character set is assigned to codes from 32 20h to 127 7Fh Refer to N ational Character Sets on page C 3 countrycode specifies one of the following national character sets count rycode N ational character set A America default D Denmark E England F France G Germany 11 11 T PDT 1100 Terminal Programmer s Guide s I Italy J Japan defa
167. er statements Semicolon TAB Separates program elements in a program line Tab code Labels A label can contain alphanumeric characters and a period Rules for naming labels 4 6 Limit label length to 10 characters including periods A program can contain up to 9 999 labels Label names do not distinguish between uppercase and lowercase letters The following labels for example are treated as the same label filewrite FILEWRITE FileWrite Do not usean asterisk or dollar sign for a label The following label examples are invalid Label0 Label1 A label consisting of only numerals is valid 1000 1230 Basic Program Elements Note Do not use a single 0 zero asa label namesince it has a special meaning in ON ERROR GOTO ON KEY GOSUB and RESUME statements A reserved word cannot be used by itself for a label name but can be included within a label name as shown below inputkey A label should not start with the character string FN Identifiers Identifiers for the names of variables should comprise the same alphanumerics as the labels Rules for N aming Identifiers Limit identifier length to 10 characters including periods and excluding dollar sign and percent sign suffixes All variables can contain up to 255 identifiers e A reserved word cannot be used by itself for an identifier name but can be included within an identifier name
168. ereal expressions for example the Interpreter converts them into integers before passing them to each function CHRS i HEXS i LEFTS x 1 MIDS x i j RIGHTS x i File Numbers The Interpreter also rounds off file numbers to integers EOF 0 LOC 0 LOF 0 5 9 M PDT 1100 Terminal Programmer s Guide S 5 10 Chapter 6 Expressions and Operators Overview An expression is a combination of constants variables and other expressions which are connected using operators There aretwo types of expressions numeric expressions and string expressions BASIC 3 0 has the following types of operators O perators Description Arithmetic operator Performs arithmetic operations Relational operator Compares two values Logical operator Combines multiple tests or Boolean expressions into a single true false test Function operator Performs the built in or user defined functions String operator Concatenates or compares character strings Operator Precedence When an expression contains more than one operator BASIC 3 0 performs the operations in the standard priority of the following Precedence 1 Parentheses Parentheses allow you to override operator precedence that is operations enclosed with parentheses are first carried out 6 1 S MA PDT 1100 Terminal Programmer s Guide To improve the readability of an expression use parentheses
169. eric expression which returns a value from 1 to 32 767 Notes PUT writes a record from a field variable s declared by the FIELD statement to a data file specified by fi lenumber filenumber is the number of a data file opened by the OPEN statement recordnumber is the record number where the data is to be placed in a data file within the range of 1 to the maximum number of registrable records i1e1ength specified by the OPEN statement when a new data file is created f recordnumber option is omitted the default record number is one more than the last record written Record numbers to be specified do not have to be continuous If you specify record number 10 when records 1 through 7 have been written for example the PUT instruction creates records 8 and 9 filled with spaces and then writes data to record 10 Iftheactual data length of a field variable is longer than the field width specified by the FIELD statement the excess is truncated from the right end column Since data in a data file is treated as text ASCII strings numeric data should be converted into the proper string form with the sTR function before being assigned to a field variable 10 111 T PDT 1100 Terminal Programmer s Guide ThePur statement cannot write data to files stored in the flash ROM B Syntax Error Error Code and Message Meaning error 71 Syntax error filenumber iS missing Execution Error Error Code
170. erminal Programmer s Guide Handling Errors Statements Definitions ON ERROR GOTO Enables error trapping RESUME Resumes program execution at a specified location after control is transferred to an error handling routine Functions Definitions ERL Returns the current instruction location of the program where an execution error occurred ERR Returns the error code of the most recent execution error Defining and Allocating Variables Statements Definitions COMMON Declares common variables for sharing between user programs DATA Stores numeric and string literals for READ statements DEFREG Defines register variables DIM Declares and dimensions arrays also declares the string length for a string variable ERASE Erases array variables LET Assigns a value to a given variable READ Reads data defined by DATA statement s and assigns them to variables RESTORE Specifiesa DATA statement location wheretheREAD statement should start reading data K 2 Quick Reference for Statements and Functions Controlling the LCD Screen Statements Definitions APLOAD Loads a user defined font in the single byte AN K mode CLS Clears the LCD screen CURSOR Turns the cursor on or off KEY Assigns a string or a control code to a function key also defines a function key asthe LCD backlight function on off key This statement also def
171. es o o oooooooooooo 5 3 Structure of a Program Line 4 1 SRA a dad trac pt 11 49 A e Ao pate A 11 50 SUDTOUtIN OS cari aa 3 1 symbol support center o o XV Syntax Errors aaau ee A 5 SYNTAX TOS ito ea ee ee 2 12 System Program BASIC 3 0 Interpreter 1 2 System ProgramS 0c eee eee 1 2 Extension Programs 1 2 System Mode 2c eee eee 1 2 Index 5 A Book Title S T Terminal setup 00 00 02 eee eee 2 16 text control characters M 6 M 23 text format o oooooooooooo M 18 M 35 TIMEA TIMEB TIMEC 11 54 Timer and Beeper onunu aaa 7 10 Timer Functions sssaaa 7 10 TIMES andara 11 52 Transmission Code 0 0ooooo oooooo oo M 2 transmission control characters M 6 M 22 transmission control sequence M 9 transmission control sequences M 25 transmission Messages o o ooooo M 7 transmission messages format M 24 transparency ee ee ee eee M 22 Type Conversion saaana 5 7 Assignment of Real Expressions to Integer Variables 5 8 File Numbers aaua 5 9 O perands for an Arithmetic Operator MOD o 5 8 Operands for Logical O perators AN D OR NOT and XOR 5 8 Parameters for Functions 5 9 U Usable Characters nunaa aaa 4 3 User Program Index 6 EXeCUION tina a a 2 17 User Programs in the Memory 3 4 user
172. etained Contents of Flash ROM Files stored in RAM are backed up by the built in rechargeable lithium battery The files may be damaged if the unit is left unused long enough for the battery voltage to drop below the specified level Unlike files stored in RAM files stored in flash ROM are retained regardless of the voltage level of the lithium battery O nce data is written onto flash ROM it is retained until deleted Wake up Function Thewake up function allows you to turn on the PDT 1100 from OFF at thewake up time of the system clock specified in user programs To set the wake up time using the TIMES function 1 Set bit 2 on port 8 to 1 to switch the TIMES function to the setting of the wake up time 2 Set the wakeup time using the rrmms function 3 Set bit 0 on port 8 to 1 to activate the wakeup function To confirm the wake up time preset 1 Set bit 2 on port 8 to 1 to switch the TIMES function to the setting of the wake up time 2 Retrieve the wakeup time using the Times function If you set or retrieve the system time or wake up time using the Times function the value of bit 2 on port 8 is reset to zero and you can set or retrieve the current system time with the TIMES function The value of bit 1 on port 8 in user programs indicates the initiation option of the PDT 1100 If this bit is 1 the unit is initiated by the wake up function if itis 0 by the PW key LED and Beeper Control Using the oren Bar
173. f the memory Syntax FRE areaspec where areaspec A numeric expression which returns a value from 0 to 3 Notes FRE returns the number of bytes left unused in a memory area specified by areaspec listed below areaspec RAM 0 Array work variable area 1 File area 2 Operation stack area for the Interpreter 3 File area in the flash ROM e Thefile area is allocated to data files and program files in cluster units where a cluster is equal to 4 096 bytes The FRE function returns the total number of bytes of non allocated clusters For details about a cluster refer to Appendix F M emory Area Theoperation stack area for the Interpreter is mainly used for numeric operations string operations and for calling user defined functions A returned value of this function is a decimal number 11 22 Function Reference Execution Error Error code M eaning 05h Parameter out of range areaspec is out of range OFh String length out of range stringexpressionis more than a single byte 11 23 T PDT 1100 Terminal Programmer s Guide HEX Function Name H EX adecimal Type String Function Description Converts a decimal number into the equivalent hexadecimal string Syntax HEXS numericexpressi on where numericexpression A numeric expression which returns a value from 32 768 to 32 767 Notes HEXS function converts a decimal number from 32768 to 32767 into the equivalent hexadecimal st
174. ference Statements ON ERROR GOTO and RESUME Functions ERL and HEXS 11 19 T PDT 1100 Terminal Programmer s Guide ETX Function Name End of Text Type I O Function Description M odifies the value of a terminator ETX for the PDT 1100 protocol also returns the current value of a terminator Syntax Syntax 1 Changing the value of a terminator TX stringexpression Syntax 2 Returning the current value of a terminator tj ETXS where stringexpression A string expression which returns a single byte character Notes Syntax 1 ETX modifies the value of a terminator a text control character which indicates the end of data text in the PDT 1100 protocol when a data file is transmitted by an xFILE instruction For the PDT 1100 protocol refer to the PDT 1100 User s M anual ETXS is called a protocol function e Theinitial value of a terminator ETX is 03h Syntax 2 ETXS returns the current value of a terminator 11 20 Function Reference Execution Error Error code M eaning 05h Parameter out of range stringexpression is a null string OFh String length out of range stringexpression is more than a single byte Reference Statements XFILE and OPEN com Functions sous and stx 11 21 T PDT 1100 Terminal Programmer s Guide Function Name FREe area Type Memory M anagement Function Description Returns the number of bytes available in a specified area o
175. ff and on restarts it Low Battery Warning If the battery voltage of dry batteries or the NiMH battery cartridge drops below the specified level the PDT 1100 displays the Replace the batteries message or Charge the battery message beeps five times and then turns off power Refer to the PDT 1100 User s M anual H 2 Programming Notes Selecting a Communications Device File ThePDT 1100 supports both optical interface and direct connect interface O nly one can be opened at a time using the open com statement OPEN COM1 AS filenumber For the optical interface OPEN COM2 AS filenumber For the direct connect interface If you designate com the default interface selected on the ser com menu in System M ode becomes active If an xrtLE instruction is executed the interface specified by theopen com statement becomes active Prohibited Simultaneous O perations To save power at peak load the beeper the LASER diodeand theLCD backlight do not work simultaneously The beeper has the highest priority the LASER diode has the next priority and the LCD backlight has the lowest priority Controlling the LCD Backlight A gey statement defines the backlight function on off key and sets the length of backlight on time Use the our statement to turn the LCD backlight on or off and set the backlight on time When theLCD backlight is activated with the our statement pressin
176. filelength Syntax 2 OPEN drivename filename AS filenumber RECORD filelength where filenumber A numeric expression which returns a value from 1 to 16 filename and drivename filename A string expression filelength An integer constant which has the value from 1 to 32 767 Notes OPEN opens a data file specified by filename and associates the opened file with filenumber for allowing I O activities according to filenumber Themaximum number of files which can be opened at onetime is 16 including the bar code device file and communications device files e filename consists of a file name and a file extension The file name should be 1 to 8 characters long Usable characters for the file name include alphanumerics a minus sign and an underline _ N ote that a minus sign and underline should not be used for the starting character of the filename Uppercase and lowercase letters are both treated as uppercase letters 10 84 Statement Reference Thefile extension can be up to 3 characters long or may be omitted It should not be PD3 EX 3 FN 3 and FLD a dat master01 dat The filename should be preceded by the drivename The drivename is A for RAM or B for flash ROM If the drivename is omitted the default A RAM applies filelength is the maximum number of registrable records in a file It can be set only when a new data file is created by an OPEN instruct
177. formation file If this option is not selected no debug information file information file is output default For details refer to the D option in the Windows based Compiler Address source Outputs an address source list to the file XX X LST If this option is not List selected no address source list is output default For details refer to the L option in the Windows based Compiler Symbol table Outputs a symbol table to the file X X X LST If this option is not selected no symbol table is output default For details refer to the S option in the Windows based Compiler 2 14 Development Environment and Procedures Table 2 2 List of Compiling Options Available Continued Compiling Description O ptions X Cross Outputs a cross reference to the file XXX LST If this option is not selected no reference cross reference is output default For details refer to the X option in the Windows based Compiler Variable size Outputs the sizes of common variables work variables and register variables to the file XXX ERR If this option is not selected no variable size is output default For details refer to the V option in the Windows based Compiler Example C gt BHTC3 prog2 V The output for this example is as follows Common XXXXX bytes XXXXX bytes on memory XXXXX bytes in file Work XXXXX bytes XXXXX bytes on memory XXXXX bytes in file Register XXXXX bytes
178. g have the following special meaning Table 4 1 Symbols and C ontrol Codes Symbols and C ontrol C odes Typical Use String suffix for variables or user defined functions Dollar sign Integer suffix for variables constants in decimal notation or Percent sign user defined functions A M ultiplication operator Asterisk Addition operator or unary positive sign Plus sign Concatenation operator in string operation Format control character in PRINT USING statement Division operator Slant Separator for date information in DATES function Decimal point Period Format control character in PRINT USING statement Subtraction operator or unary negative sign M inus sign 4 4 Basic Program Elements Table 4 1 Symbols and Control Codes Continued Symbols and Control Codes Typical Use lt Less than sign Relational operator Equal sign Relational operator Assignment operator in arithmetic or string operation User defined function definition expressions in single line form DEF FN Register variable definition expressions gt Relational operator Greater than sign A pair of double quotes delimits a string constant or a device file Double quote name amp Integer prefix for constants in hexadecimal notation which Ampersand should be followed by an H Format control character in PRINT USING statement j Init
179. g procedure by checking the number of digits entered from the keyboard e Calculate e g subtotals and totals e Support file transmission protocols or transmission procedures suitable for host computers and connected modems Download master files Support a program to transfer control to several job programs depending upon conditions BASIC 3 0 Features BASIC 3 0 is an optimal programming language to make application programs for the PDT 1100 and to enable efficient program development with the following features Syntax Similar to Microsoft BASIC BASIC 3 0 is based on the BASIC language which isthe most widely used high level language The syntax of BASIC 3 0 is very similar to that used in M icrosoft BASIC M S BASIC the practical standard of the BASICs running on personal computers over the world 13 M PDT 1100 Terminal Programmer s Guide S No Line Numbers Required Like M icrosoft Quick BASIC BASIC 3 0 requires no line number notation You can write a branch statement with a label instead of alinenumber so cut and paste functions can be used with an editor in developing source programs facilitating the use of program modules for development of other programs MS DOS Programming Environment Any MS DOS personal computer can be used to develop programs with BASIC 3 0 Advantages of the Dedicated Compiler The dedicated compiler referred to asthe Compiler hereafter checks the syntax of the ed
180. g the backlight function on off key cannot turn off the backlight Refer to KEY on page 10 61 Appendix D 1 0 Ports and Appendix Backlight Function Keyboard Keypad The keys on the PDT 1100 are not auto repeat The Shift key can be set to non lock type or lock type by selecting N onlock or Onetime on the shift key setting menu of the SET SY STEM screen in System M ode Non lock type The keypad shifts only when the Shift key is held down Lock type Once the Shift key is pressed the next key pressed is shifted and the following keys are not shifted When keys are shifted the shift key icon appears at the right end of the bottom line of the LCD if the system status indication is on Turn on the system status indication through the SET DISPLAY menu in System M ode or by using the our statement H 3 M PDT 1100 Terminal Programmer s Guide F Beeper A BEEP statement sounds the beeper at a specified frequency H z If frequency option is omitted the default frequency is 4 337 Hz Specification of 0 1 or 2 to frequency produces the special beeper effects listed below Specification to Frequency Statement example frequency 0 986Hz BEEP 0 1 1807 Hz BEEP 1 2 2711 Hz BEEP 2 When frequency is set to 0 1 or 2 or the frequency option is omitted adjust the beeper volume on the LCD when powering on the unit refer to the PDT 1100 User s M anual When frequency is set to a value other than 0 1 and 2 t
181. g variable is 20 Memory O ccupation A string variable occupies the memory space by the number of characters one bytes where the added one byte is used for the character count That is it may occupy 2 to 256 bytes If a non array string variable consisting of 20 characters is declared for example it occupies 21 byte memory space Numeric Variables A numeric variable occupies 2 bytes or 6 bytes of the memory space for an integer variable or a real variable respectively Non Array Integer Variables Format non array integer variables with an identifier followed by a percentage sign as shown below Syntax identifier Example a bcd Array Integer Variables Format array integer variables with an identifier followed by a percentage sign and a pair of parentheses as shown below Syntax identifi ery subscriptl subscript Example e 10 9 2 3 hB 1 3 wherea pair of parentheses indicates an array 5 4 Data Types Non Array Real Variables Format non array real variables with an identifier only as shown below Syntax identifier Example a bed Array Real Variables Format array real variables with an identifier followed by a pair of parentheses as shown below Syntax identifierl subscriptl subscript Example e 10 f9 2 3 h i 5 wherea pair of parentheses indicates an array Classification of Variables Work Variables Optionally declare a work variable for genera
182. gits or moreincluding start and stop characters If not this function returns a null string To check that the CD is correct pass a CD suffixed barcodedata to a CHKDGTS as shown below If the returned value is equal to the CD the CD data is suitable for the barcodedata Sample coding IF CHKDGTS a0123 a N THEN To add aCD to bar code data pass barcodedata followed by a dummy character and include start and stop characters to a CHKDGTS as shown bdow The returned value becomes the CD to be replaced with the dummy character Sample coding 1d LEN a0123a PRINT LEFTS a0123a 1d 1 CHKDGTS a01230a N RIGHTS a0123a 1 a0123 a Execution Error Error code M eaning 05h Parameter out of range cntype is out of range Reference Statements OPEN BARI 11 8 Function Reference CHR Function Name CH aRacter code Type String Function Description Returns the character corresponding to a given ASCII code Syntax CHRS characode where characode A numeric expression which returns a value from 0 to 255 Notes CHRS converts a numerical ASCII codespecified by characode into the equivalent single byte character This function sends control codes e g EN Q and ACK to a communications device file or displays a double quotation mark or other characters having special meanings in the BASIC 3 0 Execution Error Error code M eaning 05h Paramet
183. hase 2 with EOT Phase 2 with repeated EN Q transmission due to no response or invalid response If the sending station receives no response or any invalid response from the receiving station in response to a transmission block sent it resends an EN Q every 3 seconds up to nine times If the sending station receives an ACK during this time it continues the message transmission Sending Receiving Station Station Data Text m 3 seconds aa oe 3 cobs ice ee ACK Data Text m 1 35864058 eps Figure M 11 Phase 2 with Repeated ENQ Transmission Communications Abort of phase 2 If the sending station receives no ACK from the receiving station after sending an EN Q nine times in succession it sends an EOT to the receiving station 3 seconds after 9th ENQ to terminate the transmission sequence Sending i Receiving Station Station 3 seconds ENQ 1 3 seconds ees oe ENQ 9 3 seconds pe EN Bane eee Abnormal Termination Figure M 12 Abort of Phase 2 Phase 3 Release of Data Link Normal phase 3 The sending station transmits an EOT to the receiving station When an ACK is received from the receiving station the sending station terminates the message transmission normally and releases the data link Sending Receiving Station EOT Station Normal Termination 35864060 eps Figure M 12 Normal Phase 3 Phase 3 with Repea
184. he Interpreter to check bar codes with M OD 10 The check digit is included in the number of digits OPEN BAR AS 1 CODE I 6 10C Codabar NW 7 N Syntax N mini no digits max no digits startstop CD where mini no digitsand minimum and maximum number of digits for bar codes to be read max no digits by thePDT 1100 in the range of 3 to 99 If both mini no digits and max no digits are omitted the default reading range is 3 to 99 digits If only max no digits is omitted the PDT 1100 can only read the number of digits specified by mini no digits startand stop start and stop characters Each of them should bean a B c or D If a question mark is specified it acts as a wild card The start and stop characters are included in the number of digits cD acheck digit Specifying a c causes the Interpreter to check bar codes with M OD 16 The check digit is included in the number of digits OPEN BAR AS 1 CODE N 8AAC 10 91 a PDT 1100 Terminal Programmer s Guide Code 39 M Syntax M mini no digits max no digits CD where mini no digitsand minimum and maximum number of digits for bar codes to be read max no digits bythePDT 1100 in the range of 1 to 99 If both mini no digits and max no digits are omitted the default reading range is 1 to 99 digits If only max no digits is omitted the PDT 1100 can only read the number of digits specified by mini no digits cD
185. he beeper volumeis set to the maximum and is not adjustable RS CS Control ThePDT 1100 supports only the SD TX D and RD RXD lines during both optical interface and direct connect interface operations The CS CTS signal may be monitored only if you modify the cable connection and arrange the direct connect interface port 3 pole plug mini stereo jack with an open com statement so that the RD signal is regarded as a CS signal Supplemental Codes Specifying an s to the supplemental option of a readcodein an open Bar statement allows the PDT 1100 to read supplemental codes Flash ROM ThePDT 1100 incorporates a flash ROM and RAM where you can store user program files and data files The following tips help you usethe flash ROM correctly H 4 Programming Notes Storing Files To storea filein flash ROM download it from the DOWNLOAD menu in System M ode or use the xrILE statement in user programs Copy files stored in RAM into flash ROM with the file copy function activated by pressing the 1 key while holding down the SF key on the SET SYSTEM screen The user area of flash ROM is 568 kilobytes or 64 kilobytes depending upon ROM size Only the cet statement can be used for files stored in flash ROM the pur statement cannot be used Deleting Files Delete files stored in flash ROM usingthe x11 statement or the file deletion function activated by pressing the 0 key while holding down the SF key on the S
186. hed BEEP 1 2 4337 Hz H igh pitched BEEP 2 If Freguencyis set to 0 1 or 2 or if it is omitted adjust the beeper volumeon the LCD when powering on the PDT 1100 For the adjustment procedure refer to the PDT 1100 Terminal Product Reference Guide for details If you set a value other than 0 1 and 2 the beeper volume is set to the maximum and is not adjustable e Specifying a value of 3 through 61 to frequency deactivates the beeper Setting onduration to 0 deactivates the beeper Setting onduration to a value other than 0 and of fduration to 0 causes the PDT 1100 to beep continuously Setting onduration to a value other than 0 and offduration to a value other than 0 and repetitioncount to 0 deactivates the beeper The following table specifies the relationship between frequencies and the musical 10 6 scale Table 10 2 Relationship of Frequency to Musical Scale Scalel Scale2 Scale3 Scale4 Scale5 Scale 6 do 130Hz 261Hz 523Hz 1046Hz 2093 Hz 4186 Hz do 138 277 554 1108 2217 re 146 293 587 1174 2349 ref 155 311 622 1244 2489 mi 164 329 659 1318 2637 fa 174 349 698 1396 2793 fa 184 369 739 1479 2959 Statement Reference Table 10 2 Relationship of Frequency to Musical Scale Continued Scalel Scale2 Scale3 Scale4 Scale5 Scale 6 sol 195 391 783 1567 3135 sol 207 415 830 1661 3322 la 220 440 880 1760 3520
187. iates a comment A postrophe A pair of apostrophes delimits an included file name Left and right parentheses Delimits an array subscript or a function parameter Forces the order of evaluation in mathematical relational string and logical expressions C olon Separates statements Separates time information in TIME function H alf width space Separator which separates program elements in a program line N ote that a two byte full width space cannot be used as a separator CR code Terminates a program line Enter A If followed by a cr code an underline extends one program line U nderline up to 8192 characters Separates parameters or arguments Comma Line feed control character in INPUT and other statements Format control character in PRINT USING statement I Exclamation mark Format control character in PRINT USING statement 4 5 M PDT 1100 Terminal Programmer s Guide Table 4 1 Symbols and Control Codes Continued Symbols and Control Codes Typical Use File number prefix in OPEN CLFILE FIELD and other Pound sign statements Format control character in PRINT USING statement Define the initial value for an array element Braces Define the length of a string variable Square brackets Define the string length of the returned value of a string use defined function i Line feed control character in INPUT and oth
188. icensed programs delivered hereunder and to include the same on any authorized copies it makes in whole or in part The user agrees not to decompile disassemble decode or reverse engineer any licensed program delivered to the user or any portion thereof Symbol reserves the right to make changes to any software or product to improve reliability function or design Symbol does not assume any product liability arising out of or in connection with the application or use of any product circuit or application described herein No license is granted either expressly or by implication estoppel or otherwise under any Symbol Technologies Inc intellectual property rights An implied license only exists for equipment circuits and subsystems contained in Symbol products Symbol Spectrum One and Spectrum24 are registered trademarks of Symbol Technologies Inc Other product names mentioned in this manual may be trademarks or registered trademarks of their respective companies and are hereby acknowledged Symbol Technologies Inc One Symbol Plaza Holtsville New York 11742 1300 http www symbol com Contents About This Guide NotationalCONVENtIONS ustrrrtlaa ad rr a A p a xiv Servic Informatio samainen A A AE XV Symbol Support Centers 2 cise od oa oes vee eee Sada ee A E XV Related Publications ii A ee la ita whee ln de xvi Warrants RRA sti E ah a Namath tdo Xvi Warranty Coverage and Procedure 1 teas Xvi IG
189. ide Function Name LEN gth Type String Function Description Returns the length number of bytes of a given string Syntax LEN stringexpressi on Notes LEN returns the length of stringexpression that is the number of bytes in the range from 0 to 255 If stringexpressionisa null string LEN returns the value 0 11 34 Function Reference LOC Function Name LO cation Counter of file Type Filel O Function Description Returns the current position within a specified file Syntax Loc filenumber where filenumber A numeric expression which returns a valuefrom 1 to 16 Notes Loc returns the current position within a file a data file communications device file or bar code device file specified by filenumber e Depending upon thefiletype the content of the returned value differs as listed below File type Returned value Data file Record number following the number of the last record read by a cer statement Communications device file Number of characters contained in the receive buffer 0 if no data is present in the receive buffer Bar code device file Number of characters contained in the bar code buffer 0 if the PDT 1100 is waiting for bar code reading The size of the bar code buffer is 99 bytes If Loc is used before execution of the first GET instruction after a data file is opened it returns 1 or 0 when the data file has any data or no data respectively 1
190. iency and might cause fatal execution errors Avoid using coro statements if possible 3 3 M PDT 1100 Terminal Programmer s Guide S Handling User Programs User Programs in the Memory The user area of the memory RAM and flash ROM inthePDT 1100 can store more than one user program If you have selected a user program as an execution program in the Setting menu of System M ode thePDT 1100 runsthe user program when powered on For the operating procedure of System M ode refer to the PDT 1100 Terminal Product Reference G uide Program Chaining Program chaining caused by the carn statement below terminates a currently running user program and transfers control to another program CHAIN another PD3 To transfer the variables and their values used in the current calling user program to the chained to program along the program chain use the common statement as follows COMMON a 2 b c 3 CHAIN another PD3 The Interpreter writes these declared variable values into the common variable area in memory To make the chained to program refer to these values use the common statement again COMMON as 2 b c 3 In BASIC 3 0 thename type definition order and number of COM M ON declared variables used in the current calling program must match those in the next program the chained to program since they have special significance whilein M S BASIC thenames of variables may be changed
191. imum of 9 999 program lines Comment lines starting with a single quotation mark and those with a rem have the following description rules A single quotation mark can be put in from the first or the following columns or immediately following any other statement A REM should be put in the second or following columns To put a rem following any other statement a colon should precede the rem Comment CLS Comment REM Comment CLS REM Comment End the rr statement with an END IF Or ENDIF since the iF statement is treated as a block structured statement IF aS Y OR aS y then GOTO sub12 END IF The default number of characters for a non array string variable is 40 and for an array string variable is 20 Specifying the pm or pEFREc statement allows a string variable to treat 1 through 255 characters DIM b 255 DIM c 2 3 255 DEFREG d 255 DEFREG e 2 3 255 Note BASIC 3 0 does not support some of the statements and functions used in Microsoft BASIC or QuickBASIC For details refer to Appendix L Unsupported Statements and Functions 2 5 M PDT 1100 Terminal Programmer s Guide S Compiling in Windows Setting up the Compiler Set up the BASIC 3 0 Compiler on your computer to run with Windows according to the procedure given below Start Windows 2 Insert the BASIC 3 0 diskette in the disk drive Copy all filesin the directory WIN on the disketteto the appropriate
192. ine is completed by issuing a RETURN instruction When control returns from the event handling routine by a RETURN instruction the Interpreter executes KEY ON instruction If it is not necessary to resume keystroke trapping describe a KEY OFF statement in the event handling routine e If you issue more than one ON KEY GOSUB instruction specifying the same keynumbex the last statement takes effect 10 82 Statement Reference GOSUB instructions can be nested to a maximum of 10 levels When using the ON KEY GOSUB statement with block structured statements FOR NEXT IF THEN ELSE END IF SELECT CASE END SELECT and WHILE WEND you can nest them to a maximum of 30 levels e Specifying a keynumber of 32 is ignored Syntax Error Error Code and Message Meaning error 71 Syntax error label has not been defined label is missing keynumber is not enclosed in parentheses Execution Error Error Code M eaning 05h Parameter out of range keynumber is out of the range 07h Insufficient memory space too many program nesting levels by cosus statements Reference Statements KEY KEY ON and KEY OFF 10 83 T PDT 1100 Terminal Programmer s Guide OPEN Statement Name O pen Type Filel O Statement Description Opens a file for I O activities Syntax Syntax 1 OPEN filename AS filenumber RECORD
193. ines a magic key as the trigger switch shift key or battery voltage display key KPLOAD Loads a user defined Kanji font in the two byte Kanji mode LOCATE M ovesthe cursor to a specified position and changes the cursor shape PRINT Displays data on the LCD screen PRINT USING Displays data on the LCD screen under formatting control SCREEN Sets the screen mode and the character attribute Functions Definitions COUNTRY Sets a national character set or returns a current country code CSRLIN Returns the current row number of the cursor POS Returns the current column number of the cursor K 3 7 M PDT 1100 Terminal Programmer s Guide Controlling the Keyboard Input Statements Definitions INPUT Reads input from the keyboard into a variable KEY Assignsa string or a control codeto a function key also defines a function key asthe LCD backlight function on off key T his statement also defines a magic key as the trigger switch shift key or battery voltage display key KEY ON Enables keystroke trapping for a specified function key KEY OFF Disables keystroke trapping for a specified function key LINE INPUT Reads input from the keyboard into a string variable ON KEY GOSUB Specifies an event handling routine for keystroke interrupt Functions Definitions INKEYS Returns a character read from the keyboard INPUTS Returns a specified number of charac
194. ion If you specify filelength when opening existing data file including a downloaded data file the filelength is ignored Specifying filelength does not allocate memory Therefore whether or not a PUT instruction can write records up to the specified filelength depends on the memory occupation state If ilelength is omitted the default file size is 1 000 records Syntax Error Error Code and Message Meaning error 3 W missing No double quote precedes or follows filename error 71 Syntax error filelengthis out of the range filelength is not an integer constant filename is not enclosed in double quotes 10 85 T PDT 1100 Terminal Programmer s Guide Execution Error Error Code M eaning 02h Syntax error filename is not correct or the bar code device file or communications device file is specified 07h Insufficient memory space 32h File type mismatch 37h File already open 3Ah File number out of range 41h File damaged Reference Statements CLOSE OPEN BAR and OPEN com 10 86 Statement Reference OPEN BAR Statement Name Open Bar Type Filel O Statement Description O pens the bar code device file This statement also activates or deactivates the reading confirmation LED and the beeper individually Syntax OPEN BAR readmodell LEDcontro1llbeepercontro1 AS 4 filenumber CODE readcod Lr adcod a where readnumber A string expression LEDc
195. ion where n is the number of spaces between the ampersands 4 s If the format field specified by stringformat is longer than the stringexpression thestring is left justified and padded with space if it is shorter the extra characters are truncated Statement example PRINT USING amp amp ABCDE Output ABCDE Below are statement examples containing incorrect formatting strings Example PRINT USING Answer a Example PRINT USING 4 4 a b expression Of stringexpression If more than one number or string is specified the PRINT USING instruction displays each of them according to numericformat or stringformat respectively PRINT USING HHH 7 a b c CR LFcont rol CR LFcont rol determines where the cursor is to be positioned after the PRINT USING instruction executes For details refer to the CR LFcont rol in the PRINT statement Syntax Error Error Code and Message Meaning error 71 Syntax error numericformat iS missing expression OF stringexpression contains a comma or semicolon error 86 missing Nosemicolon follows numericformat or string format 10 110 Statement Reference PUT Statement Name Put Type Filel O Statement Description Writes a record from a field variableto a data file Syntax PUT 4 filenumberl recordnumber where filenumber A numeric expression which returns a valuefrom 1 to 16 recordnumber A num
196. ion and secondary station Define the primary station and the secondary station as follows When uploading data files Primary station PDT 1100 Secondary station H ost computer When downloading data files Primary station H ost computer Secondary station PDT 1100 8 10 Files Protocol functions In the PDT 1100 Ir protocol you cannot change the values of the headers and terminator with the protocol functionsin BASIC 3 0 File Transfer Tools For the M S DOS personal computers and Windows version which are available for Transfer Utility and the operating procedure of Transfer Utility refer to the Transfer Utility G uide Note If you have modified transmission headers or terminator to any other character codes by using the protocol functions Transfer Utility is no longer available Ir Transfer Utility C Ir Transfer Utility C is optionally provided on diskette It is available in two versions M S DOS version and Windows version It supports the PDT 1100 Ir protocol and allows you to upload or download user program files and data files between the host and the PDT 1100 using an IR beam when invoked by the xrtLE statement This utility can also transfer user program files and data files to from System M ode For the M S DOS personal computers and Windows versions which are available for Ir Transfer Utility and the operating procedure of Ir Transfer Utility refer to the PDT 1100 Terminal Ir Transfer Utility G uide
197. ited source program on an MS DOS personal computer enabling efficient debugging in program development It also outputs debugging information including cross reference lists of variables and labels The Compiler assigns variables to fixed addresses so the Interpreter does not have to allocate or release memories when executing user programs shortening execution time Program Compression by the Dedicated Compiler The Compiler compresses a source program into the intermediate language to produce an object program a user program N ote W hen the compiled user program is downloaded to thePDT 1100 it packs the two byte data in the intermediate language into a single byte hexadecimal format for more efficient use of the memory area in thePDT 1100 Compilation and Program Execution Compiler and Interpreter BASIC 3 0 consists of the Compiler and the Interpreter Compiler The Compiler development tool compiles a source program written on an MS DOS personal computer to generate a user program in the intermediate language The Compiler is optionally provided in an M S DOS format floppy disk which contains the following three 1 4 Software Overview files BHTC3 EXE M S DO S based Compiler BHTC3W EXE Windows based Compiler and BHTC3 M SG M essage file The Compiler checks the syntax of a source program during compilation and outputs syntax errors if any to the MS DOS standard output device When the Compiler fin
198. ith space characters and then search for the target field data A B C Send data A B C Receive data A B C Lopes Filling with space characters A B C Luu Search data to be specified 1 denotes a space character 36099023 eps Figure G 2 Space Character Substitution Example 2 Before downloading a data file substitute any character not used as effective data e g an asterisk for the space characters in the host computer A B C Send data A B C Receive data A B C Data to be searched A B C i Poe Search data to be specified u denotes a space character 36099024 eps Figure G 3 Asterisk Character Substitution G 3 ae PDT 1100 Terminal Programmer s Guide Example 3 When specifying a field data to be searched do not include space characters in the tail of the data field A B C Send data a eee A B C Receive data A B iC yu Datato be searched A B C Search data to be specified 4 denotes a space character 36099025 eps Figure G 4 No character Substitution You can also use System M ode or an xrILE statement to specify the handling of space characters in the tail of a data field System M ode To handle space characters as data select Data on the field space setting screen on the communications parameter setting menu from the SET SYSTEM menu XFILE statement To handle space characters as data specify
199. k cant a AEN A M 3 BEEPS O A a dd eL A eke EEE a 10 5 Beep Settings ouaaa aaa 10 6 BEEP Statement oooooooo 7 10 BIEO TA meria tann LAA M 2 block check character M 3 Block Format User Defined Functions 3 1 Block Structured Statements 3 2 DUES ai PA xiv C CALE 2 Sere arte a tir ad 10 9 CHA Nic d 10 11 Character Sets n aaua aaa aaua C 1 CHECK digit ors mendis ie aie nea ia 8 8 CHOKDGES lt a a aaa ah 11 6 CARS E tt VO 11 9 Classification of Variables 5 5 CLRILE tae 10 13 CLOSE TA ie 10 15 CESA a ra teca rd DA 10 17 COMMON ooo cc 4 2 COMMON cece eee ee ees 10 18 Common Variables 5 5 Communications Device 8 8 Communications Parameters 8 9 communications specifications M 1 Comparison of Character Strings 6 8 Compilation and Program Execution 1 4 COMPI OE ciar eee e 1 4 FUNCION Sc ieee aed tad wear eae de 2 3 Index 1 S Compiler and Interpreter 1 4 Compiling in Windows 2 6 Displaying the Compile Results 2 12 Executing the Compiler 2 10 O perating Procedure for the Compiler 2 8 Output from the Compiler 2 10 Reading in the Initialization File 2 7 Selecting the file to be compiled 2 8 Specifying the Compiling Options 2 9 Starting the Compiler 2 7 Concatenation of Character Strings 6
200. key M1 M2 M3 or M4 2 The wart statement monitors the CS CTS signal status only when the direct connect interface is selected and its interface port 3 pole plug mini stereo jack is arranged so that the receive data signal RD is functionally regarded as CS signal Ina single wart statement you can specify morethan onel O deviceif the same port number applies To monitor the keyboard buffer and the bar code buffer with a single wart statement for example describe the program as follows OPEN BAR AS 10 CODE A WAIT 0 amp h03 This example sets the value of amp h03 00000011 to port 0 indicating that it keeps waiting until either bit 0 or bit 1 becomes ON by pressing any key or by reading a bar code 7 13 M PDT 1100 Terminal Programmer s Guide S 7 14 I O Facilities 7 15 M PDT 1100 Terminal Programmer s Guide S 7 16 Chapter 8 Files File Overview Data Files and Device I O Files BASIC 3 0 treats data files and bar code device I O s and communications device 1 0 s as files by assigning the specified names to them Table 8 1 FileType and File Name File Type File Name Remarks Data File filename extension drivename filename extension Device I O File Bar Bar code device Device I O File com Communications device Note Data files and user program files are stored in the user area of memory Access M ethods To acce
201. l error 4 Token file I O error fatal error 5 Relocation information file I O error fatal error 6 Cross reference file I O error fatal error 7 Symbol file I O error fatal error 8 Compile list file 1 O error fatal error 9 Debug information file I O error source address fatal error 10 Debug information file I O error label address fatal error 11 Debug information file I O error variable intermediate code A 3 S M PDT 1100 Terminal Programmer s Guide Table A 2 Fatal Errors Continued Error Code M essage fatal error 12 Out of disk space for work file fatal error 13 Out of disk space for object file fatal error 14 Out of disk space for token file fatal error 15 Out of disk space for relocation information file fatal error 16 Out of disk space for cross reference file fatal error 17 Out of disk space for symbol file fatal error 18 Out of disk space for compile list file fatal error 19 Out of disk space for debug information file source address fatal error 20 Out of disk space for debug information file label address fatal error 21 Out of disk space for debug information file variable intermediate code fatal error 22 Source file I O error fatal error 23 Cannot find XX X XSRC fatal error 24 Error count exceeds 500 fatal error 25 Out of memory i
202. l use using the pim statement The following examples show work variables DIM a 10 b 5 c 1 d 100 e 45 FOR count s1 TO s2 NEXT count At the start of a user program the Interpreter initializes all work variables to zero 0 or a null character string At the end of theprogram all variables will be erased Upon execution of the DIM statement declaring an array variable the Interpreter allocates the memory for the array variable The declared array variable can be erased by the zrase statement Common Variables A common variable is declared by the common statement It passes its value to the chained to programs Register Variables A register variable is a unique non volatile variable supported exclusively by BASIC 3 0 It retains its value by battery backup even after the program has terminated or the PDT 1100 5 5 M PDT 1100 Terminal Programmer s Guide 7 is powered off and can store settings of programs and other values in memory The Interpreter stores register variables in the register variables area of the memory separate from the work variables area Like other variables register variables are classified into two types string variables and numeric variables which are subclassified into non array and array types The format of register variables is the same as general variables Declare register variables including non array register variables with erre statements BASIC 3 0 can handle array variables up
203. ld variable and a general variable except that no register variable common variable or array variable can be used for a field variable A record can contain up to 16 fields The total number of bytes of all fieldwidths plus the number of fields should not exceed 255 If aFIELD instruction executes for an opened file having the number of fields or field width unmatching that of the FIELD specifications except for field variables an execution error occurs If morethan one FIELD instruction is issued to a same file the last one takes effect 10 43 T PDT 1100 Terminal Programmer s Guide Syntax Error Error Code and Message Meaning error 71 Syntax error filenumber iS missing Execution Error Error Code 05 34 36 3A1 36 3D Example Reference Statements 10 44 N N N M eaning Parameter out of range fieldwidth out of the range Bad file name or number filenumber of an unopened file specified Improper file type i1enumber of a file other than data files specified File number out of range FIELD overflow FIELD instruction specifies the record length exceeding 255 bytes A FIELD statement specifies the field width which does not match one that specified in file creation fileNumber 4 OPEN Datafile dat AS fileNumber FIELD fileNumber 20 AS code39 16 AS itf 5 AS kyin GET PUT OPEN CLFILE and CLOSE Statement Reference FOR NE
204. le Syntax Syntax 1 For direct connect interface OPEN com n baudll parityll charalengthll stopbitll rs cs timeout AS 4 filenumber Syntax 2 For optical interface OPEN COM ni baud AS filenumber where baud Fortheoptical interface 115200 57600 38400 19200 9600 or 2400 For the direct connect interface 38400 19200 9600 4800 2400 1200 600 or 300 parity N E orO charalength 8or7 stopbit lor2 RS CS 0 1 2 3 0r4 timeout An integer numeral from 0 to 255 filenumber A numeric expression which returns a value from 1 to 16 Notes OPEN com opens a communications device file and associates it with i1enumber for allowing input output activities using the communications interface 10 95 s T PDT 1100 Terminal Programmer s Guide e If optional parameters enclosed with brackets are omitted the most recently specified values or the defaults become active Listed below are the defaults Baud rate Parity check Character length Stop bit RS CS control Timeout COM n is a communications device file name 9600 bps No parity 8 bits 1 bit 0 No control 3 seconds Since the PDT 1100 supports both optical and direct connect interfaces but cannot open them concurrently set one of the specifications listed above If you attempt to open both interfaces concurrently an execution error occurs O ptical interface Direct connect interface Interfa
205. le identifying them by designating the desired bar code types following the cope in the open Bar statement Read Mode of the Trigger Switch Use the open Bar statement to select the read mode of the trigger switch Table 8 3 Trigger Switch Read M ode OPEN BAR Statement Remarks M omentary Switching M ode OPEN BAR M Auto off M ode OPEN BAR F Default Alternate Switching M ode OPEN BAR A Continuous Reading M ode OPEN BAR C To check whether the trigger switch is pressed or not usethe rnp function or the wart statement as shown below trig INP 0 AND h04 8 7 M PDT 1100 Terminal Programmer s Guide If the value of the trigs is 04h the trigger switch is kept pressed if 00h it is released Generation of Check Digit Specifying a check digit in the open Bar statement causes the Interpreter to check bar codes If necessary use the cexocTs function for generating a check digit of bar code data Control of Reading Confirmation LED and Beeper When the PDT 1100 has read a bar code successfully the reading confirmation LED illuminates green Activate or deactivate the confirmation LED function and the beeper function in the open Bar statement To turn on the reading confirmation LED and sound the beeper OPEN BAR B AS 1 CODE A To sound the beeper without turning on the reading confirmation LED OPEN BAR BL
206. lue of controlvariable by the value 0f increment Then control returns to the FOR instruction at the top of the loop Go back to step 2 The default value 0f increment is 1 You can nest FOR NEX When using the For NI instructions to a maximum of 10 levels EXT statement together with other block structured statements IF THEN WHILE WEND you Can executes ELSE END IF SELECT CASE END SELECT and nest them to a maximum of 30 levels A same controlvariable should not be reused in a nested loop Otherwise an execution error occurs when the NEXT instruction for an outer FOR NEXT loop N ested loops should not be crossed Shown below is a correctly nested sample FOR i 1 FOR TO 10 3 2 TO 100 FOR k 3 TO 1000 EXT k NEXT j NEXT i FOR 1 1 NEXT 1 TO 3 Statement Reference Syntax Error Error Code and Message M eaning error 26 Too many nesting levels error 52 Incorrect use NEXT Without For of FOR NEXT error 53 Incomplete Incomplete pairs of ror and NEXT index variable control structure error 54 Incorrect FOR controlvariable for For is different from that for NEXT error 88 TO missing TO finalvalue is missing Execution Error Error Code M eaning 01h NEXT Without For 07h Insufficient memory space too many nesting levels 10 47 D PDT 1100 Terminal Programmer s Guide
207. m C gt TU3 userprog PD3 Tool Transfer Utility C 2 3 M PDT 1100 Terminal Programmer s Guide C gt IT3C userprog PD3 Tool Ir Transfer Utility C On the PDT 1100 Execute the user program in System M ode EXECUTE PROGRAM A USERPROG PD3 If an execution error occurs execute the program again Writing of a Source Program Writing a Source Program Using Editor To write a source program use an editor designed for an Windows personal computer use of a commercially available editor is recommended See the instruction manual for the editor for information on its use C gt EDIT progl SRC If you place an extension SRC in a source program file you may omit the filename extension in compilation C gt BHTC3 progl Rules for Writing a Source Program When writing a source program according to the syntax of BASIC 3 0 observe the following rules A label name should begin in the first column ABC 2000 2 4 Development Environment and Procedures A statement should begin in the second or the following columns PRINT FOR I 1 TO 100 NEXT I Oneprogram line should be limited to 512 characters excluding a CR code and end with a CR code the return key If an underline _ precedes a CR code however one program line can be extended up to 8192 characters For statements other than the PRINT PRINT and PRINT USING Statements you may use a comma preceding a CR code A program can contain a max
208. ment Name Wait Type O Statement Description Pauses program execution until a designated input port presents a given bit pattern Syntax WAIT portnumbex ANDbytel XORbyte where portnumber A numeric expression ANDbyte and XORbyte A numeric expression which returns a value from 0 to 255 Notes WAIT suspends a user program while monitoring the input port designated by portnumber until the port presents the bit pattern given by anDbyteand XORbyte Refer to Appendix D 1 0 Ports Each bit in ANDbyte corresponds to a port bit to be turned on Each bit in xoRbyte corresponds to a port bit to be turned off The byte at the input port is first XO Red with the xorbyte parameter N ext the result is AN Ded with the value of ANDbyte parameter If the final result is zero 0 the wArT instruction rereads the input port and continues the same process If it is nonzero control passes to the statement following the WATT f xORbyte option is omitted the wAIT instruction uses a value of zero 0 WAIT 1 x WAIT 1 x 0 e Ifan invalid port number or bit data is specified zero 0 is assumed so the WAIT instruction falls into an infinite loop 10 126 Statement Reference Syntax Error Error Code and Message Meaning error 71 Syntax error portnumber IS missing ANDbyte is missing Execution Error Error Code M eaning 05h Parameter out of range Example WAIT 0 amp HO3 The above instruction suspends a user pr
209. n Function Description Returns the largest whole number less than or equal to the value of a given numeric expression Syntax INT numericexpression where numericexpression A real expression Notes INT returns the largest whole number less than or equal to the value of numericexpression by stripping off the fractional part Use INT as shown below to round off the fractional part of a realnumber INT realnumber 0 5 Example dat 1 5 PRINT INT dat 0 5 2 f numericexpression is negative this function operates as shown below PRINT INT 1 5 PRINT INT 0 2 2 1 11 32 Function Reference LEFTS Function Name LEFT Type String Function Description Returns the specified number of leftmost characters from a given string expression Syntax LEFTS stringexpression stringlength where stringlength A numeric expression which returns a value from 0 to 255 Notes LEFTS extracts a portion of a string specified by stringexpression by the number of characters specified by stringlength starting at the left side of the string If stringlengthis zero LEFTS returns a null string f stringlength is greater than the length of stringexpression the whole stringexpression is returned Execution Error Error code M eaning 05h Parameter out of range stringlength is out of range Reference Functions LEN MIDS and RIGHTS 11 33 T PDT 1100 Terminal Programmer s Gu
210. n a double quotation mark or any control codes Numeric Constants Integer Constants In Decimal Notation An integer constant in decimals can be followed by a percent sign or the can be omitted Syntax sign decimalnumericstring3 5 1 M PDT 1100 Terminal Programmer s Guide S Where sign is either a plus or a minus The plus sign can be omitted The valid range is from 32 768 to 32 767 Using a comma in an integer constant to mark every three digits causes a syntax error In Hexadecimal Notation Integer constants in hexadecimals should be formatted as shown bdow Syntax amp H hexnumericstring The valid range is from Oh to FFFFh Using a period in a numeric string in hexadecimals to denote a decimal point causes a syntax error Real Constants Real constants should be formatted as shown bdow Syntax sign mantissa Syntax sign mantissa E sign exponent A lowercase e may be used instead of uppercase E mantissa is a numeric string of up to of 10 significant digits It can include a decimal point Using a comma in a real constant as shown below to mark every three digits causes a syntax error 123 456 syntax error 5 2 Data Types Variables A variable is a symbolic name that refers to a unit of data storage The contents of a variable can change during program execution Types of Variables According to Format Variables are classified into two types string variables
211. n works only with line numbers not labels Addresses which the ERL returns correspond to ones that are output to the left end of the address source list in hexadecimals when a L option is specified in compilation if converted from decimals to hexadecimals with the Hexs function Sincethe ERL function returns a significant value only when an execution error occurs usethis function in error handling routines where you can check the error type for effective error recovery Thereturned valueisin decimals so it may be necessary to use the HEXS function for decimal to hexadecimal conversion Reference Statements ON ERROR GOTO and RESUME Functions ERR and HEXS 11 18 Function Reference ERR Function Name ERror Code Type Error H andling Function Description Returns the error code of the most recent execution error Syntax ERR Notes ERR returns the code of an execution error that invoked the error handling routine e Codes which the ERR returns correspond to ones that are listed in Execution Errors on page A 1 if converted from decimals to hexadecimals with the HExs function Sincethe ERR function returns a significant value only when an execution error occurs usethis function in error handling routines to check the error type for effective error recovery Thereturned valueisin decimals so it may be necessary to use the HExs function for decimal to hexadecimal conversion Re
212. nal is High OPEN COM 3 1 if RD signal is Low OPEN COM 4 Depends upon theRD signal state If the direct connect interface is closed the PDT 1100 returns the value 0 4 Lower four bits bit 3 to bit 0 in this byte represent the contrast level of theLCD in 0000 to 1011 in binary notation or in 0 to 11 in decimal notation 0 represents the lowest contrast 11 the highest 3 Do not use the wart statement to monitor the LCD contrast message version system status indication or VRAM because the program may enter an infinite loop 6 In System M ode the message version appears on the LCD 7 If the PDT 1100 is initiated by the wake up function this bit goes ON 1 8 ThePDT 1100 can display the system status on the bottom line of the LCD 2 The PDT 1100 returns the re read prevention enabled time length in units of 100 ms If the returned value is zero 0 the re read prevention is permanently enabled so that the PDT 1100 does not read same bar codes in succession 10 An 8 bit binary pattern bits 7 to 0 on the input ports 10h to 24Fh which read VRAM represents a basic dot pattern column of theLCD Bit value 1 means a black dot The port number gives the dot column address 11 A user program returns the A D converted value 0 to 255 of the battery voltage level 0 to 5V The returned value is an instantaneous value when data on the input port is read Use the voltage level as a reference value as it varies depending up
213. nd modify the on duration For details about the key statement refer to KEY on page 10 61 a PDT 1100 Terminal Programmer s Guide The backlight function is OFF when you power on the terminal Backlight OFF Press the M1 key while holding down the Shift key Or press the backlight function on off key specified by KEY statement y Backlight ON A Press the M1 key while If no key is pressed holding down the Shift key for at least 3 seconds Or press the backlight function on off key specified by KEY statement Y Press any key except for the Backlight OFF backlight function on off key The backlight function is ON Press the M1 key while holding down the Shift key Or press the backlight function on off key specified by KEY statement Figure l 1 LCD Backlight Function You can control the backlight function using the our statement Set port 6020h to 1 with the out statement to activate the LCD backlight function and turn on the backlight If no key is l 2 Backlight Function pressed for the time length set to port 6021h default 5 seconds the backlight goes off but the backlight function remains activated Set port 6020h to O to deactivatetheLCD backlight function and turn off the backlight When the backlight function is activated with the OUT statement the backlight function on off key and ON duration specified by the KEY st
214. ng routine back to any specified statement as listed below Table 9 2 RESUME Statement RESUME Statement Description RESUME Or RESUME 0 Resumes program execution with the statement that caused the error RESUME NEXT Resumes program execution with the statement immediately following the one that caused the error RESUME label Resumes program execution with the statement designated by label Event of Keystroke Trapping If the function key previously specified for keystroke trapping is pressed event trapping cause an interrupt to transfer control from the current program to the specified event handling routine This trapping facility checks whether the function key is pressed or not between every execution of the statements Programming for Trapping Keystrokes To trap keystrokes use both the on KEy GosuB and key on statements The on KEY GOSUB statement designates the key number of the function key to be trapped and the event handling routine to which control is to betransferred if a specified function key is pressed in its label The key on statement activates the designated function key This trapping cannot take effect 9 4 Event Polling and Error Event Trapping until both the on kEy cosuB and key on statements have been executed The keystroke of an unspecified function key or numerical key cannot betrapped Thefollowing program sample traps keystroke of f
215. nsmission between the sender and receiver To do this define the bit order position the character length and the beginning and end of the character to be transmitted Thestart stop synchronization is an asynchronous system which synchronizes each character as a unit that is it externally adds start and stop bits to the leading and trailing bit positions M 1 M PDT 1100 Terminal Programmer s Guide S of the character to be transmitted respectively A clock starts counting when it receives the start bit and it stops communicating when the stop bit is received The number of the stop bits is selectable 1 or 2 bits Optical Interface Communications Range Theoptical interface s maximum effective rangeis 80 cm with theIR beam within a 10 angle of divergence Transmission Code and Bit O rder All characters should be coded to 7 or 8 bit codefor data transmission The standard data exchange code of the PDT 1100 is 7 or 8 bit code The transmission bit order is LSB Least Significant Bit first Following isan example for transmitting character A 41h 01000001b coded to 8 level code with an even parity and a single bit for start and stop bits LSB 1 0 i 0 0 i 0 i 0 1 0 i 0 Start Bit Stop Bit Parity Bit 35864050 eps Figure M 1 Transmission Example Response M ethod When two devices initiate communications they exchange signals for correct data transmission This procedure is call
216. nstructions in a program The READ instruction assigns data stored by DATA instructions in the same order that those DATA instructions appear in a source program e Using the RESTORE statement can read a same DATA statement more than once e You can specify more than one literal ina program line within 512 characters by separating them with commas You can describe DATA statements also in included files 10 22 Statement Reference Syntax Error Error Code and Message M eaning error 3 W missing N o double quote precedes or follows a string data Reference Statements READ REM RESTORE and SINCLUDE 10 23 T PDT 1100 Terminal Programmer s Guide DEFREG Statement Name DEFine REGister Definition Defines register variables Syntax Type Declarative Statement DEFREG registerdefiniti orl registerdefinition where registerdefinition 10 24 non arraynumericvariable numericconstan t DEFREG n1 10 DEFREG n2 12 5 arraynumericvariabl el subscript numericinitialvaluedefiniti on DEFREG n3 5 6 non arraystringvariable stringl ength stringconstan t DEFREG s1 abc123 DEFREG s2 6 abc123 arraystringvariabl el subscript l stringl ength stringinitialvaluedefinition DEFREG s2 1 3 16 subscript For one dimensional integerconstant DEFREG n4 3 For two dimensional integerconstant integerconstant DEFREG n5 4 5
217. nt is shown below N on shift mode Shift mode 7 8 9 Q R S 4 5 6 U V Ww 1 2 3 Y Z 0 CR A B D 1 3 K L EJ FJ G HJ M N LO P BS c L O G L 35864090 eps 35864090 eps Figure E 2 Default Data Assignments E 2 Appendix F Memory Area Memory Map Figure F 1 illustrates the PDT 1100 memory map System Program Area 196 KB ROM User Area 60 KB System Work Area 48 KB or 172 KB RAM User Area 464 AKB or 1976 KB Figure F 1 Memory Map The size and area allocation of the memory incorporated in the PDT 1100 differ depending upon the following models F 1 M PDT 1100 Terminal Programmer s Guide S ROM Flash ROM ROM size KB System program area KB 512 160 1024 160 RAM RAM size KB System work area KB 512 48 2048 72 User area KB 64 568 User area KB 464 1976 In the system program area the system programs the drivers BASIC 3 0 Interpreter and System M ode are resident The system work area is shared by the system parameters work variables common variables directories etc The user area stores application programs and collected data The size of the user area is M emory size System area size Memory Managemen
218. nt size standard size or small size If the standard size font is selected the cursor appears as 6 dots wide by 8 dots high in the single byte ANK mode and as 8 dots wide by 16 dots high in thetwo byte Kanji mode If the small size font is selected the cursor appears as 6 dots wide by 6 dots high in the single byte AN K mode and as 6 dots wide by 12 dots high in the two byte Kanji mode e Thecursor shape specified by the most recently executed LOCATE instruction takes effect After execution of LOCAT E O which makes the cursor invisible the CURSOR ON instruction cannot display the cursor Usethe LOCATE statement to display the cursor 10 20 Statement Reference Syntax Error Error Code and Message M eaning error 71 Syntax error Specification other than on and orr is described Reference Statements INPUT LINE INPUT and LOCATE Functions INPUTS and INKEYS 10 21 T PDT 1100 Terminal Programmer s Guide DATA Statement Name Data Type Declarative Statement Description Stores numeric and string literals for READ statements Syntax DATA literall literal where literal A numeric or string constant Notes DATA stores numeric and string literals so that READ instructions can assign them to variables A DATA instruction can appear anywhere in a source program A string data should be enclosed with a pair of double quotation marks You may have any number of DATA i
219. ntario Canada L4W 422 905 629 7226 Asia Pacific Symbol Technologies Asia Inc 230 Victoria Street 04 05 Bugis Junction O fficeT ower Singapore 188024 337 6588 Inside Singapore 465 337 6588 O utside Singapore S Australia Symbol Technologies Pty Ltd 432 St Kilda Road M elbourne Victoria 3004 1 800 672 906 Inside Australia 61 3 9866 6044 O utside Australia Denmark D anmark Symbol Technologies AS Gydevang 2 DK 3450 Allerod Denmark 7020 1718 Inside Denmark 45 7020 1718 Outside Denmark Finland Suomi Oy Symbol Technologies Kaupintie8 A 6 FIN 00440 H elsinki Finland 9 5407 580 Inside Finland 358 9 5407 580 Outside Finland G ermany D eutchland Symbol Technologies GmbH Waldstrasse 68 D 63128 Dietzenbach Germany 6074 49020 Inside Germany 49 6074 49020 Outside Germany M PDT 1100 Terminal Programmer s Guide Austria sterreich Symbol Technologies Austria GmbH Prinz Eugen Strasse 70 Suite 3 2 Haus 5 Stock 1040 Vienna Austria 1 505 5794 Inside Austria 43 1 505 5794 Outside Austria Europe M id East Distributor O perations Contact your local distributor or call 44 208 945 7360 France Symbol Technologies France Centre d Affaire d Antony 3 Rue de la Renaissance 92184 Antony Cedex France 01 40 96 52 21 Inside France 33 1 40 96 52 50 Outside France Italy Italia Symbol Technologies Italia S R L Via Cristoforo Columbo 49 20090 Trezzano S N Navigilo M ilano Italy
220. nterface Direct connect interface Transmission Speed 2400 9600 19200 38400 57600 or 115200 bps 300 600 1200 2400 4800 9600 19200 or 38400 bps Character Length 8 bits 7 or 8 bits Vertical Parity None Odd even or none Stop Bit Length 1 bit 1 or 2 bits The 300 bps and 600 bps are not available in System M ode In System M ode Refer to the PDT 1100 Terminal Product Reference G uideto set communications parameters in the system mode In BASIC 3 0 To set the transmission speed optical interface only character length vertical parity and stop bit length usethe OPEN COM statement in BASIC 3 0 OPEN COM opens the interface port selected in System M ode Through the interface port opened by the OPEN COM statement The xrILE statement transmits a designated file through the interface port OPEN COM 1 opens the optical interface port for data transmission routing through the CRD 1100 regardless of the setting in System M ode OPEN COM2 opens the direct connect interface port for data transmission irrespective of the setting in System M ode Note You cannot open both the optical interface port and the direct connect interface port at the sametime M PDT 1100 Terminal Programmer s Guide 7 Communications Protocols ThePDT 1100 supports both the protocol and the Ir protocol for file transmission Protocol The protocol uses
221. nternal labels exceed 3000 fatal error 26 Control structure nesting exceeds 30 fatal error 27 Expression type stack exceeds 50 fatal error 28 Program too large object area over flow fatal error 29 Out of memory for cross reference fatal error 30 Cannot find include file fatal error 31 Cannot nest include file A 4 Error Codes and Error Messages Syntax Errors Table A 3 lists the syntax errors and their meanings Table A 3 Syntax Errors Error Code M essage error 1 Improper label format error 2 Improper label name redefinition variable name or reserved word used error 3 missing error 4 Improper expression error 5 Variable name redefinition error 6 Variable name redefinition error 7 Variable name redefinition error 8 Too many variables work integer error 9 Too many variables work float error 10 Too many variables work string error 11 Too many variables register integer error 12 Too many variables register float error 13 Too many variables register string error 14 Too many variables common integer error 15 Too many variables common float error 16 Too many variables common string error 17 Too many variables work integer array error 18 Too many variables work float array error 19 Too many variables work string array error 20 Too many vari
222. ntrast level of the LCD in 0000 to 1011 in binary notation or in 0 to 11 in decimal notation 0 represents the lowest contrast 11 the highest Following are examples of OUT statements T 371k T 3 amp h0b Contrast is highest Contrast is lowest D 5 M PDT 1100 Terminal Programmer s Guide S 4 The sleep time feature interrupts program execution if the PDT 1100 receives no input within the length of time set by bit 7 to 0 Shown below are examples of out statements Setting 0 to this byte disables the sleep timer feature Refer to Sleep Timer on page H 1 OUT 6 30 3 seconds OUT 6 0 N o sleep operation gt To activate the wake up function set this bit to 1 to deactivate it set it to 0 6 To makethe Times function return or set the system time set 0 to this bit to makethe TIMES function return or set the wake up time set 1 Executing the TIMES function after selecting the wake up time resets this bit to zero reviewers help 7 To display the system status on the bottom line of the LCD set this port to 1 to erase it set it to 0 8 This byte sets the re read prevention enabled time length in units of 100 ms Specifying zero 0 permanently enables the reread prevention so the PDT 1100 does not read same bar codes in succession 2 An 8 bit binary pattern bits 7 to 0 on output ports 10h to 24Fh stored in the VRAM represents a basic dot pattern column of theLCD Bit value 1 means a bla
223. o be deleted should be closed beforehand 10 68 Statement Reference Syntax Error Error Code and Message M eaning error 3 error 71 Syntax error missing N o double quote precedes or follows filename or drivename filename filename OF drivename filename is not enclosed in double quotes Execution Error Error Code 02h 35h 37h Example Reference Statements M eaning Syntax error the format of filename Or drivename filename iS not correct Filenot found File already open CLOSE IF kyIn Y THEN KILL Master Dat END IF CLFILE 10 69 T PDT 1100 Terminal Programmer s Guide Statement Name Let Type Assignment Statement Description Assigns a value to a given variable Syntax Syntax 1 LET stringvariable stringexpression Syntax 2 LET numericvariable numericexpression Description LET assigns a value of expression on the right hand side to a variable on the left hand side In anumeric data assignment the assignment instruction converts an integer value to a real value In the type conversion from a real value to an integer value it rounds off the fractional part Keyword LET can be omitted since the equal sign is all that is required to assign a value Thedata type of a variable and an expression must correspond 10 70 Statement Reference Syntax Error Error Code and Message M eaning error 71
224. of Communications Protocols ThePDT 1100 supports the two communications protocols PDT 1100 protocol and PDT 1100 IR protocol PDT 1100 Protocol The xfr statement allows you to upload or download a data file This filetransmission uses the PDT 1100 protocol which is also used in System M ode or Easy Pack For the communications specifications of the PDT 1100 protocol refer to the PDT 1100 Terminal Product Reference G uide 8 9 M PDT 1100 Terminal Programmer s Guide S Primary Station and Secondary Station Define the primary station and the secondary station as follows When uploading data files Primary station PDT 1100 Secondary station H ost computer When downloading data files Primary station H ost computer Secondary station PDT 1100 Protocol Functions To modify a transmission header or terminator in a send data usethe following protocol functions For a header SOH OF STXS For a terminator ETXS PDT 1100 IR Protocol ThePDT 1100 also supports the PDT 1100 IR protocol which is used for file transmission via the optical interface infrared port If you select the PDT 1100 Ir protocol by using the out statement Port No amp h6060 or in System M ode you can upload or download a data file with the xFILE statement The PDT 1100 Ir protocol isalso used in System M ode or Easy Pack For the communications specifications of the PDT 1100 Ir protocol refer to the PDT 1100 User s M anual Primary stat
225. ogram You cannot define the same function name twice This statement block should not be defined in the block structured statements FOR NEXT IF THEN ELSE END IF SELECT CASE END SELECT and WHILE WEND in the error or handling routine event handling routine or in the e DEF FN END DEF functions can be recursive In defining a character function you can specify the maximum stringlength If its specification is omitted the default value of 40 characters takes effect dummyparametex Which corresponds to the variable having the same name in the function definition block isa local variable valid only in that block Therefore if a variable having the same name as dummyparameter is used outside DEF FN END DEF statement block or used as a dummyparameter of any other function in the same program it is treated independently In user defined functions you can call other user defined functions Y ou can nest DEF FN END DEF instructions to a maximum of 10 levels When using the DEF FN END DEF together with block structured statements FOR NEXT TF THEN ELSE END IF SELECT CASE END SELECT and WHILE WEND you can nest them to a maximum of 30 levels If variables other than dummyparameter s are specified in the function definition block they are treated as global variables whose current values are available EXIT DEF exits the function block prematurely and returns control to the position immediatel
226. ogram until data is entered from the keyboard or the bar code reader Reference Statements OUT Functions INP 10 127 T PDT 1100 Terminal Programmer s Guide WHILE WEND Statement Name While Wend Type Flow Control Statement Description Continues to execute a statement block as long as the conditional expression is true Syntax WHILE conditionalexpression statementblock WEND Notes A WHILE WEND continues to execute statementblock as long as the conditionalexpression is true not zero according to the steps below The conditionalexpression in the WHILE statement is evaluated 2 If the condition is false zero the statementblock is bypassed and control passes to the first statement following the WEND If the condition is true not zero the statementblock is executed When WEND statement is encountered control returns to the WHILE statement Go back to step 1 ThewHILE and WEND statements cannot be written on a same program line If no WEND statement is written corresponding to the WHILE a syntax error occurs e TheBASIC 3 0 does not support a Do Loop statement block You can nest the WHILE END instructions to a maximum of 10 levels 10 128 Statement Reference When using the WHILE WEND statement with other block structured statements FOR NEXT IF THEN ELSE END IF and SELECT CASE END SELECT you Can nest them up
227. ol A comma or a semicolon Notes PRINT displays a number or a character string specified by data at the current cursor position on the LCD and repositions the cursor according to CR LFcontro1 To position the cursor use a LOCATE statement data may be displayed in any mode Select the screen mode using a SCREEN statement before execution of the PRINT instruction If you specify single byte AN K characters for data after using a SCREEN statement to select the two byte Kanji mode or condensed two byte Kanji mode the AN K characters appear in the half width size CLS SCREEN 1 Kanji mode PRINT ABC123 SCREEN 0 ANK mode PRINT DEF456 These statements produce this output 10 103 T PDT 1100 Terminal Programmer s Guide J ABC 12 3 DEF 456 data may be displayed in standard size or small size depending upon the display font size selected e Ifyou omit data option a blank line outputs the cursor moves to the first column of the next screen line e Positive numbers and zero display with a leading space e Control codes 08h to 1Fh appear as a space except for BS 08h CR ODh and C 18h codes BS 08h deletes the character preceding the cursor to move the cursor backwards by one column PRINT CHRS 8 CR 0Dh causes a carriage return which moves the cursor to the first column of the next screen line PRINT CHR amp hOD C 18h clears the
228. om Functions EOF INPUTS and Loc 11 38 Function Reference MARK Function Name codeM ARK Type O Function Description Returns a bar code type and the number of digits of the bar code Syntax MARKS Notes MARKS returns a 3 byte string which consists of the first one byte representing a bar code type and the remaining two bytes indicating the number of digits of the bar code Thefirst one byte of a returned value contains one of the following letters representing bar code types Bar code type First one byte of a returned value EAN 13 or UPC A A EAN 8 B UPC E C ITF Interleaved 2 of 5 STF Standard 2 of 5 NW7 Codabar Code 39 Code 93 Code 128 EAN 128 E A rs Z Theremaining two bytes of a returned value indicate the number of digits of the bar code in decimal notation 11 39 T PDT 1100 Terminal Programmer s Guide MARKS returns a null string until bar code reading takes place first after start of the program 11 40 Function Reference MIDS Function Name M Ddle Type String Function Description Returns a portion of a given string expression from anywhere in the string Syntax MIDS stringexpression startpositionl stringlength where startposition A numeric expression which returns a value from 1 to 255 stringlength A numeric expression which returns a value from 0 to 255 Notes Starting from a position specified by startposition MIDS extracts a p
229. on PDT 1100 operation and is not proportional to the battery capacity D 3 M PDT 1100 Terminal Programmer s Guide S 12 A user program returns the communications protocol type used for file transmission with the xrILE statement For details about the communications protocol refer to thePDT 1100 User s M anual 13 A user program returns the PDT 1100 s ID number required to usethe PDT 1100 Ir protocol ThelD number is expressed by two bytes lower byte on port 6061h and upper byte on port 6062h The range of the returned valueis from 1 to FFFFh If the ID number is 1234h for example the value on 6061h is 34h and that on 6062h is 12h 14 If the value of this bit is 0 standard size characters are displayed as follows W x H Single byte AN K mode 6 dots x 8 dots If the value of this bit is 1 small size characters will be displayed as follows W x H Single byte AN K mode 6 dots x 6 dots Output Ports A user program can use the out statement to control the hardware through the output ports BASIC 3 0 defines each port as a byte The table below lists the output ports and their controlling function in the PDT 1100 Table D 2 Output Port Assignments Port No Bit Assignment 1 Controls the following 1 0 Reading Confirmation LED red 2 0 OFF 1 ON 1 Reading Confirmation LED green 2 0 OFF 1 0N 3 3 0 LCD contrast level 0 to 11 0 Lowest 11 Highest 4 0 M essage version 0 Japanese
230. on block to check data transmission A horizontal parity byte called BCC Block Check Character is appended aftertheETX of every transmission block Every parity bit of BCC is set so that all set bits at the same bit level including a parity bit in the transmission block characters have an even number by binary addition excluding SOH STX and functions SO H and STX Refer to SO H on page 11 47 and STX on page 11 50 Vertical Paritys gt _ 35864062 eps Character For 8 bit Data Horizontal Parity Byte BCC Figure M 14 Horizontal Parity Checking Shown below isa data text block indicating the bits to be added for horizontal parity checking S A EIB Serial T Number Data Text T C X E N gt To be added for horizontal parity checking 35864064 eps Figure M 15 Bitsto be Added M 17 a PDT 1100 Terminal Programmer s Guide Text Format Before transmission text should be formatted according to the standard of the protocol Following are two types of the standard text formats for program files and data files Program Text Format Byte Position 1 23 4 5 6 7 8 9 10 1112 1314 15 16 17 Program File Name Number of Data Texts Contained The number of data 12 bytes 5 bytes Exampleof p RO G 1 P D 3 0 0 3 5 2 Contents 1 1 1 1 1 1 1 1 1 1 1 1 1 1 l 11 The prog
231. ontrol A string expression Specification of 1 deactivates the reading confirmation LED Default A ctivated beepercontrol A string expression Specification of s activates the beeper Default Deactivated filenumber A numeric expression which returns a value from 1 to 16 readcode A string expression Notes OPEN BAR opens the bar code device file and associates it with i1enumber for allowing data entry from the bar code reader according to filenumber If the bar code device file has been opened with the OPEN BAR instruction pressing the M keys turns on the illumination LED indicating the PDT 1100 is ready to read bar codes Only one bar code device file can be opened at a time Up to 16 files can be opened at a time including data files and communications device files ThePDT 1100 cannot open the bar code device file and the optical interface of the communications device file concurrently If you attempt to open them concurrently an execution error occurs 10 87 T PDT 1100 Terminal Programmer s Guide s ThePDT 1100 can open the bar code device file and the direct connect interface concurrently Thename of the bar code device file BAR may bein lowercase OPEN bar AS 10 CODE A Lowercase letters may be used for readmode LEDcontrol beepercontrol and readcode readmode ThePDT 1100 supports four read modes M omentary switching mode m OPEN BAR M AS
232. ontrol code KEY 2 CHR 8 Backspace where a backspace code is assigned to the function key numbered 2 7 7 M PDT 1100 Terminal Programmer s Guide S NULL Character or String Assignment Assigning a NULL character or string to a function key causes an invalid entry if the function key is pressed In the example below pressing the keys numbered 3 and 4 produces no keyboard entry KEY 3 wir KEY 4 CHRS 0 Defining a Function Key as the LCD Backlight Function On Off Key Define a particular function key as the backlight function on off key and set the length of backlight on time using the key statement KEY 5 BL60 This defines the function key numbered 5 and sets the on time to 60 Note You cannot assign both a character string and the backlight on off function to a same function key For details refer to xgy in Chapter 10 Defining a Function Key as the Battery Voltage Display Key Define a particular function key as the battery voltage display key using the kev statement as shown below KEY 5 BAT This defines the function key numbered 5 Defining an M Key Define an M key asthe SF key trigger switch or battery voltage displaykey and assign a character string control code ENT key or backlight function on off key to it The trigger switch function is assigned to both M 1 and M 2 keys by default KEY 30 SFT This defines the M 1 key asthe SF key KEY 31 TRG
233. or BCC is also added to each block This forms a transmission block A set of transmission blocks makes up one transmission message S MA PDT 1100 Terminal Programmer s Guide Shown below is an example of a transmission message formed with the protocol Text Transmission Message Heading Data Text Data Text 2 Data Text Text S E B O Heading Text T C Transmission Block H x c E B Serial Data Text 1 SR T T C Transmission Block Number x x C S E T Serial T A i E Data Text ransmission Bloc x Number la 35864052 eps Figure M 4 ProtocolT ransmission Message In this figure SOH STX and ETX aretext control characters as described in Control Characters A serial number is expressed by a five digit decimal number starting from 00001 to 32767 and identifies transmitted data texts For the BCC refer to PDT 1100 Terminal Product Reference Guide M 8 Communications Transmission Control Sequences Shown below is a typical message transmission sequence supported by the protocol This example does not include transmission errors or negative responses Sending Receiving Station Station Establishment ENQ of Data Link A a Phase 1 y lt ACK A i S E B O Heading Text TC ss H x C lt ACK fS E B T Serial Number Data Text 1 T c gt i xX x c lt A
234. orth America Shipments from the US or other locations will be made F O B Symbol s manufacturing plant Symbol will use new or refurbished parts at its discretion and will own all parts removed from repaired products Customer will pay for the replacement product in case it does not return the replaced product to Symbol within 3 days of receipt of the replacement product The process for return and customer s charges will be in accordance with Symbol s Exchange Policy in effect at the time of the exchange Customer accepts full responsibility for its software and data including the appropriate backup thereof Repair or replacement of a product during warranty will not extend the original warranty term Symbol s Customer Service organization offers an array of service plans such as on site depot or phone support that can be implemented to meet customer s special operational requirements and are available at a substantial discount during warranty period General Except for the warranties stated above Symbol disclaims all warranties express or implied on products furnished hereunder including without limitation implied warranties of merchantability and fitness for a particular purpose The stated express warranties are in lieu of all obligations or liabilities on part of Symbol for damages including without limitation special indirect or consequential damages arising out of or in connection with the use or performance of the product Seller
235. ortion of a string specified by stringexpression by the number of characters specified by stringlength A returned value of MIDS depends upon the conditions as listed below Conditions Returned value If stringlength option is omitted All characters from startposition to the end of the string Example PRINT MIDS ABC123 3 C123 11 41 D PDT 1100 Terminal Programmer s Guide s If stringlength is greater than the number All characters from startposition to the end of characters contained between of the string startposition and the end of thestring Example Ad C123 If startposition is greater than thelength Null string of stri ioni TETIN IPAROS RER Example PRINT MID ABC123 10 1 Note BASIC 3 0 does not support such mips function that replaces a part of a string variable Execution Error Error code M eaning 05h Parameter out of range Reference Functions LEFTS LEN and RIGHTS 11 42 Function Reference POS Function Name POSition Type I O Function Description Returns the current column number of the cursor Syntax POS 0 Notes POS returns the current column number of the cursor in the current screen mode selected by a SCREEN statement This function returns an integer value from 1 to 17 independently of the display font size selected Even if the cursor is invisible by a LOCATE statement the Pos function operates If themaximum valuein the cu
236. ory where thefileto be executed is located for setting the options and window sizes At the end of execution the Compiler writes the data into the initialization file The BeTc3w 1N1 file contains the following Settings List 0 Editor c winapl edit exe Compiler setting section M PDT 1100 Terminal Programmer s Guide Windows Windows location amp size section AppPosx 100 Caution N ever modify the contents of the initialization file BHTC3W IN I O perating Procedure for the Compiler Selecting the File to be Compiled Select a file to compile using one of the following methods From the File menu choose the select File command Whileholding down the Ctrl key press the S key e Click the file selection button in the tool bar 36099007 eps Figure 2 2 Select File Dialog Box 2 8 Development Environment and Procedures Specifying the Compiling O ptions 1 FromtheCompile menu choose the compiling Options command The compiling Options dialog box appears o Debug information fibe o Address source List o Symbol table O X Cross reference O Variables sire 36099008 eps Figure 2 3 Compiling O ptions Dialog Box 2 Select the check boxes of the options you want to specify For details about the compiling options refer to Compiling O ptions on page 2 14 and Generating a User Program on page 2 12 2 9 M PDT 1100 Terminal Programmer s Guide S Executing the Compiler
237. ould be 255 bytes or less When you transfer five 50 digit 50 byte fields for example the total length of all data fields is 250 50x 5 bytes and the number of the character count bytes is 5 The total is 255 so the file can be transferred M 38 Index Numerics OO A id ea 2 16 A abort data transmission M 16 M 34 Access M ethodS nuaa aaa 8 1 ACK a e iea ad a ea 11 9 Activating the alphabet input function with OUT statement 7 4 Alphabet Input Function 7 3 AND Operator cee eee eee 6 6 ANK Faria 10 20 11 13 11 43 C 4 APLOAD cal EAN 10 2 Application Programs 1 3 Easy Pack 0 0 0 cee eee eee 1 3 User Programs 0 0 eee 1 3 Arithmetic Operators 0 6 3 Array Integer Variables 5 4 Array Real Variables 5 5 Array String Variables 5 4 Aa Dota AA oia 11 3 Assigning a Character String to a Function Key 7 8 assignment statement LET 10 70 B BAR daria rado seated 10 87 bar code buffer como 8 7 Bar Code Device 0 0 eee 8 6 BASIC 3 0 1 3 8 1 8 11 9 1 B 1 D 2 D 4 Overview ossee 1 3 BASIC 3 0 Compiler 0 2 2 BASIC 3 0 Interpreter o o o F 2 Basic Program Elements 4 1 Basic Program Elements 4 1 Battery Backup of Memory F 2 BC Ce petite ha e
238. p 5 a s k Ay 10 as t sd Thesecond method using a comma and CR code cannot be used for the PRINT PRINT and PRINT USING statements Usable Characters Following are characters which can be used for writing programs N ote that a double quote cannot be used inside a character string Symbols and inside a character string appear as and gt on the LCD of thePDT 1100 respectively If used outside of a character string symbols and control codes below have special meaning described in Special Symbols and Control Codes on page 4 4 Letters Including both uppercase and lowercase letters A to Z and ato 2 N umerals Including 0 to 9 for decimal notation and 0 to 9 and A to F ato f for hexadecimal notation Symbols Including the following lt gt amp 7 _ Control codes CR space and tab 4 3 M PDT 1100 Terminal Programmer s Guide 7 Distinction between U ppercase and Lowercase Letters The Compiler makes no distinction between the uppercase and lowercase letters except for those used in a character string data The statements below for example all producethe same effect When used in a character string data uppercase and lowercase letters are distinguished from each othe The statements below for example both produce different display output PRINT abc PRINT ABC Special Symbols and Control Codes Symbols and control codes used outside of a character strin
239. ppendix D 1 O Ports lists the I O ports Appendix E Key Number Assignment on the Keyboard shows the number assignment for the keyboard Appendix F Memory Area describes the memory area allocations Appendix G Handling Space Characters in Downloading describes how to handle different types of space characters during downloading Appendix H Programming N otes describes specific programming tips Appendix Backlight Function describes how to use the backlight function Appendix J Program Samples shows sample programs to use on the PDT 1100 Appendix K Quick Reference for Statements and Functions lists the statements and functions by categories Appendix L Unsupported Statements and Functions lists what M S BASIC supports that BASIC 3 0 does not Appendix M Communications describes in detail the communications procedures and parameters Notational Conventions The following conventions are used in this document Italics are used to highlight specific items in the general text and to identify chapters and sections in this and related documents Bullets indicate action items lists of alternatives lists of required steps that are not necessarily sequential Sequential lists e g those that describe step by step procedures appear as numbered lists Itemsin regular courier fontindicate constant syntax items in italic courier Xiv font indicate variable syntax About This Guide Servic
240. provides detailed descriptions of the statements used to program the PDT 1100 terminal 10 1 T PDT 1100 Terminal Programmer s Guide APLOAD Statement Name ANK Pattern LOAD Type I O Statement Description Loads a user defined font in the single byte AN K mode AN K Alphanumeric and Katakana Syntax APLOAD characode fontarrayname where characode A numeric expression which returns a value from 128 80h to 159 9Fh fontarrayname An array integer variable name Note Do not specify parentheses or subscripts which represent a general array as shown below or a syntax error results APLOAD amp H80 cp error APLOAD amp H80 cp 5 error Notes APLOAD loads a user defined font data defined by fontarrayname to the user font area specified by characode e To display user defined fonts loaded by the APLOAD use the PRINT statement in the single byte AN K mode If you attempt to display an undefined character code a space character appears e InthePDT 1100 if the small size font is selected user defined fonts loaded by the APLOAD are condensed into small size 6 dots wide by 6 dots high for display For the generating procedure of the small sized user defined fonts refer to Display M ode and Letter Size on page C 4 e Theloaded user defined fonts are in effect when the user program which loaded those fonts is running and during execution of the successive user programs chained by the CHAIN sta
241. ption Causes program execution to resume at a specified location after control is transferred to an error handling routine Syntax Syntax 1 RESUME 0 Syntax 2 RESUME NEXT Syntax 3 RESUME label Notes RESUME returns control from the error handling routine to a specified location of the main program to resume program execution The RESUME instruction has three forms as listed below The form determines where execution resumes RESUME Or RESUME 0 Resumes program execution with the statement that caused the error RESUME NEXT Resumes program execution with the statement immediately following the one that caused the error RESUME label Resumes program execution with the statement designated by label The RESUME statement should be put inside the error handling routine 10 118 Statement Reference Syntax Error Error Code and Message Meaning error 71 Syntax error label has not been defined Execution Error Error Code M eaning 14h RESUME Without error resume instruction occurs before the start of an error handling routine Reference Statements ON ERROR GOTO Functions ERR and ERL 10 119 T PDT 1100 Terminal Programmer s Guide RETURN Statement Name Return Type Flow Control Statement Description Returns control from a subroutine or an event handling routine for keystroke interrupt Syntax RETURN Notes
242. r a control code to a function key also defines a function key astheLCD backlight function on off key This statement also defines an M key asthetrigger switch shift key or battery voltage display key Syntax Syntax 1 Assigning a string or a control code to a function key KEY keynumber stringdata Syntax 2 Defining a function key as the backlight function on off key KEY backlightkeynumbey onduration Syntax 3 Defining an M key as the trigger switch shift key or battery voltage display key KEY M keynumber TRG Trigger switch KEY M keynumber SFT Shift key KEY M keynumber BAT Battery voltage display key where keynumber A numeric expression which returns a value from 1 to 31 33 and 38 stringdata A string expression which returns up to two characters or a control code backlightkeynumber A numeric expression which returns a value from 1 to 31 33 and 38 onduration Keyword BL and a string expression which returns a value from 0 to 255 BLO to BL255 M Keynumber 30 31 35 10 61 T PDT 1100 Terminal Programmer s Guide Notes Assignin KEY g a string or a control code to a function key in Syntax 1 assigns a string or a control code specified by stringdatato a function key specified by keynumber Pressing the specified function key generates the assigned string data or control code and then passes it to the user program as if each character is keyed in directl
243. r is included in the code the data is not temporally stored and all the data excluding the FN C2 character is transmitted to the bar code buffer 3 FNC3 IfaFNC3 character is included in the code no read data is transmitted to the bar code buffer When the LED indicator and or the buzzer vibrator are is enabled only these two functions become operable 4 FNC4 InaFNC4 character the data encoded by Code Set A or B is converted into Extended ASCII data Full ASCII 128 One FN C4 character converts one subsequent data character into Extended ASCII data A pair of FN C4 characters in succession keeps converting all of the subsequent data characters into ASCII data until another such pair or the stop character is encountered H owever if only one FN C4 is encountered the data character right after the FN C4 is excluded from this data conversion The GS character s converted from FN C1 is also excluded from the same conversion Field Length Restriction When a data file is transmitted from PDT 1100 according to the communications protocol the maximum field length is 255 bytes including a character count byte The host computer should support the same field length H 8 Appendix Backlight Function Press the M 1 key while holding down the Shift key to activate or deactivate the backlight function The default backlight on time on duration is 3 seconds You can also use a KEY statement to select the backlight function on off key a
244. r the Compiler 00 cece tte 2 8 Screen Shown During Execution of theCompiler 0 0 cece eee 2 10 Output from the Compiler 0 20 0 cee tenes 2 10 Generating a User Program 0 0 c cette eee tenets 2 12 Error Mess A atest ti a Aten ata Rae he here BO ae Weta a ata earn Be A Real aha 2 12 Compiling OPtlOnsSi 0 lt wees egy os de an ee eS 2 14 Designating the Work Drive and Directory 00 cece tees 2 15 Downloading acraea a TA Ge Gwe EO id Vuk Se Se eh 2 16 Ir Transfer Utility C Ir Transfer Utility E aoaaa aaa 2 16 Setting upthe PDT T1002 de pena dog seeded itd wana aa nega Rp oe Pe een tte ae ws 2 16 Executing a User Program ooo 2 17 SEGUE IN lees cheat e ori ee he 2 17 EXeCUtION cx iaa e iaa da ed ds 2 17 TAMIL de dia a 2 17 Chapter 3 Program Structure Statement BLOCKS TE maamaa a aa a qa sin tio wala Bate ita 3 1 SUDEQUN ES swine atar a a e E ida 3 1 Error Event H andling Routines 0 0 cece rr 3 1 Block Format User Defined Functions ooocoococcoccco a 3 1 Block Structured Statements 0 0 ce eee 3 2 Jumping Into O ut of Statement BIOCKS 1 ee tee 3 3 Handling User Programs 0 0 eee eet 3 4 User Programs in the Memory ooocccccococ 3 4 Program Chaining se reran o e a e ed 3 4 Included ls o A A A RA den aan tice aac dan AIR a 3 5 Chapter 4 Basic Program Elements Structure of a Program Li it tt A AA ce aera ct wed 4 1 Format of a Program Line ooccoo
245. ram file name should be a If the program file name is maximum of 12 characters in length less than 12 characters in 35864064 eps and consist of FILE NAME and EXTENSION The FILE NAME should be 1 to 8 characters The EXTENSION should be PD3 FN3 and EX3 may be available for future functional expansion length the lower blank bytes are filled with space characters Figure M 16 ProgramText Format M 18 texts should be 0 to 32767 If itis less than 5 digits the upper blank bytes are filled with zeros 0 Communications Data Text Format 128 or 130 Byte DRA a A AAA tarios Position T T 2 t T T T T T T T T T T T T T T T T T y 128 bytes if extension is PD3 Program Data 130 bytes if it is FN3 or EX3 Example of Contents fi i jo 1 a pes j L 0 D 0 A 0 0 0 0 0 0 l 35864065 eps Object file compiled from a If a program data field is source program file having the less than the maximum extensions PD3 FN3 or digits the lower blank bytes EX3 are filled with zeros 0 Figure M 17 Data Text Format Number of Fields 2 bytes Length of Data Field 1 Length of 2 bytes Data Field n Byte 2 bytes Position 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1920 21 T T T T T T T T T T y Number of Data Data File Name Texts Contained 12 bytes 5 bytes Example of Contents M A S T E R D A T L 0 0 5 9 2 n 0 6 1 0 J
246. response to EN Q Phase 1 negative acknowledgment response to text Phase 2 ThePDT 1100 uses non transparent mode It views the control characters and codes e g STX ETX and SOH as starting or ending markers and does not transmit them as normal data in the transmission texts M 6 Communications Text control characters format transmission texts In the protocol they include the following headers and a terminator Table M 4 Text Control Characters Symbol Value M eaning Function SOH 01h Start Of H eading Indicates the start of heading text Phase 2 STX 02h Start Of Text Indicates the start of data text Phase 2 ETX 03h End Of Text Indicates the end of data text Phase 2 You may designate headers and a terminator with the protocol functionsin BASIC 3 0 If you do not designate them in a user program the PDT 1100 may apply them as listed above Format of Transmission Messages The PDT 1100 transmits data as units of a file First it transmits a heading text which includes the file information e g file name and the number of data texts to be transmitted Then it transmits the data text in the file A heading text and data text comprise a text In text transmission the text is divided into several blocks with a header and terminator added to each block If the serial number management or error checking by BCC Block Check Character is required the serial number
247. ring Syntax 1 without specification of i1enumber INPUTS reads a string or control codes from the keyboard INPUTS does not echo back read characters on the LCD screen Thecursor shape invisible underlined or full block depends upon the specification selected by the LOCAT E statement If any key previously specified for keystroke trapping is pressed during execution of the INPUTS the keyboard input will beignored that is neither typed data is read by INPUTS nor Keystroke is trapped 11 28 Function Reference Syntax 2 with specification of i1enumber INPUTS reads from a device file the bar code device file or any of the communications device files Usethe Loc function to indicate the number of characters in a device file Execution Error Error code 05h 34h 36h 3Ah Reference Statements Functions Meaning Parameter out of range numcharas is out of range Bad file name or number fi Jenumber of an unopened file specified Improper file type i1enumber of a data file specified File number out range CURSOR INPUT LINE INPUT LOCATE OPEN BAR and OPEN com EOF INKEYS LOC and Lor 11 29 T PDT 1100 Terminal Programmer s Guide INSTR Function Name IN STRing Type String Function Description Searches a specified target string for a specified search string and then returns the position wherethe search string is found Syntax INSTR
248. ring which is expressed with 0 to 9 and A toF Listed below are conversion examples numericexpression Returned value 32 768 8000 1 FFFF 00 Ti 32 767 7FFF Execution Error Error code M eaning 06h The operation result is out of allowable range 11 24 INKEY Function Reference Function Name IN put KEY board Description Returns a character read from the keyboard Syntax INKEYS Notes INKEYS reads from the keyboard to see whether a key has been pressed and returns one character read If no key has been pressed INKEYS returns a null string For the character codes refer to Appendix C Character Sets For the key number assignment refer to Appendix E Key Number Assignment on the Keyboard Type 1 0 Function INKEYS does not echo back a read character on theLCD screen A common use for INKEYS is to monitor a keystroke while the PDT 1100 is ready for bar code reading or other events If any key previously specified for keystroke trapping is pressed INKEYS cannot return the typed data since the To display the cursor use the OCA INK EYS has lower priority than keystroke trapping E and CURSOR statements as shown below LOCATE 1 CURSOR ON k INKEYS IF k k THEN Reference Statements CURSOR LOCATE KEY ON and KEY OFF Functions ASC and INPUTS 11 25 T PDT 1100 Terminal Programmer s Guide INP Function Name IN put data
249. riting operations is limited to approximately 10 000 e In application programs you cannot write data onto the flash ROM Theuser area is 568 kilobytes or 64 kilobytes depending upon the ROM size For details refer to Appendix F M emory Area System Programs Drivers The BASIC 3 0 Interpreter or System M ode calls a set of programs which controls the hardware The drivers include the Decoder Software used for bar code reading BASIC 3 0 Interpreter Interprets and executes user programs or Easy Pack System Mode Sets up the execution environment for user programs or Easy Pack Extension Programs Enable the following functions of the BASIC 3 0 e Displays ruled lines on the LCD Transmits receives files using the X M ODEM and Y M ODEM protocols These extension programs are stored in files having an FN 3 extension in each file per function Download a xxxx FN 3 file containing the necessary function from the BASIC 3 0 Extension Library to the user area 12 Software Overview Application Programs User Programs User written object programs which are ready to be executed Easy Pack Application program used for bar code data collection Overview of BASIC 3 0 With BASIC 3 0 you can customize application programs to meet specific needs e Retrieve products names price information etc in a master file e Includecheck digits in bar code reading to make a checking procedure more reliable e Improve the checkin
250. rocedures using BASIC 3 0 are outlined below Creating a Source Program Create a source program using an editor according to the syntax of BASIC 3 0 Compiling Compilethe source program by the Compiler to generate a user program an object program Downloading the User Program Download the user program to the PDT 1100 by using Ir Transfer Utility C 2 2 Development Environment and Procedures Executing the User Program Execute the user program on the PDT 1100 Functions of the Compiler The Compiler has the following functions Functions of the Compiler Description Syntax check Detects syntax errors in source programs Output of a user program Translates a source program into a user program in intermediate language When downloaded to the PDT 1100 by Ir Transfer Utility C the user program is packed to be executed by the Interpreter Output of debug information Outputs list files and debug information files Developing Procedure Flow Thesteps below shows the developing procedure On an Windows Personal Computer 1 Writea source program Tool Editor C gt EDIT userprog SRC CLS PRINT BASIC 3 0 END 2 Compilethe source program C gt BHTC3 userprog SRC Tool BASIC 3 0 Compiler If a compilation error occurs go back to step 1 and correct the program If no compilation error occurs and the user program is generated proceed to step 3 3 Download the user progra
251. rol disabled RD is used as an input port If RS cs is specified for the optical interface it is ignored with no execution eror RS CS also applies to the direct connect interface for Busy control Following is a program sample for enabling RS cs control OPEN COM 1 AS 16 10 97 T PDT 1100 Terminal Programmer s Guide An OUT statement can be used instead of the OPEN com statement to control the RS signal or the ER signal A wAIT statement or INP function can be used to monitor the CS signal or CD signal To connect the PDT 1100 to an asynchronous half duplex modem use the ouT and WAIT statements and INP function timeout timeout is the maximum time from 0 to 255 in increment of 100 ms until the CS signal goes ON after the PDT 1100 becomes ready to send data Assigning zero 0 causes no timeout The optical interface of the PDT 1100 does not support timeout If specified the timeout option is ignored with no execution error T he direct connect interface supports timeout set the RS cs option to 2 or 3 so theRD signal is regarded as CS If the Rs cs option is set to 0 1 or 4 the value of the timeout option is modified Syntax Error Error Code and Message Meaning error 71 Syntax error filenumber IS missing Execution Error Error Code Meaning 02h Syntax error the x in com x contains an invalid parameter 37h File already open 3Ah File number out
252. ror Error Code M eaning 05h Parameter out of range expression is negative or greater than 255 07h Insufficient memory space too many program nesting levels by cosub instructions Reference Statements GOSUB GOTO and SELECT CASE END SELECT 10 81 T PDT 1100 Terminal Programmer s Guide ON KEY GOSUB Statement Name On Key Gosub Type 1 0 Statement Description Specifies an event handling routine for keystroke interrupt Syntax ON KEY keynumber GOSUB label where keynumber A numeric expression which returns a value from 1 to 31 and 33 to 38 Notes According to label ON KI invoked if a function key EY GOSUB specifies the first line of an event handling routine to be specified by keynumber is pressed Refer to Appendix E Key Number Assignment on the K eyboard ON KEY GOSUB specifies the location of an event handling routine but does not enable keystroke trapping Refer to KEY ON and KEY OFF on page 10 66 for keystroke trappin g e Assigning zero 0 to Zabel disables keystroke trapping e Ifa keystroke trap occurs the Interpreter executes KEY OFF instruction for the pressed function key before passing control to an event handling routine specified by label in ON KEY GOSUB instruction This prevents a same event handling routine from becoming invoked again by pressing a same function key during execution of the routine until the current event handling rout
253. ror Error Code and Message Meaning error 71 Syntax error label has not been defined label is missing 10 52 Statement Reference IF THEN ELSE END IF Statement Name If Then Else End If Type Flow Control Statement Description Conditionally executes specified statement blocks depending upon the evaluation of a conditional expression Syntax Syntax 1 IF conditionalexpression THEN statementblock1 ELSE statementblock2 END IF IF conditionalexpression ELSE statementblock END IF where conditionalexpression A numeric expression which evaluates to true or false Notes IF statement block tests whether conditionalexpression is true or false If the condition is true not zero statementblock which follows THEN is executed if it is false Zero statementblock which follows ELSE is executed Then program control passes to the first statement after END IF You can omit either THEN block or ELSE block IF statement block should terminate with END IF which indicates the end of the block 10 53 T PDT 1100 Terminal Programmer s Guide J IF statement blocks can be nested W hen using the IF statement block together with other block structured statements FOR NEXT SELECT CASE END SELECT and WHILE WEND you can nest them to a maximum of 30 levels A block structured IF statement block has the following advantages over a single lin
254. rrent screen modeis returned it means that the cursor stays outside of the rightmost column e When thesmall size font is selected a full or half width character occupies a screen area two times or one time as wide as a character in the single byte AN K mode respectively e 0 isadummy parameter that can have any value or expression but it is usually 0 For the current row number of the cursor refer to the CSRLIN function Reference Statements LOCATE and SCREEN Functions CSRLIN 11 43 T PDT 1100 Terminal Programmer s Guide RIGHTS Function Name RIGHT Type String Function Description Returns the specified number of rightmost characters from a given string expression Syntax RIGHTS stringexpression stringlength where stringlength A numeric expression which returns a value from 0 to 255 Notes Starting at the right side of the string RIGHTS extracts a portion of a string specified by stringexpression by the number of characters specified by stringlength If stringlengthis zero RIGHTS returns a null string f stringlength is greater than the length of stringexpression the whole stringexpression is returned Execution Error Error code M eaning 05h Parameter out of range stringlength is out of range Reference Functions LEN LEFTS and MIDS 11 44 Function Reference SEARCH Function Name SEARCH Type Filel O Function Description Searches a specified data file for specified d
255. s is 64 kilobytes You can specify an initial value to an array variable by enclosing it in braces 3 No comma is allowed for terminating the list of initial values If the number of the specified initial values is less than that of the array elements or if no initial value is specified Compiler sets a zero 0 or a null string as an initial value for a numeric variable or a string variable of the array elements not assigned initial values respectively Syntax Error Error Code and Message Meaning error 6 Variable name A same register variable name is declared twice in a program redefinition error 71 Syntax error stringlengthis not an integer constant The number of the specified initial values is greater than that of the array elements The list of initial values is terminated with a comma The type of the specified variable does not match that of its initial value note that a real variable can have an integer constant as an initial value subscript is not an integer constant error 73 Improper stringlength is out of range string length error 74 Improper subscript is out of range array element number error 75 Out of space Definition by perreEG exceeds the register variable area for register variable area 10 26 Statement Reference error 77 Initial The dimension of the specified array variable does not match string too long that of its initial value The number of initial value elements for the spe
256. smits a file from the PDT 1100 ROrr Receives a file from the host computer Example XFILE d2 dat R filename or drivename filename cannot be omitted even in file reception Serial number Parameter omitted default No serial number setting sors Adds a serial number to every transmission block Example XFILE a2 dat s A 5 digit decimal serial number follows the text control character heading each transmission block When less than five digits the upper digits with no value are filled with zeros Horizontal parity checking BCC Parameter omitted default No horizontal parity checking POrp Suffixes a BCC to every transmission block Example XFILE d2 dat P A block check character BCC follows the terminator of each transmission block The horizontal parity checking checks all bits except for headers SOH and STX 10 131 T PDT 1100 Terminal Programmer s Guide s Transmission monitoring Parameter omitted default No serial number indication MOF m Displays a serial number of the transmission block during file transmission Example XFILE d2 dat M A 5 digit decimal serial number appears at the current cursor position before execution of the XFILE instruction Space codes in the tail of a data field during file transmission Parameter omitted default Ignores space codes Tort Handles space codes as data Example
257. ss data files or device I O files first use the open statement to open those files Input or output data to from the opened files by issuing statements or functions to them according to their file numbers Then close those files using the crose statement 8 1 M PDT 1100 Terminal Programmer s Guide S Data Files O verview Calculate the memory capacity available for data files by subtracting the memory space occupied by both the system programs and user programs from thetotal RAM capacity The available memory capacity is the calculated RAM capacity plus the flash ROM capacity calculated by subtracting the memory space occupied by user programs from the user area For the memory mapping refer to Appendix F Memory Area The Fre function checks the current occupation of the memory The zor function cannot be used for data files Naming Files The name of a data file generally contains fi 1ename extension The filename can have one to eight characters the extension can have one to three characters The filename extension should be preceded by the drivename The drivename isa for specifying theRAM ors for flash ROM If drivename is omitted the default a RAM applies The following file names cannot be used for data files since they are reserved for Easy Pack PACK1 DAT PACK2 DAT PACK3 DAT PACK4 DAT The extension Can be omitted In such a case a period should be also omitted The following extensions cannot
258. startposition targetstring searchstring where startposition A numeric expression which returns a valuefrom 1 to 32 767 targetstring and searchstring A string expression Notes INSTR searches a target string specified by targetst ring for a search string specified by searchstring and then returns the first character position of the search string first found e startposition is the character position where the search is to begin in targetstring If you omit startposition option the search begins at the first character of targetstring targetstringis the string being searched e searchstringisthestring you are looking for Do not mistake the description order of targetstring and searchstring A returned value of INSTRis a decimal number from 0 to 255 depending upon the following conditions 11 30 Function Reference Conditions Returned value If searchstring is found within First character position of thesearch string first targetstring found If startposition is greater than the length 0 Of targetstring or 255 If targetstring IS a null string 0 If searchstringis not found 0 If searchstring IS a null string Value of startposition l if startposition option is omitted Execution Error Error code M eaning 05h Parameter out of range startposition is out of range Reference Functions LEN 11 31 T PDT 1100 Terminal Programmer s Guide INT Function Name IN Teger Type Numeric O peratio
259. string variable you can specify the string length If its specification is omitted the default value of 20 characters takes effect If no subscript is specified for a string variable Compiler regards the string variable as a non array string variable so that the default for a non array string variable 40 characters takes effect Syntax Error Error Code and M eaning M essage error 7 Variable The array declared with prm had been already declared with name redefinition DEFREG error 71 Syntax stringlength is out of range Sorar stringlength is not an integer constant error 72 Variable A same variable name is declared twice inside a same DIM name redefinition statement A same variable name is used for a non array variable and array variable error 78 Array M orethan 30 variables are declared inside one pim statement symbols exceed 30 for one DIM statement 10 38 Statement Reference Execution Error Error Code 07h 08h 09h 0Ah Reference Statements M eaning Insufficient memory space the variable area has run out Array not defined Subscript out of the range an array referred to is different from a defined array in dimension Duplicate definition an array is declared twice ERASE and DEFREG 10 39 T PDT 1100 Terminal Programmer s Guide END Statement Name End Type Flow Control Statement Description Terminates program execution Syntax END Notes END terminates
260. sults in the returned value of one character for example describe as follows DEF FNshort 1 1 5 6 Data Types If the returned value is more than 40 characters set the actually required length T o define a function which results in the returned values of 128 characters for example describe as follows DEF FNlong i 128 Dummy Arguments and Real Arguments Dummy arguments define user defined functions In the example below is isa dummy argument DEF FNfunc 15 dummy i 5 END DEF Real arguments are passed to user defined functions when those functions are called In the example below 3 is a real argument PRINT FNfunc 3 Type Conversion BASIC 3 0 type conversion facility converts a value of one data type into another data type during value assignment to numeric variables and operations from a real number into an integer number by rounding off and vice versa depending upon the conditions The Interpreter converts a value of a real into an integer in the following cases Assignment of real expressions to integer variables Operands for an arithmetic operator mop Operands for logical operators AND OR NOT and XOR Parameters for functions File numbers In the type conversion from real into integer the allowable value range of the resulting integer is limited as shown below If the resulting integer comes out of the limit an execution error occurs 32768 resultantintegervalue
261. symbol PDT 1100 Terminal 70 36099 01 Revision B May 2001 Symbol Technologies Inc O ne Symbol Plaza Holtsville N Y 11742 1300 PDT 1100 Terminal Programmer s Guide 70 36099 01 Revision B May 2001 2001 by Symbol Technologies Inc All rights reserved No part of this publication may be reproduced or used in any form or by any electrical or mechanical means without permission in writing from Symbol This includes electronic or mechanical means such as photocopying recording or information storage and retrieval systems The material in this manual is subject to change without notice The software is provided strictly on an asis basis All software including firmware furnished to the user is on a licensed basis Symbol grants to the user a non transferable and non exclusivelicenseto use each softwareor firmware program delivered hereunder licensed program Except as noted below such license may not be assigned sublicensed or otherwise transferred by the user without prior written consent of Symbol No right to copy a licensed program in whole or in part is granted except as permitted under copyright law The user shall not modify merge or incorporate any form or portion of a licensed program with other program material create a derivative work from a licensed program or use a licensed program in a network without written permission from Symbol The user agrees to maintain Symbol s copyright notice on the l
262. system area of the memory The directory information for example contains the following filename extension Information of Each Field Field length Number of Written Records Maximum Number of Registrable Records 8 3 M PDT 1100 Terminal Programmer s Guide 7 Number of W ritten Records The Lor function returns the number of records already written in a data file If no record number is specified in the put statement the Interpreter assigns the current written record number 1 to the record PUT 1 Maximum Number of Registrable Records You may declare the maximum number of records registrable in a data file using the recorD option in the open statement as shown below OPEN work DAT AS 10 RECORD 50 FIELD 410 13 AS code 5 AS price The above program allows you to write up to 50 records in the data file named worx Dar If the statement below is executed following the above program an execution error occurs PUT 10 51 The maximum number of registrable records can be optionally specified only when you make a new data file If designated to the already existing data file the specification will be ignored without an execution error Specifying the maximum number of registrable records does not cause the Interpreter to reserve the memory area Programming for Data Files Input O utput for Numeric Data To write numeric data into a data file Use the strs function to convert the value of a numeric expression in
263. t ThePDT 1100 manages the user area of the memory by a 4 kilobyte or 8 kilobyte segment called a cluster for user programs and data files In units with 2048 kilobyte RAM the cluster size is 8 kilobytes in other units it is 4 kilobytes The maximum allowable size for a single user program is 64 kilobytes excluding register variables Battery Backup of Memory ThePDT 1100 backs up user programs and data files stored in the memory with dry batteries or a battery cartridge so data is not lost if the program is terminated or the unit is powered off Backed up data is listed below User programs Execution status of a current user program Data files Register variables Screen contents o gt gt o F 2 Memory Area Keyboard status Memory Space Available for Variables Listed below arethe maximum memory spaces availablefor work common and register variables Variables Maximum memory space Work and common variable area 6KB Register variable area 64 KB Each variable occupies the memory space listed below Variables Memory occupation An integer variable 2 bytes A real variable 6 bytes A string variable 2 to 256 bytes including a single character count byte An array variable occupies the memory space by number of bytes per array element x number of array elements F 3 M PDT 1100 Terminal Programmer s Guide S F 4 Appendix G Handling Space Characters in Downloading Spac
264. ta to variable prompt is a prompting message to be displayed on the LCD Thesemicolon and comma after prompt have the following meanings If prompt is followed by a semicolon the INPUT instruction displays the prompting message followed by a question mark and a space INPUT data a data If prompt is followed by a comma the instruction displays the prompting message but no question mark or space is appended to the prompting message INPUT data a data 10 55 s 10 56 T PDT 1100 Terminal Programmer s Guide The cursor shape specified by the most recently executed LOCATE instruction takes effect Even after execution of the CURSOR OFF instruction the INPUT instruction displays the cursor Data inputted by the user echoes back to theLCD To assign it to variable press the ENT key Pressing the ENT key causes a line feed except when INPUT is followed by a semicolon in an INPUT statement If you type no data and press the ENT key an INPUT instruction automatically assigns a zero or a null string to variable When echoed back data is displayed on the LCD press the Clear key to erase all displayed data or BS key to erase the last character of data If no data is displayed pressing Clear or BS has no effect N otes for entering numeric data The effective length of numeric data is 12 characters The 13th typed in literal and the following is ignored
265. tax error filenumber iS missing 10 13 T PDT 1100 Terminal Programmer s Guide Execution Error Error Code M eaning 34h Bad file name or number i1enumber of an unopened file specified 36h Improper file type i1enumber of a file other than data files specified 3Ah File number out of range 43h Not allowed to access the data in the flash ROM Example OPEN master Dat AS 1 FIELD 41 20 AS bar 10 AS ky CLFILE 1 CLOSE 1 10 14 Statement Reference CLOSE Statement Name Close Type Filel O Statement Description Closes file s Syntax CLOSE 14 filenumben filenumber where filenumber A numeric expression which returns a value from 1 to 16 Notes CLOSE Closes file s specified by i1enumbexts Thefilenumber s closed by the CLOSE instruction becomes available for a subsequent OPEN instruction If no file number is specified the CLOSE instruction closes all opened data files and device 1 O files e Specifying the unopened file number does not cause an operation or execution error Syntax Error Error Code and Message Meaning error 71 Syntax error filenumber IS missing 10 15 T PDT 1100 Terminal Programmer s Guide Execution Error Error Code M eaning 3Ah File number out of range Reference Statements END and OPEN 10 16 Statement Reference CLS Statement Name CLear Screen Type 1 0 Statement Description Clears the LCD screen
266. ted EOT transmission due to no response or invalid response If the sending station receives no response or any invalid response from the receiving station in response to an EOT sent it repeats the EOT at three second intervals up to ten times If the M 15 M PDT 1100 Terminal Programmer s Guide S sending station receives an ACK during this time it terminates the message transmission normally and releases the data link Sending Receivin Station M n 3 second EOT 3 seconds ee A Nor Termination Figure M 13 Phase 3 with repeated EPTs Abnormal termination of phase 3 If the sending station receives no ACK from the receiving station within three seconds from the 10th EOT it aborts the message transmission and releases the data link Sending Receivin Station EOT 1 Station 3 second EOT 2 3 second EOT 3 3 seconds Abnormat Termination 35864061 eps Figure M 13 Abnormal Termination of Phase 3 Aborting DataT ransmission Pressing the C key aborts data transmission If theC key is pressed during downloading the PDT 1100 transmits an EOT and aborts the file transmission If it is pressed during uploading the PDT 1100 transmits the current transmission block followed by EOT and then aborts the file transmission Communications BCC for Horizontal Parity Checking ThePDT 1100 supports horizontal parity checking for every transmissi
267. tement 10 2 Statement Reference If you issue more than one APLOAD statement specifying a same character code the last statement takes effect Thelnterpreter refers to the array data defined by fontarrayname only when it executes the APLOAD statement O nce a user program has finished loading the user font changing the data in the array or deleting the array itself by the ERASE statement does not affect the loaded user font e An array integer variable a work array register array or common array for fontarrayname should be declared by the DIM DEFREG or COMMON statement respectively DIM cp0 5 DEFREG cp1 5 COMMON cp2 5 The array variable should be one dimensional and have at least six elements Each element data should be an integer and stored in the area from the first to 6th elements of the array Syntax Errors Error Codeand Message Meaning error 71 Syntax error NO fontarrayname is defined fontarrayname has an array string variable fontarrayname includes parentheses fontarrayname includes subscripts Execution Errors Error Code M eaning 05h Parameter out of the range characode is out of the specified range e Thearray structure is not correct 08h Array not defined 10 3 T PDT 1100 Terminal Programmer s Guide Example DIM cp 5 cp 0 H00 cp 1 amp H08 cp 2 amp H1C cp 3 amp H3E cp 4 amp H7F cp 5 H00 APL
268. ters read from the keyboard or from a device file Beeping Statements Definitions BEEP Sounds the beeper K 4 Quick Reference for Statements and Functions Manipulating System Date Current Time or Timers Functions Definitions DATES Returns the current system date or sets a specified system date TIMES Returns the current system time or wake up time or sets a specified system time or wake up time TIMEA Returns the current value of timer A or sets timer A TIMEB Returns the current value of timer B or sets timer B TIMEC Returns the current value of timer C or sets timer C Communicating with I Os Statements Definitions OUT Sends a data byte to an output port POWER Controls the automatic power off facility WAIT Pauses program execution until a designated input port presents a given bit pattern Functions Definitions FRE Returns the number of bytes available in a specified area of the memory INP Returns a byte read from a specified input port K 5 S M PDT 1100 Terminal Programmer s Guide Communicating with Bar Code Device Statements Definitions CLOSE Closes file s INPUT Reads data from a device I O file into specified variables OPEN BAR Opens the bar code device file also activates or deactivates the reading confirmation LED and the beeper in
269. the ACK NAK response method to transmit files between the PDT 1100 and a host or between PDT 1100s The protocol is composed of a defined set of control character sequences including the following three phases Phase 1 Establishment of data link the sending station confirms that the receiving station is ready to receive data Phase 2 Data transmission the sending station transmits data to the target receiving station Phase 3 Release of data link T he sending station confirms whether or not all of the transmitted data has been correctly received by the receiving station If yes the sending station terminates the data transmission and releases the data link Control Characters There are two groups of control characters transmission control characters and text control characters The transmission control characters in the following table compose transmission control sequences in phases 1 through 3 Table M 3 Transmission Control Characters Symbol Value M eaning Function EOT 04h End Of Transmission Releases a data link Phase 3 requests abort of transmission Phase 2 ENQ 05h Enquiry Requests establishment of a data link Phase 1 prompts the receiver to respond to the sent text Phase 2 ACK 06h Acknowledge Acknowledgment response to ENQ Phase 1 acknowledgment response to text Phase 2 acknowledgment response to EOT Phase 3 NAK 15h_ NegativeAcknowledge N egative acknowledgment
270. the SET LINKUP TIME screen in System M ode and the X FILE statement given in PDT 1100 Terminal Programmer s Guide p n 70 36099 01 Abnormal termination of phase 1 A bort of phase 1 If the sending station receives no ACK from the receiving station after sending an ENQ 10 times in succession it sendsan EOT to the receiving station three seconds after 10th EN Q to terminate the message transmission Sending Receiving Station ENQ 1 Station 3 O Ena 3 io BIE ENQ 10 3 seconds Abnormal Termination 35864056 eps Figure M 8 Abort of Phase 1 Note Thereceiving station s default timeout is 30 seconds You may modify the timeout length on the SET LINKUP TIME screen in System M ode p 52 or by using the X FILE statement refer to thePDT 1100 Terminal Programmer s Guide p n 70 36099 01 Phase 2 Data Transmission Normal phase 2 The sending station first sends a transmission block containing the heading text Each time the sending station receives an ACK from the receiving station it sends a transmission block containing the data texts as shown below Upon receipt of an ACK in response to the last transmission block data text n the sending station shifts to phase 3 If M 11 M PDT 1100 Terminal Programmer s Guide S a transmission message contains no data text the sending station transmits the heading text only Sending Receiving Station E ee Station AC
271. the data is written into that VRAM area but cannot be displayed on the bottom line INP function If you specify theVRAM area assigned to theright end of the bottom lineof the LCD as an input port the rnp function reads one byte data from that area 7 2 I O Facilities Notes when displaying the system status with our statement Specifying the system status indication with the out statement overwrites the system status on the current data shown at the right end of the bottom line of the LCD Notes when erasing the system status with the our statement Erasing the system status with the our statement displays the content of the VRAM area assigned to the right end of the bottom line of the LCD on that part of the LCD Input from the Keyboard Alphabet Input Function The alphabet input function allows you to enter letters a space and symbols from thePDT 1100 keyboard keypad during execution of a user program To activate or deactivate the alphabet input function use our statement in a user program Three characters are assigned to each 0 9 numerical key and period key For example A B and C are assigned to the 7 key To designate one of the three assigned characters use the trigger switch Usethe M 1 or M 2 key when the trigger switch function or no function is assigned to the key ABC DEF GHI TI 18 9 JKL MNO PQR STU VWX YZsp 1 2 18 0 ENT Fi F2 F3 F4
272. the universal product codes UPC Interleaved 2 of 5 ITF Codabar N W 7 Code 39 Code 93 and Code 128 It also supports 10 89 T PDT 1100 Terminal Programmer s Guide the Standard 2 of 5 STF and the EAN 128 if Code 128 is specified For more information refer to the PDT 1100 User s M anual UPC a Syntax A code 1stchara 2ndchara supplemental where code iS A B or c specifying the following Table 10 3 UPC Specifications code Bar code A EAN 13 or UPC A B EAN 8 C UPC E If code is omitted the default is all of the universal product codes 1stchara 0r 2ndchara a numeral from 0 to 9 specifying the header character country flag If a question mark is specified to 1stchara or 2ndchara it acts as a wild card supplemental a supplemental code Specifying an sto supplemental allows the PDT 1100 to read also supplemental codes OPEN BAR AS n CODE A 49S Interleaved 2 of 5 ITF 1 Syntax I mini no digits max no digits CD 10 90 Statement Reference where mini no digitsand minimum and maximum number of digits for bar codes to be read max no digits bythePDT 1100 in the range of 2 to 99 If both mini no digits and max no digits are omitted the default reading range is 2 to 99 digits If only max no digits is omitted the PDT 1100 can only read the number of digits specified by mini no digits cD acheck digit Specifying a c causes t
273. tion M 29 M PDT 1100 Terminal Programmer s Guide S Phase 2 with a sequence of DLE NAK and IDs If the sending station receives a sequence of DLE NAK and IDsfrom the receiving station in response to a transmission block containing text data m it sends that transmission block again immediately as shown below If the sending station receives a sequence of DLE ACK and IDs before receiving the sequence of DLE NAK and IDs 10 times in succession it continues the subsequent message transmission Sending Receiving Station o E Station Data Text m DLE ACK and ID ata Text m DLE ACK and ata Text m 1 Figure M 26 Phase 2 with a sequence of DLE NAK and IDs If the sending station receives a sequence of DLE NAK and IDs 10 times in succession or it fails to send a same transmission block it proceeds to Phase 3 to abort the message transmission abnormally even if Phase 3 terminates normally Sendin Receiving Station Data Text m 1 Station DLE ACK and ID Data Text m 2 erat Data Text m 10 Occurrence Of An Error To phase 3 Figure M 26 Phase 2 with RepeatedT ransmission ofDLE ENQ and IDs M 30 Communications Phase 2 with a sequence of DLE EOT and IDs If the sending station receives a sequence of DLE EOT and IDs anytime during phase 2 it shifts to phase 3 to terminate the message transmission abnormally Even if the phase 3 terminates normally
274. tion Presence absence of bar code data input or the reader number of read characters bytes Receive buffer EOF LOC or LOF function Presence absence of receive data or the number of received characters bytes Timer TIMEA TIMEB Or TIMEC function Timer count up Monitoring with the INP Function Combining the ine function with the above functions enables more detailed programming for event polling For the tne function refer to Appendix D 1 0 Ports 9 2 Event Polling and Error Event Trapping Error Trapping If an execution error occurs during a program error trapping causes an interrupt upon completion of the machine instruction to transfer control from the current program to the error handling routine specified by a label If an execution error occurs when this trapping ability is disabled the Interpreter terminates the current user program while displaying the error message below Error message sample ERL 38A4 ERR 34 This message indicates that an execution error occurred at address 38A 4h and its error code is 34h Both the address and error code are expressed in hexadecimal notation The address corresponds to the address in the program list output by the Compiler so you can pinpoint the program line where the execution error occurred The error code 34h 52 in decimal notation means that the user program attempted to access a file not opened The ERL and ERR functions described in an error han
275. tion to increase searching speed Execution Error Error code M eaning 05h Parameter out of range 34h Bad file name or number i1enumber of an unopened file specified 36h Improper file type i1enumber of a bar code device file specified 3Ah File number out of range 3Eh A pur or cer instruction executed without a FIELD instruction no FIELD instruction is found Reference Statements FIELD GET and OPEN Functions LOF 11 46 Function Reference SOH Function Name Start Of Heading Type I O Function Description M odifies the value of a header Sou for the PDT 1100 protocol also returns the current value of a header Syntax Syntax 1 Changing the value of a header SOH stringexpression Syntax 2 Returning the current value of a header SOH where stringexpression A string expression which returns a single byte character Notes Syntax 1 SOHS modifies the value of a header one of the text control characters which indicates the start of heading text in the PDT 1100 protocol when a data file is transmitted by an XFILE instruction For the PDT 1100 protocol refer to the PDT 1100 User s M anual SOHS isa protocol function e Theinitial value of a header Sox is 01h Syntax 2 sous returns the current value of a header 11 47 T PDT 1100 Terminal Programmer s Guide Execution Error Error code M eaning OFh String length out of range stringexpression is more than a
276. to declare a new array variable with the DIM statement arrayvariablename should not include subscripts or parentheses as shown below DIM a 3 b1 5 10 c 3 20 ERASE a b1 c ERASE Cannot erase a register variable declared by the DEFREG statement a common variable declared by the common statement or a non array string variable 10 41 T PDT 1100 Terminal Programmer s Guide Syntax Error Error Code and Message Meaning error 71 Syntax error Erasing a register variable declared by DEFREG a common variable by common or a non array string variable attempted Reference Statements DIM and DEFREG 10 42 Statement Reference Statement Name Field Type Filel O Statement Description Allocates string variables as field variables Syntax FIELD filenumber fieldwidth AS fieldvariablel fieldwidth AS fieldvariable where filenumber numeric expression which returns a value from 1 to 16 fieldwidth A numeric expression which returns a value from 1 to 254 fieldvariable A non array string variable Notes FIELD declares the length and field variable of each field of a record in a data file filenumberisthefile number of a data file opened by the OPEN statement fieldwidth is the number of bytes for a corresponding field variable You can assign a same field variable to more than one field Thereisno differencein usage between a fie
277. to a string To write 12 56 into a data file for example a field length of at least 6 bytes is required When using the FIELD statement designate the sufficient field length otherwise data is lost from the lowest digit when written to the field To read data to be treated as a numeric from a data file Use the var function to convert a string into a numeric value 8 4 Files Data Retrieval The search function not only helps you make programs for data retrieval efficiently but also makes the retrieval speed higher The szarcx function searches a designated data file for specified data and returns the record number where the search data is first encountered If none of the specified data is encountered this function returns the value 0 Deletion of Data Files The cLrILE Or KILL statement deletes the designated data file CLFILE erases only the data stored in a data file without erasing its directory information and resets the number of written records to 0 zero in the directory This statement is valid only to opened data files KILL deletes the data stored in a data file together with its directory information This statement is valid only to closed data files Program Sample with the CLFILE Statement OPEN work2 DAT AS 1 FIELD 1 1 AS a CLFILE 1 CLOSE 1 Program Sample with the KILL Statement CLOSE KILL work2 DAT Restrictions on Input Output of Data Files NO INPUT LINE INPUT OF PRINT Stat
278. to separate two operators placed in succession Function operations Arithmetic operations Operations Arithmetic O perators Precedence N egation 1 M ultiplication and and 2 division M odulo arithmetic MOD 3 Addition and subtraction and 4 Relational operations 5 O gt lt lt gt lt gt 5 lt gt Logical operations Operations Logical O perators Precedence Logical N egation NOT 1 Logical multiplication AND 2 Logical addition OR 3 Exclusive logical addition XOR 4 String operations When morethan one operator occurs at the same level of precedence the BASIC 3 0 resolves the expression by proceeding from left to right a 4 5 0 20 2 1 In the above example the operation order is as follows 5 0 20 0 25 0 25 2 0 5 4 0 5 4 5 4 5 1 53 5 6 2 Expressions and Operators Operators Arithmetic O perators Arithmetic operatorsinclude a negative sign and operators for multiplication division addition and subtraction They also include modulo operator mop O perations Arithmetic O perators Precedence Examples N egation 1 a M ultiplication and division and 2 a b a b M odulo arithmetic MOD 3 a MOD b Addition and subtraction and 4 atb a b Modulo O peration MOD The mop operator executes the modulo operation that is it divides expression 1 by expression 2 see the format
279. tructure error 64 Function error 71 Syntax error M eaning The exit DEF statement is specified outside the function definition block The eno Der statement is specified outsidethe function definition block END DEF is missing The DEF FN END DEF statement is defined in other block structured statements such as For and IF statement blocks The same function name was defined twice functionname is an integer function name but generalexpression S a real type if functionname is a real function name and generalexpression is an integer type no error occurs stringlength is out of range stringlength is not an integer constant The function name is assigned a value outside the function definition block 10 35 T PDT 1100 Terminal Programmer s Guide When calling a user defined function Error Code and Message Meaning error 68 Mismatch The number of the real parameters is not equal to that of the argument type or number dummy parameters dummyparameter Was an integer variable in defining a function but realparameter is a real type in calling the function if dummyparameter Was a real variable in defining a function and realparameter is an integer type no error occurs error 69 Function Calling of a user defined function precedes the definition of the undefined user created function Execution Error Error Code M eaning 07h Insufficient memory space DEF Fw instructions nested to more than 10 levels
280. ue from 1 to 17 A numeric expression which returns a value from 1 to 6 A numeric expression which returns a value from 1 to 8 A numeric expression which returns a value from 0 to 2 A numeric expression which returns a value from 0 to 2 LOCATE moves the cursor to a position specified by column number and row number as coordinates on the LCD It also changes the cursor shape as specified by cursorswitch Thecursor location in the upper left corner of the LCD is 1 1 which is the default cursorswitch specifies the cursor shape as listed below 10 76 cursorswitch Value Cursor shape Underline cursor default 0 Invisible 1 2 Full block cursor Statement Reference Specification of the maximum valueto column moves the cursor off the screen and out of sight If you display data on the screen under the above condition the cursor moves to the first column of the next row from where the data appears e If you specify the right end of the bottom line as the desired cursor position when the system status is displayed the cursor becomes invisible Ifa parameter is omitted the current value remains active If you omit column for example the cursor stays in the same column but moves to the newly specified row position Any parameter value outside the range results in an execution error Execution Error Error Code M eaning 05h Parameter out of range Example LOCATE 1 2 LOCATE
281. ult N N orway s Spain W Sweden e After setting a national character set you may display it for codes from 32 20h to 127 7Fh on theLCD e If countrycode is omitted the default national character set is America code A 4 countrycode set by this function is effective in the programs chained by CHAIN statements If countrycode has more than one character only the first takes effect If countrycode is a letter other than those listed above the function is ignored e countrycode may bein lowercase COUNTRY 3 Syntax 2 COUNTRYS returns a current country code as an uppercase alphabetic letter 11 12 Function Reference CSRLIN Function Name CurSor LINe Type I O Function Description Returns the current row number of the cursor Syntax CSRLIN Notes CSRLIN returns the current row number of the cursor in the current screen mode selected by a SCREEN statement as an integer If the current screen modeisthesingle byte AN K mode this function returns a value from 1 to 6 when the standard size font is selected or from 1 to 8 when the small size font is selected if it is the two byte K anji mode this function returns a value from 1 to 5 when the standard size font is selected or from 1 to 7 when the small size font is selected e Even if the cursor is invisible by a LOCATE statement the cSRLIN function operates For the current column number of the
282. unction key F1 F2 or F3 these keys are numbered 1 2 and 3 respectively ON KEY ON KEY ON KEY KEY KEY KEY 1 2 3 1 2 3 ON ON ON GOSUB subl GOSUB sub2 GOSUB sub3 Main routine Event sub2 handling routine 1 handling routine 2 handling routine 3 The RETURN statement in the event handling routine returns control to the statement immediately following that statement where the keyboard interrupt occurred Even if a function key is assigned a null string by the xey statement pressing the function key causes a keyboard interrupt when the xey on statement activates the function key If function keys specified for keystroke trapping are pressed during execution of the following statements or functions relating keyboard input this trapping facility operates as described below Table 9 3 Statement and Function Statements or Functions Keystroke Trapping INPUT statement Ignores the entry of the pressed key and causes no interrupt LINE INPUT statement Same as above 9 5 M PDT 1100 Terminal Programmer s Guide S Table 9 3 Statement and Function Continued Statements or Keystroke Trapping Functions INPUTS function Same as above INKEYS function Ignores the entry of the pressed key but causes an interrupt 9 6 Chapter 10 Statement Reference Introduction This chapter
283. unctions SO H and STX Refer to SO H on page 11 47 and STX on page 11 50 M PDT 1100 Terminal Programmer s Guide S Vertical Parity gt 35864062 eps For 8 bit Data Character Horizontal Parity Byte BCC Figure M 3 Horizontal Parity Checking IR Protocol ThelR protocol is the communications procedure for the serial infrared link which is used to transmit files between the PDT 1100 and a host or between the PDT 1100s It adopts the response method using ACK NAK codes Thelr protocol can be used also for communications through the direct connect interface The Ir protocol is composed of a defined set of the control character sequences including the following three phases Phase 1 Establishment of data link the sending station confirms that the receiving station is ready to receive data Phase 2 Data transmission the sending station transmits data to the target receiving station Phase 3 Release of data link the sending station confirms that transmitted data has been correctly received by the receiving station If yes the sending station terminates the data transmission and releases the data link Communications Parameters In System M ode and user programs written in BASIC 3 0 you may set the communications parameters listed below Communications Table M 2 Communications Parameters Communications Port Optical i
284. ven character CHR Returns the character corresponding to a given ASCII code HEXS Converts a decimal number into the equivalent hexadecimal string INSTR Searches a specified target string for a specified search string and then returns the position where the search string is found LEFTS Returns the specified number of leftmost characters from a given string expression LEN Returns the length number of bytes of a given string MIDS Returns a portion of a given string expression from anywhere in the string RIGHTS Returns the specified number of rightmost characters from a given string expression STRS Converts a numeric expression into a string VAL Converts a string into a numeric value K 9 S M PDT 1100 Terminal Programmer s Guide Defining User C reated Functions Statements Definitions DEF FN Names and defines a user created function DEF FN END DEF Names and defines a user created function Specifying Included Files Statements Definitions SINCLUDE Specifies an included file REM SINCLUDE Specifies an included file K 10 Appendix L Unsupported Statements and Functions BASIC 3 0 does not support the following M S BASIC statements and functions For handling sequential data files CVD CVI CVS LSET For RS 232C interface operation PRINT USING WRITE For interrupt handling COM OFF COM ON COM
285. which returns a value from 1 to 16 data A numericor string expression CR LFcontrol A comma or a semicolon Notes PRINT outputs a numeric valueor a character string specified by datato a communications device file specified by fi lenumber filenumber is a communications device file number assigned when the file is opened CR LFcont rol If CR LFcontrol isa comma the PRINT instruction pads data with spaces so the number of data bytes becomes a least multiple of 8 before outputting the data Statement example PRINT 1 ABC 123 Output ABC 123 CR LF _ denotes a space If CR LFcontrol isa semicolon the PRINT instruction outputs data without adding spaces or control codes Statement example PRINT 1 ABC 123 Output ABC123 10 106 Statement Reference If neither a comma nor semicolon is specified to CR LFcontro1 the PRINT instruction adds CR and LF codes Statement example PRINT 1 ABC123 Output ABC123 CR LF To extend one program lineto more than 512 characters in a single PRINT statement use an underline _ preceding a CR code instead of a comma Syntax Error Error Code and Message Meaning error 71 Syntax error filenumber IS missing data contains a comma or semicolon Execution Error Error Code 34h 36h 3Ah Reference Statements M eaning Bad file name or number filenumber of an unopened file sp
286. y after the statement that called the user defined function Theblock format DEF FN statement should be followed by END DEF which ends the function block and returns control to the position immediately after the statement that called the user defined function Using Syntax 5 allows you to assign a return value for a function The type of functionname should match that of a return value If no return valueis assigned to functionname the value 0 or a null string is returned for a numeric function or a character function respectively FN functionname Calls the user defined function 10 34 Thenumber of realparameters should be equal to that of dummyparameters and the types of the corresponding variables used in those parameters should be identical If you specify a global variable in realparameter when calling a user defined function the user defined function cannot update the value of the global variable Statement Reference because all realparameters are passed not by address but by value Call by value Syntax Error W hen defining a user defined function Error Code and M essage error 59 Incorrect use error 60 Incomplete control structure DEF FN END DEF error 61 Cannot use DEF FN in control s
287. y from the keyboard keynumberisa key number assigned to a particular function key Refer to Appendix E Key Number Assignment on the Keyboard Specifying 32 to keynumber is ignored stringdata is a character code ranging from 0 00h to 255 FFh For the character codes refer to Appendix C Character Sets If you specify more than two characters to st ringdata only the first two characters are valid String data inputted by pressing the specified function key may be read to the user program by INPUT Or LINE INPUT statement or INKEYS or INPUTS function Note INKEYS or INPUTS 1 function can read only the first one character of the assigned two The second character remains in the keyboard buffer and can be read by the INPUT Or LINE INPUT statement or INKEYS or INPUTS function If pressed together with the Shift key any numerical key can operate as a function key If you issue more than one KEY statement specifying a same function key the last statement takes effect If a null string is assigned to a function key pressing the function key produces no key entry To make a particular function key invalid specify a null string to stringdata as shown bdow REY Lp KEY 2 CHRS 0 KEY 3 CHRS amp h0 Defining a function key as the LCD backlight function on off key KEY in Syntax 2 defines a function key specified by backlightkeynumber as the backlight function on off key and sets the length
288. y funct ionnumber from a file specified by filename and assigns the parameter specified by data to the called function filename is the name of a FN 3 function For FN 3 functions refer to the BA SIC 3 0 Extension Library M anual The extension of the file name is FN 3 functionnumber is the function number of an FN 3 specified by filename dataisa variable for the function number of the FN 3 that is it is used as an argument to the FN 3 function When specifying an array to data add a pair of parentheses containing nothing as shown below CALL _xxx FN3 1 DATA 10 9 T PDT 1100 Terminal Programmer s Guide J drivename should precede filename drivenameiS A or B fortheRAM or flash ROM respectively If drivename is omitted the default drive A applies Note To usethe CALL statement download the extension programs from the BASIC 3 0 Extension Library sold separately The BASIC 3 0 Extension Library is supported by the PDT 1100 Syntax Error Error Code and Message Meaning error 3 W missing No double quote precedes or follows filename or drivename filename error 71 Syntax error filename Of drivename filename is not enclosed in double quotes Execution Error Error Code M eaning 02h Syntax error filename Or drivename filename is incorrect syntax or the extension is not FN 3 1Fh funct ionnumber Out of the range 35h File not found
289. y specified by the x on off key trigger switch shift key or battery voltage display key by using the KEY is specified by the KEY CD backlight function LINE INPUT statement EY ON statement neither reads the pressed key data nor causes keystroke trapping Specifying 32 to keynumber is ignored Statement Reference x EY OFF disables keystroke trapping for a function key specified by keynumber Specifying 32 to keynumber is ignored Syntax Error Error Code and Message Meaning error 71 Syntax error keynumber S not enclosed in parentheses N either on or off follows keynumber Execution Error Error Code M eaning 05h Parameter out of range keynumber is out of range Reference Statements KEY and ON KEY GOSUB 10 67 T PDT 1100 Terminal Programmer s Guide KILL Statement Name Kill Type Filel O Statement Description Deletes a specified file from the memory Syntax Syntax 1 KILL filename KILL drivename filename where Filename and drivename filename A string expression Notes KILL deletes a data file or a user program file specified by filename or drivename filename The filename should be preceded by thedrivename The drivenameisA for RAM orB for flash ROM If the drivename is omitted the default a RAM applies Thespecified file is deleted from both the data and the directory in the memory A file t

Download Pdf Manuals

image

Related Search

Related Contents

ATLAS 40 - Exclusivas Sarabia, sa  HP ProLiant DL380 G5  Dicota Multi BASE  Telecamera diurna/notturna da 1/3” con illuminazione IR  TECHNICAL BULLETIN  Siemens AX75 Product data  Book 1110251261.indb  Leica DISTO™ D5  Catalogue des contrats et des stages Armées  User Manual - I  

Copyright © All rights reserved.
Failed to retrieve file