Denso BHT-200QW Dokumentacja

Przeglądaj online lub pobierz Dokumentacja dla Czytniki kodów kreskowych Denso BHT-200QW. Denso BHT-200QW Specifications Instrukcja obsługi

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 587
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 0
Przeglądanie stron 0
1 2 3 4 5 6 ... 586 587

Podsumowanie treści

Strona 2

2 1.1 Software Overview 1.1.1 Software Structure of the BHT The structure of software for the BHT is shown below. The

Strona 3 - Preface

92 7.1.3 Dot Patterns of Fonts Character fontsCharacter fontsCharacter fontsCharacter fonts In the figures below, " " shows a displ

Strona 4 - How this book is organized

Chapter 7. I/O Facilities 93 Two-byte Kanji Mode • Standard-size font Half-width Kanji 8 x 16 dots (Regular)Half-width Kanji 16 x 16 dots (Double-widt

Strona 5

94 Cursor shapeCursor shapeCursor shapeCursor shape The LOCATE statement specifies the cursor shape--Underline cursor, full block cursor, or

Strona 6

Chapter 7. I/O Facilities 95 Two-byte Kanji Mode • Standard-size font ( 8 x 16 dots) In regular size Underline cursor Full block cursor Invi

Strona 7

96 7.1.4 Mixed Display of Different Screen Modes, Font Sizes, and/or Character Enlargement Sizes [1] ANK Mode and Kanji Mode Together in One Line A

Strona 8

Chapter 7. I/O Facilities 97 [3] Regular-Size and Double-Width Characters Together on the Same Screen The regular-size and double-width characters ma

Strona 9 - Chapter 1

98 7.1.5 Displaying User-defined Characters Loading a userLoading a userLoading a userLoading a user----defined fontdefined fontdefined fontdefi

Strona 10 - 1.1 Software Overview

Chapter 7. I/O Facilities 99 7.1.6 VRAM The INP function may read the VRAM data. The OUT statement writes data into the VRAM so that graphics may be d

Strona 11

100 Setting an 8Setting an 8Setting an 8Setting an 8----bit binary patternbit binary patternbit binary patternbit binary pattern The data of a

Strona 12 - 1.1.2 Overview of BHT-BASIC

Chapter 7. I/O Facilities 101 7.1.7 Displaying the System The BHT-8000 may display the shifted key icon and alphabet input icon at the right end of t

Strona 13 - 1.2 BHT-BASIC

Chapter 1. Software Overview for the BHT 3 □□□□System Programs DriversDriversDriversDrivers A set of programs which is called by the BHT-BASIC Inte

Strona 14 - BHT-BASIC 3.0?

102 Notes when displaying the system statusNotes when displaying the system statusNotes when displaying the system statusNotes when displaying the sy

Strona 15

Chapter 7. I/O Facilities 103 7.1.8 Other Facilities for the LCD Setting national characterSetting national characterSetting national characterSe

Strona 16 - Execution

104 7.2 Input from the Keyboard 7.2.1 Alphabet Entry In addition to the numeric entry from the keypad, the BHT-8000 supports software keyboard entry

Strona 17 - Chapter 2

Chapter 7. I/O Facilities 105 Alphabet Entry ProcedureAlphabet Entry ProcedureAlphabet Entry ProcedureAlphabet Entry Procedure (1) Switch to t

Strona 18

106 When no key is ready to be established, pressing any of the function keys, BS, C, ENT, and magic keys will return the key data of the pressed key

Strona 19 - Environment

Chapter 7. I/O Facilities 107 7.3 Timer and Beeper 7.3.1 Timer Functions The timer functions (TIMEA, TIMEB, and TIMEC) are available in BHT-BASIC fo

Strona 20 - 2.1.2 Required Software

108 7.4 Controlling and Monitoring the I/Os 7.4.1 Controlling by the OUT Statement The OUT statement can control the input and output devices (I/Os

Strona 21 - Procedures

Chapter 7. I/O Facilities 109 7.4.3 Monitoring by the WAIT Statement The WAIT statement monitors the input and output devices (I/Os) listed in Append

Strona 22

110 Chapter 8 Files CONTENTSCONTENTSCONTENTSCONTENTS 8.1 File Overview...

Strona 23

Chapter 8. Files 111 8.1 File Overview 8.1.1 Data Files and Device I/O Files BHT-BASIC treats not only data files but also bar code device I/Os and c

Strona 24

4 1.1.2 Overview of BHT-BASIC With BHT-BASIC, you can customize application programs for meeting your specific needs as given below. - Retrieving

Strona 25

112 8.2 Data Files 8.2.1 Overview Like user programs, data files will be stored in the user area of the memory. The user area is located at drives A

Strona 26 - Production Procedure

Chapter 8. Files 113 8.2.3 Structure of Data Files RecRecRecRecordordordord A data file is made up of a maximum of 32767 records. A record is

Strona 27 - [ 1 ] Select a source file

114 8.2.4 Data File Management by Directory Information The Interpreter manages data files using the directory information stored in the system area

Strona 28 - [ 1 ] Create a new project

Chapter 8. Files 115 8.2.5 Programming for Data Files Input/Output for Numeric DataInput/Output for Numeric DataInput/Output for Numeric DataInpu

Strona 29

116 Restrictions on Input/Output of Data FilesRestrictions on Input/Output of Data FilesRestrictions on Input/Output of Data FilesRestrictions on

Strona 30

Chapter 8. Files 117 8.2.6 About Drives The BHT-8000 has logical drives. Drive B is provided for ensuring compatibility with other BHT series. If you

Strona 31

118 8.3 Bar Code Device 8.3.1 Overview Opening the Bar Code Device by OPENOpening the Bar Code Device by OPENOpening the Bar Code Device by OPEN

Strona 32

Chapter 8. Files 119 Specifying Options in the OPENSpecifying Options in the OPENSpecifying Options in the OPENSpecifying Options in the OPEN &quo

Strona 33 - in the toolbar

120 8.3.2 Programming for Bar Code Device Code MarkCode MarkCode MarkCode Mark The MARK$ function allows you to check the code mark (denotin

Strona 34 - [ 3 ] Building

Chapter 8. Files 121 Controlling the Indicator LED and Beeper (Vibrator) for of SuccessfulControlling the Indicator LED and Beeper (Vibrator) for

Strona 35

Chapter 1. Software Overview for the BHT 5 1.2 BHT-BASIC 1.2.1 Features BHT-BASIC is designed as an optimal programming language in making applicatio

Strona 36 - Main Window

122 8.4 Communications Device 8.4.1 Overview The available communications interface in BHT is as follows. • IrDA interface • Direct-connect interface

Strona 37

Chapter 8. Files 123 8.4.3 Programming for Data Communications Setting the Communications ParametersSetting the Communications ParametersSetting the

Strona 38 - 2.4.7 Options

124 8.4.4 Overview of Communications Protocols The BHT supports two communications protocols—BHT-protocol and BHT-Ir protocol for file transmission.

Strona 39 - [ 2 ] Linking options

Chapter 8. Files 125 [ 2 ] BHT-Ir protocol In addition to the BHT-protocol, the BHT supports the BHT-Ir protocol. If you select the BHT-Ir protocol b

Strona 40 - [ 4 ] Outputting list files

126 8.4.5 File Transfer Tools [ 1 ] Transfer Utility Transfer Utility is optionally available in two versions: MS-DOS–based and Windows-based. It s

Strona 41

127 Chapter 9 Event Polling and Error/Event Trapping CONTENTSCONTENTSCONTENTSCONTENTS 9.1 Overview...

Strona 42

128 9.1 Overview BHT-BASIC supports event polling and two types of trapping: error trapping and event trap-ping. – Event polling – Trapping Error t

Strona 43 - [ 5 ] Outputting a mapfile

Chapter 9. Event Polling and Error/Event Trapping 129 9.2 Event Polling [ 1 ] Programming sample The program below shows the event polling example wh

Strona 44

130 [ 2 ] I/O devices capable of being monitored by the event polling Listed below are the I/O devices which the event polling can monitor. I/O Dev

Strona 45 - Command Line

Chapter 9. Event Polling and Error/Event Trapping 131 9.3 Error Trapping [ 1 ] Overview If a run-time error occurs during program running, error trap

Strona 46 - [ 2 ] Options

6 1.2.2 What’s New in BHT-BASIC 3.5 Upgraded from BHT-BASIC 3.0? Based on BHT-BASIC 3.0, BHT-BASIC 3.5 newly supports the following functions: [ 1

Strona 47 - Description

132 [ 2 ] Programming for trapping errors To trap errors, use the ON ERROR GOTO statement in which you should designate the error-handling routine

Strona 48

Chapter 9. Event Polling and Error/Event Trapping 133 9.4 Event (of Keystroke) Trapping [ 1 ] Overview If any of the function keys previously specif

Strona 49

134 If function keys specified for keystroke trapping are pressed during execution of the following statements or functions relating keyboard input,

Strona 50

135 Chapter 10 Sleep Function CONTENTSCONTENTSCONTENTSCONTENTS 10.1 Sleep Function ...

Strona 51

136 10.1 Sleep Function The BHT supports the sleep function that automatically interrupts program execution if no event takes place within the specif

Strona 52 - 2.5 Downloading

137 Chapter 11 Resume Function CONTENTSCONTENTSCONTENTSCONTENTS 11.1 Resume Function ...

Strona 53 - 2.6.3 Termination

138 11.1 Resume Function The resume function automatically preserves the current status of a running application pro-gram (user program) when the BHT

Strona 54 - Chapter 3

139 Chapter 12 Power-related Functions CONTENTSCONTENTSCONTENTSCONTENTS 12.1 Low Battery Warning...

Strona 55 - 3.1 Program Overview

140 12.1 Low Battery Warning If the output voltage of the battery cartridge drops below a specified lower level limit when the BHT is in operation, t

Strona 56

Chapter 12. Power-related Functions 141 12.3 Wakeup Function The wakeup function allows you to turn the BHT on at the wakeup time (of the system clock

Strona 57 - Jump into Jump out

Chapter 1. Software Overview for the BHT 7 Defining and declaring userDefining and declaring userDefining and declaring userDefining and declaring

Strona 58 - 3.2 Handling User Programs

142 12.4 Remote Wakeup Function [1] Outline The remote wakeup function allows you to wake up the BHT from a remote location so as to run the specifie

Strona 59 - 3.2.3 Included Files

Chapter 12. Power-related Functions 143 [2] Remote wakeup operation About BHT internal operation enabling remote wakeupAbout BHT internal operati

Strona 60 - Chapter 4

144 If the host receives no response from the BHT for 30 ms, go back to step (1). (3) Perform steps (1) and (2) repeatedly for 60 seconds or more. I

Strona 61 - [ 1 ] Labels

Chapter 12. Power-related Functions 145 (4) The BHT will exit from the off state and execute t

Strona 62 - [ 3 ] Comments

146 [3] Remote wakeup program File nameFile nameFile nameFile name The BHT may handle the file named "BHTRMT.PD3" as a remote wakeu

Strona 63 - 4.1.2 Program Line Length

Chapter 12. Power-related Functions 147 (4) Set the BHT station ID to be used in the BHT response message Set a 6-byte numeric string referring to th

Strona 64 - 4.2 Usable Characters

148 Checking the execution recordChecking the execution recordChecking the execution recordChecking the execution record of remote wakeup of remo

Strona 65

149 Chapter 13 Backlight Function CONTENTSCONTENTSCONTENTSCONTENTS 13.1 Backlight Function...

Strona 66

150 13.1 Backlight Function The BHT has a backlight function (LCD backlight and key backlight). Pressing the M1 key while holding down the Shift key

Strona 67 - 4.3 Labels

Chapter 13. Backlight Function 151 Setting 0 to port 6020h deactivates the backlight function and turns off the backlight if lit. When the backlight f

Strona 68 - 4.4 Identifiers

8 1.3 Program Development and Execution BHT-BASIC consists of Compiler and Interpreter. 1.3.1 Compiler BHT-BASIC 3.5 Compiler consists of the follo

Strona 69 - 4.5 Reserved Words

152 Chapter 14 Statement Reference CONTENTSCONTENTSCONTENTSCONTENTS APLOAD...153 BEEP...

Strona 70 - Chapter 5

Chapter 14. Statement Reference 153 ____________________________________________________________________ ANK Pattern LOAD I/O statement APLOAD Loa

Strona 71 - 5.1 Constants

154 • If you issue more than one APLOAD statement specifying a same character code, the last statement takes effect. • Only when the Interpreter ex

Strona 72

Chapter 14. Statement Reference 155 • The cursor size will be as shown below. Display font Size (W×H) No. of elements Standard-size 6×8 dots LSB

Strona 73 - 5.2 Variables

156 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error • No fontarrayname or cursor

Strona 74 - [ 2 ] Numeric Variables

Chapter 14. Statement Reference 157 ____________________________________________________________________ I/O statement BEEP Drives the beeper or vibr

Strona 75

158 You may change the beeper volume with the OUT statement. (For details, refer to Appendix D, "I/O Ports.") If you set a value other than

Strona 76 - 5.3 User-defined Functions

Chapter 14. Statement Reference 159 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error T

Strona 77 - 5.4 Type Conversion

160 ____________________________________________________________________ Flow control statement CALL Calls an FN3 or SUB function. _________________

Strona 78

Chapter 14. Statement Reference 161 • filename is the name of an FN3 function. The extension of the file names is fixed to .FN3. (For the FN3 functio

Strona 79 - 5.5 Scope of Variables

9 Chapter 2 Development Environment and Procedures CONTENTSCONTENTSCONTENTSCONTENTS 2.1 Overview of Development Environment...

Strona 80

162 Calling a userCalling a userCalling a userCalling a user----defined functiondefined functiondefined functiondefined function (SUB function) (

Strona 81 - 5.5.2 Local Variables

Chapter 14. Statement Reference 163 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 02h Syntax error ("[dri

Strona 82

164 ____________________________________________________________________ Flow control statement CHAIN Transfers control to another program. ________

Strona 83 - 5.5.4 Common Variables

Chapter 14. Statement Reference 165 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 3: ’"’ missin

Strona 84 - Chapter 6

166 ____________________________________________________________________ CLear FILE File I/O statement CLFILE Erases the data stored in a data file

Strona 85 - 6.1 Overview

Chapter 14. Statement Reference 167 Example:Example:Example:Example: OPEN "master.Dat"AS #1 FIELD #1,20 AS bar$,10 AS ky$ CLFILE #1 CLOSE #1

Strona 86 - 6.2 Operator Precedence

168 ____________________________________________________________________ File I/O statement CLOSE Closes file(s). __________________________________

Strona 87 - 6.3 Operators

Chapter 14. Statement Reference 169 ____________________________________________________________________ CLear Screen I/O statement CLS Clears the L

Strona 88 - 6.3.2 Relational Operators

170 ____________________________________________________________________ Declarative statement COMMON Declares common variables for sharing between

Strona 89 - 6.3.3 Logical Operators

Chapter 14. Statement Reference 171 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 5: Variable name r

Strona 90 - [ 4 ] The XOR operator

10 2.4.7 Options...30 [ 1 ] Compiling options

Strona 91 - 6.3.5 String Operators

172 ____________________________________________________________________ Declarative statement CONST Defines symbolic constants to be replaced with

Strona 92

Chapter 14. Statement Reference 173 ____________________________________________________________________ I/O statement CURSOR Turns the cursor on or

Strona 93 - Chapter 7

174 ____________________________________________________________________ Declarative statement DATA Stores numeric and string literals for READ stat

Strona 94 - 7.1.1 Display Fonts

Chapter 14. Statement Reference 175 ____________________________________________________________________ User-defined function declarative statement

Strona 95

176 Description:Description:Description:Description: DECLARE defines a user-defined function defined in other source program files. • Declaration of

Strona 96

Chapter 14. Statement Reference 177 ____________________________________________________________________ DEFine FuNction User-defined function defin

Strona 97

178 Description:Description:Description:Description: Creating a user-defined function DEF FN creates a user-defined function. • Definition of a use

Strona 98

Chapter 14. Statement Reference 179 Syntax errors:Syntax errors:Syntax errors:Syntax errors: When defining a user-defined function Error code and me

Strona 99

180 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 07h Insufficient memory space (You nested DEF FN statements

Strona 100 - 7.1.3 Dot Patterns of Fonts

Chapter 14. Statement Reference 181 ____________________________________________________________________ DEFine FuNction...END DEFine User-defined f

Strona 101

Chapter 2. Development Environment and Procedures 11 2.1 Overview of Development Environment The following hardware and software are required for de

Strona 102

182 Description:Description:Description:Description: Creating a user-defined function DEF FN ..END DEF creates a user-defined function. The function

Strona 103

Chapter 14. Statement Reference 183 Calling a user-defined function FNfunctionname calls a user-defined function. • The number of realparameters sho

Strona 104

184 When calling a user-defined function Error code and message Meaning error 68: Mismatch argument typeor number • The number of the real parame

Strona 105 - Same Screen

Chapter 14. Statement Reference 185 ____________________________________________________________________ DEFine REGister Declarative statement DEFRE

Strona 106

186 numericinitialvaluedefinition For one-dimensional: {numericconstant[,numericconstant...]} DEFREG n6%(3)={9,8,7,6} For two-dimensional: {{numericc

Strona 107 - 7.1.6 VRAM

Chapter 14. Statement Reference 187 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 6: Variable name

Strona 108

188 Example:Example:Example:Example: Example 1: Valid DEFREG statements DEFREG a,e$ DEFREG b=100,c(10),d$(2,4)[ 10] DEFREG bps$="19200" DEF

Strona 109 - 7.1.7 Displaying the System

Chapter 14. Statement Reference 189 ____________________________________________________________________ DIMension Memory control statement DIM Decla

Strona 110

190 • In declaring an array string variable, you can specify the string length. If its specification is omitted, the default value of 20 characters

Strona 111

Chapter 14. Statement Reference 191 ____________________________________________________________________ Flow control statement END Terminates progra

Strona 112 - 7.2 Input from the Keyboard

Copyright © 2003 DENSO WAVE INCORPORATED All rights reserved. No part of this publication may be reproduced i

Strona 113

12 2.1.2 Required Software • OS • Editor Windows95/98/NT/2000/XP • BHT-BASIC 3.5 Compiler • Transfer Utility (option) • Ir-Transfer Utility C

Strona 114 - [ 2 ] Shift key

192 ____________________________________________________________________ Memory control statement ERASE Erases array variables. ____________________

Strona 115 - 7.3 Timer and Beeper

Chapter 14. Statement Reference 193 ____________________________________________________________________ File I/O statement FIELD Allocates string va

Strona 116

194 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error filenumber is missing. RunRunRun

Strona 117

Chapter 14. Statement Reference 195 ____________________________________________________________________ Flow control statement FOR…NEXT Defines a lo

Strona 118 - Chapter 8

196 • The default value of increment is 1. • You can nest FOR ..NEXT statements to a maximum of 10 levels. • When using the FOR ..NEXT statement t

Strona 119 - 8.1 File Overview

Chapter 14. Statement Reference 197 ____________________________________________________________________ User-defined function statement FUNCTION…END

Strona 120 - 8.2 Data Files

198 Description:Description:Description:Description: Creating a user-defined function FUNCTION...END FUNCTION creates a user-defined function. The f

Strona 121

Chapter 14. Statement Reference 199 • If you specify a global variable in realparameter when calling a user-defined function, the user-defined functi

Strona 122 - Information

200 When calling a user-defined function Error code and message Meaning error 68: Mismatch argument type or number • The number of the real para

Strona 123

Chapter 14. Statement Reference 201 ____________________________________________________________________ File I/O statement GET Read a record from a

Strona 124

Chapter 2. Development Environment and Procedures 13 2.2 Overview of Developing Procedures 2.2.1 Developing Procedures The program developing procedu

Strona 125 - 8.2.6 About Drives

202 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error filenumber is missing. RunRunRu

Strona 126 - 8.3 Bar Code Device

Chapter 14. Statement Reference 203 ____________________________________________________________________ Declarative statement GLOBAL Declares one or

Strona 127

204 subscript For one-dimensional: integerconstant For two-dimensional: integerconstant,integerconstant Where integerconstant is a numeric

Strona 128

Chapter 14. Statement Reference 205 ____________________________________________________________________ Flow control statement GOSUB Branches to a s

Strona 129

206 ____________________________________________________________________ Flow control statement GOTO Branches to a specified label. ________________

Strona 130 - 8.4 Communications Device

Chapter 14. Statement Reference 207 ____________________________________________________________________ Flow control statement IF…THEN…ELSE…END IF C

Strona 131

208 • A block-structured IF statement block has the following advantages over a single-line IF statement (which is not supported in BHT-BASIC): - Mo

Strona 132 - [ 1 ] BHT-protocol

Chapter 14. Statement Reference 209 ____________________________________________________________________ I/O statement INPUT Reads input from the key

Strona 133 - [ 2 ] BHT-Ir protocol

210 • The cursor shape specified by the most recently executed LOCATE statement takes effect. • Even after execution of the CURSOR OFF statement, th

Strona 134 - 8.4.5 File Transfer Tools

Chapter 14. Statement Reference 211 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 06h The operation result is

Strona 135 - Chapter 9

14 2.2.2 Functions of BHT-BASIC 3.5 BHT-BASIC 3.5 contains Compiler, Linker, and Librarian whose functions are listed below. Functions of Compiler

Strona 136 - 9.1 Overview

212 ____________________________________________________________________ File I/O statement INPUT # Reads data from a device I/O file into specified

Strona 137 - 9.2 Event Polling

Chapter 14. Statement Reference 213 • Notes for entering numeric data: Valid characters include 0 to 9, a minus sign (-), and a period (.). They shou

Strona 138

214 ____________________________________________________________________ I/O statement KEY Assigns a string or a control code to a function key; als

Strona 139 - 9.3 Error Trapping

Chapter 14. Statement Reference 215 Description:Description:Description:Description: Assigning a string or a control code to a function key KEY in sy

Strona 140

216 • Pressing the M1 key (key number 30) while holding down the shift key functions as a backlight on/off control key by default. • If pressed tog

Strona 141 - [ 1 ] Overview

Chapter 14. Statement Reference 217 NOTE If you issue KEY statements specifying a same function key, only the lastKEY statement takes effect. The

Strona 142

218 ____________________________________________________________________ I/O statement KEY ON and KEY OFF Enables or disables keystroke trapping for

Strona 143 - Chapter 10

Chapter 14. Statement Reference 219 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error •

Strona 144 - 10.1 Sleep Function

220 ____________________________________________________________________ File I/O statement KILL Deletes a specified file from the memory. _________

Strona 145 - Chapter 11

Chapter 14. Statement Reference 221 Example:Example:Example:Example: CLOSE IF kyIn$="Y"THEN KILL "Master.Dat" END IF Reference:Re

Strona 146 - 11.1 Resume Function

Chapter 2. Development Environment and Procedures 15 2.3 Writing a Source Program 2.3.1 Writing a Source Program by an Editor To write a source prog

Strona 147 - Chapter 12

222 ____________________________________________________________________ Kanji Pattern LOAD I/O statement KPLOAD Loads a user-defined Kanji font in

Strona 148 - Backlight

Chapter 14. Statement Reference 223 • The loaded user-defined fonts are effective during execution of the user program which loaded those fonts and d

Strona 149 - 12.3 Wakeup Function

224 • An array integer variable--a work array, register array, or common array--for cursorarrayname should be declared by the DIM, DEFREG, or COMM

Strona 150 - 12.4 Remote Wakeup Function

Chapter 14. Statement Reference 225 • If the double-width is specified, then user-defined cursors loaded by the KPLOAD will display in double-width,

Strona 151 - [2] Remote wakeup operation

226 Example:Example:Example:Example: DIM kp%(15) kp%(0)=&H0000 kp%(1)=&H8011 kp%(2)=&H6022 kp%(3)=&H1844 kp%(4)=&H0600 kp%(5)=&am

Strona 152

Chapter 14. Statement Reference 227 ____________________________________________________________________ Assignment statement LET Assigns a value to

Strona 153

228 ____________________________________________________________________ LINE INPUT LINE INPUT Reads input from the keyboard into a string variable.

Strona 154 - [3] Remote wakeup program

Chapter 14. Statement Reference 229 If "prompt" is followed by a comma, the statement displays the prompting message but no question mark or

Strona 155

230 ____________________________________________________________________ File I/O statement LINE INPUT # Reads data from a device I/O file into a st

Strona 156

Chapter 14. Statement Reference 231 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error •

Strona 157 - Chapter 13

16 • Comment lines starting with a single quotation mark (') and those with a REM should have the following description rules each. A single qu

Strona 158 - 13.1 Backlight Function

232 ____________________________________________________________________ I/O statement LOCATE Moves the cursor to a specified position and changes t

Strona 159

Chapter 14. Statement Reference 233 • The entry ranges of the column and row are the same in the regular-size, double-width. • Any parameter value o

Strona 160 - Chapter 14

234 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 05h Parameter out of the range Example:Example:Example:Exam

Strona 161

Chapter 14. Statement Reference 235 ____________________________________________________________________ Error control statement ON ERROR GOTO Enable

Strona 162

236 ____________________________________________________________________ Flow control statement ON…GOSUB, ON…GOTO Branches to one of specified label

Strona 163

Chapter 14. Statement Reference 237 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error •

Strona 164

238 ____________________________________________________________________ I/O statement ON KEY…GOSUB Specifies an event-handling routine for keystrok

Strona 165

Chapter 14. Statement Reference 239 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error •

Strona 166

240 ____________________________________________________________________ File I/O statement OPEN Opens a data file for I/O activities. _____________

Strona 167

Chapter 14. Statement Reference 241 • filelength is the maximum number of registrable records in a file. It can be set only when a new data file is c

Strona 168

Chapter 2. Development Environment and Procedures 17 2.4 Producing a User Program 2.4.1 Starting the BHT-BASIC 3.5 Compiler Start the Compiler, e.g.

Strona 169

242 ____________________________________________________________________ File I/O statement OPEN "BAR: " Opens the bar code device file. T

Strona 170

Chapter 14. Statement Reference 243 • Only a single bar code device file can be opened at a time. The total number of files which can be opened at a

Strona 171

244 □□□□Auto-off mode (F) OPEN "BAR :F"AS #7 CODE "A" If you press the trigger switch *1 , the illumination LED *2 comes on. When

Strona 172

Chapter 14. Statement Reference 245 • If readmode is omitted, the BHT defaults to the auto-off mode. • In the momentary switching mode, alternate swit

Strona 173

246 readcode The BHT supports seven types of bar codes--the universal product codes, Interleaved 2 of 5 (ITF), Standard 2 of 5 (STF), Codabar

Strona 174

Chapter 14. Statement Reference 247 □□□□Interleaved 2 of 5 (ITF) (I) Syntax : I[:[mini.no.digits[-max.no.digits]][CD] [,[mini.no.digits[-max.no.dig

Strona 175

248 CD is a check digit. Specifying a C to CD makes the Interpreter check bar codes with MOD-16. The check digit is included in the number of digits.

Strona 176

Chapter 14. Statement Reference 249 □□□□Code 128 ((((K)))) Syntax : K[:[mini.no.digits[-max.no.digits]] [,[mini.no.digits[-max.no.digits]]] [,[mini.n

Strona 177

250 (4) FNC4 An FNC4 converts data encoded by the code set A or B into a set of extended ASCII-encoded data (128 added to each official ASCII code va

Strona 178

Chapter 14. Statement Reference 251 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error T

Strona 179

18 2.4.2 Outline of User Program or Library Production Procedure Unlike the BHT-BASIC 3.0 Compiler that converts a single source program into a user

Strona 180

252 ____________________________________________________________________ File I/O statement OPEN "COM: " Opens a communications device fil

Strona 181

Chapter 14. Statement Reference 253 Description:Description:Description:Description: OPEN "COM:" opens a communications device file and asso

Strona 182

254 charalength charalength is a character length or the number of data bits. It should be 8(default) or 7 bits. stopbit stopbit is th

Strona 183 - DECLARE

Chapter 14. Statement Reference 255 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error f

Strona 184

256 ____________________________________________________________________ I/O statement OUT Sends a data byte to an output port. ____________________

Strona 185

Chapter 14. Statement Reference 257 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 05h Parameter out of the ran

Strona 186

258 ____________________________________________________________________ I/O statement POWER Controls the automatic power-off facility. ____________

Strona 187

Chapter 14. Statement Reference 259 Turning off the power immediately Execution of POWER OFF or POWER 0 immediately turns off the power. • The execut

Strona 188

260 ____________________________________________________________________ I/O statement PRINT Displays data on the LCD screen. ______________________

Strona 189 - DEF FN…END DEF

Chapter 14. Statement Reference 261 CR/LFcontrol CR/LFcontrol determines where the cursor is to be positioned after the PRINT statement executes. • I

Strona 190

Chapter 2. Development Environment and Procedures 19 2.4.3 Designating a Single Source File or a Project File 2.4.3.1 Designating a single source fi

Strona 191

262 ____________________________________________________________________ File I/O statement PRINT # Outputs data to a communications device file. __

Strona 192

Chapter 14. Statement Reference 263 • If CR/LFcontrol is a semicolon (;), the PRINT # statement outputs data without adding spaces or control codes. S

Strona 193

264 ____________________________________________________________________ I/O statement PRINT USING Displays data on the LCD screen under formatting

Strona 194

Chapter 14. Statement Reference 265 numericformat numericformat is a formatting string consisting of #, decimal point (.), and/or +,each of which cau

Strona 195

266 stringformat stringformat is a formatting string consisting of !, @, and/or &&, each of which causes a special printing effect as descri

Strona 196

Chapter 14. Statement Reference 267 CR/LFcontrol CR/LFcontrol determines where the cursor is to be positioned after the PRINT USING statement execute

Strona 197

268 ____________________________________________________________________ Declarative statement PRIVATE Declares one or more work variables or regist

Strona 198

Chapter 14. Statement Reference 269 subscript For one-dimensional: integerconstant For two-dimensional: integerconstant,integerconstant Wher

Strona 199

270 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 05h Parameter out of the range 07h Insufficient memory spac

Strona 200

Chapter 14. Statement Reference 271 ____________________________________________________________________ File I/O statement PUT Writes a record from

Strona 201

20 2.4.3.2 Designating a project file To build a library out of a single source file or to build a user program or library out of multiple source fi

Strona 202

272 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error filenumber is missing. RunRunRu

Strona 203 - FOR…NEXT

Chapter 14. Statement Reference 273 ____________________________________________________________________ I/O statement READ Reads data defined by DAT

Strona 204

274 If the string data is invalid as numeric data, the READ statement assigns the value 0 to the numeric variable. Statement example:

Strona 205 - FUNCTION…END FUNCTION

Chapter 14. Statement Reference 275 ____________________________________________________________________ Declarative statement REM Declares the rest

Strona 206

276 ____________________________________________________________________ I/O statement RESTORE Specifies a DATA statement location where the READ st

Strona 207

Chapter 14. Statement Reference 277 ____________________________________________________________________ Error control statement RESUME Causes progra

Strona 208

278 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 14h RESUME without error (RESUME statement occurs outside o

Strona 209

Chapter 14. Statement Reference 279 ____________________________________________________________________ Flow control statement RETURN Returns contro

Strona 210

280 ____________________________________________________________________ I/O statement SCREEN Sets the display mode (screen mode, and font size) and

Strona 211

Chapter 14. Statement Reference 281 • At the start of program execution, the following settings apply: Screen mode ANK mode Font size Standard-siz

Strona 212

Chapter 2. Development Environment and Procedures 21 [ 2 ] Select an existing project file You may select an existing project file in the Select Proj

Strona 213

282 ____________________________________________________________________ Flow control statement SELECT…CASE…END SELECT Conditionally executes one of

Strona 214

Chapter 14. Statement Reference 283 • You can nest the SELECT…CASE…END SELECT statements to a maximum of 10 levels. SELECT a CASE 1 SELECT b CASE 3 P

Strona 215 - IF…THEN…ELSE…END IF

284 ____________________________________________________________________ User-defined function statement SUB…END SUB Names and defines user-defined

Strona 216

Chapter 14. Statement Reference 285 Description:Description:Description:Description: Creating a user-defined function SUB...END SUB creates a user-de

Strona 217

286 Syntax errors:Syntax errors:Syntax errors:Syntax errors: When defining a user function Error code and message Meaning error 64: Function redefi

Strona 218

Chapter 14. Statement Reference 287 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 07h Insufficient memory s

Strona 219

288 ____________________________________________________________________ I/O statement WAIT Pauses program execution until a designated input port p

Strona 220 - INPUT #

Chapter 14. Statement Reference 289 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error •

Strona 221

290 ____________________________________________________________________ Flow control statement WHILE…WEND Continues to execute a statement block as

Strona 222

Chapter 14. Statement Reference 291 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 26 : Too deep nest

Strona 223

i Preface This manual describes the syntax and development procedure of BHT-BASIC 3.5 which is a programming language for developing application pr

Strona 224

22 [ 3 ] Add files to a project file You may add one or more source files and libraries to a project file at a time. (1) Create a new project (Refe

Strona 225

292 ____________________________________________________________________ I/O statement XFILE Transmits a designated file according to the specified

Strona 226 - KEY ON and KEY OFF

Chapter 14. Statement Reference 293 - Transmission direction Parameter omitted (default) Transmits a file from the BHT. R or r Receives a file from t

Strona 227

294 - Timeout length when a link will be established Specify the timeout length by 1 to 9. Uploading Set value DownloadingBHT-protocol BHT-Ir protoco

Strona 228

Chapter 14. Statement Reference 295 • A communications device file should be opened before execution of the XFILE statement. (For the file opening,

Strona 229

296 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 02h Syntax error ([drivename:]filename is not correct.) 07h

Strona 230

Chapter 14. Statement Reference 297 ____________________________________________________________________ File I/O statement $INCLUDE Specifies an inc

Strona 231

298 Fatal Error:Fatal Error:Fatal Error:Fatal Error: Error code and message Meaning fatal error 30: Cannot find include file "XXX" No inc

Strona 232

Chapter 14. Statement Reference 299 Additional Explanation for Statements Effective range of labels Labels are effective only in a file. Definition

Strona 233

300 Chapter 15 Function Reference CONTENTSCONTENTSCONTENTSCONTENTS ABS ...301 ASC ...

Strona 234

Chapter 15. Function Reference 301 ____________________________________________________________________ ABSolute Numeric function ABS Returns the abs

Strona 235

Chapter 2. Development Environment and Procedures 23 [ 4 ] Select files in the active project From files existing in the active project, you may selec

Strona 236 - LINE INPUT

302 ____________________________________________________________________ ASCii code String function ASC Returns the ASCII code value of a given cha

Strona 237

Chapter 15. Function Reference 303 ____________________________________________________________________ Block Check Character String function BCC$ R

Strona 238 - LINE INPUT #

304 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 05h Parameter out of the range (checktype is out of the

Strona 239

Chapter 15. Function Reference 305 ____________________________________________________________________ CHecK DiGiT String function CHKDGT$ Returns

Strona 240

306 Sample coding 1: CD.Data$=CHKDGT$("a123Qa","N") "Q" is a CD position character, so CHKDGT$ calculates the correct

Strona 241

Chapter 15. Function Reference 307 When CDtype is I (ITF), the length of barcodedata must be an even number of two or more digits. If not, CHKDGT$ re

Strona 242

308 When CDtype is N (Codabar), the length of barcodedata must be three digits or more including start and stop characters. If not, CHKDGT$ returns

Strona 243 - ON ERROR GOTO

Chapter 15. Function Reference 309 ____________________________________________________________________ CHaRacter code String function CHR$ Returns

Strona 244 - ON…GOSUB, ON…GOTO

310 • To display a Kanji code, use a shift JIS code as shown below. The shift JIS code for 漢 is 8ABFh. SCREEN 1 PRINT CHR$(&h8A);CHR$(&hBF)

Strona 245

Chapter 15. Function Reference 311 ____________________________________________________________________ COUNTRY I/O function COUNTRY$ Sets a national

Strona 246 - ON KEY…GOSUB

24 • Main Object display area This area shows the name of a main object in a user program if you have selected "User program (PD3)" with t

Strona 247

312 • After setting a national character set, you may display national characters assigned to 32 (20h) to 127 (7Fh), on the LCD. • "countrycode

Strona 248

Chapter 15. Function Reference 313 ____________________________________________________________________ CurSoR LINe I/O function CSRLIN Returns the

Strona 249

314 ____________________________________________________________________ DATE I/O function DATE$ Returns the current system date or sets a specifie

Strona 250 - OPEN "BAR: "

Chapter 15. Function Reference 315 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 05h Parameter out of the r

Strona 251

316 ____________________________________________________________________ End Of File File I/O function EOF Tests whether the end of a device I/O fi

Strona 252

Chapter 15. Function Reference 317 ____________________________________________________________________ ERror Line Error-handling function ERL Retur

Strona 253

318 ____________________________________________________________________ ERRor code Error-handling function ERR Returns the error code of the most

Strona 254 - □Universal product codes (A)

Chapter 15. Function Reference 319 ____________________________________________________________________ End of TeXt I/O function ETX$ Modifies the v

Strona 255

320 ____________________________________________________________________ FREe area Memory management function FRE Returns the number of bytes avail

Strona 256

Chapter 15. Function Reference 321 ____________________________________________________________________ HEXadecimal String function HEX$ Converts a d

Strona 257

Chapter 2. Development Environment and Procedures 25 2.4.4 Compiling and Building First specify the options and then proceed to the compiling or buil

Strona 258

322 ____________________________________________________________________ INput KEYboard I/O function INKEY$ Returns a character read from the keybo

Strona 259

Chapter 15. Function Reference 323 ____________________________________________________________________ INPort data I/O function INP Returns a byte

Strona 260 - OPEN "COM: "

324 ____________________________________________________________________ INPUT File I/O function INPUT$ Returns a specified number of characters re

Strona 261

Chapter 15. Function Reference 325 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 05h Parameter out of the r

Strona 262

326 ____________________________________________________________________ IN STRing String function INSTR Searches a specified target string for a s

Strona 263

Chapter 15. Function Reference 327 • A returned value of INSTR is a decimal number from 0 to 255, depending upon the conditions as listed below. Con

Strona 264

328 ____________________________________________________________________ INTeger Numeric operation function INT Returns the largest whole number les

Strona 265

Chapter 15. Function Reference 329 ____________________________________________________________________ LEFT String function LEFT$ Returns the specif

Strona 266

330 ____________________________________________________________________ LENgth String function LEN Returns the length (number of bytes) of a given

Strona 267

Chapter 15. Function Reference 331 ____________________________________________________________________ LOcation Counter of file File I/O function L

Strona 268

26 [ 2 ] Compiling In any of the following methods, compile the currently selected source file(s) into an object file(s): From the Build menu, choo

Strona 269

332 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 34h Bad file name or number (You specified filenumber of

Strona 270 - PRINT #

Chapter 15. Function Reference 333 ____________________________________________________________________ Location Of File File I/O function LOF Retur

Strona 271

334 ____________________________________________________________________ code MARK I/O function MARK$ Returns the bar code type and the number of d

Strona 272 - PRINT USING

Chapter 15. Function Reference 335 ____________________________________________________________________ MIDdle String function MID$ Returns a portion

Strona 273

336 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 05h Parameter out of the range Reference:Reference:Refe

Strona 274

Chapter 15. Function Reference 337 ____________________________________________________________________ POSition I/O function POS Returns the current

Strona 275

338 ____________________________________________________________________ RIGHT String function RIGHT$ Returns the specified number of rightmost char

Strona 276 - PRIVATE

Chapter 15. Function Reference 339 ____________________________________________________________________ SEARCH File I/O function SEARCH Searches a

Strona 277

340 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 05h Parameter out of the range 34h Bad file name or numb

Strona 278

Chapter 15. Function Reference 341 ____________________________________________________________________ Start Of Heading I/O function SOH$ Modifies

Strona 279

Chapter 2. Development Environment and Procedures 27 2.4.5 Setting the Editor for Displaying Files Set the editor that you want to use for displaying

Strona 280

342 ____________________________________________________________________ STRing String function STR$ Converts the value of a numeric expression into

Strona 281

Chapter 15. Function Reference 343 ____________________________________________________________________ Start of TeXt I/O function STX$ Modifies the

Strona 282

344 ____________________________________________________________________ TIME I/O function TIME$ Returns the current system time or wakeup time, or

Strona 283

Chapter 15. Function Reference 345 Syntax 2 Setting the system time TIME$ sets the system time specified by "time." The format of "tim

Strona 284 - RESTORE

346 ____________________________________________________________________ TIMER-A/TIMER-B/TIMER-C I/O function TIMEA/TIMEB/TIMEC Returns the current

Strona 285

Chapter 15. Function Reference 347 ____________________________________________________________________ VALue String function VAL Converts a string i

Strona 286

348 Chapter 16 Extended Functions CONTENTSCONTENTSCONTENTSCONTENTS 16.1 Overview...

Strona 287

Chapter 16. Extended Functions 349 16.1 Overview In addition to the BHT-BASIC statements and functions, the BHT-8000 series supports the following ext

Strona 288

350 16.2 Reading or writing system settings from/to the memory (SYSTEM.FN3) 16.2.1 Function Number List of SYSTEM.FN3 The SYSTEM.FN3 may read or w

Strona 289

Chapter 16. Extended Functions 351 16.2.2 Detailed Function Specifications .fcSysIGet(=1) Read numeric data from System Mode settings Synta

Strona 290 - SELECT…CASE…END SELECT

28 2.4.6 Error Messages and Their Indication onto the Main Window [ 1 ] Selecting either an editor or main window as an error message output device

Strona 291

352 Item number (PARA%) System menu item Attribute*1 DATA%, numeric data of the system menu item Initial value .syCmifOpt 0 IrDA interface .syCmif

Strona 292 - SUB…END SUB

Chapter 16. Extended Functions 353 Item number (PARA%) System menu item Attribute*1 DATA%, numeric data of the system menu item Initial value .syHP

Strona 293

354 .fcSysISet(=2) Write numeric data to System Mode settings Syntax: CALL "SYSTEM.FN3" .fcSysISet PARA%,DATA% Description:

Strona 294

Chapter 16. Extended Functions 355 .fcSysSSet(=4) Write string data to System Mode settings Syntax: CALL "SYSTEM.FN3" .fcSysSSe

Strona 295

356 16.3 Controlling system files(SYSMDFY.FN3) 16.3.1 Function Number List of SYSMDFY.FN3 The SYSMDFY.FN3 may reconfigure the BHT system , as well

Strona 296

Chapter 16. Extended Functions 357 .fcMdBDo(=2) Reconfigure BHT system Syntax: CALL "SYSMDFY.FN3" .fcMdBDo FILE$, OPT% Description: T

Strona 297

358 16.4 Calculating a CRC (CRC.FN3) 16.4.1 Function Number List of CRC.FN3 The CRC.FN3 may calculate a CRC depending upon the function number spec

Strona 298 - WHILE…WEND

359 Chapter 17 TCP/IP (BHTs with Bluetooth communications device) CONTENTSCONTENTSCONTENTSCONTENTS 17.1 Two Sides...

Strona 299

360 17.5 Socket Library (SOCKET.FN3)... 386 17.5.1 Overview ...

Strona 300

Chapter 17. TCP/IP 361 17.1 Two Sides 17.1.1 BHT The BHT equipped with a spread spectrum communications device or IrDA communications device includes

Strona 301

Chapter 2. Development Environment and Procedures 29 [ 2 ] How error messages are displayed on the editor or main window During building, the BHT-BAS

Strona 302

362 17.2 Programming Procedure 17.2.1 Bluetooth Communication System The following is the procedure for using TCP/IP over a Bluetooth communications

Strona 303

Chapter 17. TCP/IP 363 [ 2 ] Configure TCP/IP System To connect to the TCP/IP pathway, specify the following system settings by using the extension l

Strona 304

364 [ 3 ] Declare TCP/IP Communications Pathway Specify the following system settings by using the socket library (SOCKET.FN3): • Communications de

Strona 305 - $INCLUDE

Chapter 17. TCP/IP 365 [ 4 ] Connect to TCP/IP Communications Pathway Use the extension library SOCKET.FN3. Connecting to the TCP/IP communications p

Strona 306

366 [ 5 ] Transfer Data or File via Socket Interface To transfer data via the socket interface, use the extension library SOCKET.FN3. Refer to 17.3,

Strona 307

Chapter 17. TCP/IP 367 17.3 Socket API 17.3.1 Overview The SOCKET.FN3 library implements a subset of the BSD4.4 socket application program interface

Strona 308 - Chapter 15

368 User Datagram Protocol (UDP)

Strona 309

Chapter 17. TCP/IP 369 17.3.2 Programming Notes for Socket API [ 1 ] Programming Notes for TCP (a) Avoid retransmission control in application pro

Strona 310

370 [ 2 ] Programming Notes for UDP The user datagram protocol (UDP) has no flow control, so send/receive data may go missing due to poor line condi

Strona 311

Chapter 17. TCP/IP 371  Host's retransmission cHost's retransmission cHost's retransmission cHost's retransmission control for a

Strona 312

30 2.4.7 Options To specify compiling options and linking options, select the check-box options you want in the Set Options dialog box. Each of avail

Strona 313 - CHKDGT$

372 [ 3 ] Programming Notes for Socket API If TCP/IP communication becomes no longer possible during data transmission, extended functions SOCKET.FN

Strona 314

Chapter 17. TCP/IP 373 (Example) STATUS% = 0 ON ERROR GOTO TCP.ERR 'Prepare for error interrupt (To TCP.ERR 'at the time of error

Strona 315

374 IF STATUS% > 2 THEN '<<<<< Close the socket processing (CALL “SOCKET.FN3 28) >>>>> IF (WERR<&g

Strona 316

Chapter 17. TCP/IP 375  Note for runNote for runNote for runNote for run----time error 105htime error 105htime error 105htime error 105h Socket cl

Strona 317

376 17.4 FTP Client 17.4.1 Overview The FTP.FN3 library implements FTP client services for file transfers to and from FTP servers. Note that there ar

Strona 318

Chapter 17. TCP/IP 377 The FTP client automatically pads the last record of a downloaded program file with null codes (00h) to maintain the fixed-leng

Strona 319 - COUNTRY$

378 [ 2 ] Extension Libraries (*.FN3 and *.EX3) The FTP client treats files with extensions .FN3 and .EX3 as extension libraries. Extension librarie

Strona 320

Chapter 17. TCP/IP 379 Aside: When downloading extension libraries, the BHT uses 128 bytes out of 130 bytes of record length (the remaining 2 bytes w

Strona 321

380 [ 3 ] Data Files The FTP client treats files with extensions other than .PD3, .FN3, and .EX3 as data files. Data file records consist of fields

Strona 322

Chapter 17. TCP/IP 381 The treatment of short records is under application control. The default is to delete any trailing spaces (20h). Alternativ

Strona 323

Chapter 2. Development Environment and Procedures 31 [ 2 ] Linking options Linking Options Description Mapfile Outputs map information to the file

Strona 324

382 Line delimiters inside data records The FTP client can send and receive all codes from 00h to FFh as described above. The treatment of line delim

Strona 325

Chapter 17. TCP/IP 383 17.4.3 Using FTP Client [ 1 ] Basic Procedure First, set up for using the FTP client, as necessary, with the following steps.

Strona 326

384 [ 3 ] Calculating Memory Requirements The FTP protocol specifications do not provide for checking the amount of BHT memory available during down

Strona 327

Chapter 17. TCP/IP 385 Data Files Determine MEM from the field lengths and number of records. BPR = bytes per record = (number of fields) + (sum o

Strona 328

386 17.5 Socket Library (SOCKET.FN3) 17.5.1 Overview String Variables The following are the string variables used by this library together with t

Strona 329

Chapter 17. TCP/IP 387 Function Number List Number Used to: Corresponding Socket API Function .fcAccept 1* –– accept() .fcBind 2 Assign address to

Strona 330

388 Number Used to: Corresponding Socket API Function .fcSocket 26 Create socket socket() .fcWritev 27*–– writev() .fcClose 28 Close socket close(

Strona 331

Chapter 17. TCP/IP 389 17.5.2 Detailed Function Specifications Function #2 .fcBind Assign address to socket Syntax: CALL "SOCKET.FN3" .fcB

Strona 332

390 Function #3 .fcConnect Connect socket Syntax: CALL "SOCKET.FN3" .fcConnect SOCKFD%, FAMILY%, PORT%, address where address is ADDRES

Strona 333

Chapter 17. TCP/IP 391 Run-time errors: Error code Meaning 105h Power-off detected 106h An internal error has occurred in the TCP/IP module during dat

Strona 334

ii How this book is organized This manual is made up of 16 chapters and appendices. Chapter 1. Software Overview for the BHTChapter 1. Software Overv

Strona 335

32 [ 4 ] Outputting list files The Compiler may output three types of list files as listed below depending upon the options specified at the start o

Strona 336

392 Function #6 .fcGSckOpt Get socket option Syntax: CALL "SOCKET.FN3" .fcGSckOpt SOCKFD%, OPTNAME%, option where option is OPTION% or

Strona 337

Chapter 17. TCP/IP 393 Run-time errors: Error code Meaning 105h Power-off detected. 106h An internal error has occurred in the TCP/IP module during da

Strona 338

394 Function #7 .fcHToNL Convert host long (4 bytes) to network byte order Syntax: CALL "SOCKET.FN3" .fcHToNL HOSTLONG, NETLONG Descript

Strona 339

Chapter 17. TCP/IP 395 Function #11 .fcNToHL Convert network long (4 bytes) to host byte order Syntax: CALL "SOCKET.FN3" .fcNToHL NETLONG

Strona 340

396 Function #14 .fcRecv Receive data sent to the specified TCP socket Syntax: CALL "SOCKET.FN3" .fcRecv SOCKFD%, RECVBUFF$[()], RECVLEN

Strona 341

Chapter 17. TCP/IP 397 Run-time errors: Error code Meaning 105h Power-off detected 106h An internal error has occurred in the TCP/IP module during dat

Strona 342

398 Example: Append operation Incoming data: 1024 bytes ("0123456789...0123") Receive buffer: 8 elements, 128 characters each for a

Strona 343

Chapter 17. TCP/IP 399 Example: Overwrite operation Incoming data: 1024 bytes ("0123456789...0123") Receive buffer: 8 elements, 128 c

Strona 344

400 Function #15 .fcRcvfrom Receive data sent to the specified UDP socket Syntax: CALL "SOCKET.FN3" .fcRcvfrom SOCKFD%, RECVBUFF$[()], R

Strona 345

Chapter 17. TCP/IP 401 Run-time errors: Error code Meaning 105h Power-off detected 106h An internal error has occurred in the TCP/IP module during dat

Strona 346

Chapter 2. Development Environment and Procedures 33 •••• Address of object programAddress of object programAddress of object programAddress of ob

Strona 347 - SEARCH

402 Function #17 .fcSelect Monitor socket requests Syntax: CALL "SOCKET.FN3" .fcSelect MAXFD%, READFDSET$, WRITEFDSET$, EXCEPTFDSET$, TI

Strona 348

Chapter 17. TCP/IP 403 Function #18 .fcFDZERO Initialize socket identifier set Syntax: CALL "SOCKET.FN3" .fcFDZERO SOCKFDSET$ Description

Strona 349

404 Parameters: SOCKFD% Socket identifier SOCKFDSET$ Socket identifier set Return value: (None)

Strona 350

Chapter 17. TCP/IP 405 Function #21 .fcFDISSET Get socket identifier status from socket identifier set Syntax: CALL "SOCKET.FN3" .fcFDISS

Strona 351

406 Function #22 .fcSend Send message to another TCP socket Syntax: CALL "SOCKET.FN3" .fcSend SOCKFD%, SENDBUFF$[()], SENDLEN%, SENDMODE

Strona 352

Chapter 17. TCP/IP 407 Run-time errors: Error code Meaning 105h Power-off detected 106h An internal error has occurred in the TCP/IP module during dat

Strona 353

408 Function #23 .fcSendto Send message to another UDP socket Syntax: CALL "SOCKET.FN3" .fcSendto SOCKFD%, SENDBUFF$[()], SENDLEN%, SEND

Strona 354 - TIMEA/TIMEB/TIMEC

Chapter 17. TCP/IP 409 Run-time errors: Error code Meaning 105h Power-off detected 209h Socket identifier is invalid. 216h A parameter is invalid. 228

Strona 355

410 Function #24 .fcSSckOpt Set socket options Syntax: CALL "SOCKET.FN3" .fcSSckOpt SOCKFD%, OPTNAME%, option where option is OPTION% o

Strona 356 - Chapter 16

Chapter 17. TCP/IP 411 Run-time errors: Error code Meaning 105h Power-off detected. 106h An internal error has occurred in the TCP/IP module during da

Strona 357 - 16.1 Overview

34 •••• Symbol table for common variableSymbol table for common variableSymbol table for common variableSymbol table for common variablessss L

Strona 358 - (SYSTEM.FN3)

412 Function #25 .fcShutdwn Shut down socket Syntax: CALL "SOCKET.FN3" .fcShutdwn SOCKFD%, HOWTO% Description: This function shuts down

Strona 359 - R/W: Read and write possible

Chapter 17. TCP/IP 413 Function #26 .fcSocket Create socket Syntax: CALL "SOCKET.FN3" .fcSocket FAMILY%, TYPE%, PROTOCOL%, SOCKFD% Descri

Strona 360

414 Run-time errors: Error code Meaning 105h Power-off detected. 106h An internal error has occurred in the TCP/IP module during data transmission. 1

Strona 361 - Read and write possible

Chapter 17. TCP/IP 415 Function #28 .fcClose Close socket Syntax: CALL "SOCKET.FN3" .fcClose SOCKFD% Description: This function closes t

Strona 362

416 Function #40 .fcTSetup Specify TCP/IP communications pathway Syntax: CALL "SOCKET.FN3" .fcTSetup IFTYPE%, LAYERMODE%, INTERFACE% Des

Strona 363

Chapter 17. TCP/IP 417 Function #41 .fcTCnnSys Connect TCP/IP communications pathway with system settings Syntax: CALL "SOCKET.FN3" .fcTC

Strona 364 - 16.3 Controlling system

418 Function #42 .fcTCnnUsr Connect TCP/IP communications pathway with user settings Syntax: CALL "SOCKET.FN3" .fcTCnnUsr INTERFACE%, I

Strona 365

Chapter 17. TCP/IP 419 Run-time errors: Error code Meaning 34h Communications device file not open 101h Cannot connect to communications pathway 102h

Strona 366

420 Function #43 .fcTDiscnn Disconnect TCP/IP communications pathway Syntax: CALL "SOCKET.FN3" .fcTDiscnn INTERFACE% Description: This

Strona 367 - Chapter 17

Chapter 17. TCP/IP 421 Function #44 .fcTSysGet Get TCP/IP system settings Syntax: CALL "SOCKET.FN3" .fcTSysGet PARA%, data where data i

Strona 368

Chapter 2. Development Environment and Procedures 35 [ 5 ] Outputting a mapfile Select the Mapfile check box of the Linking Options in the Set Option

Strona 369 - 17.1 Two Sides

422 Function #45 .fcTSysSet Set TCP/IP system settings Syntax: CALL "SOCKET.FN3" .fcTSysSet PARA%, data where data is DATA% or DATA$ D

Strona 370 - 17.2 Programming Procedure

Chapter 17. TCP/IP 423 Function #46 .fcTStsGet Get TCP socket status Syntax: CALL "SOCKET.FN3" .fcTStsGet SOCKFD%, PATTERN%, TIMEOUT%, RE

Strona 371

424 17.6 FTP Library (FTP.FN3) 17.6.1 Overview String Variables The following are the string variables used by this library together with their m

Strona 372

Chapter 17. TCP/IP 425 Reply Codes The messages that FTP servers send during and after FTP operations vary, but servers all use the same reply code

Strona 373

426 Reply Codes Description 426 Connection closed; transfer aborted. 450 Requested file action not taken. File unavailable (e.g., file busy). 451 R

Strona 374 - 'interface%

Chapter 17. TCP/IP 427 17.6.2 Detailed Function Specifications Function #1 .fcFTPOpnS Open FTP client session with system settings Syntax: CALL &quo

Strona 375 - 17.3 Socket API

428 Function #2 .fcFTPOpnU Open FTP client session with user settings Syntax: CALL "FTP.FN3" .fcFTPOpnU FTPHANDLE%, SERV.IP$, USERNAME$,

Strona 376

Chapter 17. TCP/IP 429 Function #3 .fcFTPClos Close FTP client session Syntax: CALL "FTP.FN3" .fcFTPClos FTPHANDLE%, REPLY% Description

Strona 377

430 Function #4 .fcPWD Get current directory on FTP server Syntax: CALL "FTP.FN3" .fcPWD FTPHANDLE%, CURDIR$, REPLY% Description: This

Strona 378

Chapter 17. TCP/IP 431 Function #5 .fcCWD Change current directory on FTP server Syntax: CALL "FTP.FN3" .fcCWD FTPHANDLE%, NEWDIR$, REPLY

Strona 379

36 •••• Map for userMap for userMap for userMap for user----defined functiondefined functiondefined functiondefined functionssss Shows the sym

Strona 380

432 Function #6 .fcRETR Download file from FTP server Syntax: CALL "FTP.FN3" .fcRETR FTPHANDLE%, SERV.FNAME$, CLNT.FNAME$, CRLF.TYPE%, CRL

Strona 381 - (Example)

Chapter 17. TCP/IP 433 .ftRcdData1 Treat line delimiters in records as DATA. TRIM trailing spaces in fields. .ftLspDel 10 Treat line delimiters in r

Strona 382

434 CRLF.MODE% = .ftRcdSepa 'Data composition: Will be ignored for 'files except data files DISP.MODE% = .ftDisp 'Enable prog

Strona 383

Chapter 17. TCP/IP 435 Run-time errors: Error code Meaning 02h Syntax error (Incorrect file name) 05h Number of field items or number of digits in a f

Strona 384 - 17.4 FTP Client

436 Function #7 .fcSTOR Upload file to FTP server Syntax: CALL "FTP.FN3" .fcSTOR FTPHANDLE%, SERV.FNAME$, CLNT.FNAME$, CRLF.TYPE%, UP.MOD

Strona 385

Chapter 17. TCP/IP 437 Example: Uploading program file, with progress display CLNT.FNAME$ = "SAMPLE.PD3" 'Name of file on BHT SER

Strona 386

438 Function #8 .fcFSysGet Get FTP system settings Syntax: CALL "FTP.FN3" .fcFSysGet PARA%, ftp.para where ftp.para is FTP.PARA% or FTP

Strona 387

Chapter 17. TCP/IP 439 Function #9 .fcFSysSet Change FTP system settings Syntax: CALL "FTP.FN3" .fcFSysSet PARA%, ftp.para where ftp.para

Strona 388 - [ 3 ] Data Files

440 Function #10 .fcRNFR Change file name on FTP server Syntax: CALL "FTP.FN3" .fcRNFR FTPHANDLE%, OLD.FNAME$, NEW.FNAME$, REPLY% Descri

Strona 389

Chapter 17. TCP/IP 441 Function #11 .fcPORT Set port number for file transfer Syntax: CALL "FTP.FN3" .fcPORT FTPHANDLE%, PORT% Descriptio

Strona 390

Chapter 2. Development Environment and Procedures 37 2.4.8 Starting the BHT-BASIC Compiler from the Command Line You may start the BHT-BASIC Compiler

Strona 391 - 17.4.3 Using FTP Client

442 Function #12 .fcDELE Delete file from FTP server Syntax: CALL "FTP.FN3" .fcDELE FTPHANDLE%, SERV.FNAME$, REPLY% Description: This f

Strona 392 - User Programs (*.PD3)

443 Chapter 18 Bluetooth (BHTs with Bluetooth communications device) CONTENTSCONTENTSCONTENTSCONTENTS 18.1 Bluetooth Communications...

Strona 393 - [ 5 ] FTP Transfers

444 18.1 Bluetooth Communications 18.1.1 Introduction The BHT supports the following profiles based on the BluetoothTM Specification Ver.1.1. • The

Strona 394 - 17.5.1 Overview

Chapter 18. Bluetooth 445 18.1.2 System Components The following figures give examples of Bluetooth networks using the BHT. For further details, refer

Strona 395 - Function Number List

446 • The BHT does not support multiple simultaneous links (Piconet.) As master, the BHT supports only one slave at a time. • As a slav

Strona 396

Chapter 18. Bluetooth 447 18.2 Programming Overview 18.2.1 Software Components The BHT system consists of the BHT main system and Bluetooth communicat

Strona 397 - Assign address to socket

448 18.2.2 Statements and Functions Used Bluetooth communications uses the following statements and functions. (1) Statements and functions Refer t

Strona 398 - Connect socket

Chapter 18. Bluetooth 449 18.2.3 Programming Procedures 18.2.3.1 Discovering Accessible Remote Devices in the Vicinity (Inquiry) The BHT supports the

Strona 399 - Run-time errors:

450 There are two ways to specify the above parameters. • Use the system settings • Specify them in the OPEN statement The user modifies the system

Strona 400 - Get socket option

Chapter 18. Bluetooth 451 18.2.3.2 Serial Link with Remote Device The BHT supports the Serial Port Profile for RS232 (or similar) serial cable emulat

Strona 401

38 [ 2 ] Options The BHT-BASIC 3.5 Compiler supports three types of options—compiler processing options, compiling options, and linking option. 

Strona 402

452 to the specified slave device. Otherwise, the Bluetooth communications device waits for a call from a master before connecting. For further detai

Strona 403 - Function #12 .fcNToHS

Chapter 18. Bluetooth 453 OPEN "COM4:M,SPP,112233AABBCC" AS #4 ' Address for remote device: ' 11:22:33:AA:BB:CC" ' U

Strona 404 - Function #14 .fcRecv

454 18.2.3.3 Dial-Up Networking via Remote Device The BHT supports the Dial-up Networking Profile for accessing the Internet via a modem or other de

Strona 405

Chapter 18. Bluetooth 455 Dial-up networking connections have the following parameters. • Bluetooth device address for remote device •

Strona 406 - Example: Append operation

456 OPEN "COM4:M,DUN" AS #4 (b) Specifying parameters in the OPEN statement OPEN "COM4:M,DUN,112233AABBCC,BHT,30,2" AS #4 &a

Strona 407 - Example: Overwrite operation

Chapter 18. Bluetooth 457 auh% = .soPPPPAP ' PPP authentication procedure: PAP usr$ = "USER" ' User name for PPP authenticat

Strona 408 - Function #15 .fcRcvfrom

458 18.2.3.4 Service Discovery The BHT supports the Service Discovery Application Profile for querying and browsing for services offered by another B

Strona 409

Chapter 18. Bluetooth 459 (a) Using the system settings OPEN "COM4:M,SDAP" as #4 (b) Specifying parameters in the OPEN statement OPEN &q

Strona 410 - Monitor socket requests

460 18.2.4 Programming Notes 18.2.4.1 Retransmission control in serial communications Any system design using wireless communications must assume da

Strona 411

Chapter 18. Bluetooth 461 18.2.4.2 Reading data received in serial communications We recommend that user programs always follow the approach shown be

Strona 412 - Return value: (None)

Chapter 2. Development Environment and Procedures 39 Compiling optionsCompiling optionsCompiling optionsCompiling options Compiling options D

Strona 413 - Function #21 .fcFDISSET

462 Do not use INPUT# or LINE INPUT# statement for reading data received. The INPUT# or LINE INPUT# statement waits for reception of CR (0Dh) or com

Strona 414 - Function #22 .fcSend

Chapter 18. Bluetooth 463 18.2.4.3 Resume Operation Bluetooth communications does not support resume operation. If the BHT shuts itself down due to lo

Strona 415

464 18.2.4.4 Power Supply Control  Power supply control of Power supply control of Power supply control of Power supply control of Bluetooth commun

Strona 416 - Function #23 .fcSendto

Chapter 18. Bluetooth 465 • Power-saving mode introduces delays. For operations involving real-time communications, we recommend that

Strona 417

466 18.3 Bluetooth Statements and Functions 18.3.1 Overview The following statements and functions are available for use with the Bluetooth communi

Strona 418 - Set socket options

Chapter 18. Bluetooth 467 Statement or FunctionUsed to: EOF Read whether there is data in the Bluetooth communications device file receive buffer LOC

Strona 419

468 18.3.2 Detailed Specifications OPEN "COM4:I" Open the Bluetooth communications device file in inquiry mode, discovering accessible re

Strona 420 - Shut down socket

Chapter 18. Bluetooth 469 COM4 This indicates the Bluetooth interface. Note that the BHT cannot open this communications device file concurrentl

Strona 421 - Create socket

470 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 105h Power-off detected 600h Failed to open a Bluetooth

Strona 422

Chapter 18. Bluetooth 471 OPEN "COM4:M" Open the Bluetooth communications device file with the BHT as master and connect to a slave Synta

Strona 423 - Close socket

40 [ 3 ] Error Level Indication by ERRORLEVEL If you specify a +E option at the command line and run the BHT-BASIC 3.5 Compiler, the ERRORLEVEL of M

Strona 424 - Function #40 .fcTSetup

472 COM4 This indicates the Bluetooth interface. Note that the BHT cannot open this communications device file concurrently with the IrDA inter

Strona 425 - Function #41 .fcTCnnSys

Chapter 18. Bluetooth 473 timeout This specifies a time limit for completing the operation. The unit is seconds; the range, 1 to 255. Leaving thi

Strona 426 - Function #42 .fcTCnnUsr

474 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 47h Abnormal end of communications or termination of com

Strona 427

Chapter 18. Bluetooth 475 OPEN "COM4:S" Open the Bluetooth communications device file with the BHT as a slave and wait for a master Synta

Strona 428 - Function #43 .fcTDiscnn

476 COM4 This indicates the Bluetooth interface. Note that the BHT cannot open this communications device file concurrently with the IrDA inter

Strona 429 - Get TCP/IP system settings

Chapter 18. Bluetooth 477 Leaving this parameter blank specifies the use of the system setting. Specifying a parameter does not affect the system sett

Strona 430 - Set TCP/IP system settings

478 CLOSE Close the Bluetooth communications device file Refer to Chapter 14, "Statement Reference." INPUT # Read data from the Bluetoo

Strona 431 - Get TCP socket status

Chapter 18. Bluetooth 479 PRINT # Write data to the Bluetooth communications device file Syntax:Syntax:Syntax:Syntax: Refer to Chapter 14, "

Strona 432 - 17.6 FTP Library (FTP.FN3)

480 WAIT Wait for a change in Bluetooth communications device file receive buffer status Refer to Chapter 14, "Statement Reference." XFI

Strona 433 - Reply Codes

Chapter 18. Bluetooth 481 18.4 Bluetooth Extended Functions (BT.FN3) 18.4.1 Overview The Bluetooth extended functions (BT.FN3) used in a BHT-BASIC CA

Strona 434

Chapter 2. Development Environment and Procedures 41 2.4.9 Output from the BHT-BASIC 3.5 Compiler The BHT-BASIC 3.5 Compiler outputs the following in

Strona 435 - Function #1 .fcFTPOpnS

482 18.4.2 Detailed Specifications Function #1 .fcBTGetVal Read Bluetooth integer setting Syntax: CALL "BT.FN3" .fcBTGetVal PARA%,DATA% De

Strona 436 - Function #2 .fcFTPOpnU

Chapter 18. Bluetooth 483 Function #2 .fcBTSetVal Write Bluetooth integer setting Syntax: CALL "BT.FN3" .fcBTSetVal PARA%,DATA% Descripti

Strona 437 - Close FTP client session

484 Function #3 .fcBTGetStr Read Bluetooth string setting Syntax: CALL "BT.FN3" .fcBTGetStr PARA%,DATA$ Description: This function reads

Strona 438 - Function #4 .fcPWD

Chapter 18. Bluetooth 485 Run-time errors: Error code Meaning 05h Parameter out of the range F0h Mismatch parameter number F1h Mismatch parameter typ

Strona 439 - Function #5 .fcCWD

486 Function #4 .fcBTSetStr Write Bluetooth string setting Syntax: CALL "BT.FN3" .fcBTSetStr PARA%,DATA$ Description: This function wri

Strona 440 - Function #6 .fcRETR

Chapter 18. Bluetooth 487 Function #7 .fcBTSysVer Read Bluetooth system version Syntax: CALL "BT.FN3" .fcBTSysVer BTSYSVER$ Description:

Strona 441

488 Function #8 .fcBTDevInf Read Bluetooth device information Syntax: CALL "BT.FN3" .fcBTDevInf PARA%,DATA$ Description: This function re

Strona 442

Chapter 18. Bluetooth 489 Run-time errors: Error code Meaning 05h Parameter out of the range 34h Bad file name or number. (The Bluetooth communicatio

Strona 443

490 Function #9 .fcBTRmtNam Get remote device name Syntax: CALL "BT.FN3" .fcBTRmtNam BDADDR$,BDNAME$ Description: This function gets the

Strona 444 - Upload file to FTP server

Chapter 18. Bluetooth 491 Run-time errors: Error code Meaning 05h Parameter out of the range 34h Bad file name or number. (The Bluetooth communicati

Strona 445

iii Chapter 12. PowerChapter 12. PowerChapter 12. PowerChapter 12. Power----related Functionsrelated Functionsrelated Functionsrelated Functions D

Strona 446 - Get FTP system settings

42 Output Destination Conditions Address–Source list If the Address-source List check box is selected in the Set Options dialog box. Symbol table

Strona 447 - Change FTP system settings

492 Function #10 .fcBTInqRes Read remote device discovery results Syntax: CALL "BT.FN3" .fcBTInqRes NUM%,BDADDR$[()] Description: This

Strona 448 - Function #10 .fcRNFR

Chapter 18. Bluetooth 493 Run-time errors: Error code Meaning 05h Parameter out of the range 34h Bad file name or number. (The Bluetooth communicati

Strona 449 - Function #11 .fcPORT

494 Function #11 .fcBTRmtInf Get Bluetooth device address for remote device Syntax: CALL "BT.FN3" .fcBTRmtInf BDADDR$ Description: This

Strona 450 - Delete file from FTP server

Chapter 18. Bluetooth 495 Function #12 .fcBTGetStt Read connection status Syntax: CALL "BT.FN3" .fcBTGetStt STATUS% Description: This fun

Strona 451 - Chapter 18

496 Function #13 .fcBTGetLnk Read authenticated Bluetooth device addresses Syntax: CALL "BT.FN3" .fcBTGetLnk NUM%,BDADDR$[()] Description

Strona 452 - 18.1.1 Introduction

Chapter 18. Bluetooth 497 Function #14 .fcBTClrLnk Erase authenticated Bluetooth device addresses Syntax: CALL "BT.FN3" .fcBTClrLnk [BDADD

Strona 453 - 18.1.2 System Components

498 Function #15 .fcBTHold Control power-saving mode Syntax: CALL "BT.FN3" .fcBTHold INTERVAL% Description: This function shifts into th

Strona 454 - Availabl

Chapter 18. Bluetooth 499 Run-time errors: Error code Meaning 05h Parameter out of the range 34h Bad file name or number. (The Bluetooth communicati

Strona 455 - 18.2 Programming Overview

500 Function #20 .fcBTChkSnd Check data transmit result Syntax: CALL "BT.FN3" .fcBTChkSnd STATUS% Description: This function checks whet

Strona 456

Chapter 18. Bluetooth 501 Example: Transmit a message and wait for completion of the transmission PRINT #4, "1234567890" ' Transmit da

Strona 457 - Vicinity (Inquiry)

Chapter 2. Development Environment and Procedures 43 2.4.10 Structure of User Programs and Libraries If you specify a user program to be produced in

Strona 458

502 Function #21 .fcBTGetSvc Read service discovery results Syntax: CALL "BT.FN3" .fcBTGetSvc NUM%,SCLASS%[()],SNAME$[()] Description: T

Strona 459

Chapter 18. Bluetooth 503 SNAME$ entries, the interface stops when the arrays are full. If the service name is longer than the string length of SNAME$

Strona 460

504 AppendicesAppendicesAppendicesAppendices CONTENTSCONTENTSCONTENTSCONTENTS Appendix A Error Codes and Error Messages...

Strona 461 - Chapter 18. Bluetooth

Appendices 505 Appendix AAppendix AAppendix AAppendix A Error Codes and Error MessagesError Codes and Error MessagesError Codes and Error MessagesE

Strona 462

506 Error code Meaning 36h Improper file type (The statement attempts an operation that conflicts with the file type-- data file, communications de

Strona 463

Appendices 507 Error code Meaning 100h Cannot specify communications pathway 101h Cannot connect to communications pathway 102h Communications pa

Strona 464

508 Error code Meaning 293h The problem occurred on the communication pathway. 295h There is no user for login request. 600h Failed to open a Bl

Strona 465

Appendices 509 A2. Compilation ErrorsA2. Compilation ErrorsA2. Compilation ErrorsA2. Compilation Errors Fatal ErrorsFatal ErrorsFatal ErrorsFa

Strona 466 - 18.2.3.4 Service Discovery

510 Syntax ErrorsSyntax ErrorsSyntax ErrorsSyntax Errors Error code & Message error 1: Improper label format error 2: Improper label name

Strona 467

Appendices 511 Error code & Message error 21: Too many variables (register float array) error 22: Too many variables (register string array) erro

Strona 468 - 18.2.4 Programming Notes

44 2.5 Downloading 2.5.1 Overview of Transfer Utility/Ir-Transfer Utility C/Ir-Transfer Utility E Transfer Utility/Ir-Transfer Utility C/Ir-Transfer

Strona 469

512 Error code & Message error 46: error 47: error 48: error 49: error 50: Incorrect use of IF...THEN...ELSE...ENDIF error 51: Incomplete

Strona 470

Appendices 513 Error code & Message error 77: Initial string too long error 78: Array symbols exceed 30 for one DIM, GLOBAL, or PRIVATE statement

Strona 471 - 18.2.4.3 Resume Operation

514 Linking ErrorsLinking ErrorsLinking ErrorsLinking Errors Error Message PRC area size different Out of space in RFG area Out of space in PR

Strona 472

Appendices 515 Error Message Non-array integer register variable area overflow Non-array float register variable area overflow Register memory pool a

Strona 473 - User Program

516 Library ErrorsLibrary ErrorsLibrary ErrorsLibrary Errors Error Message Cannot find object to be deleted [objectname] Designated object alr

Strona 474 - Functions

Appendices 517 Appendix BAppendix BAppendix BAppendix B Reserved WordsReserved WordsReserved WordsReserved Words The following list shows reser

Strona 475

518 Appendix CAppendix CAppendix CAppendix C Character SetsCharacter SetsCharacter SetsCharacter Sets C1. Character SetC1. Character SetC1. Cha

Strona 476 - [#]filenumber

Appendices 519 C2. National Character SetsC2. National Character SetsC2. National Character SetsC2. National Character Sets You may switch characte

Strona 477 - Syntax errors:Syntax errors:

520 Appendix DAppendix DAppendix DAppendix D I/O PortsI/O PortsI/O PortsI/O Ports Input PortsInput PortsInput PortsInput Ports A user p

Strona 478

Appendices 521 Port No. Bit assign- ment Monitors the following: - 0 Deactivated 0 Wakeup function .pvWupOn 1Activated - 0 Initiated by the power key

Strona 479

Chapter 2. Development Environment and Procedures 45 2.6 Executing a User Program 2.6.1 Starting To run a user program, start System Mode and select

Strona 480

522 Port No. Bit assign-ment Monitors the following: - 0 Released 0 Magic key 1 .pvM1kyOn 1 Held down - 0 Released 1 Magic key 2 .pvM2kyOn 1 Held

Strona 481

Appendices 523 Port No. Bit assign-ment Monitors the following: .pvRwuOff 0 Deactivated .pnRwuCtrl 60F0h 0 Remote wakeup function *13 .pvRwuOn 1 Acti

Strona 482

524 *8 A user program returns the A/D converted value (0 to 255) of the battery voltage level (0 to 7V). The returned value is an instantaneous valu

Strona 483

Appendices 525 Output PortsOutput PortsOutput PortsOutput Ports A user program can control the hardware through the output ports by using the

Strona 484

526 Port No. Bit assign-ment Controls the following: .pnTmPOff 6030h 7-0 Effective held-down time of power key *10 - 1-255 .pvCPBHT 0 BHT-protocol .

Strona 485

Appendices 527 *1 The indicator LED is controllable only when the bar code device file is closed. If the file is opened, the OUT statement will be ig

Strona 486

528 *11 You can set the communications protocol type for transmitting files with the XFILE statement. *12 You may set the BHT’s ID number to be used

Strona 487

Appendices 529 Appendix EAppendix EAppendix EAppendix E Key Number Assignment on the Key Number Assignment on the Key Number Assignment on the Key

Strona 488

530 Appendix FAppendix FAppendix FAppendix F Memory AreaMemory AreaMemory AreaMemory Area Memory MapMemory MapMemory MapMemory Map The

Strona 489 - (BT.FN3)

Appendices 531 ROM 8MB, RAM 512KB Type (except BHT8048DB)System work area (512KB) Font area JIS Level 1 font

Strona 490 - Function #1 .fcBTGetVal

46 Chapter 3 Program Structure CONTENTSCONTENTSCONTENTSCONTENTS 3.1 Program Overview ...

Strona 491 - Function #2 .fcBTSetVal

532 Memory ManagementMemory ManagementMemory ManagementMemory Management The BHT manages the user area of the memory for user programs and dat

Strona 492 - Function #3 .fcBTGetStr

Appendices 533 Appendix GAppendix GAppendix GAppendix G Handling Space CharactersHandling Space CharactersHandling Space CharactersHandling Space C

Strona 493

534 To handle space characters as data To handle trailing spaces in a data field as data (not as padding characters), you must take special co

Strona 494 - Function #4 .fcBTSetStr

Appendices 535 Example 3 When specifying a field data to be searched, do not include trailing spaces in a data field. A B CA B CA B CA B

Strona 495 - Function #7 .fcBTSysVer

536 To make the BHT handle space characters as dataTo make the BHT handle space characters as dataTo make the BHT handle space characters as data

Strona 496 - Function #8 .fcBTDevInf

Appendices 537 Appendix HAppendix HAppendix HAppendix H Programming NotesProgramming NotesProgramming NotesProgramming Notes Program file na

Strona 497

538 Appendix IAppendix IAppendix IAppendix I Program SamplesProgram SamplesProgram SamplesProgram Samples Writing the function for receiving b

Strona 498 - Get remote device name

Appendices 539 .kb$ = input$(1) while .kb$<>"" if instr(esc$, .kb$) then'Key designated in esc$? fnbarkey$ = .kb$ 'Then, ret

Strona 499

540 Testing the written functionTesting the written functionTesting the written functionTesting the written function while 1 '

Strona 500 - Function #10 .fcBTInqRes

Appendices 541 Appendix JAppendix JAppendix JAppendix J Quick ReferenceQuick ReferenceQuick ReferenceQuick Reference for Statements and Functifo

Strona 501

Chapter 3. Program Structure 47 3.1 Program Overview 3.1.1 Statement Blocks A statement block is a significant set of statements (which is also called

Strona 502 - Function #11 .fcBTRmtInf

542 Handling errors Statements ON ERROR GOTO Enables error trapping. RESUME Causes program execution to resume at a specified location after

Strona 503 - Read connection status

Appendices 543 Controlling the LCD screen Statements APLOAD Loads a user-defined font in the single-byte ANK mode. CLS Clears the LCD screen. CUR

Strona 504 - Function #13 .fcBTGetLnk

544 Controlling the keyboard input Statements INPUT Reads input from the keyboard into a variable. KEY Assigns a string or a control code to a f

Strona 505 - Function #14 .fcBTClrLnk

Appendices 545 Communicating with I/Os Statements OUT Sends a data byte to an output port. POWER Controls the automatic power-off facility. WAIT Pau

Strona 506 - Control power-saving mode

546 Manipulating data files and user program files Statements CLFILE Erases the data stored in a data file. CLOSE Closes file(s). FIELD Allocate

Strona 507

Appendices 547 Functions BCC$ Returns a block check character (BCC) of a data block. EOF Tests whether the end of a device I/O file has been reache

Strona 508 - Check data transmit result

548 Manipulating string data Functions ASC Returns the ASCII code value of a given character. CHR$ Returns the character corresponding to a giv

Strona 509

Appendices 549 Appendix KAppendix KAppendix KAppendix K Unsupported Statements and Unsupported Statements and Unsupported Statements and Unsupporte

Strona 510 - Function #21 .fcBTGetSvc

550 SupplementSupplementSupplementSupplement CONTENTSCONTENTSCONTENTSCONTENTS Supplement A What's different from the BHT-5000?...

Strona 511

Supplement 551 Suuplement ASuuplement ASuuplement ASuuplement A What's different from the What's different from the What's different

Strona 512 - AppendicesAppendices

48 [ 3 ] User-defined Functions Before calling user-defined functions, it is necessary to define those functions with any of the following statement

Strona 513

552 •••• Switching time between sending and receiving on the IrDA interfaceSwitching time between sending and receiving on the IrDA interfaceSwit

Strona 514

Supplement 553 A.3 Screen displayA.3 Screen displayA.3 Screen displayA.3 Screen display Item BHT-5000 BHT-8000 BHT-2000 compatible mode Available

Strona 515

554 A.4 KeyboardA.4 KeyboardA.4 KeyboardA.4 Keyboard Item BHT-5000 BHT-8000 Magic keys *1 M1 and M2 keys M1, M2, M3, and M4 keys Default trigger

Strona 516

Supplement 555 A.6 FilesA.6 FilesA.6 FilesA.6 Files Item BHT-5000 BHT-8000 File storage device(s) RAM (Drive A) Flash ROM (Drive B) Flash ROM (The

Strona 517 - A2. Compilation Errors

556 A.A.A.A.8 Beeper & vibrator control8 Beeper & vibrator control8 Beeper & vibrator control8 Beeper & vibrator control Item BHT-

Strona 518

Supplement 557 Supplement BSupplement BSupplement BSupplement B What's different from the What's different from the What's different

Strona 519

558 B.3 Screen displB.3 Screen displB.3 Screen displB.3 Screen displayayayay Item BHT-6000 BHT-8000 Standard-size font: 16 x 6 (6 x 8) Standard-s

Strona 520

Supplement 559 B.4 KeyboardB.4 KeyboardB.4 KeyboardB.4 Keyboard Item BHT-6000 BHT-8000 Magic keys *1 M1 and M2 keys M1, M2, M3, and M4 keys Defau

Strona 521

560 B.6 FilesB.6 FilesB.6 FilesB.6 Files Item BHT-6000 BHT-8000 File storage device(s) RAM (Drive A) Flash ROM (Drive B) Flash ROM (The RAM is use

Strona 522

Supplement 561 B.8 Beeper & vibrator controlB.8 Beeper & vibrator controlB.8 Beeper & vibrator controlB.8 Beeper & vibrator control

Strona 523

Chapter 3. Program Structure 49 3.1.2 Notes for Jumping into/out of Statement Blocks It is not recommended to jump control from a main routine or sub

Strona 524

562 Supplement CSupplement CSupplement CSupplement C What's different from the What's different from the What's different fro

Strona 525

Supplement 563 C.3 Monitor the CUC.3 Monitor the CUC.3 Monitor the CUC.3 Monitor the CU state state state state Item BHT-7000 BHT-8000 Get the CU s

Strona 526 - C1. Character Set

564 C.7 Remote wakeupC.7 Remote wakeupC.7 Remote wakeupC.7 Remote wakeup Item BHT-7000 BHT-8000 When the rechargeable battery cartridge is loaded

Strona 527 - C2. National Character Sets

IndexIndexIndexIndex _ _(underline, underscore), 433, 436 1 12-dot font, 87 16-dot font, 87 A ACK, 143, 144, 309 address-source list, 30, 33, 3

Strona 528

BEEP, 85, 107, 129, 152, 157, 158, 159, 517, 544, 556, 561, 563 beeper, ii, iii, 107, 121, 136, 140, 157, 158, 191, 242, 245, 249, 524, 528, 544, 54

Strona 529

170, 171, 223, 312, 517, 541 chained, 50, 67, 147, 153, 154, 164, 170, 223, 312 chaining, ii, 50 charaattribute, 88, 169, 280, 281 character attribu

Strona 530

counter, 216, 258, 259 country code, 246, 311, 312, 543 countrycode, 311, 312, 519 CRC-16, 303, 358 cross reference, 5, 30, 39, 51, 297, 509 CU, v,

Strona 531

469, 472, 476, 523 directories, 27 directory, 27, 37, 41, 43, 114, 115, 166, 220, 376, 385, 424, 426, 430, 431, 432, 436, 438, 440 directory, direct

Strona 532

FD_ISSET, 387, 405 FD_SET, 387, 403 FD_ZERO, 387, 403 field, 113, 115, 124, 193, 194, 201, 266, 271, 292, 293, 295, 339, 353, 380, 385, 432, 433, 43

Strona 533

239, 275, 279, 505, 517, 541, 549 GOTO, 16, 47, 49, 53, 129, 152, 205, 206, 208, 236, 237, 275, 374, 517, 541, 549 H header, 32, 124, 296, 341, 343,

Strona 534

50 3.2 Handling User Programs 3.2.1 User Programs in the Memory The user area of the memory (memories) in the BHT can store more than one user prog

Strona 535

239, 279, 322, 517, 527, 543, 544, 554, 559, 562 KEY OFF, 152, 217, 218, 238, 239, 322, 544 KEY ON, 133, 152, 217, 218, 238, 239, 322, 544 keyboard

Strona 536

Multi-statements, 54 N national character, 103, 311, 312, 518, 519, 543 non-array integer variable, 66, 170, 175, 177, 197, 284 non-array real varia

Strona 537

461, 517 OUT, 6, 85, 87, 96, 97, 99, 100, 101, 102, 104, 105, 108, 116, 121, 125, 136, 146, 150, 151, 152, 158, 245, 256, 257, 281, 289, 323, 345, 3

Strona 538

register variable, 6, 7, 30, 34, 35, 36, 39, 67, 71, 136, 138, 185, 186, 187, 192, 193, 203, 268, 299, 510, 512, 515, 532, 542 Relational operations

Strona 539

440, 441, 442, 456, 457, 507 socket API, 367, 369, 387, 388, 389, 390, 392, 394, 395, 396, 400, 402, 403, 405, 406, 408, 410, 412, 413, 415 socket a

Strona 540

286, 548 subnet mask, 363 Subnet mask, 363, 365, 386, 418, 421 subroutine, 47, 205, 206, 279, 541 subscript, 57, 65, 66, 185, 187, 189, 190, 203, 20

Strona 541

447, 449, 450, 452, 455, 458, 460, 461, 463, 464, 479, 487, 492, 494, 496, 520, 523, 524, 525, 527, 532, 537, 542, 546, 556, 561, 563 user-defined f

Strona 542

BHT-BASIC (BHT-8000 series) Programmer’s Manual 3rd Edition, June 2003 DENSO WAVE INCORPORATED The purpo

Strona 543

Chapter 3. Program Structure 51 3.2.3 Included Files "Included files" are separate source programs which may be called by the INCLUDE metaco

Strona 544

iv Notational Conventions Used in This BookNotational Conventions Used in This BookNotational Conventions Used in This BookNotational Conventions

Strona 545

52 Chapter 4 Basic Program Elements CONTENTSCONTENTSCONTENTSCONTENTS 4.1 Structure of a Program Line ...

Strona 546

Chapter 4. Basic Program Elements 53 4.1 Structure of a Program Line 4.1.1 Format of a Program Line A program line consists of the following element

Strona 547 - 'the initial state

54 [ 2 ] Statements Statements can come in two types: executable and declarative statements. • Executable statements• Executable statements• Executa

Strona 548

Chapter 4. Basic Program Elements 55 4.1.2 Program Line Length A program line is terminated with a CR code by pressing the carriage return key. The a

Strona 549 - Controlling program flow

56 4.2 Usable Characters 4.2.1 Usable Characters Listed below are characters which can be used for writing programs. Note that a double quote ("

Strona 550 - Statements

Chapter 4. Basic Program Elements 57 4.2.2 Special Symbols and Control Codes Symbols and control codes used outside of a character string have the fo

Strona 551 - Controlling the LCD screen

58 Symbols and control codes Typical use : (Colon) • Separates statements. • Separates time information in TIME$ function. ; (Semicolon) Line feed c

Strona 552

Chapter 4. Basic Program Elements 59 4.3 Labels A label can contain the following characters: • Alphabet characters • Numeral characters • Period (.)

Strona 553 - Communicating with I/Os

60 4.4 Identifiers Identifiers for the names of variables should comprise the same alphanumerics as the labels. Rules for naming identifiersRule

Strona 554

Chapter 4. Basic Program Elements 61 4.5 Reserved Words "Reserved words" are keywords to be used in statements, functions, and operators. F

Strona 555 - Manipulating numeric data

v Icons Used in This BookIcons Used in This BookIcons Used in This BookIcons Used in This Book Statements and functions unique to BHT-BASIC.

Strona 556

62 Chapter 5 Data Types CONTENTSCONTENTSCONTENTSCONTENTS 5.1 Constants...

Strona 557

Chapter 5. Data Types 63 5.1 Constants 5.1.1 Types of Constants A constant is a data item whose value does not change during program execution. Const

Strona 558 - SupplementSupplement

64 Real ConstantsReal ConstantsReal ConstantsReal Constants Real constants should be formatted as shown below. Syntax: sign mantissa Syntax:

Strona 559 - A.1 Communication

Chapter 5. Data Types 65 5.2 Variables A variable is a symbolic name that refers to a unit of data storage. The contents of a variable can change duri

Strona 560 - A.2 Bar code reading

66 Memory OccupationMemory OccupationMemory OccupationMemory Occupation A string variable occupies the memory space by (the number of characte

Strona 561 - A.3 Screen display

Chapter 5. Data Types 67 5.2.2 Classification of Variables Work VariablesWork VariablesWork VariablesWork Variables A work variable is intended

Strona 562

68 5.3 User-defined Functions Out of user-defined functions, the SUB and FUNCTION functions can be called from other files. The DEF FN function can b

Strona 563

Chapter 5. Data Types 69 5.4 Type Conversion 5.4.1 Type Conversion BHT-BASIC has the type conversion facility which automatically converts a value of

Strona 564

70 5.4.2 Type Conversion Examples The following examples show the type conversion from real to integer. Assignment of Real Expressions to Integer

Strona 565

Chapter 5. Data Types 71 5.5 Scope of Variables You may scope work variables and register variables to be local or global with the PRIVATE or GLOBAL s

Strona 566

vi AbbreviationsAbbreviationsAbbreviationsAbbreviations ANK Alpha-Numeric and Katakana BASIC Beginners All purpose Symbolic Instruction Code

Strona 567

72 If used inside the SUB or FUNCTION function in the same file where the global variable is defined, the variable will also have the same value. (Ex

Strona 568

Chapter 5. Data Types 73 5.5.2 Local Variables A local variable can be accessed only in a file where it is defined. Write PRIVATE preceding a desired

Strona 569

74 5.5.3 Variables Not Declared to be Global or Local If not declared to be global or local, a variable is closed in each file where it is defined.

Strona 570

Chapter 5. Data Types 75 5.5.4 Common Variables A common variable should be declared in a main object beforehand. To share the common variable by file

Strona 571

76 Chapter 6 Expressions and Operators CONTENTSCONTENTSCONTENTSCONTENTS 6.1 Overview...

Strona 572

Chapter 6. Expressions and Operators 77 6.1 Overview An expression is defined as a combination of constants, variables, and other expressions which ar

Strona 573 - IndexIndex

78 6.2 Operator Precedence When an expression contains more than one operator, BHT-BASIC performs the operations in the standard precedence as shown

Strona 574

Chapter 6. Expressions and Operators 79 6.3 Operators 6.3.1 Arithmetic Operators Arithmetic operators include a negative sign (-) and operators for mu

Strona 575

80 6.3.2 Relational Operators A relational operator compares two values. Depending upon whether the comparison is true or false, the operator returns

Strona 576

Chapter 6. Expressions and Operators 81 6.3.3 Logical Operators A logical operator combines multiple tests and manipulates Boolean operands, then retu

Strona 577

1 Chapter 1 Software Overview for the BHT CONTENTSCONTENTSCONTENTSCONTENTS 1.1 Software Overview...

Strona 578

82 [ 2 ] The AND operator The AND operator ANDs the same order bits in two expressions on either side of the operator, then sets 1 to the resultant

Strona 579

Chapter 6. Expressions and Operators 83 6.3.4 Function Operators The following two types of functions are available in BHT-BASIC, both of which work a

Strona 580

84 Comparison of Character StringsComparison of Character StringsComparison of Character StringsComparison of Character Strings The string ope

Strona 581

85 Chapter 7 I/O Facilities CONTENTSCONTENTSCONTENTSCONTENTS 7.1 Output to the LCD Screen...

Strona 582

86 7.1 Output to the LCD Screen 7.1.1 Display Fonts [1] Screen mode and font size Listed below are the fonts available on BHT. Screen mode Font s

Strona 583

Chapter 7. I/O Facilities 87 Screen modeScreen modeScreen modeScreen mode The ANK mode displays ANK characters listed in Appendices C1 and C2.

Strona 584

88 [2] Character attributes (Reverse font and enlargement attribute) Reverse font attributeReverse font attributeReverse font attributeReverse f

Strona 585

Chapter 7. I/O Facilities 89 7.1.2 Coordinates on the LCD To locate characters on the coordinates of the LCD screen, use the LOCATE statement. To obt

Strona 586

90 Two-byte Kanji Mode • Standard-size font Be careful about the specification of line numbers in figures below. A single column shown below represen

Strona 587 - BHT-BASIC

Chapter 7. I/O Facilities 91 • Small-size font Be careful about the specification of line numbers in figures below. A single column shown below repres

Komentarze do niniejszej Instrukcji

Brak uwag