The text of a manual · part 24 of 34
MCL-Designer for Phaser Series User's Guide, pages 187 to 196
Pages 187 to 196 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 187
MCL-Code Reference Guide
Display Clear (DC) Function Clears the display, or a single line of the display.
Syntax DC | line where:
Line = number of the line to be cleared. (0 clears the whole screen, else the specified line is cleared).
Affected System Variables None
Examples DC | 0
Clears all lines on the scanner display
DC | 1
Clears the first line only.
7-19
Page 188
MCL-Designer for Phaser Series User’s Guide
Display Message (DM) Function Displays a message on the scanner screen.
Syntax DM | line | column | style | message where:
Line = the line number on which to display the message (1 or 2). Column = the column position (1 to 20). Style = the display attribute: N = Normal Video. R = Reverse Video.
Message = the text or variable to be displayed.
Affected System Variables None
Note 1. If the line number or column number is outside the display range, nothing is displayed. 2. An alternate way to display characters is the use of the hexadecimal conversion, ex: \41 = “A”. 3. If the first character to be displayed is a “#”, then it must be encoded as \23 so that it is not misinterpreted as a carriage return during the download process.
Examples DM | 1 | 5 | N | MENU
Displays the word “MENU” on line 1, column 5.
DM | 1 | 7 | R | &A1
Displays the contents of variable A1 on line 1, column 7 in reverse video.
7-20
Page 189
MCL-Code Reference Guide
File Delete (delete record) (FD) Function Deletes the current record in a file.
Syntax FD | filename where:
Filename = the name of the selected file (range: A - H).
Affected System Variables &99 =
0, if no error occurs or 1 in case of error.
Notes 1. This command does not delete a file, it deletes a record in a file. (Use File Erase to delete a file). 2. The file pointer is placed on the next record of the file, except when the last record is being deleted. In this case, the pointer is set to the end of the file. 3. Command is supported on DIRECT files only. 4. Records are deleted by replacing them with a special string. 5. If filename is unknown, System Error “2” is displayed.
Examples FD | A
Deletes the current record in file “A”.
7-21
Page 190
MCL-Designer for Phaser Series User’s Guide
File Erase (delete file) (FE) Function Erases a file.
Syntax FE | filename where:
Filename = the name of the selected file (range: A - H).
Affected System Variables &99 =
0, if no error occurs or 1 in case of error.
Notes 1. After a file erase command, the file cannot be recovered. 2. A file is erased by replacing its FAT entry with all zeros (0). 3. If filename is unknown, System Error “2” is displayed.
Examples FE | A
7-22
Erases file “A”.
Page 191
MCL-Code Reference Guide
File checK (FK) Function Checks if a file is present and returns its size.
Syntax FK | filename where:
Filename = file to be checked (range: A-H).
Affected System Variables &99 =
0, if no error occurs or 1 in case of error.
&97 = file size (free format).
Example FK | A
Checks if file “A” exists.
7-23
Page 192
MCL-Designer for Phaser Series User’s Guide
File Open (FO) Function Opens a file and defines the structure of the data.
Syntax FO | filename | keys | fieldlength1 [ | fieldlength 2 ].....[ | fieldlength n] where:
Filename = the name of the file (range: A - H). Keys = the number of key fields in the record. (range: 0 - 9; if no key, enter 0).
Fieldlength 1 = the length of the first field (range: 0 -255). Fieldlength n = the length of the last field (range: 1 -255). Up to 20 fields may be declared.
Affected System Variables &99 =
0 if no error occurs, or 1 in case of error.
&98 =
If &99!=0 (if an error occurred), &98 will contain the error code: F001: Illegal File Name F002: File not empty - the record structure being defined does not match the existing record structure, and the existing file is not empty. This is not allowed, as it could cause a loss of collected data. F003: File Allocation Table could not be updated. This could result from an excessive number of file redefinitions, causing FLASH memory wear.
Notes 1. To declare a sequential file, set keys and fieldlength1 to 0 (zero), and do not declare any more fields. (Sequential files cannot have keys). 2. All fields in the record are text fields (numeric values are converted to ASCII representations). Size fields accordingly 3. If filename is unknown or any I/O error, System Error “2” is displayed. 4. If the number of key fields is greater than 9, System Error “2” is displayed. 7-24
Page 193
MCL-Code Reference Guide
5. If the file does not exist (has not been allocated using an FZ command), System Error “2” is displayed. 6. If a file is opened with the same specification that previously existed, then any existing data remains intact. If it is opened with a new specification, and the file is not empty, an error occurs. 7. A file must be opened before any operation can take place. 8. The keys represent the number of fields to use as key. They define how the file is organized as the file is sorted following these keys. 9. Keyed files are read-only. The scanner is not able to write or update records in a sorted manner. The files MUST be sorted according to the defined keys prior to downloading to the scanner. 10. The maximum record size is 255 characters with a maximum of 20 fields.
Examples FO | A | 2 | 6 | 4 | 20 | 8 Opens a file with name “A”. The file consists of records with 4 fields, with field lengths of 6, 4, 20 and 8 characters, respectively.The two first fields (6 and 4 characters) are defined as key fields. The file is created and maintained, in ascending order, on the two access keys. The primary sort is on the 1st access key, and the secondary sort is on the 2nd access key. View of the file:
000001 | 1234 | ABCDEFGHIJKLMNOPQRST | 00020.17 CRLF 000001 | 1235 | UVWXYZABCDEFGHIJKLMN | 12000.15 CRLF 000074 | 7012 | HELLO WORLD | 00000.00 CRLF
FO | A | 1 | 4 | 20
Opens a file with name “A”. The file consists of records with 2 fields, with field lengths of 4 and 20 characters, respectively.The first field (4 characters) is defined as a key field.
View of the file:
CR 0001 | BARBARA HENDRICKX LF CR 0001 | THOMAS EDISON LF 1205 | WOLFGANG AMADEUS MZTCRLF
FO | D | 0 | 0
Open a file with name “D” with no structure.
View of the file:
BARBARA HENDRICKXCR LFTHOMAS EDISON CR LFWOLFGANG AMADEUS MZTCRLF
7-25
Page 194
MCL-Designer for Phaser Series User’s Guide
File Print (FP) Function Output a file to a serial port, with no formatting and no protocol. (Dump file).
Syntax FP | com | filename | replace where:
Com = Ignored (only one com port available). Filename = the name of the file (range: A - H). Replace = N: Transmit contents of the file as is. Y: All variables (ex: &A0) are replaced with the contents of the referenced variable.
Affected System Variables &99 =
0 if no error occurs, or 1 in case of error.
Notes 1. The FP command makes use of the existing host interface software to communicate a file with a host using either serial or Synapse communications. The file will be transferred according to the file type: Direct file (files with defined record structures) will be transferred one record at a time. If a record is too big to be transmitted by the installed host, the operatio fails; therefore it is incumbent on the designer to create a record structure which can be handled by the intended host interface. Sequential files (files with no defined record structures) will be transferred in packets which are sized to the capabilities of the host interface. In either case, the global communication parameters (including data formatting for appending CR/LF to the data) will be applied.
7-26
Page 195
MCL-Code Reference Guide
2. The position of the file pointer after an FP command is indeterminable, so an FS command should be used to reposition the file at a known position prior to any subsequent accesses. 3. The file to be printed must be opened with the FO command prior to printing. 4. In order to send formatted data during an upload, a loop of SO commands shoul be used instead of FP.Note, however, that if this method is used during daisychaining, the bus arbitration will occur per record, not per file upload.
Example FP | 1 | A | Y
Dumps file “A” to serial port, replacing variables.
7-27
Page 196
MCL-Designer for Phaser Series User’s Guide
File Read (FR) Function Reads the record located at the current pointer position of the file.
Syntax FR | filename | length | variable where:
Filename = the name of the sequential file (range: A - H). Length = the number of bytes to read from the current pointer position. Variable = the variable in which data is stored. FR | filename | variable
[ | variable 2] ... [ | variable n ] where:
Filename = the name of the DIRECT file (range: A - H). Variable 1 = the variable in which data for the first field of the record is stored. (Can be replaced by ?? to skip this field).
Variable n = the variable in which data for the last field of the record is stored. (Can be replaced by ?? to skip this field).
Affected System Variables &99 =
0 if no error occurs, or 1 in case of error.
Notes 1. The number of variables must be less than or equal to the number of fields contained in the record. 2. To ignore a field of a record, enter “??” instead of the variable name. For DIRECT file read only. 3. If filename is unknown, System Error “2” is displayed. 4. After reading, the pointer remains unchanged.
7-28