The text of a manual · part 22 of 34
MCL-Designer for Phaser Series User's Guide, pages 167 to 176
Pages 167 to 176 of 288: Chapter 6 Downloading A Project; Chapter 7 MCL-Code Reference Guide
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 167
Chapter 6 Downloading A Project Downloading to a Scanner To download the project design to a Version 2.XX scanner, select Host Mode on the scanner (system menu option 1, suboption 0), then click on . To download the project design to a Version 1.XX scanner, select Load New System on the scanner (system menu option 1, suboption 2), then click on . The Send Project dialog box appears.
Figure 6-1. Send Project Dialog Box Project
Displays the name of the current project.
Comm Port
Selects the host’s communication port. 6-1
Page 168
MCL-Designer for Phaser Series User’s Guide
!
Click or
!
Enter the appropriate information to change the values and click changes.
!
Click to close the dialog box without saving the changes.
6-2 to accept the default setting to apply the
Page 169
Chapter 7 MCL-Code Reference Guide About MCL-Code The Macro Command Language (MCL-Code) is a collection of simple, high-level commands used to quickly program Symbol scanners. An MCL-Code program is a standard ASCII file containing easy-to-read macro command lines. The program is loaded into the scanner’s memory and is interpreted by the MCL-Code run-time kernel (also loaded in the scanner). Programs and File Size on page 7-95 explains how memory is organized and what limitations there are on programs and file size.
MCL-Code Program The user may design up to nine MCL-Code programs (0.MCL to 8.MCL). Each MCL-Code program can contain up to 512 lines; however, the physical restraint on a program is 4KB. Each MCL program can call subroutines, which may be defined in the same file, or in a different file. In this way, applications which exceed the 4 KB limit may still be implemented.
7-1
Page 170
MCL-Designer for Phaser Series User’s Guide
Typographic Conventions The following typographic conventions are used in this chapter: Table 7-1.Typographic Conventions Convention
Used for bold
Commands and switches that follow them. You must type the commands and their switches exactly as they appear.
italics
Place-holders that represent information you must provide. For example, if you are asked to type filename, you should type the actual name of a file instead of the word shown in italics.
|
Argument field separator within the command line or file. This is a reserved character and should not be used for any other purpose.
< Key >
Keyboard key symbols. Examples: < Enter >, < F9 >, < Spacebar >
[ arg ]
Optional arguments in a command line.
&
A variable quantity or expression. Example: &V0 = contents of variable V0
7-2
Page 171
MCL-Code Reference Guide
Introduction Overview of the MCL-Code An MCL-Code program is a sequence of command lines. All MCL command lines consist of a number of tokens, separated by a vertical bar (‘|’). The first token in a command line is the 2 character command name, and the remaining tokens are parameters for that command. MCL-Code commands can be divided into nine logical groups: !
display
!
keyboard & scanner input + special input
!
files
!
variable operations (add, subtract,...)
!
serial communication
!
input/output
!
labels and branch
!
parameterization
!
miscellaneous.
Variables Using Variables A variable: !
exists in a memory zone (typically 64 bytes except Z0 to Z2 = 512 bytes)
!
has a name (A0 to Z0, A1 to Z1,....., A3 to Y3)
!
can be written and rea
!
is global for all programs in the scanner.
When a variable is written, the user has to specify the name of the variable. ex: VM | A1 | HELLO WORLD The command writes HELLO WORLD into variable A1.
7-3
Page 172
MCL-Designer for Phaser Series User’s Guide
When a variable is read, the user specifies the contents of the variable. ex: DM | 1 | 1 | N | &A1 This command displays HELLO WORLD. &A1 represents the contents of A1. Any argument of a command can be a variable.
Types Of Variables The MCL-Code recognizes three types of variables: !
system variables
!
small variables
!
large variables.
System Variables Numbered from 00 – 99, these are parameters and function return codes. The length of the variable depends on the data represented by the variable. In general, these variables do not represent actual memory locations, but require an underlying process to read or set. This underlying process is transparent to the user. System Setup Variables on page 7-98 lists the value represented by each System Variable.
Small Variables Labeled A0, A1, A2, A3; B0-B3; …; Y0-Y3; for a total of 100 variables, each capable of storing 64 bytes of data. Small Variables store strings only; any integer data to be manipulated is converted to a string prior to storage, and back to an integer prior to processing. User variables are global variables. They can be accessed from any program in the scanner.
Large Variables Labeled Z0 – Z2, for a total of 3 variables, each capable of storing 512 bytes of data. Like Small Variables, Large Variables store only strings.
7-4
Page 173
MCL-Code Reference Guide
Files and Records General Within an MCL-Code program, you can use local files. Note: The P370/P470 RF scanners do not support files. Scanned data may be manipulated using any of the functions available in MCL. However, the resultant data must be transmitted to the host, since there is no facility for storing data long-term in the scanner. The files are named A to H. These files can be downloaded from the host computer to the scanner. MCL file commands allow the user to write, read, update, delete, or search into these files. Files can be unformatted ASCII text. Refer to Programs and File Sizes on page 7-95 for instructions on sizing the files you will use in your application. On the scanner, a file is simply an area of the FLASH reserved to hold a specific set of data. A file allocation table (FAT) will be maintained, which specifies for each file, the start and end locations, as well as the number of fields, and the size of each field. Table 7-2. Sample FAT Name A
Start 1100
End 10FF
B
1100
Keys
# Fields 10
Len 1
0
7
Len 2 6
... ...
Len 20 0
7FFF
0
3
80
7
...
0 0
C
8000
FFFF
0
0
0
0
...
D
0
0
0
0
0
0
...
0
...
...
...
...
...
...
...
...
...
H
0
0
0
0
0
0
...
0
Files are declared using a File Size command (FZ). This command specifies the name of the file to allocate, and its start and end addresses. The following commands would be used t allocate the above described files: FZ|A|1000|10F FZ|B|1100|7FFF FZ|C|8000|FFFF 7-5
Page 174
MCL-Designer for Phaser Series User’s Guide
See File Size (FZ) on page 7-34 for a complete description of the FZ command. The File Open (FO) command specifies the field structure of a file. If zero (0) fields are defined, the file is treated as a sequential ASCII file. See File Open (FO) on page 7-24 for the full specification of the FO command.
Structure Of The Files The files can have two different structures: variable or fixed length records. Fixed length records can have a key (a sort field).
Sequential Files Sequential files are defined as having 0 fields. The file is simply interpreted as a string of unformatted ASCII data. Sequential files may be used for writing activity logs and such. They CANNOT be searched by field. Sequential file records are delimited by a Carriage Return (0x0D) or Carriage Return/Line Feed (0x0D/0x0A) pair.
Direct Files Files containing fixed length records are called direct files, and may or may not have keys. These files are opened using command FO | filename | Keys | Field1… (refer toFile Open (FO) on page 7-24). Maximum values for direct file:
Record length = 255 characters. Number of keys = 9. Number of fields = 20. Field length = 255 characters.
Key fields refer to the fields on which the file is sorted, and on which fields searches may be performed. If no key fields are defined, the file is considered to be unsorted, and any search for data in the file is performed in a linear fashion. If 1 or more key fields are defined, then the file is considered to be sorted on the concatenation of all the key fields. Any keyed search on key n must specify a value for all keys from 1 to n. Keyed files cannot be appended to, as no sorting of written records is possible. The file MUST be presorted on the host prior to downloading to the scanner; the scanner has no capability to sort files. If an unsorted file is declared with keys, unexpected results may occur. When one or more keys are defined, the file is maintained in ascending order on the defined key(s); every record can be accessed directly by the use of its key(s).
7-6
Page 175
MCL-Code Reference Guide
MCL Commands Table 7-3 lists the available MCL code commands. These commands are described on the pages following as referenced in the table. Table 7-3. Logical Group, Command, and Descript i o Logical group Display
Command
Description
Page
BL Backlight
Sets Backlight On/Off.
7-10
DC Display Clear
Clears line(s) on the scanner display.
7-19
DM Display Message
Displays a message on the scanner display.
7-20
IC Input Cash
Waits for input with cash register format.
7-36
ID Input Date
Waits for input with selected date format.
7-38
IH Input Time
Waits for input with selected time format.
7-40
IK Input Key
Waits for key input.
7-41
IL Input List
Sets a variable based on a selection from a scrolling 7-43 list of options.
IX Extended Input
Waits for specific input from keyboard or scanner. 7-45
ML Menu List
Branches based on a selection from a scrolling list 7-50 of options.
Modem
MD MoDem
Outputs a string of characters to the modem 7-49 and waits for a response from the modem.
Files
FD File Delete
Deletes current record.
7-21
FE File Erase
Delete complete file.
7-22
FK File Check
File Check.
7-23
FO File Open
Opens file and defines the data structure.
7-28
FP File Print
Print a file to serial port.
7-26
FR File Read
Reads the current record.
7-28
FS File Seek
Positions the file pointer on the requested record. 7-30
FU File Update
Reads a record at the current pointer position of 7-32 the file, updates the fields with the passed parameters, writes the record at the end of the file and deletes the current record
FW File Write
Writes a new record in the file.
7-33
FZ File SiZe
Declare storage for a file.
7-34
Keyboard and Scanner Input
7-7
Page 176
MCL-Designer for Phaser Series User’s Guide
Table 7-3. Logical Group, Command, and Description (Continued) Logical group Variable Operations
Serial Communication
Labels and Branch
Command
Description
Page
VC Variable Compare
Compares text with pattern.
7-78
VE Variable Extract
Extracts characters from defined record.
7-80
VF Variable Format
Formats data as characters or a number.
7-81
VJ Variable Justify
Justifies data in variable to left or right.
7-84
VL Variable Length
Computes the size of text.
7-86
VM Variable Move
Replaces current contents of variable with new value.
7-87
VO (% + - * /) Variable Operation
Variable Operations: arithmetic.
7-88
VS Variable Substring
Extracts from a string.
7-90
VX Variable op eXtended
Variable operations (+ - * / %) with numeric formatting.
7-92
SI Serial Input
Waits for characters coming from the serial port
7-69
SO Serial Output (P360/ Sends characters to the serial port. P460 Memory Scanner)
7-73
SO Serial Output (P370/ Sends characters to the serial port. P470 RF Scanner)
7-75
LB LaBel definition
Assigns a label to the current program address.
7-48
SK SKip
Jumps to a label.
7-72
IF Condit. Branch
Compares data and jumps to labels.
7-39
RM Run MCL Program Calls a program and begins executing that program.
7-67
SR Skip and Return
Jumps to a label and returns after QX | 1.
7-77
Terminates program execution.
7-66
QX Quit or eXit Network NI Network Input Protocol Support NO Network Output (P360/P460 Memory Scanner)
Waits for a command from the network and stores 7-52 it in a variable. Sends a frame to the host via RS-232 using MCL- 7-55 Link protocol.
NO Network Output Sends a frame to the host via RS-232 using MCL- 7-57 (P370/P470 RF Scanner) Link protocol. NS MCL-Link Start
7-8
Calls MCL-Link communication program.
7-59