Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 11 of 47

PDT 1100 Terminal Programmer's Guide: Chapter 2 Development Environment and Procedures, pages 87 to 96

Pages 87 to 96 of 413, from PDT 1100 Terminal Programmer's Guide

The original document is the PDF (3.5 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Symbol PDT-1100

Page 87

I/O Facilities

OUT Statements

I/O Devices

OUT 8,&h00

Turns off the wake-up function.

OUT 8,&h04

Sets the wake-up time or reads the preset time

OUT &hE,&h01

Turns on the system status indication. 3

OUT &hE,&h00

Turns off the system status indication. 3

OUT &h0010,&hXX (XX: 00 to FF) Outputs to the VRAM. 4 &h024F,&hXX (XX: 00 to FF) OUT &h6020,&h01

Turns on the LCD backlight.

OUT &h6020,&h00

Turns off the LCD backlight.

OUT &h6021,&hXX (XX: 00 to FF) Sets the LCD backlight ON-time. 1 The reading confirmation LED illuminates green when the PDT 1100 successfully scans a bar code. If the bar code device file has already been opened with the OPEN “BAR:” statement, the OUT statement cannot turn on the reading confirmation LED. Close the bar code device file as follows: CLOSE OUT 1, 1 2 The PDT 1100 cannot control the RS (RTS) signal. This signal is ignored if turned on. 3 This setting cannot affect the setting made in System Mode. 4 Setting graphic data and addresses to the VRAM using the OUT statement enables you to output graphics to the LCD. The data value ranges from &h10 to &h24F. The data is designated by bit 7 (LSB) to bit 0 (MSB). If the bit is 1, the corresponding dot on the LCD turns on.

7-11

Page 88

PDT 1100 Terminal Programmer’s Guide

Monitoring by the INP Function The INP function monitors the input and output devices (I/Os) as listed below. (Refer to Appendix D, I/O Ports.) Table 7-2. Input and Output Devices INP Functions INP(0) AND &h01

INP(0) AND &h02

INP(0) AND &h04

INP(0) AND &h08

I/O Devices Keyboard buffer status

Bar-code buffer status Trigger switch status 1

Receive buffer status

Value

Meaning

1

Data present

0

No data

1

Data present

0

No data

1

Being pressed

0

Being released

1

Data present

0

No data

INP(0) AND &h10

TIMEA function

1

Set to 0

INP(0) AND &h20

TIMEB function

1

Set to 0

INP(0) AND &h40

TIMEC function

1

Set to 0

INP(0) AND &h80

CS (CTS) signal status 2

1

ON

0

OFF

1 The INP function monitors the trigger switch status only when the trigger switch function is assigned to a key (M1, M2, M3 or M4). 2 Using the INP function monitors the CS (CTS) signal status only when the direct-connect interface is selected and its interface port (3-pole plug mini stereo jack) is arranged so that the receive data signal RD is functionally regarded as CS signal.

Note: The INP function also checks the LCD contrast, VRAM data, system status indication, and message version (English or Japanese).

7-12

Page 89

I/O Facilities

Monitoring by the WAIT Statement The WAIT statement monitors the input and output devices (I/Os) below. Unlike the INP function, the WAIT statement makes the I/O devices idle while no entry occurs, saving power consumption and increasing the battery service life. (Refer to Appendix D, I/O Ports.) Table 7-3. WAIT Statement and I/O Devices WAIT Statement

I/O Devices

WAIT 0,&h01

Keyboard buffer status

WAIT 0,&h02

Bar-code buffer status

WAIT 0,&h04

Trigger switch status 1

WAIT 0,&h08

Receive buffer status

WAIT 0,&h10

TIMEA function

WAIT 0,&h20

TIMEB function

WAIT 0,&h40

TIMEC function

WAIT 0,&h80

CS (CTS) signal status 2

1 The WAIT function monitors the trigger switch status only when the trigger switch function is assigned to a key (M1, M2, M3 or M4). 2 The WAIT statement monitors the CS (CTS) signal status only when the directconnect interface is selected and its interface port (3-pole plug mini stereo jack) is arranged so that the receive data signal RD is functionally regarded as CS signal.

In a single WAIT statement, you can specify more than one I/O device if the same port number applies. To monitor the keyboard buffer and the bar code buffer with a single WAIT statement, for example, describe the program as follows. OPEN “BAR:” AS #10 CODE “A:” WAIT 0,&h03

This example sets the value of &h03 (00000011) to port 0, indicating that it keeps waiting until either bit 0 or bit 1 becomes ON by pressing any key or by reading a bar code.

7-13

Page 90

PDT 1100 Terminal Programmer’s Guide

7-14

Page 91 read from a scan by OCR; it may hold reading errors

YO Facilities

7-15

Page 92

PDT 1100 Terminal Programmer’s Guide

7-16

Page 93

Chapter 8 Files File Overview Data Files and Device I/O Files BASIC 3.0 treats data files and bar code device I/Os and communications device I/Os as files, by assigning the specified names to them. Table 8-1. FileType and File Name File Type Data File

File Name

Remarks filename.extension drivename:filename.extension

Device I/O File

BAR:

Bar code device

Device I/O File

COM:

Communications device

Note: Data files and user program files are stored in the user area of memory.

Access Methods To access data files or device I/O files, first use the OPEN statement to open those files. Input or output data to/from the opened files by issuing statements or functions to them according to their file numbers. Then, close those files using the CLOSE statement.

8-1

Page 94

PDT 1100 Terminal Programmer’s Guide

Data Files Overview Calculate the memory capacity available for data files by subtracting the memory space occupied by both the system programs and user programs from the total RAM capacity. The available memory capacity is the calculated RAM capacity plus the flash ROM capacity calculated by subtracting the memory space occupied by user programs from the user area. For the memory mapping, refer to Appendix F, Memory Area. The FRE function checks the current occupation of the memory. The EOF function cannot be used for data files.

Naming Files The name of a data file generally contains filename.extension. The filename can have one to eight characters; the extension can have one to three characters. The filename.extension should be preceded by the drivename. The drivename is A: for specifying the RAM or B: for flash ROM. If drivename is omitted, the default A: (RAM) applies. The following file names cannot be used for data files since they are reserved for Easy Pack: PACK1.DAT PACK2.DAT PACK3.DAT PACK4.DAT

The extension can be omitted. In such a case, a period should be also omitted. The following extensions cannot be used for data files: .PD3 .FN3 .EX3 .FLD

8-2

Page 95

Files

Structure of Data Files Record A data file is made up of a maximum of 32,767 records. A record is a set of data in a data file and its format is defined by the FIELD statement. The maximum length of a record is 255 bytes including the number of the character count bytes (= the number of the fields). When transferring data files, the PDT 1100 protocol/PDT 1100 Ir protocol prefixes a character count byte in binary format to each data field.

Field A record is made up of one or more fields. Data within the fields are treated as character (ASCII) data. Each field precedes a character count byte in binary format, as described above. Including that one byte, the maximum length of a field is 255 bytes. The following FIELD statement defines a record which occupies a 28-byte memory area (13 + 5 + 10 bytes) for data and a 3-byte memory area for three character count bytes. Totally, this record occupies not a 28-byte area but a 31-byte area in the memory. FIELD #2,13 AS bardat$,5 AS keydat$,10 AS dt$ '1+13+1+5+1+10=31

When a data file is transmitted according to the PDT 1100 protocol, the following conditions should be also satisfied: " "

A record is made up of a maximum of 16 fields. The maximum length of a field is 254 bytes excluding a character count byte.

Data File Management by Directory Information The Interpreter manages data files using the directory information stored in the system area of the memory. The directory information, for example, contains the following: filename.extension Information of Each Field (Field length) Number of Written Records Maximum Number of Registrable Records

8-3

Page 96

PDT 1100 Terminal Programmer’s Guide

Number of Written Records The LOF function returns the number of records already written in a data file. If no record number is specified in the PUT statement, the Interpreter assigns the current written record number + 1 to the record. PUT #1

Maximum Number of Registrable Records You may declare the maximum number of records registrable in a data file using the RECORD option in the OPEN statement, as shown below. OPEN “work.DAT” AS #10 RECORD 50 FIELD #10,13 AS code$,5 AS price$

The above program allows you to write up to 50 records in the data file named work.DAT. If the statement below is executed following the above program, an execution error occurs. PUT #10,51

The maximum number of registrable records can be optionally specified only when you make a new data file. If designated to the already existing data file, the specification will be ignored without an execution error. Specifying the maximum number of registrable records does not cause the Interpreter to reserve the memory area.

Programming for Data Files Input/Output for Numeric Data To write numeric data into a data file: Use the STR$ function to convert the value of a numeric expression into a string. To write -12.56 into a data file, for example, a field length of at least 6 bytes is required. When using the FIELD statement, designate the sufficient field length; otherwise, data is lost from the lowest digit when written to the field.

To read data to be treated as a numeric from a data file: Use the VAL function to convert a string into a numeric value.

8-4