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

MCL-Designer for Phaser Series User's Guide, pages 257 to 266

Pages 257 to 266 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 257

MCL-Code Reference Guide

6. The output format is always on 11 digits : 0000000.0000 to 9999999.9999.

Examples VO | + | A1 | &A1 | 1

Increments A1 by 1.

VO | - | A1 | &B1 | &D1 Subtracts contents of variable D1 from variable B1 and stores the result in A1.

7-89

Page 258

MCL-Designer for Phaser Series User’s Guide

Variable Substring (VS) Function Extracts the number of characters defined by size from a text string, starting at the position defined by begin, and stores these extracted characters in a variable.

Syntax VS | variable | text | begin | size where:

Variable = name of the variable receiving the characters. Text = text string from which the data must be extracted. Begin = starting position of the string to extract. Size = number of character to extract.

Affected System Variables &99 =

0, if no error occurs, 1 otherwise.

Notes 1. If the starting position (begin) lies outside of text string, or if the number of characters to extract (size) is too large, variable will contain an empty string (empty string = “?”). 2. Use VE command if the variable contains “ | ” characters. 3. If the Size is 0 (zero), then the string will be extracted from Begin to the end of the Text.

7-90

Page 259

MCL-Code Reference Guide

Examples VS | A1 | HELLO_WORLD | 7 | 5 Extracts “WORLD” from the text and store it in A1. Beginning position = 7, size = 5 characters. After execution : A1 = “WORLD” VS | A0 | &A1 | 2 | 3

Extracts text from A1, store it in A0. Beginning position = 2 , size = 3 characters. Example: Before execution: A1 = WORLD. After execution : A0 = “ORL”.

7-91

Page 260

MCL-Designer for Phaser Series User’s Guide

Variable operation - Arithmetic- eXtended (VX) Function Executes arithmetic operation on number1 and number2, and stores the result in a variable with a specified numeric format (see VF | N command).

Syntax VX | type | variable | number1 | number2 | sign | zero | int | dec where:

Variable = the name of the receiving variable. Number1 = the first operand. Number2 = the second operand. Type = the operation to perform: + to add. - to subtract. * to multiply. / to divide. % to compute Modulo.

Sign = add sign to the number. S = add ‘+’ or ‘-‘ before number. B = add space or ‘-’ before number. N = no sign.

Zero = fill the number with a specified character Z = fill with ‘0” before number. B= fill with space before number. N = remove all ‘0’ and space before number.

Int = number of digits of integer part. Dec = number of digits of decimal part.

7-92

Page 261

MCL-Code Reference Guide

Affected System Variables &99 =

0, if no error occurs.

&98 = the sign of the variable.

&97 remainder of divide operation.

&96 the sign of the remainder.

Notes 1. If the size of the decimal part is set to 0, the decimal point will be omitted. 2. If the size of the integer part is set to zero, the first character of the result will be a decimal point. 3. If both int and dec are set to 0, a syntax error (Error 4) will be declared.

Examples VX | + | A1 | 123747.7489 | 1 | S | B | 9 | 6 result A1 = +. . . 123748.748900.

VX | - A1 | 123747.7489 | 1 | S | Z | 9 | 6 result A1 = +000123746.748900.

7-93

Page 262

MCL-Designer for Phaser Series User’s Guide

WaiT (WT) Function Suspends execution of the current program for a defined delay period.

Syntax WT | length [ | abort ] where:

Length = length of delay (in 15-millisecond increments). Abort = Allow wait to be aborted by user intervention: Y = Keyboard or trigger will cause wait period to be aborted. N or absent = Keyboard and trigger will have no effect.

Affected System Variables None.

Notes The maximum allowed wait is 60 seconds. Anything entered above 60 seconds will default to 60 seconds.

Examples WT | 20

Current program will wait 300 milliseconds (20 x 15 ms), then continue.

WT | &A1 | Y

Current program will wait “n” times 15 milliseconds, then continue. (“n” is the value contained in variable A1). Pressing any key will abort the wait and move on to the next program step.

7-94

Page 263

MCL-Code Reference Guide

Programs and File Sizes Programs !

maximum 9 programs

!

maximum 512 lines per program

!

maximum program size 4 KB (4095 bytes)

Files ! !

size of a data file is limited by the scanner’s available memory. size of a record is limited to 255 characters (including field separator and CR LF characters).

!

a file may not contain more than 9998 records regardless of the record size.

!

total user file space = 256 KB on a 512 KB unit 768 KB on a 1 MB unit 3584 KB on a 4 MB unit 7680 KB on an 8 MB unit

7-95

Page 264

MCL-Designer for Phaser Series User’s Guide

MCL-Code Error Messages After the execution of a MCL-Code command, variable &99 generally reports the result of the command execution. Table 7-5 lists the standard error messages used by the MCL-Code commands. The error messages are displayed on the scanner display and the program is suspended. After pressing the ENTER key, the program returns to the operating system. Any previously stored data is retained intact, although the record entry on which the error occurs will be lost.

Table 7-5. Error Code Messages Error Code

7-96

Description

2 error on File operation - File name is invalid - number of fields per records too big - not enough free space on scanner: check system var. 32

3 branch error - jump out the scope of the current program - label not found, too long

4 syntax error in a MCL command - command code invalid - mandatory argument missing or invalid - bad number of arguments: check command syntax check if any variable contains “ | ” characters, if yes, use VE command to extract desired field check line length (max. 512 characters) after variable substitution (variables are replaced by their contents)

5 variable error - variable too big (in write command) - variable name invalid

6 key error - in PI or IK command, invalid key definition - too many entries in PI or IK commands

Page 265

MCL-Code Reference Guide

Table 7-5. Error Code Messages (Continued) Error Code

Description

7 serial error - attempt to execute SI or SO command on the Network communication port.

9 run program error - too many RM command without the associated QX command (max. 6 nested programs).

7-97

Page 266

MCL-Designer for Phaser Series User’s Guide

System Setup Variables Table 7-6 lists the available system variables. Table 7-6. System Setup Variabl e Variable

Default Value

02

4

Country page code: 1 = French. 2 = Dutch. 3 = British English. 4 = American English.

14

6

Baud rate: 2 = 600 BPS. 3 = 1200 BPS. 4 = 2400 BPS. 5 = 4800 BPS. 6 = 9600 BPS. 7 = 19200 BPS. 8 = 38400 BPS.

15

0

Default Error Beep Override: 0: Disabled 1: Enabled If the default Error Beeps are overridden, communications errors do not cause error beeps. Error detection must be coded into your application. You can then use whatever notification method (including display messages and beeps from the BP command table) is appropriate. Note, however, that if Default Beep Override is enabled, you MUST be diligent in coding error detection, or data loss may go unnoticed.

* : Read Only variable

7-98

Description