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

MCL-Designer for Phaser Series User's Guide, pages 237 to 246

Pages 237 to 246 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 237

MCL-Code Reference Guide

Serial Input (SI) Function Accepts input from a serial port and stores the data in variable.

Syntax SI | port | variable | beginchar | endchar | maxchar | trailingchar where:

Port = communication port (ignored for Phaser). Variable = the variable receiving the input characters. Beginchar = the starting character or string of the data string. Endchar = the last character or string of the data string. Maxchar = maximum number of characters to receive. Trailingchar = number of trailing character(s) to accept after “endchar” or “maxchar” (max. 9).

Affected System Variables If a TIMEOUT occurs (if one has been defined in the previous PI command): &97 =

“TO”

&98 =

“?”

&99 =

“0”

If a KEY (defined in the previous PI command) is pressed: &97 =

“KB”

&98 = name of the pressed key (see PI command for key names).

&99 =

“0”

7-69

Page 238

MCL-Designer for Phaser Series User’s Guide

If a CLEAR KEY (not defined in the previous PI command) is pressed: &97 =

“KB”

&98 =

“CL”

&99 =

“1”

If an error occurs on the P370/P470 RF scanner: &97 =

“?”

&98 = error number.

&99 =

“1”

Notes 1. Only the data included between the begin and the end characters are stored in the variable (beginchar and endchar characters excluded). 2. Serial Input terminates when a timeout occurs. 3. You can use “??” to ignore a parameter. 4. The maximum length of input data is 128 bytes. 5. Error numbers reported in &98 (in the P370/P470 RF scanner) are defined as follows: 5

Serial protocol error. Bad characters received.

15

RF Transmission error. Scanner is not paired properly to base or scanner is out of range.

16

RF Address error. Base to which scanner is paired has been paired with another scanner.

17

RF Transmission error. Scanner out of range.

18

MCL-Link Host unavailable. The base is connected to a Synapse cable, which cannot be used to communicate to MCL-Link.

20

Transaction error. The scanner is already busy communicating with the base.

21

Memory allocation failure. The scanner has run out of buffers necessary to manage communication. Repeated occurrence of this error should be reported to customer service.

24

RF Transmission error. The base is not responding. Repeated occurrence of this error should be reported to customer service.

7-70

Page 239

MCL-Code Reference Guide

Examples SI | 1 | B1 | \02 | \03 | 127 | 1

Accepts all data on serial port, starting with the character STX (hex. 02) and ending with the character ETX (hex. 03). When ETX is received, accepts the LRC character into the variable. Stops the input if 128 characters are received (127 + 1 trailing char.).

7-71

Page 240

MCL-Designer for Phaser Series User’s Guide

SKip (SK) Function Performs an unconditional program jump to a label.

Syntax SK | label where:

Label = address of the routine to execute. If label is unsigned numeric:

label indicates an absolute line number within the current program to jump to.

If label is signed numeric:

label indicates a relative jump (referenced from the current line number). “+1” indicates no jump (execute the next physical line next).

If label is alphanumeric:

label indicates a named label as defined in an LB command line.

Affected System Variables None

Note The scanner displays “System Error 3” if the label does not exist.

Examples SK | +1

Jumps forward one line.

SK | -5

Jumps backward 5 lines.

SK | MAIN

Jumps to the “MAIN” routine.

SK | 127

Jumps to line 127.

7-72

Page 241

MCL-Code Reference Guide

Serial Output (SO) - P360/P460 Memory Scanner Function Sends a string of characters to the serial communication port.

Syntax SO | descriptor | text where:

Descriptor = descriptor string for the barcode to be transmitted (see command Input eXtended (IX) on page 7-45 for a discussion of the barcode descriptor ??: Use default barcode descriptor (data transmits as Code 39). T: User default barcode descriptor and transparent mode (keycat/keycode values are ignored – see notes below). Other: Data transmitted using barcode descriptor provided. Value provided should be the contents of system variable 91 after the associated data was scanned.

Text = the string of characters to send.

Affected System Variables &99 =

“0” if no error, “1” if transmission fails (handshaking failure).

Notes 1. The text to be sent may include ~xyyy embedded within it. This is interpreted as KEYCAT x/KEYCODE yyy, used to insert special characters into the data stream. 2. If the text to be transmitted represents a single barcode, then the descriptor shoul be the descriptor which was returned in &91 when the code was scanned. If the text represents non-barcode data, or barcode data supplemented with other data, o anything other than a single barcode, the descriptor should be supplied as “??”. I this case, the host interface software will generate the necessary descriptor data.

7-73

Page 242

MCL-Designer for Phaser Series User’s Guide

3. If the text to be transmitted does not contain any KEYCAT/KEYCODE data, but does include the “~” character, then the descriptor must be set to 'T' to allow for “transparent” (non-translated) mode transmission. 4. To send a “~” character embedded in the barcode, the String Serial Output command must be used, or select transparent mode. 5. Unless the Host Override Enable barcode has been scanned, once the SO command is encountered, the user has 30 seconds to place the scanner in the cradle or to connect power. After 30 seconds, an error will be reported (&99 = 1). 6. If the RS232 interface is set up to user an ACK/NAK, ENQ, or ENQ/ACK/NAK handshaking protocol, and the interface times out waiting for data from the host, a host error will be reported (&99 = 1). Processing will proceed with the next MCL program statement, regardless of any Timeout branches specified in the most recent PI command.

Examples SO | ?? | HELLO WORL

Sends the characters HELLO WORLD to serial port using default descriptor

SO | &91 | &A1~7013

Sends the contents of variable A1 followed by a carriage return (Category 7, value 013), using formatting defined by descriptor in system variable 91.

7-74

Page 243

MCL-Code Reference Guide

Serial Output (SO) - P370/P470 RF Scanner Function Sends a string of characters to the serial communication port.

Syntax SO | port | text where:

Port = communication port (ignored for Phaser). Text = the string of characters to send.

Affected System Variables If a CLEAR KEY is pressed: &97 =

“KB”

&98 =

“CL”

&99 =

“1”

If an error occurs: &97 =

“?”

&98 = error number.

&99 =

“1”

7-75

Page 244

MCL-Designer for Phaser Series User’s Guide

Notes 1. The maximum length of output data is 506 bytes. 2. Error numbers reported in &98 are defined as follows: 2

Serial protocol error. Configured host does not recognize transmitted characters.

3

Serial protocol error. Handshaking failure.

5

Serial protocol error. Bad characters received.

8

SYNAPSE error. Configured host does not recognize transmitted characters.

9

SYNAPSE error. SYNAPSE transmission failed. SYNAPSE cable may not be properly installed.

15

RF Transmission error. Scanner is not paired properly to base or scanner is out of range.

16

RF Address error. Base to which scanner is paired has been paired with another scanner.

17

RF Transmission error. Scanner out of range.

18

MCL-Link Host unavailable. The base is connected to a Synapse cable, which cannot be used to communicate to MCL-Link.

20

Transaction error. The scanner is already busy communicating with the base.

21

Memory allocation failure. The scanner has run out of buffers necessary to manage communication. Repeated occurrence of this error should be reported to customer service.

24

RF Transmission error. The base is not responding. Repeated occurrence of this error should be reported to customer service.

Examples SO | 1 | HELLO WORLD

Sends the characters HELLO WORLD to serial port.

SO | 1 | &A1 WORLD \ 0D \ 0A

Sends the contents of variable A1 followed by “WORLD” and a carriage return/line feed pair to the serial port.

7-76

Page 245

MCL-Code Reference Guide

Skip and Return (SR) Function Performs an unconditional program jump to a sub-routine pointed to by a label.

Syntax SR | label [| Progname] where:

Label = address of the routine to execute. If label is unsigned numeric:

label indicates an absolute line number within the current program to jump to.

If label is signed numeric:

label indicates a relative jump (referenced from the current line number). “+1” indicates no jump (execute the next physical line next).

If label is alphanumeric:

label indicates a named label as defined in an LB command.

Progname = (Optional) MCL Program Name

Affected System Variables None

Notes 1. QX command will return program control to the statement immediately following the SR command. 2. The terminal will display “ERROR 3” if the label does not exist.

Examples SR | +1

Jump to sub-routine starting one line forward.

SR | -5

Jump to sub-routine starting five lines backwards.

SR | SUBR

Jump to the “SUBR” sub-routine.

SR | TEST | 2

Jump to sub-routine starting at label TEST in MCL program 2.

7-77

Page 246

MCL-Designer for Phaser Series User’s Guide

Variable Compare (VC) Function Compares the content of a variable with a pattern of characters.

Syntax VC | source | pattern | Skip True | Skip False where: Source = the text to be tested. Pattern = the test returns TRUE if the first characters of Source match Pattern, FALSE otherwise. If Pattern is longer than Source, the test fails. A to Z or a to z - specific character 0 to 9 - specific digit. “ - Any alphabetic character. $ - Any numeric character. ? - ignore test on this character. True = Skip address if comparison is true. False = Skip address if comparison is false.

Affected System Variables None

Notes 1. This command compares all the characters in the variable with a pattern described in the command. The variable must match all the characters of the pattern, so the variable must have at least as many characters as the pattern. 2. When an alphabetic or numeric character is placed in the pattern, the variable must perfectly match the letter or number in the pattern. Otherwise, to test if a character is alphabetic or numeric, ” mask must be used, or $ for a digit.

7-78