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 25 of 34

MCL-Designer for Phaser Series User's Guide, pages 197 to 206

Pages 197 to 206 of 288

The original document is the PDF (3.0 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 P360 and Symbol P460

Page 197

MCL-Code Reference Guide

5. Each field is stored in variable 1, variable2,.... Last variable in command contains all remaining fields. If a variable is replaced by ??, the field is not rea 6. If a sequential read is attempted on a direct file, or a direct read is attempted on a sequential file, System Error “2” is displayed.

Examples FR | A | C1 | ?? | F1 | G0

Reads a record from the current pointer position of file “A” and stores the contents of field 1 into C1, field 3 into F1, and field 4 into G0 (field 2 is ignored).

FR | A | 30 | C1

Reads 30 bytes from the current pointer position of file “A” into variable C1. (File A must be declared as a sequential file.)

7-29

Page 198

MCL-Designer for Phaser Series User’s Guide

File Seek (FS) Function Positions the file pointer to a specific record or byte, or searches a file for a specified pattern or key value.

Syntax FS | filename | position [ | pattern] OR FS | filename | position [ | key1val ] ...[ | keynval ] where:

Filename = the file to be positioned (range = A-H).. Position = the position at which the file pointer is to be set (if pattern and keyval are omitted, or at which the search begins. Values can be: F = First record. L = Last record. P = Previous record. N = Next record. C = Current record. n = An arbitrary record number.

Pattern = A pattern to find beginning at the specified position. Patterns can contain a string of characters. This string will be matched to the first n characters in each record, until a match is found.

Keynval = The value of the key fields. The number of specified keys can be any number up to the total number of keys defined for the file. The search begins at the position specified, and locates the first record whose first n keys match the specified values.

7-30

Page 199

MCL-Code Reference Guide

Affected System Variables &96 =

Current record number

&99 =

0, if the requested record is found. 1, if not found, pointer remains unchanged.

Notes 1. The number of keys must be less than or equal to the number of keys defined in the File Open command of the related file. 2. If the filename is unknown, System Error “2” is displayed. 3. If the file is defined by FO | filename | 0 | 0 (sequential file), no key or pattern can be defined. 4. System Variable 96 returns the current record number after FS command. This can be used to determine the total number of records in a file using the Last position parameter. 5. If the requested record is not found, the current file pointer is not updated.

Examples FS | A | F | 00001 | 1130 | &A0

Positions the pointer of file “A” on the first record with: key 1 = 00001. key 2 = 1130. key 3 = variable &A0.

FS | D | 18

Positions the pointer on the 18th record of file “D”.

7-31

Page 200

MCL-Designer for Phaser Series User’s Guide

File Update (FU) Function Reads a record at the current pointer position of the file updates the fields with the passed parameters, writes the record at the end of the file and deletes the current record.

Syntax FU | filename | var1 [| var2]…[|varn} where: filename = name of the file to update (A-H). var1 = the variable in which data for the first field of the record to update will be stored. (Can be replaced by “??” to skip this field.) varn the variable in which data for the last field of the record to update will be stored. (Can be replaced by “??” to skip this field.)

Affected System Variables &99 =

“0” if no error occurs. “1” if error is detected.

Notes 1. The number of variables must be less than or equal to the number of fields contained in the record. To ignore a field without using a variable, enter “??” signs instead of the variable name. 2. If the length of the specified fields exceeds the corresponding field length of the file, the variable will be truncated to fit within the field. 3. If filename is unknown, System Error “2” is displayed. 4. The updated record is appended to the end of the file. 5. After updating, the file pointer is moved to the updated record which is at the end of the file. 6. Only applies to DIRECT files.

Example FU | A | ?? | &A1 Update the second field of file “A” with the contents of variable A1 leaving the first field unchanged. 7-32

Page 201

MCL-Code Reference Guide

File Write (FW) Function Writes a new record in the file.

Syntax FW | filename | field1 [ | field2 ] ... [ | field n ] where:

Filename = the name of the file (range: A - H). Field1,…n. = the text or variable for fields 1 to n.

Affected System Variables &99 =

0 if no error occurs, or 1 in case of error.

Notes 1. The number of field(s) must be equal to the number of field(s) defined within the File Open command. 2. If filename is unknown, System Error “2” is displayed. 3. Records are appended to the end of the file, regardless of the current file pointer position. The current pointer position is not changed. 4. All fields are truncated or left justified (filled with blanks on right) to the correct length. 5. It is recommended that \od (carriage return) or \od\oa (carriage return/line feed) terminate each sequential file record to facilitate later retrieval of these records

Example FW | A | &C1 | &D0 | &F1 | 123 Writes a new record into file “A”. Stores the content of the variables C1, D0, F1 and 123 in the record.

7-33

Page 202

MCL-Designer for Phaser Series User’s Guide

File Size (FZ) Function To allocate storage for a file.

Syntax FZ | filename | start | end where:

Filename = the name of the file to allocate storage for (range 'A' –'H'). Start = the first block number to allocate for this file. Values are hexadecimal. End = the last block number to allocate for this file; if 0xFFFF is specified, the entire available memory is allocated. Values are hexadecimal.

Affected System Variables

&99 =

0 if no error occurs, or 1 in case of error.

&98 =

If an error occurs, contains the error code: FZ01 Bad block allocation: The start and end block numbers do not represent a legal file (start > end; or end too big). FZ02 = File being reallocated (allocated with different parameters than pre-existing file) is not empty. This is not allowed as data loss would occur. FZ03

File allocation would cause loss of data in another file

FZ04 = File Allocation Table could not be updated. This could be due to excessive wear on the FLASH memory part.

7-34

Page 203

MCL-Code Reference Guide

Notes 1. Files are allocated using block numbers. A block represents 256 bytes of FLASH memory. Block numbers are referenced to an artificial zero point which represents the first FLASH memory block available for data storage. Therefore, if the system code occupies 140 Kbytes (0x023000) of space, followed by 32 KB (0x008000) of MCL application storage, then “Block 0” starts at address 0x02B000. 2. MCL Designer can be set up for 512 KB, 1 MB, 4 MB or 8 MB scanners on the System Setup screen. 256 KB are reserved for system use (512 KB are reserved on the Extended Memory Phaser). Designer keeps track of the remaining space as files are allocated. 3. Minimum file size supported is 2 blocks. 4. On Extended Memory Phaser, file allocation requests are rounded up to the nearest whole 64 KB segment.

Example FZ|A|1000|125

Allocates file 'A' to begin at block 1000, and to occupy 256 blocks (64K).

7-35

Page 204

MCL-Designer for Phaser Series User’s Guide

Input Cash (IC) Function Inputs a number with selected format in cash register input mode (digits are scrolled from right to left) a short beep is emitted after input.

Syntax IC | line | column | variable | integer | fraction where:

Line = line of the input field on the display (range: 1 - 2). Column = left most column of the input field. Variable = name of the variable to receive the input. Integer = size of integer (0 to 7 digits). Fraction = size of fractional part (0 to 4 digits).

Affected System Variables None

Notes 1. Integer set to 0 means that it is not possible to enter a number greater than 0.9999. In that case, the decimal point is placed at the most left place. 2. Fraction set to 0 means that the entered number is an integer. In that case, the decimal point is not displayed. 3. Integer and fraction both set to 0 is not allowed. 4. Integer entry ends and fractional entry begins when either the maximum specified number of integers has been entered or ‘.’ or ‘,’ is pressed.

7-36

Page 205

MCL-Code Reference Guide

Active keys are: <Enter> Accept Input. ‘.’ or ‘,’ switches to fractional input. <Bksp> removes last entered character. <0> to <9> digits. All keys defined in the last PI command

Example IC | 2 | 6 | A0 | 4 | 2

Lets user enter a number with format 0000.00 in variable A0 at screen position (2,6).

7-37

Page 206

MCL-Designer for Phaser Series User’s Guide

Input Date (ID) Function Displays an input mask at a screen position and waits for a date input with selected format.

Syntax ID | line | column | variable where:

Line = line of the input field on the display (range: 1 - 2). Column = left most column of the input field. Variable = name of the variable to receive the input.

Affected System Variables None

Notes 1. The default date format is MM/DD/YYYY. The date format and date separator can be changed using the PY command. 2. Date is checked during input. All invalid dates are rejected.

Examples PY | F013 | 01 PY | F00E | 00 ID | 2 | 1 | A0

Sets format and separator.

PY | F013 | 00 PY | F00E | 02 ID | 2 | 1 | A0

Sets format and separator.

7-38

Lets user enter a date with format DD/MM/YYYY in variable A0 at screen position (2,1).

Lets user enter a date with format MM:DD:YYYY in variable A0 at screen position (2,1).