广告
广告
F300 Visual Inspection System
OMRON Vision Language (OVL)
Reference Manual
Revised March 1994
iv
Notice:
OMRON products are manufactured for use according to proper procedures by a qualified operator and only for the purposes described in this manual.
The following conventions are used to indicate and classify precautions in this manual. Always heed the information provided with them. Failure to head precautions can result in injury to people or damage to the product.
DANGER!
Indicates information that, if not heeded, is likely to result in loss of life or serious injury.
WARNING
Indicates information that, if not heeded, could possibly result in loss of life or serious injury.
Caution
Indicates information that, if not heeded, could result in relative serious or minor injury, damage to the product, or faulty operation.
OMRON Product References
All OMRON products are capitalized in this manual. The word “Unit” is also capitalized when it refers to an OMRON product, regardless of whether or not it appears in the proper name of the product.
The abbreviation “PLC” means Programmable Controller (Programmable Logic Controller) and is not used as an abbreviation for anything else.
Visual Aids
The following headings appear in the left column of the manual to help you locate different types of information.
Note Indicates information of particular interest for efficient and convenient operation of the product.
1, 2, 3...
1.
Indicates lists of one sort or another, such as procedures, checklists, etc.
OMRON, 1992
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means, mechanical, electronic, photocopying, recording, or otherwise, without the prior written permission of OMRON.
No patent liability is assumed with respect to the use of the information contained herein. Moreover, because OMRON is constantly striving to improve its high-quality products, the information contained in this manual is subject to change without notice. Every precaution has been taken in the preparation of this manual. Nevertheless, OMRON assumes no responsibility for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained in this publication.
v
vi
TABLE OF CONTENTS
PART I, Version 1.00
SECTION 1
List of Commands and Functions . . . . . . . . . . . . . . . . . . .
1-1 OVL Alphabetical List
1-2 OVL Instruction List
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SECTION 2
OVL Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-1 Line Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-2 OVL Characters and Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-3 Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-4 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-5 Type Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-6 Operations and Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-7 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-8 Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SECTION 3
Screen Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-1 Flow of Image Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-2 Display and Measurement Block Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-3 Flow of Measured Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4 Plane and Frame Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5 Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-6 Drawing Density and Drawing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-7 Run Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-8 Labelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-9 Scrolling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-10 Fill Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-11 Image Cut-off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-12 Scan Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SECTION 4
Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19
23
25
27
32
20
20
21
32
35
47
48
49
50
50
51
43
44
46
36
40
41
53
1
2
11
vii
viii
PART II, Version 2.00
SECTION 1
OVL Version 2.00 Improvements . . . . . . . . . . . . . . . . . . .
1-1 Overview of Improvements
1-2 Additional OVL Capabilities
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SECTION 2
Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SECTION 3
Sample Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-1 Determination of Multiple Windows’ ON/OFF Status . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-2 Shape Inspection using Window Enlargement/Reduction . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.
Table of Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B.
Reserved Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C.
Induction Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
169
170
172
183
203
204
208
213
213
215
217
219
229
About this Manual:
This manual describes the OMRON Vision Language (OVL) used with the F300 Visual Inspection System and includes the sections described below.
Please read this manual completely and be sure you understand the information provided before attempting to operate the F300 Visual Inspection System and use the OVL.
PART I
Version 1.00
Section 1 provides a listing of commands and functions. There is a list ordered alphabetically and a list ordered by instructions.
Section 2 provides the basic OVL syntax required before programming.
Section 3 provides general information on screen manipulation.
Section 4 provides detailed information on the commands and functions. Examples are also provided.
PART II
Version 2.00
Section 1 describes the additional functions and improvements found in OVL Version 2.00.
Section 2 provides detailed information on the new Version 2.00 commands and functions. Examples are also provided.
Section 3 provides sample programs using the new Version 2.00 commands and functions.
This manual also contains three appendices. Appendix A contains a listing of error messages, Appen-
dix B contains a listing of reserved words, and Appendix C contains a listing of induction functions.
WARNING
Failure to read and understand the information provided in this manual may result in personal injury or death, damage to the product, or product failure. Please read each section in its entirety and be sure you understand the information provided in the section and related sections before attempting any of the procedures or operations given.
ix
PART I
Version 1.00
SECTION 1
List of Commands and Functions
This section provides a listing of commands and functions. There is a list ordered alphabetically and a list ordered by usage.
1-1 OVL Alphabetical List
1-2 OVL Instruction List
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2
11
1
OVL Alphabetical List
1-1 OVL Alphabetical List
Section 1-1
Command/Function
ABS
AKCNV$
A
B
ARC
ASC
ATN
ATTR$
AUTO
AUTOLVL
BACKDISP
BCOPY
BCOPY2
BEEP
BOX
BUSY
CALL
CAMCHK
CAMERA
CAMMODE
CDBL
CHAIN
CHANGE
C CHDIR
CHR$
CINT
CIRCLE
CLEAR
CLNG
CLOSE
CLS
COLOR
COLOR@
COM ON/OFF/
STOP
COMMON
CONSOLE
Operation
Determines an absolute value.
Converts 1-byte characters to 2-byte characters.
Draws an arc.
Determines the character code.
Instruction
Calculation
Japanese character string operation
Graphic control
1-byte character string operation
Calculation Determines the arctangent (arctan) of a value.
Determines the write protect attribute of a file.
Automatically generates line numbers.
Determines the binary level.
Sets the image display outside the window.
Copies a binary image.
File control
Program editing
Image processing
Display control
Makes enlarged and reduced copies of binary images.
Turns the buzzer on and off.
Draws a rectangle.
Controls BUSY signal output status.
Special graphic display control
Special graphic display control
Special
Graphic control
I/O port I/O control
Calls a structural subroutine.
General
Determines the camera connection status.
Camera/strobe control
Switches cameras.
Camera/strobe control
Camera/strobe control Selects the image output from a Camera
I/F Unit.
Converts to a double-precision value.
Transfers control to a specified program.
Calculation
General
Changes the measuring conditions.
Changes the current directory.
Scene
File operation
Converts a character code to a character.
1-byte character string operation
Converts to an integer.
Calculation
Draws a circle.
Initializes variables.
Converts to a long integer.
Graphic control
Memory management
Calculation
Closes an open file.
Clears characters and graphics.
Changes the character attributes.
Changes the character attributes within a specified region.
Controls interrupts from the RS-232C.
File control
Graphic control
Text display control
Text display control
RS-232C communication
Type
Function
Function
Command
Function
Function
Function
Command
Function
Command
Command
Command
Command
Command
Command
Command
Function
Command
Command
Function
Command
Command
Command
Function
Function
Command
Command
Function
Command
Command
Command
Command
Command
Transfers variables.
Sets the text display mode.
General
Text display control
Command
Command
55
56
56
56
57
58
60
60
60
60
58
59
59
Page
54
54
54
55
55
63
64
65
65
65
66
66
66
61
61
62
62
63
67
67
68
2
OVL Alphabetical List
Section 1-1
DEFSTR
D DELETE
DEVICE
DIM
DIN
DISPLAY
DO. . . LOOP
REPEAT
DO. . . LOOP
UNTIL
DO. . . LOOP
WHILE
DO
REPEAT LOOP
DO
UNTIL LOOP
DO
WHILE LOOP
DOUT
DSA
DSKF
Command/Function
CONT
COS
CSNG
CSRLIN
C CURSOR
CVD
CVI
CVL
CVS
DATA
DATE$
DEF FN
DEF FN
END DEF
DEFDBL
Operation
Continues execution of a program.
Determines the cosine of an angle.
Converts to a single-precision value.
Determines the cursor line position.
Draws a cross cursor.
Converts an 8-byte character string to a double-precision real number.
Converts a 2-byte character string to an integer.
Converts a 4-byte character string to a long integer.
Converts a 4-byte character string to a single-precision real number.
Defines the data read with the READ command.
Displays and sets the date.
Instruction Type
Program execution control Command
Calculation
Calculation
Function
Function
Text display control
Graphic control
Calculation
Function
Command
Function
Calculation
Calculation
Calculation
General
Time/date control
Function
Function
Function
Command
Defines a user function.
Defines a user function block.
General
General
Function,
Command
Command
Command
Command
DEFINT
DEFLNG
DEFSNG
Declares variables as double-precision real number variables.
Declares variables as integers.
Declares variables as long integers.
Declares variables as single-precision real number variables.
General
General
General
General
Declares variables as character variables.
General
Deletes part of a program.
Program editing
Specifies the input and output devices.
Defines an array variable.
Reads data from an input port.
Special
General
I/O port I/O control
Sets the display image.
Display control
Repeats a loop specified number of times.
General
Command
Command
Command
Command
Command
Command
Command
Function
Command
Command
Repeats a loop until a condition is fulfilled.
Repeats a loop while a condition is fulfilled.
Repeats a loop specified number of times.
General
Repeats a loop until a condition is fulfilled.
Repeats a loop while a condition is fulfilled.
Outputs data to an output port.
Reads the status of the DSA signal.
Determines the free space in the memory card.
General
General
General
General
I/O port I/O control
I/O port I/O control
File control
Command
Command
Command
Command
Command
Command
Function
Function
Page
68
69
69
69
69
70
71
71
71
72
73
73
74
74
74
75
75
79
79
80
80
80
81
81
75
76
76
76
77
77
78
78
3
OVL Alphabetical List
Command/Function
EDIT
ELLIPSE
END
ENHANCE
EOF
ERASE
E ERL
ERR
ERRMSG
ERROR
ERROUT
EVENTIN
EXIT DEF/
DO/FOR/SUB
EXP
Operation
Selects the mode to edit lines of the program.
Draws an ellipse.
Stops program execution.
Creates LUT data for contrast modification.
Determines the end of the file.
Deletes an array variable.
Determines the line number where an error occurred.
Determines the error code.
Defines the operation when an error occurs.
Generates a pseudo-error.
Controls the error signal output.
Sets the image input synchronized with events.
Exits a control block.
F
FIELD#
FILES
FILTDATA
FILTER
FILTERIN
FIND
FIX
FLASH
FOR. . . TO. . .
STEP ~ NEXT
FRE
GATE
GCOPY
Instruction
Program editing
Graphic control
General
Image processing
File control
General
Error control
Error control
Error control
Error control
I/O port I/O control
Camera/strobe control
General
Determines the natural number e raised to an exponential power.
Allocates the variable areas.
Displays file names.
Specifies the line filter factors.
Sets the image filtering function.
Selects image input to the filter.
Searches for a character string in a program.
Rounds down a value to an integer.
Controls the strobe and shutter function.
Repeatedly executes instructions.
Calculation
File control
File operation
Image processing
Image processing
Image processing
Program editing
Calculation
Camera/strobe control
General
G
GCOPY2
GET#
GET@
GETBLUT
GETDLUT
GETDLVL
GETLUT
GOSUB
GOTO/GO TO
Determines the free memory size.
Controls the GATE signal.
Copies the raw image in VRAM.
Makes enlarged and reduced copies of the raw image.
Reads data from a random file.
Reads image data to VRAM.
Reads the binary LUT data.
Reads the display LUT data.
Memory management
I/O port I/O control
Special graphic display control
Special graphic display control
File control
Graphic control
Image processing
Display control
Determines the display level of the image.
Display control
Reads the filter LUT data.
Image processing
Branches to a specified subroutine.
Unconditionally jumps to a specified line.
General
General
4
Section 1-1
86
87
88
89
89
87
88
88
91
91
92
90
90
91
92
95
95
95
96
93
93
94
94
Page
81
83
83
84
82
82
83
84
84
84
85
85
General
Function
Command
Command
Command
Command
Command
Command
Function
Command
Command
Function
Command
Command
Command
Command
Command
Command
Command
Function
Command
Command
Command
Type
Command
Command
Command
Command
Function
Command
Function
Function
Command
Command
Command
Command
OVL Alphabetical List
Section 1-1
Command/Function
HELP
H HELP
ON/OFF/STOP
HEX$
Operation
Displays help messages.
Disables, enables, or stops interrupts from the HELP Key.
Converts a numeric expression to hexadecimal.
Reads a density histogram.
Evaluates a condition.
Instruction
Program editing
Key control
1-byte character string operation
Image processing
General
Type
Command
Command
Function
Command
Command
HISTGRAM
IF. . . GOTO ~
ELSE
IF. . . THEN ~
ELSE
IF. . . THEN ~
ELSEIF ~ ELSE
~ END IF
IMGLOAD
IMGSAVE
INKEY$
Evaluates a condition.
Evaluates a condition.
General
General
Command
Command
Command
Command
Function
I
J
INPUT
INPUT#
INPUT$
INPUT WAIT
INSTR
INT
INTR
ON/OFF/STOP
IPL
JIS$
KACNV$
KEXT$
KEY
KEY LIST
K KEY
ON/OFF/STOP
KEYIN
KILL
KINPUT
KINSTR
KLEN
KMID$
KNJ$
Loads image data to VRAM.
Saves image data from VRAM.
Determines the character input from the keyboard.
Assigns data to a variable.
Reads data from a file.
Reads a specified length of data.
Inputs data with a time limitation.
Determines the position of a specified character.
Rounds down a value to an integer.
Disables, enables, or stops interrupts with the STEP signal.
Sets the OVL boot-up mode.
Determines the Shift JIS code.
Special
Special
Key control
Key control
File control
File control
Key control
1-byte character string operation
Calculation
I/O port I/O control
Converts from wide to standard characters.
Selects a character.
Assigns a character string to function keys.
Displays the function key settings.
Disables, enables, or stops interrupts from the function keys.
Reads the status of the console keys.
Deletes a file.
Input data in the Japanese input mode.
Determines the position of a 2-byte character.
Determines the length of a character string including 2-byte characters.
Extracts part of a character string including 2-byte characters.
Determines a 2-byte character.
Special
Japanese character string operation
Japanese character string operation
Japanese character string operation
Key control
Program editing
Key control
Key control
File operation
Key control
Japanese character string operation
Japanese character string operation
Japanese character string operation
Japanese character string operation
Command
Command
Function
Command
Function
Function
Command
Command
Function
Function
Function
Command
Command
Command
Function
Command
Command
Function
Function
Function
Function
Page
96
96
97
97
98
98
99
107
107
108
108
108
109
105
106
106
106
109
99
100
100
101
101
102
102
103
103
104
104
105
105
5
OVL Alphabetical List
Section 1-1
Command/Function
KPLOAD
K KPOS
KTYPE
LABEL
LBOUND
LCASE$
LDATA
LEFT$
LEN
LET
LEVEL
LINE
LINE INPUT
L LINE INPUT
WAIT
LINE INPUT#
LIST
LNUM
Operation
Registers a 2-byte character pattern.
Determines the position of a character in a character string.
Determines the type of a character.
Instruction
Japanese character string operation
Japanese character string operation
Japanese character string operation
Measurement
General
Carries out labelling.
Determines the lower boundary of an array dimension qualifier.
Converts uppercase letters to-lower case letters.
Measures data for the labelled image.
Extracts the left end of the specified character string.
Determines the length of a character string.
Assigns an expression to a variable.
Sets the binary level.
Draws a straight line.
Assigns a line of data to a character variable.
Inputs data with a time limitation.
1-byte character string operation
Measurement
1-byte character string operation
1-byte character string operation
General
Image processing
Graphic control
Key control
Key control
File control
Program editing
Measurement
M
LOAD
LOC
LOCATE
LOF
LOG
LPOINT
LPUTIMG
LSET
LSORT
LTRIM$
MASKBIT
MDATA
MDATA2
MEASURE
MENU
MERGE
Reads data from a file.
Displays the program contents.
Determines the number of labelled images.
Loads a program.
Determines the current position in a specified file.
Sets the cursor position.
Determines the size of a file.
Determines natural logarithms.
Determines the label number at a specified position.
Draws a labelled image.
Writes left-justified character data.
Renumbers labels in order of area.
Deletes spaces to the left of a character string.
Disables writing to specific planes.
Reads the measured results 1.
Reads the measured results 1.
Conducts measurements.
Returns to the Menu mode.
Merges a program.
Program editing
File control
Text display control
File control
Calculation
Measurement
Measurement
File control
Measurement
1-byte character string operation
Special graphic display control
Measurement
Measurement
Measurement
Special
Program editing
Type
Command
Function
Function
Command
Function
Function
Function
Function
Function
Command
Command
Command
Command
Command
Command
Command
Function
Command
Function
Command
Function
Function
Function
Command
Command
Command
Function
Command
Function
Function
Command
Command
Command
116
116
116
117
113
114
114
115
117
117
112
113
113
Page
110
110
111
111
112
112
120
121
121
122
122
122
119
120
120
120
118
118
118
119
6
OVL Alphabetical List
Section 1-1
Command/Function
M MKL$
MKS$
Converts a long integer to a character string.
Converts a single-precision value to a character string.
Sets the measurement mode.
MMODE
NAME
N NEW
O
NPIECE
OCT$
ON COM GO-
SUB
ON ERROR
GOTO
ON HELP GO-
SUB
ON INTR GO-
SUB
ON KEY GO-
SUB
Renames files.
Deletes a program from memory.
Determines the number of smaller character strings.
Converts a number to an octal character string.
Defines the RS-232C interrupt jump destination.
Defines the error processing routine.
Defines the HELP Key interrupt subroutine.
Defines the STEP signal interrupt subroutine.
Defines the function key interrupt subroutine.
ON STOP GO-
SUB
ON TIME$ GO-
SUB
Defines the STOP Key interrupt subroutine.
Defines the timer interrupt subroutine.
ON. . . GOSUB Branches to a subroutine on a specified value.
ON. . . GOTO Jumps program operation on a specified value.
OPEN (1) Opens a file.
P
MID$
MKD$
MKDIR
MKI$
OPEN (2) Opens the RS-232C port.
OPTION BASE Declares minimum value of the array qualifier.
PIECE$ Returns partial character strings.
PIN
POINT
Operation
Extracts part of a character string.
Converts a double-precision value to a character string.
Instruction
1-byte character string operation
1-byte character string operation
Creates a new directory.
File operation
Converts an integer to a character string.
1-byte character string operation
1-byte character string operation
1-byte character string operation
Measurement
File operations
Program execution control Command
1-byte character string operation
1-byte character string operation
Type
Function,
Command
Function
Command
Function
Command
Command
RS-232C communication Command
Error control
Key control
I/O port I/O control
Key control
Key control
Time/date control
General
General
File control
RS-232C communication Command
General Command
1-byte character string operation
I/O port I/O control
Graphic control
Function
Function
Function
Function
Command
Command
Command
Command
Command
Command
Command
Command
Command
Function
Function
Function
POLYGON
POLYLINE
POS
POUT
Reads the bit status of an input port.
Determines the density at specified coordinates.
Draws a polygon.
Draws a polyline.
Determines the current cursor column position.
Controls the bit status of an output port.
Graphic control
Graphic control
Text display control
I/O port I/O control
Command
Command
Function
Command
129
130
130
131
128
128
128
129
131
132
132
133
133
133
134
134
135
135
Page
123
123
124
124
124
125
125
126
126
126
127
127
7
OVL Alphabetical List
Section 1-1
Command/Function
Operation
Displays data on the text display.
PRINT USING Displays formatted data on the text display.
Writes data to a sequential access file.
P PRINT#
PRINT# USING Writes formatted data to a sequential access file.
PSET
PUT#
Draws a point.
Writes data to a random access file.
PUT@
RANDOMIZE
RDATA
READ
R REM
RENUM
REPLACE
RESTORE
Draws a pattern in VRAM.
Initializes random number generation.
Reads the detailed run length data.
Reads data.
Inserts remarks into the program.
Renumbers program lines.
Replaces a character string.
RESUME
RETURN
RIGHT$
RMDIR
RMODE
RND
RSET
RTRIM$
Specifies the line with the DATA statement.
Restarts the operation before the error occurred.
Returns operation from a subroutine.
Extracts the right end of the specified character string.
Deletes a directory.
Sets the measurement mode for detailed run length data.
Generates a random number.
Writes right-justified character data.
Deletes spaces to the right of a character string.
Runs a program.
S
RUN
RUNL
SAVE
SBANK
SCAN
SCANSET
SCNCALIB
SCNCAM
SCNLEVEL
SCNLOAD
SCNLUT
SCNSAVE
SDATA 1
SDATA 2
Reads the simple run length data.
Saves a program.
Selects the shading memory bank number.
Conducts scan measurement.
Sets the conditions for scan measurement.
Sets the calibration data.
Reads the camera data for a scene.
Determines the binary level of a scene.
Loads the scene data.
Sets the binary level of a scene.
Saves the scene data.
Reads the scan measurement data 1.
Reads the scan measurement data 2.
Instruction
Text display control
Text display control
File control
File control
Graphic control
File control
Graphic control
General
Measurement
General
General
Program editing
Program editing
General
Error control
General
1-byte character string operation
File operation
Measurement
Calculation
File control
Function
Command
1-byte character string operation
Function
Program execution control Command
Measurement
Program editing
Special graphic display control
Measurement
Measurement
Function
Command
Command
Command
Command
Scene
Scene
Scene layout problem
Scene
Scene
Scene
Measurement
Measurement
Type
Command
Command
Command
Command
Command
Command
Command
Command
Function
Command
Command
Command
Command
Command
Command
Command
Function
Command
Command
Command
Function
Function
Command
Command
Command
Function
Function
142
143
143
144
144
145
145
145
146
146
146
140
141
141
141
142
138
139
139
140
140
142
Page
135
136
137
138
147
147
148
148
148
149
149
149
149
150
8
OVL Alphabetical List
Section 1-1
Command/Function
S
SEARCH
SELECT... CASE
~ CASEELSE ~
END SELECT
SET
SETBLUT
SETDLUT
SETDLVL
SETLUT
SFTBLUT
SFTLUT
SGN
SIN
SPACE$
Operation
Determines the number of an element in an array.
Provides multiple branching depending on a value.
Sets the write-protect attribute for a file.
Sets array data as binary LUT data.
Sets the display LUT data.
Sets the display level for each display image.
Sets array data as the filter LUT data.
Shifts the binary LUT level.
Shifts the filter LUT.
Determines the sign of a numeric expression.
Determines the sine of a numeric expression.
Inserts space characters.
General
General
Instruction
File operation
Image processing
Display control
Display control
Image processing
Image processing
Image processing
Calculation
Calculation
SPC Outputs space characters.
1-byte character string operation/key control
Text display control/key control
Graphic control SPCLOSE
SPLINE
SQR
SSCROLL
Draws a region bounded by a spline curve.
Draws a spline curve.
Determines the square-root.
Scrolls the shading master memory.
STOP
STOP
ON/OFF/STOP
TIME$
Stops program execution.
Disables, enables, or stops interrupts from the STOP Key.
STR$ Converts a number to character string representation.
Checks for incorrect strobe flashing.
STRCHK
STRING$
STRMODE
Creates a character string with a repeated character.
Enables and disables strobe flashing.
SUB ~ END SUB Defines a structural subroutine.
SWAP
TAB
Switches two variables.
Specifies the position to display characters.
TAN Determines the tangent of a numeric expression.
Displays and sets the time.
Graphic control
Calculation
Special graphic display control
General
Key control
1-byte character string operation
Camera/strobe control
1-byte character string operation
Camera/strobe control
General
General
Text display control
Calculation
Time/date control
Time/date control T TIME$
ON/OFF/STOP
TIMER
Disables, enables, or stops timer interrupts.
Reads and sets the 10 ms timer.
TROFF Exits the Trace mode.
Type
Function
Command
Function
Function
Command
Function
Function
Function
Command
Command
Command
Function
Function
Function,
Command
Command
Time/date control Function,
Command
Program execution control Command
Command
Command
Command
Command
Command
Command
Command
Function
Function
Command
Function
Command
Command
Command
Page
150
151
156
156
157
153
153
154
155
151
152
152
153
155
157
158
158
158
159
159
160
160
160
161
161
161
162
162
163
163
164
9
OVL Alphabetical List
Section 1-1
Command/Function
T TRON
U UBOUND
UCASE$
VAL
Operation
Enters the Trace mode.
Determines the upper boundary of an array dimension qualifier.
Converts lowercase letters to uppercase letters.
Converts a character string to a number.
V VDWAIT Delays the VD interrupt the specified number of times.
Inputs an image.
VIDEOIN
WDISP Sets the type of image display in a window.
WHILE ~ WEND Repeatedly executes instructions.
W WINDOW Draws a window.
WRITE
WRITE#
WSCROLL
Displays data on the display.
Writes data to a sequential file.
Scrolls the window memory.
Instruction Type
Program execution control Command
General Function
1-byte character string operation
1-byte character string operation
Special graphic display control
Camera/strobe control
Display control
Function
Function
Command
Command
Command
General
Scene
Text display control
File control
Special graphic display control
Command
Command
Command
Command
Command
165
165
166
166
167
167
168
168
Page
164
164
164
165
10
OVL Instruction List
1-2 OVL Instruction List
Instruction
General
Command/Function
Command AUTO
DELETE
EDIT
FIND t l
HELP
KEY LIST
LIST
LOAD
MERGE
RENUM
REPLACE
SAVE
Command
CONT
NEW
RUN
TROFF
TRON
Command CHDIR
FILES
KILL
MKDIR
NAME
RMDIR
SET
Command
CALL
CHAIN
COMMON
DATA
DEF FN
DEF FN ~ END DEF
DEFDBL
DEFINT
DEFLNG
DEFSNG
DEFSTR
DIM
DO. . . LOOP
DO. . . LOOP
REPEAT
UNTIL
Section 1-2
Operation
Automatically generates line numbers.
Deletes part of a program.
Selects the mode to edit lines of the program.
Searches for a character string in a program.
Displays help messages.
Displays the function key settings.
Displays the program contents.
Loads a program.
Merges a program.
Renumbers program lines.
Replaces a character string.
Saves a program.
Continues execution of a program.
Deletes a program from memory.
Runs a program.
Exits the Trace mode.
Enters the Trace mode.
Changes the current directory.
Displays file names.
Deletes a file.
Creates a new directory.
Renames files.
Deletes a directory.
Sets the write-protect attribute for a file.
Calls a structural subroutine.
Transfers control to a specified program.
Transfers variables.
Defines the data read with the READ instruction.
Defines a user function.
Defines a user function block.
Declares variables as double-precision real number variables.
Declares variables as integers.
Declares variables as long integers.
Declares variables as single-precision real number variables.
Declares variables as character variables.
Defines an array variable.
Repeats a loop specified number of times.
Repeats a loop until a condition is fulfilled.
Page
56
76
81
89
73
74
74
74
75
75
75
76
78
78
88
107
124
126
143
151
60
61
67
72
68
126
145
164
164
62
122
141
141
146
96
106
116
117
11
OVL Instruction List
Section 1-2
Instruction
General Command
Function
Command/Function
DO. . . LOOP
DO REPEAT LOOP
DO UNTIL LOOP
DO WHILE LOOP
END
ERASE
EXIT DEF/DO/FOR/SUB
FOR. . . TO. . . STEP ~ NEXT
GOSUB
GOTO/GO TO
IF. . . GOTO ~ ELSE
IF. . . THEN ~ ELSE
IF. . . THEN ~ ELSEIF ~ ELSE ~
END IF
LET
ON. . . GOSUB
ON. . . GOTO
OPTION BASE
RANDOMIZE
READ
REM
RESTORE
RETURN
SELECT... CASE ~ CASEELSE
~ END SELECT
STOP
SUB ~ END SUB
SWAP
WHILE ~ WEND
DATE$
LBOUND
SEARCH
UBOUND
WHILE
Operation
Repeats a loop while a condition is fulfilled.
Repeats a loop specified number of times.
Repeats a loop until a condition is fulfilled.
Repeats a loop while a condition is fulfilled.
Stops program execution.
Deletes an array variable.
Exits a control block.
Repeatedly executes instructions.
Branches to a specified subroutine.
Unconditionally jumps to a specified line.
Evaluates a condition.
Evaluates a condition.
Evaluates a condition.
Assigns an expression to a variable.
Branches to a subroutine on a specified value.
Jumps program operation on a specified value.
Declares minimum value of the array qualifier.
Initializes random number generation.
Reads data.
Inserts remarks into the program.
Specifies the line with the DATA statement.
Returns operation from a subroutine.
Provides multiple branching depending on a value.
Stops program execution.
Defines a structural subroutine.
Switches two variables.
Key control
Displays and sets the date.
Determines the lower boundary of an array dimension qualifier.
Determines the number of an element in an array.
Determines the upper boundary of an array dimension qualifier.
Page
79
95
96
98
98
99
82
83
86
91
79
80
80
113
130
131
132
142
151
150
164
140
140
141
142
158
161
161
166
73
112
Command COLOR
COLOR@
CONSOLE
Changes the character attributes.
Changes the character attributes within a specified region.
Sets the text display mode.
66
66
68
12
OVL Instruction List
Instruction Command/Function
Command LOCATE
PRINT USING
Function
WRITE
CSRLIN
POS
SPC
TAB
Command ARC
BOX
CIRCLE
CLS
CURSOR
ELLIPSE
GET@
LINE
POLYGON
POLYLINE
PSET
PUT@
SPCLOSE
Function
SPLINE
POINT di l
Calculation t l
Command BCOPY
BCOPY2
GCOPY
GCOPY2
MASKBIT
SBANK
Function
SSCROLL
VDWAIT
WSCROLL
ABS
ATN
CDBL
CINT
Section 1-2
Operation
Sets the cursor position.
Displays data on the text display.
Displays formatted data on the text display.
Camera/strobe control
Determines the cursor line position.
Determines the current cursor column position.
Outputs space characters.
Specifies the position to display characters.
Draws an arc.
Draws a rectangle.
Draws a circle.
Clears characters and graphics.
Draws a cross cursor.
Draws an ellipse.
Reads image data to VRAM.
Draws a straight line.
Draws a polygon.
Draws a polyline.
Draws a point.
Draws a pattern in VRAM.
Draws a region bounded by a spline curve.
Draws a spline curve.
Determines the density at specified coordinates.
Copies a binary image.
Makes enlarged and reduced copies of binary images.
Copies the raw image in VRAM.
Makes enlarged and reduced copies of the raw image.
Disables writing to specific planes.
Selects the shading memory bank number.
Scrolls the shading master memory.
Delays the VD interrupt the specified number of times.
Camera/strobe control
Determines an absolute value.
Determines the arctangent (arctan) of a value.
Converts to a double-precision value.
Converts to an integer.
Page
118
135
136
167
69
135
156
161
158
165
168
54
55
61
63
57
58
92
92
120
146
54
82
93
114
134
59
64
66
69
134
138
139
157
157
133
13
OVL Instruction List
Instruction
Calculation Function
CVS
EXP
FIX
INT
LOG
RND
SGN
SIN
SQR
TAN
Command/Function
CLNG
COS
CSNG
CVD
CVI
CVL
Error control ti
Command
ERRMSG
ERROR
ON ERROR GOTO
RESUME
Function
ERL
ERR
Command MID$
Function
ASC
CHR$
HEX$
INSTR
LCASE$
LEFT$
LEN
LTRIM$
MID$
14
Section 1-2
Operation
Converts to a long integer.
Determines the cosine of an angle.
Converts to a single-precision value.
Converts an 8-byte character string to a double-precision real number.
Converts a 2-byte character string to an integer.
Converts a 4-byte character string to a long integer.
Converts a 4-byte character string to a single-precision real number.
Determines the natural number e raised to an exponential power.
Rounds down a value to an integer.
Rounds down a value to an integer.
Determines natural logarithms.
Generates a random number.
Determines the sign of a numeric expression.
Determines the sine of a numeric expression.
Determines the square-root.
Determines the tangent of a numeric expression.
Defines the operation when an error occurs.
Generates a pseudo-error.
Defines the error processing routine.
Restarts the operation before the error occurred.
Determines the line number where an error occurred.
Determines the error code.
Extracts part of a character string.
Determines the character code.
Converts a character code to a character.
Converts a numeric expression to hexadecimal.
Determines the position of a specified character.
Converts uppercase letters to-lower case letters.
Extracts the left end of the specified character string.
Determines the length of a character string.
Deletes spaces to the left of a character string.
Extracts part of a character string.
Page
65
69
69
70
71
71
71
87
155
158
162
84
84
128
142
84
103
112
113
113
120
123
90
103
118
144
155
84
123
55
63
97
OVL Instruction List
Instruction
1-byte character t operation t i
Function
Command/Function
MKD$
MKI$
MKL$
MKS$
NPIECE
VAL
Command KPLOAD
Function AKCNV$
JIS$
KACNV$
KEXT$
KINSTR
OCT$
PIECE$
RIGHT$
RTRIM$
SPACE$
STR$
STRING$
UCASE$
File control
KLEN
KMID$
KNJ$
KPOS
KTYPE
Command CLOSE
FIELD#
GET#
INPUT#
LINE INPUT#
LSET
OPEN (1)
PRINT#
Section 1-2
Operation
Converts a double-precision value to a character string.
Converts an integer to a character string.
Converts a long integer to a character string.
Converts a single-precision value to a character string.
Determines the number of smaller character strings.
Converts a number to an octal character string.
Returns partial character strings.
Extracts the right end of the specified character string.
Deletes spaces to the right of a character string.
Inserts space characters.
Converts a number to character string representation.
Creates a character string with a repeated character.
Converts lowercase letters to uppercase letters.
Converts a character string to a number.
Page
123
124
124
125
126
127
133
143
145
156
159
160
164
165
110
54
Registers a 2-byte character pattern.
Converts 1-byte characters to 2-byte characters.
Determines the Shift JIS code.
Converts from wide to standard characters.
Selects a character.
Determines the position of a 2-byte character.
Determines the length of a character string including 2-byte characters.
Extracts part of a character string including 2-byte characters.
Determines a 2-byte character.
Determines the position of a character in a character string.
Determines the type of a character.
Closes an open file.
Allocates the variable areas.
Reads data from a random file.
Reads data from a file.
Reads data from a file.
Writes left-justified character data.
Opens a file.
Writes data to a sequential access file.
105
105
105
108
108
109
109
110
111
116
120
131
137
65
87
93
101
15
OVL Instruction List
Instruction
File control
Key control
Command/Function
Command PRINT# USING
Function
PUT#
RSET
WRITE#
ATTR$
DSKF
EOF
INPUT$
LOC
LOF
Command HELP ON/OFF/STOP
INPUT
INPUT WAIT
KEY
KEY ON/OFF/STOP
KINPUT
LINE INPUT
LINE INPUT WAIT
ON HELP GOSUB
ON KEY GOSUB
ON STOP GOSUB
STOP ON/OFF/STOP
INKEY$ Function
KEYIN
SPACE$
SPC
Time/date control Command
DATE$
ON TIME$ GOSUB
TIME$
TIME$ ON/OFF/STOP
Function
TIMER
DATE$
TIME$
TIMER
16
Section 1-2
Operation
Writes formatted data to a sequential access file.
Writes data to a random access file.
Writes right-justified character data.
1-byte character string operation
Determines the write protect attribute of a file.
Determines the free space in the memory card.
Determines the end of the file.
Reads a specified length of data.
Determines the current position in a specified file.
Determines the size of a file.
Page
138
81
83
102
117
118
139
145
168
55
96 Disables, enables, or stops interrupts from the HELP Key.
Assigns data to a variable.
Inputs data with a time limitation.
Assigns a character string to function keys.
Disables, enables, or stops interrupts from the function keys.
Input data in the Japanese input mode.
Assigns a line of data to a character variable.
Inputs data with a time limitation.
Defines the HELP Key interrupt subroutine.
Defines the function key interrupt subroutine.
Defines the STOP Key interrupt subroutine.
Disables, enables, or stops interrupts from the STOP Key.
Determines the character input from the keyboard.
Reads the status of the console keys.
Inserts space characters.
Outputs space characters.
Displays and sets the date.
Defines the timer interrupt subroutine.
Displays and sets the time.
Disables, enables, or stops timer interrupts.
Reads and sets the 10 ms timer.
Displays and sets the date.
Displays and sets the time.
Reads and sets the 10 ms timer.
101
102
106
106
108
115
116
128
129
129
159
100
163
73
162
163
107
156
156
73
130
162
163
OVL Instruction List
Instruction
RS-232C i ti management
Scene t
Measurement
Command/Function
Command COM ON/OFF/STOP
ON COM GOSUB
OPEN (2)
Command BUSY
DOUT
ERROUT
GATE
INTR ON/OFF/STOP
ON INTR GOSUB
Function
POUT
DIN
DSA
PIN
Command CLEAR
Function FRE
Command
BEEP
DEVICE
IMGLOAD
IMGSAVE
IPL
MENU
Command
CHANGE
SCNCALIB
SCNLOAD
SCNLUT
Function
SCNSAVE
WINDOW
SCNCAM
SCNLEVEL
Command
LABEL
LPUTIMG
LSORT
MEASURE
MMODE
RMODE
Function
SCAN
SCANSET
LDATA
LNUM
Section 1-2
Operation
Controls interrupts from the RS-232C.
Defines the RS-232C interrupt jump destination.
Opens the RS-232C port.
Controls BUSY signal output status.
Outputs data to an output port.
Controls the error signal output.
Controls the GATE signal.
Disables, enables, or stops interrupts with the STEP signal.
Defines the STEP signal interrupt subroutine.
Controls the bit status of an output port.
Reads data from an input port.
Reads the status of the DSA signal.
Reads the bit status of an input port.
Initializes variables.
Determines the free memory size.
Turns the buzzer on and off.
Specifies the input and output devices.
Loads image data to VRAM.
Saves image data from VRAM.
Sets the OVL boot-up mode.
Returns to the Menu mode.
Changes the measuring conditions.
Sets the calibration data.
Loads the scene data.
Sets the binary level of a scene.
Saves the scene data.
1-byte character string operation
Reads the camera data for a scene.
Determines the binary level of a scene.
Carries out labelling.
Draws a labelled image.
Renumbers labels in order of area.
Conducts measurements.
Sets the measurement mode.
Sets the measurement mode for detailed run length data.
Conducts scan measurement.
Sets the conditions for scan measurement.
Measures data for the labelled image.
Determines the number of labelled images.
Page
67
127
128
147
147
112
117
132
59
80
85
91
104
149
167
148
148
62
148
149
149
58
76
99
100
104
122
111
119
120
122
125
144
135
77
81
133
65
91
17
OVL Instruction List
Instruction
Measurement Function
Command/Function
LPOINT
MDATA
MDATA2
RDATA
RUNL
SDATA 1
SDATA 2
Image processing Command
ENHANCE
Camera/strobe
FILTDATA
FILTER
FILTERIN
GETBLUT
GETLUT
HISTGRAM
LEVEL
SETBLUT
SETLUT
SFTBLUT
SFTLUT
Function AUTOLVL
Command
CAMERA
CAMMODE
EVENTIN
Display control
FLASH
STRMODE
VIDEOIN
CAMCHK Function
STRCHK
Command
BACKDISP
DISPLAY
GETDLUT
SETDLUT
SETDLVL
Function
WDISP
GETDLVL
Section 1-2
Operation
Determines the label number at a specified position.
Reads the measured results 1.
Reads the measured results 1.
Reads the detailed run length data.
Reads the simple run length data.
Reads the scan measurement data 1.
Reads the scan measurement data 2.
Creates LUT data for contrast modification.
Specifies the line filter factors.
Sets the image filtering function.
Selects image input to the filter.
Reads the binary LUT data.
Reads the filter LUT data.
Reads a density histogram.
Sets the binary level.
Sets array data as binary LUT data.
Sets array data as the filter LUT data.
Shifts the binary LUT level.
Shifts the filter LUT.
Determines the binary level.
Switches cameras.
Selects the image output from a Camera
I/F Unit.
Sets the image input synchronized with events.
Controls the strobe and shutter function.
Enables and disables strobe flashing.
Inputs an image.
Determines the camera connection status.
Checks for incorrect strobe flashing.
Sets the image display outside the window.
Sets the display image.
Reads the display LUT data.
Sets the display LUT data.
Sets the display level for each display image.
General
Determines the display level of the image.
Page
119
85
90
160
165
60
160
56
77
94
152
153
166
95
121
121
140
146
149
150
83
153
154
56
60
60
97
114
152
153
88
88
89
94
95
18
SECTION 2
OVL Syntax
This section provides the basic OVL syntax required before programming.
2-1 Line Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-1-1 Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-1-2 Line Numbers
2-1-3 Statements
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-2 OVL Characters and Symbols
2-3 Constants
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-3-1 Character Constants
2-3-2 Numeric Constants
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-4 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-4-1 Type Declarators
2-4-2 Variable Names
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-4-3 Reserved Words
2-4-4 Array Variables
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-5 Type Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-6 Operations and Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-6-1 Operators
2-6-2 Expressions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-6-3 Priority of Operations
2-7 Interrupts
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-8 Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
23
24
24
24
21
22
23
20
20
20
20
20
21
32
32
32
25
27
27
29
19
OVL Characters and Symbols
2-1 Line Format
2-1-1 Lines
An OVL program is composed of lines.
Example Line numbers and text
10 PRINT ”OVL”
20
30
40
50
REM
***
OVL
***
’
***
OVL
***
PRINT: PRINT ”END”
END
Statement
Line number
Section 2-2
Each line consists of a line number and a statement. Each line, including the line number, spaces, and the instruction may be up to 255 bytes in length.
Normally a line declares a single statement but it is possible to include multiple statements in a line. Multiple statements in a single line are delimited by colons
(:).
2-1-2 Line Numbers
The line numbers are positioned at the start of a line and are integers applied in ascending order between 1 and 65535. If line numbers are not applied in ascending order, the lines are automatically rearranged into ascending order.
Line numbers may start and finish with any number between 1 and 65535.
Lines assigned with line numbers are stored as part of the program when the
Return Key is pressed. A line with no line number is not stored as part of the program but is executed immediately when the Return Key is pressed.
The program is executed in the order of the line numbers, except where branching occurs.
2-1-3 Statements
A statement is the smallest unit used to declare an OVL procedure.
Statements include executable statements which declare and execute OVL commands and functions, non-executable statements which provide program comments, and labels which define jump destinations.
2-2 OVL Characters and Symbols
The following characters and symbols can be used with OVL programming.
Statement 1-byte characters Roman uppercase
Roman lowercase
Numerals
Katakana
Symbols
Control characters
Symbols
2-byte characters Japanese characters
Only lowercase characters defined in a character constant or character variable inside quotes (” ”) are handled as lowercase characters. The system automatically converts other lowercase characters to uppercase characters.
Period (.)
The period indicates the current line number (the last line number executed). It can replace the line number in the following commands:
AUTO, EDIT, LIST, LLIST, RENUM.
20
Constants
Section 2-3
Minus (–)
The minus specifies a range of lines.
Colon (:)
The colon delimits one statement from another.
Comma (,)
The comma delimits parameters in a series.
Semicolon (;)
The semicolon delimits parameters in an output statement.
Apostrophe (’)
Identical in meaning to a REM statement.
Question Mark (?)
Simplifies input of the word “PRINT.” Immediately after input, the question mark is converted to “PRINT.”
Asterisk (
*
)
The asterisk indicates the start of a label name.
Space
A space must be inserted between a command and the following parameter.
Other spaces may be inserted anywhere except inside command names, variable names, or numeric values.
2-3 Constants
Values or character strings declared directly in the program are known as constants. A character constant is declared differently from a numeric constant.
Character constant Character constant
Constants
Numeric constant
Integer constant
Long integer constant
Real number constant
Octal format
Decimal format
Hexadecimal format
Octal format
Decimal format
Hexadecimal format
Single-precision constant
Double-precision constant
2-3-1 Character Constants
A character constant is a character string enclosed in double quotation marks (”) and can contain up to 255 characters.
The CHR$ function must be used to include double quotations inside a character string, as shown in one of the examples below.
A character string of zero length is known as a “null string.”
Character Strings
”1234567890” . . . . Arithmetic operations cannot be carried out on numbers in this form.
”NEW PLAN”
CHR$(34)
. . . . This character string contains 8 characters, 7 letters and one space.
. . . . . . . This character string represents a single double quotation
(”) character.
21
Constants
Section 2-3
”” . . . . . . . . . . . . . . . This is a null string.
2-3-2 Numeric Constants
A numeric constant directly declares a value for operation by the arithmetic operators.
The plus (+) of minus (–) sign can be included before the value to indicate a positive or negative value, but the plus sign may be omitted.
Numeric constants can be declared as integers or real numbers.
Integer Constants
Decimal Format
Integers must lie in the range –32768 to +32767.
Adding a % sign to a real number in the above range rounds off the value to an integer constant.
Examples of decimal format integer constants:
32767
–123
+5%
321.01% (This is identical to 321.)
Octal Format
An octal integer constant is declared as an octal value (digits 0 to 7) preceded by the prefix &O. However, the “O” can be omitted if required.
Octal integer constants can be specified between &O0 and &O177777.
Examples of octal format integer constants:
&12345
&O77777
Hexadecimal Format
A hexadecimal integer constant is declared as a hexadecimal value (digits 0 to 9, A to F) preceded by the prefix &H.
Hexadecimal integer constants can be specified between &H0 and
&HFFFF.
Examples of hexadecimal format integer constants:
&H100
&HFCA0
Long Integer Constants
Decimal Format
Integers must lie in the range –2147483648 to +2147483647.
Adding a & sign to a real number in the above range rounds off the value to a long integer constant.
Examples of decimal format long integer constants:
9500000&
–365432&
100.12& (This is identical to 100.)
Octal Format
An octal integer constant is declared as an octal value (digits 0 to 7) preceded by the prefix &O and followed by the type declarator (&).
Octal integer constants can be specified between &O0& and
&O37777777777&.
Examples of octal format long integer constants:
&O12345&
&O112377777&
22
Variables
Section 2-4
Real Number Constants
Hexadecimal Format
A hexadecimal integer constant is declared as a hexadecimal value (digits 0 to 9, A to F) preceded by the prefix &H and followed by the type declarator
(&).
Hexadecimal integer constants can be specified between &H0& and
&HFFFFFFFF&.
Examples of hexadecimal format long integer constants:
&H100&
&HFCA00&
Note Values input in octal and hexadecimal format are printed out in decimal format.
Single-precision Format
Real number data between –1.70141E+38 to +1.70141E+38 to 6 significant digits.
The following numbers are declared as single-precision real numbers:
•
Values with a decimal point but not exceeding 6 significant digits
•
Values with the single-precision declarator (!)
•
Values in the single-precision E exponent format.
Examples of single-precision constants:
108.12
3.14!
–8.76E–6
Double-precision Format
Real number data between –1.701411834604692D+38 to
+1.701411834604692D+38 to 16 significant digits.
The following numbers are declared as double-precision real numbers:
•
Real numbers with 7 or more digits
•
Values with the double-precision declarator (#)
•
Values in the double-precision D exponent format.
Examples of double-precision constants:
108.123456
3.14#
–8.76D–6
2-4 Variables
Variable
Named areas in the program in which values or character strings are stored are known as variables.
Before a value is allocated, a numeric variable contains 0 and a character variable contains a null string (” ”).
The user can declare both the name and type of a variable.
Character variable
Numeric variable
Integer variable
Long integer variable
Real number variable Single-precision variable
Double-precision variable
2-4-1 Type Declarators
The type of variable is declared with a declarator suffix to the variable name.
Variables with an identical variable name but different declarators are treated as separate variables.
23
Variables
Section 2-4
Types of Declarator:
$ . . . . Character
% . . . . Integer
& . . . . Long integer
!
. . . . . Single-precision
# . . . . Double-precision
The type of variable can also be declared with a type statement. However, the type declared with the type declarator takes priority over the type statement.
Types of Type Statement:
DEFSTR
. . . . . Declares a character variable.
DEFINT
. . . . . Declares an integer variable.
DEFLNG
. . . . . Declares a long integer variable.
DEFSNG
. . . . . Declares a single-precision variable.
DEFDBL
. . . . . Declares a double-precision variable.
Variables not declared with a type declarator or type statement are treated as single-precision numeric variables.
Examples of type statements:
DEFSTR NAME$
DEFDBL AX#, AY#, AZ#
The $ and # can be omitted from these statements.
2-4-2 Variable Names
Variable names are limited to 40 characters, including the type declarator. Alphanumeric characters, the period, and type declarator are valid in a variable name.
The name must start with an alphabetic character. Uppercase and lowercase characters are not differentiated. The type declarator must be added to the end of the variable name.
Symbols cannot be used in variable names.
Reserved words cannot be used as variable names. However, variable names may contain reserved words.
Variable names cannot begin with the letters “FN.”
2-4-3 Reserved Words
Reserved words are character strings defined in the system, such as commands, functions, and operators. Users cannot use reserved words as variable names.
The reserved words are listed in Appendix B, Reserved Words.
2-4-4 Array Variables
A variable with a single variable name storing multiple values is known as an array variable.
Array variables storing character strings are classified as character array variables and array variables storing numeric values are classified as numeric array variables.
Numeric array variables are further subdivided according to the type of numeric values they store into integer array variables, long integer array variables,
24
Type Conversion
Section 2-5
Array variable single-precision real number array variables, and double-precision real number array variables.
Character array variable
Numeric array variable
Integer array variable
Long integer array variable
Single-precision real number array variable
Double-precision real number array variable
The dimension of the array variable and the subscript range are declared with the DIM statement.
It is unnecessary to use the DIM statement to declare subscripts up to 10.
Example:
DIM A (10, 10, 10) may be omitted.
The dimensions of the array must be declared in a single program line (255 characters). The subscripts are limited by the amount of memory. Consequently,
4-dimensional, 5-dimensional, and 6-dimensional arrays may be declared but the number of elements are restricted.
Example:
DIM A(10)
DIM TA(10, 50)
1-dimensional array, number of elements = 11
2-dimensional array, number of elements = 11 x 51 = 561
DIM TTA$(2, 5, 3)
3-dimensional array, number of elements = 3 x 6 x 4 = 72
.
.
.
.
.
.
4-dimensional array
5-dimensional array
.
.
.
6-dimensional array
Subscripts start from zero, so that the action number of elements is 1 plus the subscript.
2-5 Type Conversion
If necessary, the type of numeric data can be converted under the conditions described below.
It is not possible to convert between character and numeric data.
Condition 1
Condition 2
When data is assigned to a variable of a different type, the data is converted to the type declared with the variable type declarator.
Example of assigning a value to a variable of a different type:
10 A%=1.234
.
Assigns the single-precision real number 1.234 to the integer variable A% (assigned as 1).
20 PRINT A% .
Displays the value stored in the integer variable A% on the screen.
Result:
1 . . . . . . . . . . . . . . . . . .
The integer 1 is displayed.
Before operations are carried out on values with different accuracies, all values are first converted to the accuracy of the highest accuracy value.
Example of operations on values of different accuracy:
10 A%=10%/3%
20 PRINT A% .
The result of the operation on integers is displayed as an integer.
30 B!=10%/3!
25
Type Conversion
Condition 3
Condition 4
Condition 5
Section 2-5
40 PRINT B!
.
The integer 10% is converted to a single-precision real number, the operation is carried out on single-precision values, and the result displayed as a single-precision value.
50 C#=10%/3#
60 PRINT C# .
The integer 10% is converted to a double-precision real number, the operation is carried out on doubleprecision values, and the result displayed as a doubleprecision value.
Results:
3 . . . . . . . . . . . . . . . . . . . . . .
Result of execution of line 20 is an integer.
3.33333
. . . . . . . . . . . . . . .
Result of execution of line 40 is a single-precision real number.
3.333333333333333
. . . Result of execution of line 60 is a double-precision real number
Before logical operations all values are converted into integers and the results are also integers.
Example of logical operations:
10 A=1.234
. .
Assigns the value 1.234 to the numeric variable A.
20 B=NOT A . .
Converts the value 1.234 stored in the numeric variable A to the integer 1, executes the NOT logical operation, and assigns the result (–2) to the numeric variable B.
30 PRINT B, A
Displays the values stored in the numeric variables B and A on the screen.
Result:
–2 1.234
. . . . . .
Result of execution of line 30 is displayed on the screen.
Real numbers are rounded off to an integer. An error occurs if the converted value lies outside integer range.
Example of conversion to an integer:
10 A%=1.45
. .
Assigns the value 1.45 rounded of to 1 to the integer variable A%.
20 B%=1.65
. .
Assigns the value 1.65 rounded of to 2 to the integer variable B%.
30 PRINT A%,B%
Displays the values stored in the integer variables A% and B% on the screen.
Result:
1 2 . . . . . . . . . . . .
Result of execution of line 30 is displayed on the screen.
When a double-precision variable is assigned to a single-precision variable, the variable is rounded off to 6 significant digits, with subsequent digits rounded off.
Example of conversion to a single-precision, real number variable:
10 A!=3.14159265358
.
Substitutes the effective six digits, 3.14159, for a single-precision, real number variable A!.
20 PRINT A!
. . . . . . . . . .
The value to be stored as the single-precision, real number variable A! will be displayed (the seventh digit will be rounded to the nearest whole number).
Result:
3.14159
. .
.
Result of execution of line 20 is displayed on the screen.
26
Operations and Expressions
Section 2-6
Note OVL does not convert between numeric and character data, except for special applications such as random access file I/O and conversion of number declaration character strings to numeric data.
Special functions are used to convert between numeric and character data, where required.
Random access file I/O:
CVI/CVL/CVS/CVD functions
MKI$/MKL$/MKS$/MKD$ functions
Conversion of a number declaration character string to numeric data:
VAL function
Conversion of numeric data to a character string:
STR$ function
2-6 Operations and Expressions
2-6-1 Operators
Operator
Three types of operator are used in OVL: arithmetic operators, relational operators, and logical operators.
Arithmetic operator
Relational operator
Logical operator
. . . . .
. . . . .
Addition, subtraction, multiplication, division, exponent, remainder operations.
Comparison of two expressions.
. . . . . . . . Operations under multiple conditions, bit operations, binary operations
Arithmetic Operators
Arithmetic operators link numeric constants or variables to carry out addition, subtraction, multiplication, division, exponent, and remainder operations.
*
/
+
–
¥
^
Arithmetic operator
Description
Addition
Subtraction
Multiplication
Real number division
Integer division
Declaration example
A + B
A – B
A * B
A / B
A ¥ B
A ^ B
Mathematical notation
A + B
A – B
A x B or AB
A
÷
B or A/B
[A/B]
[ ] indicates Gauss’ notation
A
B
MOD
Exponent operation
Remainder calculation
A MOD B
A – [A/B] x B
[ ] indicates Gauss’ notation
If either the divisor or dividend for integer division is a real number, the real number is rounded off to an integer before division. If the quotient contains decimal places, these are dropped.
Example of integer division:
123.4¥67.89
A
123¥68
A
1.808
A
1
Decimals rounded off A Division A Decimals dropped A Results
The decimal places are rounded off before the remainder calculation is carried out on real numbers. The result is the remainder from the integer division.
Example of remainder calculation:
13.3 MOD 4 = 1 Remainder of 13 divided by 4.
25.68 MOD 6.99 = 5 Remainder of 26 divided by 7.
27
Operations and Expressions
Relational Operators
Section 2-6
Digit overflow occurs if the result of a calculation exceeds the range of the value type. If the digits overflow, an error is output and the calculation continues with the maximum value the computer can handle.
Example of digit overflow:
A% = 32760 + 10
An error is output and the A% value becomes 32767.
If division by 0 is carried out during operation, an error is output and the calculation continues with the maximum value the computer can handle. The same applies if the exponent operation is carried out on 0 with a negative exponent.
Relational operators compare two numeric data or 2 character data.
True (–1) is returned if the result of the compared data is the same or False (0) is returned if the result of the compared data is different.
Relational operator
<
>
=
< >
,
> <
< =
,
= <
> =
,
= >
Description
Equals
Not equals
Less than
Greater than
Less than or equal to
Greater than or equal to
Declaration example
A = B
A < > B
,
A > < B
A < B
A > B
A < = B
,
A = < B
A > = B
,
A = > B
Logical Operators
Relational operators are used inside the IF statement to control the flow of program execution.
Examples of relational operators inside the IF statement:
IF A<>B THEN 1000
. . . . . . . . . Jump to line 1000 if A is not equal to B (A <
> B is true (–1)).
IF A$ = “Y” THEN *
PROCESS1 Jump to label * PROCESS1 if A$ is equal to “ Y” (A$ = “ Y” is true (–1)).
Logical operators are used to investigate multiple conditions and carry out bit operations or binary (Boolean) operations on a specified value.
The handled values are first converted to a two’s complement display integers between –32768 to +32767 before the value 0 or 1 is assigned to each bit as the result of the operation. An error occurs if this range is exceeded during conversion.
NOT
AND
OR
XOR
IMP
EQV
Logical operator Description
Declaration example
Negation
Logical product
Logical sum
Exclusive OR
Inclusive OR
Equivalence
NOT A
A AND B
A OR B
A XOR B
A IMP B
A EQV B
Refer to page 29 for details of the results of logical operations.
28
Operations and Expressions
2-6-2 Expressions
Numeric Expressions
+
–
Not
Section 2-6
In an OVL program, an “expression” refers to constants, variables, functions, numeric constants and variables linked with arithmetic operators, and character constants and variables linked with plus signs (+).
Examples of expressions:
Numeric expressions
A=20 * 15/3
S=P * D * D/4
2.7145
A
SIN (X)
Character expressions
A$=”OVL”+”BASIC”
A$=B$+C$
”OVL”
A$
CHR$ (31)
Function expressions
A=B
A<B
A<>B
Logical expressions
A AND B
A OR B
A XOR B
A<B AND A>C
A=B OR A<>C
An expression returning a numeric value is known as a numeric expression.
Numeric expressions can be numeric constants, numeric variables, or functions returning numeric values linked by arithmetic or logical operators.
Multiple expressions contained within parentheses ( ) can be linked together.
Numeric constant
Numeric variable
Function returning a numeric value
(Numeric expression)
Arithmetic operator
Logical operator
Character Expressions
An expression returning a character string is known as a character expression.
Character expressions can be character constants, character variables, or functions returning character strings linked by plus signs.
Multiple expressions contained within parentheses ( ) can be linked together.
Character constant
Character variable
Function returning a character string
(Character expression)
Plus sign +. . . links character strings
+
Relational Expressions
A pair of numeric expressions linked by a relational operator is known as a relational expression.
Relational expressions can be numeric constants, numeric variables, or functions returning numeric values linked by relational operators.
Numeric constant
Numeric variable
Function returning a numeric value
(Numeric expression)
Relational operator
Numeric constant
Numeric variable
Function returning a numeric value
(Numeric expression)
Logical Expressions
Multiple relational expressions linked by logical operators are known as a logical expression.
A logical expression is made up of several relational expressions linked by logical operators to execute bit or binary operations or to evaluate multiple conditions.
29
Operations and Expressions
Section 2-6
Logical expressions have a numeric value and may be used in any position as a numeric expression.
A logical expression is True if the result of the expression is –1 or False if the result is 0.
NOT
A
0
1
AND
A
0
0
1
1
OR
A
1
1
0
0
(Not)
Relational operator
Relational operator
B
0
1
0
1
B
0
1
0
1
NOT A
Result
1
0
A AND B
Result
0
0
0
1
A OR B
Result
0
1
1
1
Logical expressions may include six types of logical operator: NOT, OR, AND,
XOR, IMP and EQV.
The results of operation by these logical operators on a single bits A and B are shown in the following tables.
EQV
A
1
1
0
0
IMP
A
1
1
0
0
XOR
A
0
0
1
1
B
0
1
0
1
B
0
1
0
1
B
0
1
0
1
A XOR B
Result
0
1
1
0
A IMP B
Result
1
1
0
1
A EQV B
Result
1
0
0
1
Examples of bit operations using logical expressions:
Logical expression (NOT): NOT 5 Result: –6
---
Logical expression
NOT 5
Integer representation
5
–6
Binary representation
0000000000000101
1111111111111010
30
Operations and Expressions
Functions
Section 2-6
Logical expression (AND): 3 AND 5
---
Logical expression
---
3 AND 5
Result: 1
5
1
Integer representation
3
Binary representation
0000000000000011
0000000000000101
0000000000000001
Logical expression (OR): 3 OR 5
---
---
Logical expression
3 OR 5
Result: 7
3
5
Integer representation
7
Binary representation
0000000000000011
0000000000000101
0000000000000111
Logical expression (XOR): 3 XOR 5
---
Logical expression
---
3 XOR 5
Result: 6
5
6
Integer representation
3
Binary representation
0000000000000011
0000000000000101
0000000000000110
Logical expression (IMP): 3 IMP 5
---
---
Logical expression
3 IMP 5
Result: –3
3
5
Integer representation
–3
Binary representation
0000000000000011
0000000000000101
1111111111111101
Logical expression (IMP): 3 EQV 5
---
Logical expression
---
3 EQV 5
Result: –7
Integer representation
3
5
–7
Binary representation
0000000000000011
0000000000000101
1111111111111001
A function executes predefined operations on specified values (called arguments) and returns a numeric value or character string as the result. Although functions are handled as expressions, unlike numeric, character, relational, and logical expressions the function itself holds the result of the operations.
Some functions are automatically assigned values by the system. These functions are known as system variables.
System variables require no arguments. Values are assigned to some system variables under special system conditions, such as when an error or interrupt occurs, but some other system variables always hold values, such as the time or date.
OVL offers user-defined functions that the BASIC user can define as required.
User-defined functions are handled inside the program in the same way as the system variables.
Elementary functions (such as the SIN function) match the precision of the argument. The function becomes double precision if the argument is a double-
31
Labels
Section 2-8
precision value or single-precision if the argument is an integer or a single-precision value.
2-6-3 Priority of Operations
Operations are executed in the order of priority shown below. Low numbers take priority over higher numbers. Operations with the same number are executed in the order in which they appear.
1, 2, 3...
1. Expressions enclosed in parenthesis
2. Functions
3. ^ (Exponents)
4. – (Minus signs: not preceded by a value or numeric expression)
5.
*
, / (multiplication and real number division)
6. ¥ (integer division)
7. MOD (remainder calculation)
8. +, – (addition, subtraction)
9. Relational operators (<, >, =, and combinations)
10. NOT
11. AND
12. OR
13. XOR
14. IMP
15. EQV
Example:
A% = 2 + 8 MOD 5 – 3
The above expression is interpreted as 2 + (8 MOD 5) – 3, so that A% = 2. Although the parentheses are not strictly necessary in this example, it is normal to include them to prevent confusion when reading the program.
2-7 Interrupts
OVL supports the interrupts listed below.
Stop Key (ON STOP GOSUB)
Help Key
Real-time timer
Function Key
(ON HELP GOSUB)
(ON TIME$ GOSUB)
(ON KEY GOSUB)
RS-232C circuit
Processing error
STEP signal
(ON COM GOSUB)
(ON ERROR GOTO)
(ON INTR GOSUB)
2-8 Labels
Labels can be used instead of line numbers to control jump destinations in a program. Precede label names by an asterisk (
*
).
Define the name after the asterisk in alphabetic characters and the period character (.). Uppercase and lowercase characters are not differentiated.
Reserved words cannot be used as label names. However, label names may contain reserved words.
The length label name is restricted only by the number of characters in the program line (255 characters).
Label names must be positioned at the start of the program line.
32
Labels
Section 2-8
Example:
100 IF A<>B GOTO
*
UNEQUAL
110 ....
120 ....
200
*
UNEQUAL
210 ....
*
UNEQUAL
is interpreted in the
GOTO
statement as identical to 200. In this case, the program jumps to line 200 if A
≠
B.
33
SECTION 3
Screen Operations
This section provides general information on screen manipulation.
3-1 Flow of Image Data
3-1-1 VRAM
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-1-2 LUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-1-3 Display LUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-1-4 Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-2 Display and Measurement Block Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-2-1 Display and Measurement Status of the Camera Image . . . . . . . . . . . . . . . . . . . .
3-2-2 Display and Measurement Status of the Image Memory Contents . . . . . . . . . . . .
3-3 Flow of Measured Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4 Plane and Frame Memory
3-4-1 Plane Memory
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4-2 Frame Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4-3 Binary Image Planes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4-4 Mask Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5 Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5-1 Window Planes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5-2 Paint Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5-3 Pattern Matching Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-6 Drawing Density and Drawing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-6-1 Drawing Density . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-6-2 Drawing Mode
3-7 Run Length
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-7-1 Simple Run Length
3-7-2 Detailed Run Length
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-8 Labelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-9 Scrolling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-9-1 Window Scrolling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-9-2 Shading Scrolling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-10 Fill Measurement
3-11 Image Cut-off
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-12 Scan Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
48
49
49
49
46
47
47
48
50
50
51
45
46
46
43
44
44
45
43
43
43
43
40
41
41
36
36
38
39
39
40
35
Flow of Image Data
Section 3-1
3-1 Flow of Image Data
OVL offers image-processing commands and functions in addition to the normal
BASIC commands and functions. The flow of this image-processing data is shown in the block diagram below.
Image Data Flow
Image bus 1
8 bit
Camera unit
8 bits
8 bit
Filter
Shading memory
VRAM 4:
LUT
VRAM 3:
Image memory
VRAM 2:
Window memory
Image bus 0
8 bits
1 bit
VRAM 1:
Graphic memory
Display control
1 bit
VRAM 0:
Character memory
Display
3-1-1 VRAM
Memory directly influencing the measurements or display is known as VRAM.
The F300 has 5 types of VRAM, which are explained below.
Memory
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Plane
Type
Frame
Character Memory (Plane)
The character memory is mainly used to display characters and is used to edit the OVL program and display compilation results. The contents of the character memory have no direct effect on the measurement results. The memory is configured as 512 x 512 x 1 bit.
Density (0 or 1 only):
0
A
0
!0
A
1
1 bit
512
512
36
Flow of Image Data
Graphic Memory (Plane)
The application of the graphic memory is not fixed.
Density (0 or 1 only):
0 A 0
!0 A 1
1 bit
Section 3-1
512
512
Window Memory (Frame)
The window memory is used to draw the windows. It consists of 8 window planes with a one-to-one relationship to the binary image planes.
The window memory can be treated as 8 memory areas of 512 x 512 x 1 bit configuration or as a single area with 512 x 512 x 8 bit configuration.
Density:
0 to 255
0
1
2
3
4
5
6
7
512
8 bits
512
Image Memory (Frame)
The image memory is used to store the raw image direct from the camera or the
8 binary images generated from the look-up table (LUT). The image memory contents are treated as the raw measurement data.
The image memory can be treated as 8 memory areas of 512 x 512 x 1 bit configuration or as a single area with 512 x 512 x 8 bit configuration.
Density:
0 to 255
0
1
2
3
4
5
6
7
512
8 bits
512
37
Flow of Image Data
Section 3-1
Shading Memory (Frame)
The shading memory is used for shading compensation. If no shading compensation is carried out, the memory has no effect on the measurements or display.
The shading memory can be treated as 8 memory areas of 512 x 512 x 1 bit configuration or as a single area with 512 x 512 x 8 bit configuration. The shading master memory has two banks: Bank 0 and Bank 1.
Density:
0 to 255
0
1
2
3
4
5
6
7
512
8 bits
512
3-1-2 LUT
LUT is an abbreviation of Look-Up Table. The LUT is a conversion table for selecting the colors displayed by the display system. The LUT plays the same role in the system as a palette plays for an artist painting a picture; it selects the actual color from amongst numerous gradations.
To express monochrome gradations, the OVL assigns 8 bits of data to each image pixel, that is 28 = 256 gradations.
The LUT is used with the frame-structured memories (VRAM3: image memory,
VRAM4: shading memory). The gradation in the frame memory is determined by referring to the LUT.
The LUT is a prewritten memory containing output data corresponding to any input data address. The F300 uses the LUT conversion function for preprocessing of binary and raw images and for conversion of the displayed image.
38
Flow of Image Data
Input data
–256 to 255
Section 3-1
Related commands and functions:
AUTOLVL
GETBLUT
HISTGRAM
SETBLUT
SFTBLUT
ENHANCE
GETLUT
LEVEL
SETLUT
SFTLUT
LUT data conversion
Output data
0 to 255
Binary conversion: 8 binary images
Graduated image preprocessing
Display image conversion
Camera
Image memory
LUT
Binary value 0 or 1
Plane numbers
0
1
5
6
7
2
3
4
8 binary image planes
3-1-3 Display LUT
The LUT used to improve the contrast of the display image and change the gradations (0 to 255) of the raw image inside or outside a window is known as the display LUT.
Related commands:
GETDLUT
SETDLUT
3-1-4 Filter
The filter is a pre-processing feature which sharpens the edges when the perimeter of the measured object is blurred.
39
Display and Measurement Block Diagrams
Related commands:
FILTER
FILTDATA
Section 3-2
Sharpens blurred contrast around perimeter of image.
3-2 Display and Measurement Block Diagrams
3-2-1 Display and Measurement Status of the Camera Image
The image data recorded by the camera is input to the image memory either directly from the camera ((1) in the diagram) or after LUT conversion of the image ((2) in the diagram).
Input
Camera
I/F Unit
Filter
LUT
VRAM 3:
Image memory
(1)
(2)
VRAM 2:
Window memory
Display
VRAM 1:
Graphic memory
VRAM 4:
Shading memory
VRAM 0:
Character memory
40
Flow of Measured Data
Section 3-3
3-2-2 Display and Measurement Status of the Image Memory Contents
Input from the camera unit is not possible during measurement or display of an image already stored in memory.
No input from camera unit
Camera
I/F Unit
Filter
VRAM 3:
Image memory
LUT
No input to image memory
VRAM 2:
Window memory
Display
VRAM 1:
Graphic memory
VRAM 4:
Shading memory
VRAM 0:
Character memory
3-3 Flow of Measured Data
This section describes how the combination of the window function (W), paint function (P), and pattern matching function (PM) set with the measure mode
(MMODE) command acts on the binary image planes 0 to 7.
W:
P:
Window function
Paint function
PM: Pattern matching function
The functions themselves are described in detail in 3-5 Windows.
Setting Example 1
W
P
PM
Function
On
Off
Off
Setting Description
Window function: ON
Paint function: OFF
Pattern matching function: OFF w
Binary image data
Window memory data
AND
GATE
Measuring
Binary
41
Flow of Measured Data
Setting Example 2
Section 3-3
W
P
PM
Function
Off
Off
Off
Setting Description
Window function: OFF
Paint function: OFF
Pattern matching function: OFF
Binary image data
Measuring
Binary
P
W
PM
Setting Example 3
Setting Example 4
W
P
PM
Function
Off
On
Off
Setting Description
Window function: OFF
Paint function: ON
Pattern matching function: OFF
Binary
P
Binary image data
Paint window data
(Window memory plane 7)
OR GATE
Measuring
W
W
P
PM
Function
On
On
Off
Setting Description
Window function: ON
Paint function: ON
Pattern matching function: OFF
Binary
W
Binary image data
Paint window data
Window memory data
OR
AND
Measuring
P
42
Plane and Frame Memory
Section 3-4
3-4 Plane and Frame Memory
3-4-1 Plane Memory
The term “plane” is used to describe a memory with 512 x 512 x 1 bit configuration. Consequently, the character memory, graphic memory, and parts of the other 3 image memories with 512 x 512 x 1 bit configuration are grouped under the name “plane memories.”
VRAM
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Type
Plane (512 x 512 x 1 bit)
Frame (512 x 512 x 8 bit)
512
1 bit
512
3-4-2 Frame Memory
The term “frame” is used to describe an image memory with 512 x 512 x 8 bit configuration. Consequently, the window memory, image memory, and shading memory with 512 x 512 x 8 bit configuration memories are grouped under the name “frame memories.”
0
1
2
3
4
5
6
7
512
8 bits
512
3-4-3 Binary Image Planes
Each of the eight types of binary image converted by the binary LUT from the camera or frame memory raw image is known as a binary image plane, and is denoted by a binary plane number between 0 and 7. The binary image plane has a one-to-one relationship with the window plane of the same number. All eight binary image planes are measured simultaneously.
Often the term “plane” is used to include the window plane.
0
1
2
3
4
5
6
7 Window plane 7
Binary image plane:
Any of the window planes can be set as the window to be measured. However, the eighth window (window plane 7) has a special function as the paint window. Refer to sections 3-5-2 Paint Window and 3-5-3 Pattern Matching
Window for information about the function of this window.
3-4-4 Mask Bits
Write protection can be enabled by setting a mask bit to prevent data being changed after it is written to a frame memory.
43
Windows
Section 3-5
Related commands:
MASKBIT
VRAM
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Plane
Frame
Type Description
Mask bits not available
Mask bit can be used to enable write protection.
Example: 27
(10) =
00011011
(2)
Plane number
Corresponding bit
7
0
6
0
5
0
4
1
3
1
2
0
1
1
0
1
Write protected
Note If the mask bit is set to 1, the corresponding plane is write protected and its contents cannot be changed.
0
1
2
3
4
5
6
7
Write protected
In the example above, planes 0, 1, 3, and 4 are write protected. The other planes are write enabled, that is the data can be changed.
3-5 Windows
Windows define the measurement area on a binary image plane. If some of the binary image displayed on the screen is not to be measured, a window graphic can be set to include only the object to be measured so that the binary image outside the object is deleted before measurement.
0
1
2
3
.
. .
7
Object to be measured
Measurement window
Binary image outside the object
(eliminated before measurement)
3-5-1 Window Planes
Multiple windows can be set for each of the eight binary image planes. In this case, each of the eight binary image planes is known as a window plane and has the same number between 0 and 7 as the binary image plane.
The term “plane” may be used to refer collectively to binary image planes and window planes.
44
Windows
Section 3-5
The eight binary image planes:
0
1
2
3
.
. .
7
Window plane 0 to 7
Multiple windows can be set for each binary image plane. In this example, three windows are set in a single window plane.
3-5-2 Paint Window
The eighth window (window plane 7) is used exclusively for paint windows. A paint window can be set in the area to be measured, regardless of whether the binary image of the measured object is available. For example, by selecting a paint window over the hole in the measured object, the object is measured as if it had no hole.
Window plane 7 can be set as the paint window for each binary image plane.
Each of the binary image planes number 0 to 6 can function simultaneously with normal windows and paint windows. However, normal and paint windows cannot be mixed in binary plane number 7.
A paint and pattern matching window cannot be set simultaneously in a single binary image plane.
The eight binary image planes:
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
The eighth window plane is the special paint window plane number 7. It cannot simultaneously contain both normal and paint windows.
Both normal and pattern matching windows can be set simultaneously in window planes 0 to 6.
Hole
Object is considered to have no hole if the the hole is filled with paint.
3-5-3 Pattern Matching Window
Pattern matching is carried out in window plane 7.
In this case, window plane number 7 is known as the pattern matching window.
During pattern matching, the shape of the pattern matching window is superimposed on the shape of the measured object binary image and the area of the non-matching parts is measured.
Window plane 7 can be set as the pattern matching window for each binary image plane. Each of the binary image planes number 0 to 6 can function simultaneously with normal windows and pattern matching windows. However, normal and paint windows cannot be mixed in binary plane number 7.
A paint and pattern matching window cannot be set simultaneously in a single binary image plane.
45
Drawing Density and Drawing Modes
Section 3-6
The eight binary image planes:
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
The eighth window plane is the special paint window plane number 7. It cannot simultaneously contain both normal and paint windows.
Both normal and pattern matching windows can be set simultaneously in window planes 0 to 6.
3-6 Drawing Density and Drawing Modes
3-6-1 Drawing Density
The drawing density directly specifies the density when drawing a graphic to image memory with the graphic control command. Existing contents of the image memory are overwritten.
Only values 0 and 1 are written to a plane image memory. In this case, specify the drawing density either as 0 or as a non-zero value (!0). The value 0 is written to memory if the drawing density is specified as 0. The value 1 is written to the image memory if the drawing density is specified as a non-zero value.
Drawing density values between 0 and 255 can be written to a frame image memory. These values are expressed as 8-bit binary values. Each of these bits corresponds to one plane of the frame memory. For example, if the drawing density is 105, which is expressed as 01101001 in binary, 1 is written to planes 0,
3, 5, and 6, and 0 is written to planes 1, 2, 4, and 7.
VRAM
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Plane
Frame
Example: 105
(10) =
01101001
(2)
Plane number
Corresponding bit
7
0
6
0
Type
5
0
4
1
3
1
0: Off
1: On
2
0
0 or 1
0 to 255
1
1
0
1
Density
3-6-2 Drawing Mode
The drawing mode carries out logical operations on the graphic in the graphic memory and the graphic data being written to the graphic memory when a graphic is drawn to image memory with the graphic control command.
The following three modes can be specified:
OR: the drawn graphic is ORed with the image memory contents
XOR: the drawn graphic is XORed with the image memory contents
NOT: the contents of the image memory are cleared
200
Image memory contents = 200
46
Run Length
Section 3-7
255
The results of these logical operations are shown below.
200 255
200 0
200
255 55
0
OR XOR NOT
3-7 Run Length
A binary image can be considered as a collection of line segments in the X and Y directions. The length of these line segments is known as the run length. The
F300 can measure two types of run length: the simple run length and the detailed run length.
Detailed run length: The lengths of lines AB and CD are determined separately.
Simple run length: The total length of lines AB and CD is determined.
X
Concave Object
A B C D
Y
Both the simple run length and detailed run length give the same result for the length of the line segment AB.
X
Convex Object
Y
A B
3-7-1 Simple Run Length
The simple run length is the total length of line segments at various Y-coordinate positions. Measurement is possible in the X direction only.
If multiple line segments exist at a single Y coordinate, the individual lengths of each section cannot be determined. If measurements are made on a convex object with no hole, the simple run length is identical to the detailed run length in the X direction.
If a concave object is measured, the simple run length includes the detailed run length.
Related commands and functions:
MEASURE
MMODE
RUNL
47
Labelling
Section 3-8
It is not possible to determine the individual lengths of more than one line segment at a single Y-axis coordinate axis position, like AB and CD in the diagram for example.
X (512 pixels)
Y
(484 pixels)
A B C D
3-7-2 Detailed Run Length
The detailed run length is the individual length of each line segment at an X- or
Y-coordinate position. The number of detailed run length data depends on the size of the binary image and complexity of the shape.
Related commands and functions:
MEASURE
RMODE
RDATA
X (512 pixels)
Y
(484 pixels)
3-8 Labelling
Labelling involves applying serial numbers starting from 0 to unlinked binary images. Complex applications can be handled using the results of labelling and other measurement properties.
Labelling can be used to determine how many measured objects are contained in the screen. The maximum label number corresponds to the number of objects. The properties of each object can be determined from the data after labelling, giving more detailed information.
Label 1: Measured object 1
Label 2:
Label 3:
Label 4:
Label 255:
Measured object 2
Measured object 3
Measured object 4
Measured object 255
Label 1
Label 4
Label 2
Label 3
..... Label 255
Two methods are used to determine the linked status of objects during labelling:
Four-neighbor evaluation and eight-neighbor evaluation.
In four-neighbor evaluation, pixels are considered to be linked into a single object if the four pixels on the top, bottom, left, and right of the evaluated pixel
48
Scrolling
Section 3-9
have the same density. The pixels in the diagonal corners of the evaluated pixel are ignored.
In eight-neighbor evaluation, pixels are considered to be linked into a single object if all adjacent pixels have the same density.
Four-neighbor evaluation
(Considered as a single object.)
Eight-neighbor evaluation
(Considered as a single object.)
: These pixels all have the same density.
Example:
Four-neighbor evaluation: Considered as five objects
Eight-neighbor evaluation: Considered as one object
Related commands:
LABEL
LSORT
LPOINT
LPUTIMG
LDATA
3-9 Scrolling
3-9-1 Window Scrolling
If the position of the measured object moves inside the screen, the position of the window must be moved accordingly. This operation is known as positional displacement compensation.
The following two methods are possible for compensating for positional displacement:
•
Compensation by scrolling the window
•
Rotating the image of the measured object
The F300 uses only the first method, compensation by scrolling the window, as this method overcomes the errors in measurement results which occur when the image of the measured object is rotated.
Related command:
WSCROLL
Window
2: Rotation
1: Window scrolling
3-9-2 Shading Scrolling
If the background to the measured object has uneven brightness and the position of the background changes inside the screen, shading compensation is required to move the shading memory contents accordingly. This operation is known as shading scrolling.
49
Image Cut-off
Section 3-11
Related command:
SSCROLL
Background Shading scrolling is carried out if the position of an unevenly-lit background moves.
3-10 Fill Measurement
The measurement of an object containing a hole as if it had no hole is known as fill measurement. However, accurate measurements ignoring the hole only are only possible for measured objects with a convex outline. A concave outline is defined as a shape in which no tangent crosses the outline itself. Consequently, a hole in a circle, triangle, or square outline is ignored accurately, but this is not possible with a star-shaped or U outline, for example.
Hole is ignored
Depression is ignored
3-11 Image Cut-off
Removing images which coincide with the edge of the window is known as image cut-off. Images fully contained in the window remain unchanged.
The F300 uses labelling to carry out this feature.
Related commands:
RMODE
LPUTIMG
LDATA
LABEL
LSORT
LPOINT
Window
Image cut-off
Label 0
Label 2
Label 1
During labelling, cut-off images are skipped, so that in this case only Label 1 remains.
50
Scan Measurement
Section 3-12
3-12 Scan Measurement
Scan measurement allows measurement of the number and length of measured objects along the binary image of any shaped line in the image memory.
The following shapes can be scanned:
•
Ellipses (including circles)
•
Polygons
•
Straight lines
•
Polygonal lines
Related commands and functions:
SCAN
SDATA1
SCANSET
SDATA2
Example:
The number of teeth and various scan lengths can be measured on this gearwheel.
51
SECTION 4
Reference
This section provides detailed information on the commands and functions. Examples are also provided.
53
ARC Reference
ABS
(Function)
Action
Format
Example
Description
AKCNV$
(Function)
Action
Format
Example
Description
ARC
(Command)
Action
Format
Example
Description
Section 4
ABSolute
Determines an absolute value.
ABS
(numeric expression)
A = ABS (–7)
Assigns 7, the absolute value of –7, to variable A.
Determines the absolute value of the specified numeric expression.
The numeric expression may be in the form of an integer, long integer, or a single or double-precision real number. The ABS function always returns a double-precision real number.
Ank Kanji CoNVert$
Converts 1-byte characters in a character string to 2-byte characters.
AKCNV$
(character string)
C$ = AKCNV$ (”OVL”)
Assigns “OVL” to variable C$.
The AKCNV$ function converts all 1-byte characters in a character string to a
2-byte equivalent. The AKCNV$ function returns a character string containing
2-byte characters only.
Specify a character string containing a mixture of 1- and 2-byte characters as a character variable or character constant with the character string variable.
The KACNV$ function has the opposite action to the AKCNV$ function.
KACNV$ converts 2-byte characters in a character string to a 1-byte equivalent.
ARC
Draws an arc in VRAM.
ARC
X, Y, R, start angle, end angle, VRAM [, [page#] [, drawing density or
drawing mode]]
ARC 200, 250, 45, 35, 75, 2,, 128
Draws an arc on Plane 7 of the window memory with center coordinates (200,
250), radius (45), start angle (35 % ), and end angle (75 % ).
The ARC command draws an arc clockwise between the start and end angle around the center coordinates (X, Y) with the specified radius (R). Start angle and end angle specified in degrees.
Specify the VRAM where the arc is drawn with a number, as follows.
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
Specify the drawing method with the drawing density or the drawing mode. The default value is drawing mode, OR.
54
ATTR Reference
ASC
(Function)
ATN
(Function)
ATTR
(Function)
Action
Format
Example
Description
Action
Format
Example
Description
Action
Format
Example
Section 4
The drawing density parameter specifies the density between 0 and 255 when drawing to the window, image, or shading memory. The default value is 255. The
drawing density parameter has the following effect when set for the character or graphic memory.
0 : 0 written to memory
!0: 1 written to memory
The drawing mode settings operate as follows.
OR: The current contents of the image memory ORed with 255 are written to memory.
NOT: 0 is written to memory
XOR: The current contents of the image memory are inverted.
The default value for the drawing mode is OR.
When writing to a frame memory, the contents of planes write protected with the
MASKBIT command remain unchanged.
ASCii
Determines the character code of the first character in a character string.
ASC
(character string)
A = ASC (” BASIC”)
Assigns the character code (66) for the first letter (B) of the character string
(BASIC) to variable A.
Returns the decimal character code of the first character in the specified
character string.
The CHR$ function has the opposite action to the ASC function. CHR$ returns the character corresponding to the specified character code.
ArcTaNgent
Determines the arctangent (arctan) of a value.
ATN
(numeric expression)
A = ATN(1)
*
180/
π
Determines the arctan of 1 and assigns the corresponding angle (455) to variable A.
The ATN function returns the arctangent value in radians between –p/2 and p/2.
Multiply this value by 180/p to convert the returned value to degrees.
The numeric expression may be in the form of an integer, long integer, or a single or double-precision real number. The ATN function always returns a double-precision real number.
ATTRibute$
Determines the write protect attribute of the specified file.
ATTR$
(filename or [#] file#)
ATTRIBUTE$ = ATTR$(” FILE.BAS”)
Determines the write protect attribute of the file FILE.BAS and assigns the result to variable ATTRIBUTE$.
55
BACKDISP Reference
Section 4
Description
Determines if the file specified with a filename or file# is write protected or write enabled and returns a letter indicating the status.
Specify the filename stored in a memory card as a character string. Specify the
file# as the number in which the file was opened with the OPEN statement.
The ATTR$ function returns a 2-character character string (attribute code) corresponding to the write protect attribute assigned to the file specified with the
filename or file#. The attribute codes are described in the table below.
Attribute code
”
__
”
”
_
”E
P”
_ ”
Meaning
The file has no write protect attribute allocated. The file specified with the filename or file# is write enabled.
The file specified with the filename or file# is write protected.
The file specified with the filename or file# is coded.
Note
_ indicates a blank
AUTO
(Command)
Action
Format
Example
AUTOmatic numbering
Description
Automatically generates line numbers when the program is keyed in.
AUTO
[initial value] [,increment]
AUTO 1000, 20
The line numbers 1000,1020, 1040, ... are displayed automatically.
When the AUTO command is input, the line number initial value is displayed at the start of the next line and the cursor stops to the right of this line number. Subsequently, each time the Return Key is pressed to input a line, the present line number plus the specified increment is displayed at the start of the next line.
The default value of the initial value is 10. The default value of the increment is
10. Both the initial value and increment may be omitted.
If a line number already exists, an asterisk (
*
) is displayed after the line number.
Press the CTRL+C or STOP Keys to end automatic line number generation.
AUTO LeVeL AUTOLVL
(Function)
Action
Format
Example
Description
Determines the ideal binary level from density histogram data.
AUTOLVL
(algorithm, array name, qualifier)
AL = AUTOLVL (0, H, 0)
The ideal binary level will be obtained from the histogram data of array H.
The AUTOLVL determines the ideal binary level from the array data, which is specified with the array name, where the histogram data obtained with the
HISTGRAM command is stored.
Always set the algorithm to 0.
The qualifier specifies the first element used in the histogram data array.
Normally set to 0.
BACKground DISPlay BACKDISP
(Command)
Action
Format
Example
Sets the type of display for the image outside the window.
BACKDISP
display image [, [binary image plane#] [, binary reverse]]
BACKDISP 2
Sets a mask image (black) for the image outside the window.
56
BCOPY . . . Reference
Description
Section 4
BACKDISP sets how the image outside the window is displayed.
Set the display image to one of the following values.
0: Raw image
1: Binary image
2: Mask image (black)
If a binary image is specified as the display image, set the binary image plane
number between 0 and 7 to specify the plane for binary conversion. The binary image corresponding to the specified binary image plane# is displayed outside the window. The default value is 0.
The binary reverse value can be specified if a binary image is selected, as follows.
0: Normal monochrome display
1: Reversed monochrome display
The default value is 0.
The BACKDISP command sets the display only and does not affect the measurements.
Binary COPY BCOPY
(Command)
Action
Format
Example
Description
Copies a binary image in VRAM.
BCOPY
VRAM1, [page# 1], [plane# 1], VRAM2, [page# 2], [plane# 2] [, [X1] [,
[Y1] [, [X2] [, [Y2] [, [X] [, Y]]]]]]
BCOPY 2,, 0, 2,, 1
Copies the entire Plane 0 in window memory to Plane 1.
BCOPY copies a binary image between VRAMs.
Specify the numbers of the copy source and destination VRAMs, with VRAM1 and VRAM2, as follows.
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the setting for the page# 1 and page# 2 or set them to 0.
Specify the plane number of the copy source and destination VRAMs, with
plane# 1 and plane# 2.
To enclose the copy source image in a rectangular region, specify the top-left and bottom-right coordinates as X1, Y1 and X2, Y2, respectively. The default value of X1 and Y1 is 0 and the default value of X2 and Y2 is 511.
Specify the top-left coordinates of the copy destination copy start region with X,
Y. The default values of X, Y are 0,0.
When copying from a plane VRAM to a frame VRAM, if the plane# of the copy destination (plane# 2) is specified, only the specified plane is copied, otherwise all planes are copied.
The plane# of the copy source VRAM (plane# 1) must be specified when copying from a frame VRAM to a plane VRAM. Data in planes write protected with the MASKBIT command remains unchanged when data is copied to a frame VRAM.
57
BEEP Reference
BCOPY2
(Command)
Action
Format
Example
Description
BEEP
(Command)
Action
Format
Example
Description
Section 4
Binary COPY2
Makes enlarged and reduced copies of binary images in VRAM.
BCOPY2
VRAM1, [page# 1], [plane# 1], VRAM2, [page# 2], [plane# 2] [,
[XS1] [, [YS1] [, [XS2] [, [YS2] [, [XD1] [, [YD1] [, [XD2] [, YD2]]]]]]]]
BCOPY2 2,, 0, 2,, 1, 100, 100, 200, 200, 200, 200, 400,
400
Enlarges by a factor of 2 the rectangular region with corner coordinates
(100,100), (200,200) on plane 0 of the window memory and copies it to the rectangular region with corner coordinates (200,200), (400,400) on plane 1.
BCOPY2 makes enlarged and reduced copies of binary images between rectangular regions in VRAM.
Specify the numbers of the copy source and destination VRAMs, with VRAM1 and VRAM2, as follows.
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the setting for the page# 1 and page# 2 or set them to 0.
Specify the plane number of the copy source and destination VRAMs, with
plane# 1 and plane# 2.
Specify the top-left and bottom-right coordinates of the copy source rectangular region as XS1, YS1 and XS2, YS2, respectively. The default value of XS1 and
YS1 is 0 and the default value of XS2 and YS2 is 511.
Specify the top-left and bottom-right coordinates of the copy destination rectangular region as XD1, YD1 and XD2, YD2, respectively. The default value of XD1 and YD1 is 0 and the default value of XD2 and YD2 is 511.
When copying from a plane VRAM to a frame VRAM, if the plane# of the copy destination (plane# 2) is specified, only the specified plane is copied, otherwise all planes are copied.
The plane# of the copy source VRAM (plane# 1) must be specified when copying from a frame VRAM to a plane VRAM. Data in planes write protected with the MASKBIT command remains unchanged when data is copied to a frame VRAM.
BEEP
Turns the buzzer on and off.
BEEP
[switch]
BEEP 1
The buzzer sounds.
The BEEP command turns the buzzer on and off.
Specify the switch parameter as 0 or 1, as follows.
0: Stop the buzzer.
1: Continuously sound the buzzer.
The buzzer sounds for a fixed time if the parameter is omitted.
After the buzzer is turned on, it can be turned off again only with the BEEP command. The buzzer remains on if program operation stops.
58
BUSY Reference
BOX
(Command)
Action
Format
Example
Description
BUSY
(Command)
Action
Format
Example
Description
Section 4
BOX
Draws a rectangle in VRAM.
BOX
X1, Y1, X2, Y2, VRAM [, [page#] [,[drawing density or drawing mode] [,
lineart]]]
BOX 0, 0, 128, 255, 2,, 128, 0
Draws a rectangle on Plane 7 of the window memory with opposing corner coordinates (0,0), (128,255).
The BOX command draws a rectangle between the opposing corner coordinates (X1, Y1) and (X2, Y2).
Specify the VRAM where the rectangle is drawn with a number, as follows:
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
Specify the drawing method with the drawing density or the drawing mode. The default value is drawing mode, OR.
The drawing density parameter specifies the density between 0 and 255 when drawing to the window, image, or shading memory. The default value is 255. The
drawing density parameter has the following effect when set for the character or graphic memory:
0 : 0 written to memory
!0: 1 written to memory
The drawing mode settings operate as follows.
OR: The current contents of the image memory ORed with 255 are written to memory.
NOT: 0 is written to memory
XOR: The current contents of the image memory are inverted.
The default value for the drawing mode is OR.
Specify with the lineart parameter if the rectangle is an outline only or filled.
0: Filled rectangle
1: Rectangle outline only
The default value is 0 (filled).
When writing to a frame memory, the contents of planes write protected with the
MASKBIT command remain unchanged.
BUSY
Controls the BUSY signal output status.
BUSY
0 or 1
BUSY 1
Turns ON the BUSY signal output of all connected Terminal Block Unit or Parallel
I/O Units.
The BUSY command turns the BUSY signal output ON and OFF for the Terminal
Block and Parallel I/O Units.
Set the parameter to 0 to turn OFF the BUSY signal or to 1 to turn ON the BUSY signal.
When multiple Terminal Block or Parallel I/O Units are connected, the BUSY signals are controlled simultaneously for all Units.
59
CAMMODE Reference
CALL
(Command)
Action
Format
Example
Description
CAMCHK
(Function)
Action
Format
Example
Description
CAMERA
(Command)
Action
Format
Example
Description
CAMMODE
(Command)
Action
Format
Example
Section 4
CALL
Calls a subroutine defined between the SUB and END SUB commands.
CALL
label (argument [, argument...])
CALL *SUB1 (PARAM1, PARAM2$, 1)
Calls the subroutine SUB1.
The CALL command calls subroutines in which local variables are used.
The label parameter specifies a label designated with the SUB command.
The arguments specify data to be transferred to the subroutine. The arguments can be any type of variable, constant, or expression, but the argument type must match the type of argument used with the SUB command.
If a variable specified as an argument is changed in the subroutine, the value of the argument changes simultaneously. No logical limitation is placed on the number of arguments. However, the command line can physically accommodate up to 255 characters only.
An entire array cannot be used as an argument. Data from an array can be used as an argument by specifying individual elements of the array in the form: array name(qualifier). If multiple arguments are specified with the CALL command, no variable name can be used more than once.
CAMera CHecK
Determines the connection status of the camera specified with the camera number.
CAMCHK
(camera#)
A = CAMCHK (1)
Assigns the connection status of camera#1 to variable A.
The CAMCHK function determines the status of the camera specified with the
camera number (0 to 7), and returns a value as follows:
0: Connected
–1: Not connected
CAMERA
Switches cameras.
CAMERA
camera#
CAMERA 2
Switches to camera# 2.
The CAMERA commands switches to the camera specified by the camera
number (0 to 7).
The F300 cannot simultaneously receive inputs from multiple cameras. Only the image from the camera selected with the CAMERA command is processed.
CAMera MODE
Selects the image output from a Camera I/F Unit.
CAMMODE
output image
CAMMODE 1
Selects the image from the Camera I/F Unit internal memory as the output image.
60
CHAIN . . . . Reference
Description
CDBL
(Function)
Action
Format
Example
Description
CHAIN
(Command)
Action
Format
Section 4
The CAMMODE command is valid for the Camera I/F Unit (normal/simultaneously) and Camera I/F Unit (shutter/simultaneously) only.
Both the Camera I/F Unit (normal/simultaneously) and Camera I/F Unit (shutter/ simultaneously) have a built-in image memory able to hold one image screen from a single camera. The CAMMODE selects if the image output from the Camera I/F Unit to the IMP Unit is the image output directly from the camera or the image from the Camera I/F Unit internal video memory.
The parameter of the CAMMODE command selects the output image, as follows:
0: Output the camera image directly.
1: Output the image from the internal video memory.
Images are written to the video memory with the FLASH command.
If multiple Camera Units with internal memory are connected, the setting with the
CAMMODE command applies to all Units.
Convert DouBLe
Converts a value to a double-precision value.
CDBL
(numeric expression)
DBL# = CDBL(A!)
Converts the value of the single-precision real number A! to a double-precision real number and assigns it to the double-precision real number variable DBL#.
The CDBL function returns the specified numeric expression converted to a double-precision real number.
The CDBL function converts values to a double-precision real value. It does not change the number of significant digits of the returned value. Consequently, the precision of the returned value is the same as the precision of the value before conversion.
The following type conversion functions are also available:
CINT function: Converts a value to an integer.
CLNG function: Converts a value to a long integer
CSNG function: Converts a value to a single-precision real number.
CHAIN
Example
Description
Calls and transfers control to a specified program.
1.
CHAIN
”filename” [, line#] [, ALL]
2.
CHAIN MERGE
”filename” [, line#] [, ALL] [,
DELETE
line# 1 – line# 2]
CHAIN MERGE ”PRO1.BAS”, 1000, ALL
Merges the program PRO1.BAS with the current program and executes it from line 1000. All variables remain unchanged.
The CHAIN command reads the program with the specified filename from the memory card and executes the program from the specified line#.
If no line# parameter is specified, the program is executed from the beginning.
If the command is specified in format 1, the current program is cleared before the specified program is read.
If the command is specified in format 2, the current program is merged with the new program. All variables remain unchanged if the ALL parameter is specified.
61
CHDIR . . . . Reference
Section 4
If ALL is not specified, all numeric variables become 0 and character variables become blank (null). Use the COMMON command to leave some of the variables unchanged.
If the DELETE parameter is used, the program lines between the specified line#
1 and line# 2 are deleted before the programs are merged.
Labels can be used instead of numbers for the line#, line# 1, and line# 2 parameters.
CHANGE scene CHANGE
(Command)
Action
Format
Example
Description
Changes the measuring conditions to the scene setting conditions set in the
Menu mode.
CHANGE
scene#
CHANGE 2
Switch to the scene 2 measuring conditions.
The CHANGE command refers to the scene setting data previously set in the
Menu mode and changes the setting data to the scene specified with the
scene#.
The following items can be changed:
•
Drawing the window graphic (WINDOW)
•
Measuring mode for each binary plane (MMODE)
•
Camera selection (CAMERA)
•
Displayed image (DISP, FILTERIN)
•
Window display image (WDISP)
•
Filtering (FILTER, FILTDATA)
•
Binary level (LEVEL)
However, the following settings can only be made from the Menu mode, they are not possible with the CHANGE command:
•
Measurement with multiple camera
•
Window displacement compensation
•
Shading displacement compensation
•
Window measurement items
•
Window evaluation conditions
If measurement with multiple cameras is selected in the Menu mode, the camera specified in the Menu mode for the display is used with the CHANGE command.
CHange DIRectory CHDIR
(Command)
Action
Format
Example
Changes the current directory.
CHDIR
directory name
CHDIR ”.. SRC”
Switches the current directory to directory SRC, which is on the same hierarchical level as the current level (that is, both directories are contained in the same directory on the next level of the hierarchy.)
62
CINT Reference
Description
CHR$
(Function)
CINT
(Function)
Action
Format
Example
Description
Action
Format
Example
Description
Section 4
Specify the directory name parameter as a character string. Specify the name of a directory existing on the memory card. An error (Path not found) occurs if the specified directory does not exist on the memory card.
To specify an absolute path name for the directory, delimit the directory names with ¥ signs. The total length, including the ¥ signs, must not exceed 127 characters.
Specify the directory name as [“..”] to switch the current directory up to the next hierarchy.
CHaRacter$
Determines the character corresponding to a character code.
CHR$
(numeric expression)
A$ = CHR$ (97)
Assigns the character “a” corresponding to character code 97 (= 61H) to variable
A$.
The CHR$ functions returns the 1-byte character or the control code corresponding to the character code.
Specify the numeric expression as an integer between 0 and 255.
The ASV function ASC has the opposite action to the CHR$ function. ASC returns the decimal character code corresponding to a character.
Convert INTeger
Converts a value to an integer.
CINT
(numeric expression)
SEI% = CINT (A#)
Converts the value of the double-precision real number A# to an integer and assigns it to the integer variable SEI%.
The CINT function rounds off the decimal places of the specified numeric ex-
pression and returns an integer.
An error occurs if the integer returned by the CINT function does not lie between
–32768 (–2
16
) and 32767 (2
16
–1).
The following type conversion functions are also available:
CDBL function: Converts a value to a double-precision real number.
CLNG function: Converts a value to a long integer
CSNG function: Converts a value to a single-precision real number.
The FIX and INT functions are similar to the CINT function. However, the FIX function simply cuts off (rounds down) the decimal places from the specified value. The INT function also rounds down the specified value, but this function never returns a value larger than the value specified with the numeric expression.
Examples of the actions of the FIX, INT, and CINT function are shown in the table below.
Positive numeric expression
Negative numeric expression
Specified function
FIX (1.7)
INT (1.7)
CINT (1.7)
FIX (–1.7)
INT (–1.7)
CINT (–1.7)
1
1
2
–1
–2
–2
Returned value
63
CIRCLE . . . Reference
CIRCLE
(Command)
Action
Format
Example
Description
Section 4
CIRCLE
Draws a circle in VRAM.
CIRCLE
X, Y, R, VRAM , [, [[page#]] [, [drawing density or drawing mode] [,
lineart]]]
CIRCLE 128,255, 25, 2,, 128, 0
Draws a circle on Plane 7 of the window memory with center coordinates (128,
255) and radius (25).
The CIRCLE command draws a circle around the center coordinates (X,Y) with the specified radius (R).
Specify the VRAM where the circle is drawn with a number, as follows:
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
Specify the drawing method with the drawing density or the drawing mode. The default value is drawing mode, OR.
The drawing density parameter specifies the density between 0 and 255 when drawing to the window, image, or shading memory. The default value is 255. The
drawing density parameter has the following effect when set for the character or graphic memory:
0 : 0 written to memory
!0: 1 written to memory
The drawing mode settings operate as follows.
OR: The current contents of the image memory ORed with 255 are written to memory.
NOT: NOT: 0 is written to memory
XOR: XOR: The current contents of the image memory are inverted.
The default value for the drawing mode is OR.
Specify with the lineart parameter if the circle is an outline only or filled.
0: Filled circle
1: Circle outline only
The default value is 0 (filled).
When writing to a frame memory, the contents of planes write protected with the
MASKBIT command remain unchanged.
64
CLOSE . . . . Reference
CLEAR
(Command)
Action
Format
Example
Description
Initializes variables.
CLEAR
CLEAR
The CLEAR command initializes all numeric variables to 0 and all character variables to a blank (null).
Change to LoNG integer CLNG
(Function)
Action
Format
Example
Section 4
CLEAR
Description
Converts a value to a long integer.
CLNG
(numeric expression)
A& = CLNG(B#)
Converts the value of the double-precision real number B# to a long integer and assigns it to the long integer variable A&.
The CLNG function rounds off the decimal places of the specified numeric expression and returns a long integer.
An error occurs if the long integer returned by the CLNG function does not lie between –2147483648 (–2
31
) and 2147483647 (2
31
–1).
The following type conversion functions are also available:
CDBL function: Converts a value to a double-precision real number.
CINT function: Converts a value to an integer.
CSNG function: Converts a value to a single-precision real number.
CLOSE CLOSE
(Command)
Action
Format
Example
Description
Closes an open file.
CLOSE
[file# [, file#] ...]
CLOSE #1
Closes the file which was opened as file# 1.
The CLOSE command closes a file previously opened for data I/O.
Specify the same file# used when the file was opened with the OPEN command.
After a file is closed with the CLOSE command, data I/O operations on the file are not possible until the file is reopened with the OPEN command.
After a file is closed with the CLOSE command, the same file# can be used to open a different file with the OPEN command. Alternatively, the closed file can be reopened with the original file#.
Multiple file numbers (file#) can be specified to close multiple files simultaneously with a single CLOSE command. All open files are closed if the file# is omitted.
Similarly, all files are closed automatically when the END, NEW, or STOP command is executed.
When a file opened for data output is closed, all data remaining in the file buffer is written to the file before it is closed. The CLOSE command must be used to ensure this data is correctly written to the file.
65
COLOR@ . . Reference
CLS
(Command)
Action
Format
Example
Description
Section 4
CLear Screen
Clears the specified VRAM.
CLS
[VRAM [, [page#] [, plane#]]]
CLS 2,, 3
Clears plane 3 of the window memory.
The CLS command clears the specified VRAM.
Specify the VRAM to be cleared with a number, as follows.
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
Specify the plane to be cleared with the plane# parameter. All planes are cleared if this parameter is omitted. When a frame memory is specified, the contents of planes write protected with the MASKBIT command remain unchanged.
COLOR COLOR
(Command)
Action
Format
Example
Description
Changes the text display. character attribute.
COLOR
attribute code
COLOR 2
Sets the character attribute to overline.
The COLOR command changes the character attribute to the specified attribute.
Specify the attribute with a number, as follows.
0: Clear attribute
2: Overline
4: Underline
7: Reverse
COLOR@ COLOR@
(Command)
Action
Format
Example
Description
Changes the character attribute within a rectangular region of the text display.
COLOR@
(X1, Y1) – (X2, Y2) [,attribute code]
COLOR@ (0, 0) – 31, 5), 7
Reverses the characters between line 0, character 0 and line 5, character 31.
The COLOR@ command changes the character attribute to the specified attribute within the rectangular region between the opposing corners specified in character coordinates (X1, Y1) and (X2, Y2).
Specify the horizontal character coordinates X1 and X2 as an integer between 0 and 63 and the vertical character coordinates Y1 and Y2 between as an integer between 0 and 24.
66
COMMON . Reference
Section 4
Specify the attribute code with a number, as follows.
0: Clear attribute
2: Overline
4: Underline
7: Reverse
The default value is 7 (reverse).
COM ON/OFF/STOP
(Command)
Action
COMmunication ON/OFF/STOP
Enables, disables, or stops interrupts from the RS-232C.
Format
Example
COM
(RS-232C port#) ON or OFF or STOP
Description
COM(n) ON
COM(1) ON
Permits branching to the interrupt routine when input data is received via the
RS-232C channel 0.
Specify the port# as 1 or 2. The default value is 1. The port# is represented by n in the description below.
Branches to the interrupt subroutine at the specified line# or label when input data is received via the specified port#. The line# or label must be specified with the ON COM GOSUB statement before the COM(n) ON command is executed.
In addition, use of the RS-232C communication port must be declared with the
OPEN command before the COM(n) ON command is executed.
Example:
10 OPEN ”COM:9600N 82N” AS #1
20 ON COM GOSUB *LABEL1
30 COM ON
70 COM OFF
100 *LABEL1
200 RETURN
COM (n) OFF
COM (n) STOP
Disables branching to the interrupt routine when input data is received via the specified port#.
Temporarily stops operation when input data is received via the specified port#.
Operation does not branch to the interrupt subroutine. Operation will branch to the interrupt subroutine after the COM (n) ON command is executed.
Note The COM (n) OFF status must be set before the program execution ends.
COMMON COMMON
(Command)
Action
Format
Example
Transfers variables to a program linked with the CHAIN command.
COMMON
variable name [, variable name ...]
COMMON X, Y, A$, B
Transfers variables X, Y, A$ and B to a specified program in the CHAIN command.
67
CONT Reference
Description
CONSOLE
(Command)
Action
Format
Example
Description
CONT
(Command)
Action
Format
Example
Description
Section 4
The COMMON command transfers variables to another program. The
COMMON command is used as a pair with the CHAIN command. The
COMMON statement must be declared before the CHAIN statement, that is, at the start of the program.
Variables must not be duplicated in a single COMMON command.
Add parentheses to declare array variables, e.g., B( ).
Use the ALL parameter in the CHAIN statement to transfer all variables to the linked program.
Example:
10 DIM B(100), C(10), D(10)
50 CHAIN ”TEST.BAS”,, ALL
CONSOLE
Sets the text display mode.
CONSOLE
[[scroll start line] [, [number of scroll lines] [, [function key display
switch] [, character mode]]]]
CONSOLE ,,, 1
Sets the text display mode to the graphic character mode and hold all other parameter settings.
The CONSOLE command sets the text display mode.
The area designated by the scroll start line and number of scroll lines parameters. The screen clear operation acts on this specified scroll area. The default value for the scroll start line is 0. If the number of scroll lines is not specified, the previous setting is maintained.
The function key display switch setting specifies whether the function key menu is displayed on the bottom line of the screen. The function key menu is not displayed if this parameter is set to 0. If the function key display switch is not specified, the previous setting is maintained.
Set the character mode to 1 to select the graphic character mode. This mode permits display of the graphic characters (character codes &H80 to &H9F and
&HE0 to &HF7) but disables the Japanese character display.
Set the character mode to 0 to enable the Japanese character display but disable display of the graphic characters. If no setting is specified, the previous setting is maintained.
CONTinue
Continues execution of a stopped user program.
CONT
CONT
Restarts program execution.
The CONT command is a direct command to continue execution of a user program stopped by pressing the STOP or CTRL+C Keys or by executing the
STOP command.
Operations such as printing the variable names in the direct mode are possible while the program is stopped. However, a program cannot be continued if it was modified while execution was stopped.
68
CURSOR . . Reference
COS
(Function)
Action
Format
Example
Description
CSNG
(Function)
Action
Format
Example
Description
CSRLIN
(Function)
Action
Format
Example
Description
CURSOR
(Command)
Action
Format
Example
Section 4
COSine
Determines the cosine of an angle.
COS
(numeric expression)
A! = COS(60*3.14159/180)
Assigns the cosine of 60
%
(0.50000) to variable A!.
Returns the cosine as a value between –1 and 1.
The angle in the numeric expression is set in radians.
The numeric expression may be in the form of an integer, long integer, or a single or double-precision real number. The COS function always returns a doubleprecision real number.
Convert SiNGle
Converts a value to a single-precision value.
CSNG
(numeric expression)
SNG! = CSNG (A#)
Converts the value of the double-precision real number A# to a single-precision real number and assigns it to the single-precision real number variable SNG!.
The CSNG function returns the specified numeric expression converted to a single-precision real number.
The CSNG function converts values to a single-precision real value between
–1.70141E+38 and –1.70141E+38. An error occurs if the value lies outside this range.
The following type conversion functions are also available:
CDBL function: Converts a value to a double-precision real number.
CLNG function: Converts a value to a long integer
CINT function: Converts a value to an integer.
CurSoR LINe
The CSRLIN function determines the number of the line where the character cursor is positioned.
CSRLIN
LN% = CSRLIN
Assigns the current cursor line position to the variable LN%.
Returns the line position of the character cursor (the Y-axis character coordinate).
The value returned is between 0 and 24.
Use the POS function to determine the cursor character position along the line.
CURSOR
Draws the cross cursor in VRAM.
CURSOR
X, Y, angle, VRAM [,[page#][,drawing density or drawing mode]]
CURSOR 200, 250, 45, 1
Draws a cross cursor at an angle of 45
%
in the graphic memory at coordinate position (200,250).
69
CVD Reference
Description
CVD
(Function)
Action
Format
Example
Description
Section 4
The CURSOR command draws a cursor at coordinate position (X,Y) at the specified angle.
The angle parameter specifies the tilt angle of the cross cursor.
Specify the VRAM where the cursor is drawn with a number, as follows.
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
Specify the drawing method with the drawing density or the drawing mode. The default value is drawing mode, OR.
The drawing density parameter specifies the density between 0 and 255 when drawing to the window, image, or shading memory. The default value is 255. The
drawing density parameter has the following effect when set for the character or graphic memory:
0 : 0 written to memory
!0: 1 written to memory
The drawing mode settings operate as follows.
OR: The current contents of the image memory ORed with 255 are written to memory.
NOT: NOT: 0 is written to memory
XOR: XOR: The current contents of the image memory are inverted.
The default value for the drawing mode is OR.
When writing to a frame memory, the contents of planes write protected with the
MASKBIT command remain unchanged.
ConVert to Double
Converts an 8-byte character string to a double-precision real number.
CVD
(8-byte character string)
C# = CVD(C$)
Converts a character-type numeric data variable C$ created with the MKD$ function to a double-precision real number and assigns it to variable C#.
The CVD function returns the value of an 8-byte character string converted to a double-precision real number.
Because numeric data cannot be handled in a random access file, a a doubleprecision real number must be converted to a character-type numeric data variable (character string) with the MKD$ function before it is written to a random access file. The CVD function converts character-type numeric data read from a random access file back to a double-precision real number.
The CVD function has the opposite action to the MKD$ function. The MKD$ function converts numeric data to a character string.
Character-type numeric data is read from a random access file with the GET# command to the variable areas defined with the FIELD# command in the file buffer.
70
CVS Reference
CVI
(Function)
Action
Format
Example
CVL
(Function)
CVS
(Function)
Description
Action
Format
Example
Description
Action
Format
Example
Section 4
ConVert to Integer
Converts a 2-byte character string to an integer.
CVI
(2-byte character string)
A% = CVI(A$)
Converts a character-type numeric data variable A$ created with the MKI$ function to an integer and assigns it to variable A%.
The CVI function returns the value of a 2-byte character string converted to an integer.
Because numeric data cannot be handled in a random access file, an integer must be converted to a character-type numeric data variable (character string) with the MKI$ function before it is written to a random access file. The CVI function converts character-type numeric data read from a random access file back to an integer.
The CVI function has the opposite action to the MKI$ function. The MKI$ function converts numeric data to a character string.
Character-type numeric data is read from a random access file with the GET# command to the variable areas defined with the FIELD# command in the file buffer.
ConVert Long integer
Converts a 4-byte character string to a long integer.
CVL
(4-byte character string)
A& = CVL(A$)
Converts a character-type numeric data variable A$ created with the MKL$ function to a long integer and assigns it to variable A&.
The CVL function returns the value of a 4-byte character string converted to a long integer.
Because numeric data cannot be handled in a random access file, a long integer must be converted to a character-type numeric data variable (character string) with the MKL$ function before it is written to a random access file. The CVL function converts character-type numeric data read from a random access file back to long integer data.
The CVL function has the opposite action to the MKL$ function. The MKL$ function converts numeric data to a character string.
Character-type numeric data is read from a random access file with the GET# command to the variable areas defined with the FIELD# command in the file buffer.
ConVert to Single
Converts an 4-byte character string to a single-precision real number.
CVS
(4-byte character string)
B! = CVS(B$)
Converts a character-type numeric data variable B$ created with the MKS$ function to a single-precision real number and assigns it to variable B!.
71
DATA Reference
Description
DATA
(Command)
Action
Format
Example
Description
Section 4
The CVS function returns the value of an 4-byte character string converted to a single-precision real number.
Because numeric data cannot be handled in a random access file, a a singleprecision real number must be converted to a character-type numeric data variable (character string) with the MKS$ function before it is written to a random access file. The CVS function converts character-type numeric data read from a random access file back to a single-precision real number.
The CVS function has the opposite action to the MKS$ function. The MKS$ function converts numeric data to a character string.
Character-type numeric data is read from a random access file with the GET# command to the variable areas defined with the FIELD# command in the file buffer.
DATA
Defines the integer constants and character constants read with the READ command.
DATA
constant [, constant [, constant...]]
DATA 10, 20, 30, 40
Defines the integer constants 10, 20, 30, and 40 as decimal data.
DATA 5.5, ”OVL”, 200
DATA 5.5, OVL, 200
Defines the real number 5.5, character string ”OVL,” and integer 200 as data.
The DATA statement is not executable. It can be declared anywhere in the program.
The constants (numeric and character) are delimited by commas (,).
A constant cannot be defined as a constant expression, such as 10 * 2.
When one of the character strings described below is declared as a constant, it must be enclosed in double quotations (”).
•
A character string containing a meaningful symbol such as a comma (,), colon
(:), or period (.)
•
A character string starting or ending with a meaningful blank.
The constants defined with the DATA command are read sequentially to the variables defined with the READ command.
Normally the DATA statement constants and the READ statement variables have the same format. However, it is possible to specify character variables for the READ statement which are read as the character-type numeric variables in the corresponding DATA statement.
DATA statement constant format
Numeric constant
Numeric constant
Character constant
Character constant
READ statement variable format
Numeric variable
Character variable
Character variable
Numeric variable
Results of executing
READ statement
Read as a normal number
Number read as a character string
Read as a normal character string
Error
A RESTORE command before the READ command specifies the line containing the DATA statement to read. If the DATA statement is not specified by a
72
DEF FN . . . Reference
Section 4
Second and succeeding executions
RESTORE command, the position of the data read depends on the execution status of the READ command.
Execution status of READ command
First execution in program
Data to be read
Sequentially reads the data beginning with the first data statement in the program.
Continues reading the data sequentially after all remaining data from the first execution has been read.
DATE$
(Command-Function)
Action
Format
DATE$
Example
Description
Displays and sets the date in the internal clock.
Format 1
DATE$
Format 2
DATE$
=”
yy/mm/dd”
PRINT DATE$
Displays the date returned in DATE$.
DATE$ = ”92/11/10”
Sets the date to 10 November, 1992.
Reads the date from the F300.
The F300 has no internal clock. The clock is set to 00/00/00 on 80/01/01 when the power supply is turned on. The time elapsed since the power was turned on is counted. Therefore, it is not possible to read the correct date with the DATE$ function until the clock has been set.
A character string with the year, month, and day (yy/mm/dd) delimited by slashes is returned when the DATE$ function is executed. The format is shown below. The last two digits of the year are returned.
YY/MM/DD
DEF FN
(Command)
Action
Format
Example
Description
Day - returns two characters between 01 to 31
Month - returns two characters between 01 to 12
Year - returns two characters between 80 and 99
DEFine FunctioN
Defines a user function.
DEF FN
name [(parameter [, parameter...])] = expression
DEF FNX% (X%) = X% * X%
Defines a function to square the parameter.
The DEF function defines a function and its name.
Function names are subject to the same restrictions as variable names.
The parameters have the same names as the variables used inside the function.
These variable names are used only for evaluation of the expression inside the function. The same variable names can be used elsewhere inside the program.
The expression declares the operation of the function. It must not exceed one line.
73
DEFINT . . Reference
Section 4
The function is called in the format: FN name (variable). It is not necessary for the variable name used to match the name used in the expression declaring the operation of the function, however the variable format must be the same.
The function must be declared before it can be called.
DEF FN...END DEF DEFine FuNction END DEFine
(Command)
Action
Defines a user function block.
Format
Example
DEF FN
name [(parameter [, parameter...])]
statement in DEF FN block
END DEF
DEF FNX% (X%)
Description
DEFDBL
(Command)
Action
Format
Example
Description
DEFINT
(Command)
Action
Format
Example
FNX% = A% + X%
END DEF
Defines function X.
Defines a user function block.
The function names must conform to restrictions covering variable names.
The parameters have the same names as the variables used inside the function.
These variable names are used only for evaluation of the expression inside the function. The same variable names can be used elsewhere inside the program.
It is possible to describe operation expressions as statements in more than one line in a DEF FN statement block.
Use the format FN name (variable) to have access to a function. A DEF FN statement must exist before the above format.
No further DEF FN ... END DEF declaration can be nested inside a DEF FN statement block. The GOTO command must not be used to jump into or out of a
DEF FN statement block.
Use the EXIT DEF command to get out of a DEF FN statement block.
DEFine DouBLe
Declares variables as double-precision real number variables.
DEFDBL
character range [,character range...]
DEFDBL E–H, Z
Declares all variables starting with the letters E, F, G, H, and Z as double-precision real numbers.
Declares variables starting with characters in the specified character range as double-precision real number variables.
Only single characters can be specified in the character range. Specify multiple characters using the minus (–) sign.
The type statements (%, &, !, #, $) take priority over type declarations with this command.
DEFine INTeger
Declares variables as integers.
DEFINT
character range [,character range...]
DEFINT A, F–I
Declares all variables starting with the letters A, F, G, H, and I as integers.
74
DEFSTR . . Reference
Description
Section 4
Declares variables starting with characters in the specified character range as integer variables.
Only single characters can be specified in the character range. Specify multiple characters using the minus (–) sign.
The type statements (%, &, !, #, $) take priority over type declarations with this command.
DEFine LoNG DEFLNG
(Command)
Action
Format
Example
Description
DEFSNG
(Command)
Action
Format
Example
Description
Declares variables as long integers.
DEFLNG
character range [,character range...]
DEFLNG B, C–F
Declares all variables starting with the letters B, C, D, E, and F as long integers.
Declares variables starting with characters in the specified character range as long integer variables.
Only single characters can be specified in the character range. Specify multiple characters using the minus (–) sign.
The type statements (%, &, !, #, $) take priority over type declarations with this command.
DEFine SiNGle
Declares variables as single-precision real number variables.
DEFSNG
character range [,character range...]
DEFSNG A, B–D
Declares all variables starting with the letters A, B, C, and D as single-precision real numbers.
Declares variables starting with characters in the specified character range as single-precision real number variables.
Only single characters can be specified in the character range. Specify multiple characters using the minus (–) sign.
The type statements (%, &, !, #, $) take priority over type declarations with this command.
DEFine STRing DEFSTR
(Command)
Action
Format
Example
Description
Declares variables as character variables.
DEFSTR
character range [,character range...]
DEFSTR A, B–D
Declares all variables starting with the letters A, B, C, and D as character strings.
Declares variables starting with characters in the specified character range as character string variables.
Only single characters can be specified in the character range. Specify multiple characters using the minus (–) sign.
The type statements (%, &, !, #, $) take priority over type declarations with this command.
75
DIM Reference
DELETE
(Command)
Action
Format
Example
DEVICE
(Command)
Action
Format
Example
Description
DIM
Description
(Command)
Action
76
Format
Section 4
DELETE
Deletes all lines in a specified range of the program.
DELETE
[line# 1] [–line# 2]
DELETE 100–190
Deletes all lines from 100 to 190.
Deletes all lines between line# 1 and line# 2.
Only line# 1 is deleted if line# 2 is not specified.
Lines from the start of the program to line# 2 are deleted if line# 1 is not specified.
Use a period (.) instead of line# 1 or line# 2 to specify the current program line.
The current line is indicated by the pointer. The current line is the last line input during program creation or the last line displayed with the LIST command.
It is not possible to omit both the line# 1 and line# 2 parameters.
DEVICE
Specifies the standard OVL input and output devices.
DEVICE
[”KYBD:” or ”COM:”], [”SCRN:” or ”COM:”]
DEVICE ”COM:”, ”COM:”
Specifies program input and output through the RS-232C port.
The input device can be selected as the keyboard or RS-232C port. The output device can be selected as the video monitor or the RS-232C port.
The first parameter specifies the input device, as one of the following.
KYBD: Keyboard
COM: RS-232C
Input from the keyboard is disabled if the input device is set to the RS-232C port.
The second parameter specifies the input device, as one of the following.
SCRN: Video monitor
COM: RS-232C
Subsequent characters are output to the RS-232C port if the output device is set to RS-232C.
Previous settings remain unchanged if both parameters are omitted.
DIMension
Defines an array variable.
DIM
variable name (qualifier max. value [, qualifier max. value ...]) [, variable
name (qualifier max. value [, qualifier max. value...])]
DISPLAY . . Reference
Example
Description
Section 4
DIM A$(50)
Defines a one-dimensional character array variable A$(50).
Defines a two-dimensional single-precision real number array variable
B$(10,3).
Declares the variable format, number of dimensions, and qualifier maximum
values of an array variable and assigns the array variable to an area of memory.
The array variable format is specified with the type statements (%, !, #, $, &). The default type if the type statement is omitted is a single-precision real number variable.
The number of qualifier maximum values indicates the number of dimensions of the array. If multiple dimensions are specified, the qualifier maximum values are delimited by commas (,).
The qualifier maximum value parameters specify the maximum value a qualifier can have. The qualifier minimum value can be specified as 0 or 1 with the
OPTION BASE statement.
The default value is 0 if no OPTION BASE statement is specified. Note that executing the command DIM A(20) if no OPTION BASE statement is specified in the program results in an array with elements from 0 to 20, that is, 21 elements.
Data IN DIN
(Function)
Action
Format
Example
Description
Reads the status of the Terminal Block Unit or Parallel I/O Unit input port.
DIN
(bit address [, size])
A = DIN (2, 8)
Reads the status of the eight bits 2 to 9 from the Terminal Block Unit or Parallel
I/O Unit and assigns the bits to variable A.
The DIN function reads the data input to the Terminal Block Unit or Parallel I/O
Unit input ports.
If both Terminal Block Units and Parallel I/O Units are connected, the DIN function does not differentiate between the two. The maximum number of input bits becomes the total number of the input bits for all Units.
Specify the number of input data bits with the size parameter. The default value is 8. Specify the data input start position with the bit address parameter.
Data is input as integers with + or – signs.
DISPLAY DISPLAY
(Command)
Action
Format
Example
Sets the display image.
DISPLAY
display image [, image pathway]
DISPLAY 31
Displays all images.
77
DO–LOOP UNTIL Reference
Section 4
Description
The DISPLAY command specifies the image displayed on the video monitor as a display number between 0 and 31.
The decimal number between 0 and 31 set for the display image represents a binary number. The image corresponding to a bit set to 1 is displayed. The relationship between the bits and displayed images is shown below. Normally leave bit 0 set to 1.
Bit 0: Camera image
Bit 1: Paint/pattern matching window memory image
Bit 2: Window memory image
Bit 3: Graphic memory image
Bit 4: Character memory image
The image pathway parameter specifies the image bus taken by the displayed image. The default value is 2.
0: Binary image and raw image .. Image bus 0
1: Binary image ... Image bus 1, raw image ... Image bus 0
2: Binary image ... Image bus 0, raw image ... Image bus 1
3: Binary image and raw image .. Image bus 1
DO–LOOP REPEAT
(Command)
Action
DO–LOOP REPEAT
Repeats the statement between DO and LOOP the specified number of repetitions.
Format
Example
Description
DO
Statements in DO block
LOOP REPEAT
number of times
DO
PRINT I
LOOP REPEAT 20
Displays variable I 21 times.
The DO–LOOP REPEAT command executes the statement between DO and
LOOP the specified number of times.
The statements in the DO block are executed the number of times specified by the (number of times parameter + 1).
The GOTO command must not be used to jump into or out of a DO block. Use the
EXIT DO command to get out of a DO block.
DO–LOOP UNTIL
(Command)
Action
DO–LOOP UNTIL
Repeats the statements between DO and LOOP until the condition is fulfilled.
Format
DO
Statements in DO block
LOOP UNTIL
conditional expression
Example
I = 20
DO
PRINT I
I = I + 1
LOOP UNTIL I > 29
Displays the integers from 20 to 29.
78
DO REPEAT–LOOP . . . . . Reference
Section 4
Description
The DO–LOOP UNTIL command executes the statement between DO and
LOOP until the condition is fulfilled.
The statements in the DO block are executed repeatedly while the conditional expression is false.
The GOTO command must not be used to jump into or out of a DO block. Use the
EXIT DO command to get out of a DO block.
DO–LOOP WHILE
(Command)
Action
DO–LOOP WHILE
Repeats the statements between DO and LOOP while the condition is fulfilled.
Format
DO
Statements in DO block
LOOP WHILE
logical expression
Example
Description
I=0
DO
PRINT I
I=I+1
LOOP WHILE I<10
Displays the integers from 0 to 9.
The DO–LOOP WHILE command executes the statement between DO and
LOOP while the condition is fulfilled.
The statements in the DO block are executed repeatedly while the logical expression is true.
The GOTO command must not be used to jump into or out of a DO block. Use the
EXIT DO command to get out of a DO block.
DO REPEAT–LOOP
(Command)
Action
DO REPEAT–LOOP
Repeats the statements between DO and LOOP the specified number of times.
Format
DO REPEAT
number of times
Statements in DO block
LOOP
Example
Description
DO REPEAT 20
PRINT I
LOOP
Displays variable I 20 times.
The DO REPEAT and LOOP command executes the statement between DO and LOOP the specified number of times.
The statements in the DO block are executed the specified number of times.
The GOTO command must not be used to jump into or out of a DO block. Use the
EXIT DO command to get out of a DO block.
79
DOUT . . . . Reference
Section 4
DO UNTIL–LOOP
(Command)
Action
DO UNTIL–LOOP
Repeats the statements between DO and LOOP until the condition is fulfilled.
Format
DO UNTIL
logical expression
Statements in DO block
LOOP
Example
Description
I=25
DO UNTIL I <20
PRINT I
I=I–1
LOOP
Displays the integers from 25 to 20.
The DO UNTIL–LOOP command executes the statement between DO and
LOOP until the condition is fulfilled.
The statements in the DO block are executed repeatedly while the logical expression is false.
The GOTO command must not be used to jump into or out of a DO block. Use the
EXIT DO command to get out of a DO block.
DO WHILE–LOOP
(Command)
Action
DO WHILE–LOOP
Repeats the statements between DO and LOOP while the condition is fulfilled.
Format
DO WHILE
logical expression
Statements in DO block
LOOP
Example
Description
I=0
DO WHILE I <10
PRINT I
I=I+1
LOOP
Displays the integers from 0 to 9.
The DO WHILE–LOOP command executes the statement between DO and
LOOP while the condition is fulfilled.
The statements in the DO block are executed repeatedly while the logical expression is true.
The GOTO command must not be used to jump into or out of a DO block. Use the
EXIT DO command to get out of a DO block.
Data OUTput DOUT
(Command)
Action
Format
Example
Outputs data to a Terminal Block Unit or Parallel I/O Unit.
DOUT
output data [, [bit address] [, size]]
DOUT 123,16,8
Outputs the data 123 as eight bits from bit 16 of the Terminal Block Unit or
Parallel I/O Unit.
80
EDIT Reference
Description
DSA
(Function)
DSKF
(Function)
Action
Format
Example
Description
Action
Format
Example
Description
EDIT
(Command)
Action
Format
Example
Description
Section 4
The DOUT function outputs the data specified with the output data parameter to the output port of the Terminal Block Unit or Parallel I/O Unit.
If both Terminal Block Units and Parallel I/O Units are connected, the DOUT function does not differentiate between the two. The maximum number of output bits becomes the total number of the output bits for all units.
Specify the data output start position (0 – (max. no. of output bits –1)) with the bit
address parameter. The default value is 0.
Specify the number of data bits to define the output data with the size parameter.
The default value is 16.
Data Set Acknowledge
Reads the status of the DSA signal.
DSA
A=DSA
Assigns the status of the Terminal Block Unit or Parallel I/O Unit DSA signal to variable A.
The DSA function reads the status of the Terminal Block Unit or Parallel I/O Unit
DSA signal, and returns a value as follows:
1: DSA signal is ON.
0: DSA signal is OFF.
When multiple I/O units are used simultaneously, this function reads the DSA signal status from the unit with the lowest slot address.
DiSK Function
Determines the free space remaining in the memory card.
DSKF
(drive)
J=DSKF(”C:”)
Determines the free space remaining in the memory card.
Determines the number of free bytes remaining in the disk specified by the drive parameter.
The memory card interface is Drive C.
EDIT
Selects the mode to edit lines of the program.
EDIT
line number or .
EDIT 100
Displays line#1000 and selects the Edit mode.
Displays the line with the specified line number and selects the Edit mode.
In the Edit mode, the lines are edited with the ROLL-UP, ROLL-DOWN, and other Keys. Use a period (.) to specify the current program line.
The current line is indicated by the pointer. The current line is the last line input during program creation or the last line displayed with the LIST command.
81
END Reference
ELLIPSE
(Command)
Action
Format
Example
Description
END
(Command)
Action
Format
Example
Description
Section 4
ELLIPSE
Draws an ellipse in VRAM.
ELLIPSE
X, Y, XR, YR, VRAM [, [page#], [drawing density or drawing mode]
[, lineart]]
ELLIPSE 128,255,90,35,2,,128,0
Draws a filled ellipse on Plane 7 of the window memory with center coordinates
(128,255), horizontal axis (9), and vertical axis (35).
The ELLIPSE command draws an ellipse around the center coordinates (X,Y) with the specified horizontal axis (XR), and vertical axis (YR).
Specify the VRAM where the ellipse is drawn with a number, as follows:
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
Specify the drawing method with the drawing density or the drawing mode. The default value is drawing mode, OR.
The drawing density parameter specifies the density between 0 and 255 when drawing to the window, image, or shading memory. The default value is 255. The
drawing density parameter has the following effect when set for the character or graphic memory:
0 : 0 written to memory
!0: 1 written to memory
The drawing mode settings operate as follows:
OR: The current contents of the image memory ORed with 255 are written to memory.
NOT: 0 is written to memory
XOR: The current contents of the image memory are inverted.
The default value for the drawing mode is OR.
Specify with the lineart parameter if the ellipse is an outline only or filled.
0: Filled ellipse
1: Ellipse outline only
The default value is 0 (filled).
When writing to a frame memory, the contents of planes write protected with the
MASKBIT command remain unchanged.
END
Stops program execution.
END
IF A$=”FINISH” THEN END
Stops program execution if A$ contains the character string “FINISH”.
Stops program execution.
All files opened during program execution are closed when the END command is executed. Even if no END command is executed, all files are closed and program execution stops when the last line of the program has been executed.
82
ERASE . . . . Reference
ENHANCE
(Command)
Action
Format
Example
EOF
(Function)
ERASE
(Command)
Description
Action
Format
Example
Description
Action
Format
Example
Description
Section 4
ENHANCE
Creates LUT data for contrast modification from histogram array data.
ENHANCE
array name, modification array name
ENHANCE A,E
Converts the histogram data in array A to contrast-modified histogram data and stores it in array E.
The ENHANCE command creates the original contrast-modified histogram from the histogram data obtained with the HISTGRAM command. This contrast-modified histogram is set into a LUT (look-up table) for binary conversion with the
SETLUT command. After the camera image is selected with the FILTERIN command and the image is input to the video memory with the VIDEOIN command, the contrast of the image input from the camera is improved before the image is input to the image memory.
Use the the array name parameter to specify the name of the array containing the histogram obtained with the HISTGRAM command.
Specify the name of the array to store the converted data with the modification
array name parameter.
The array to store the modified data must contain at least 256 elements.
End Of File
Determines if the file is at the end of the file.
EOF
(file#)
IF EOF(2) THEN CLOSE #2
Closes file #2 during I/O execution if the EOF (end of file) is detected in file #2.
The EOF function can be used for sequential access files and communication ports. Sequential access files on the memory card must be opened in the INPUT mode.
The EOF function returns –1 (true) if no readable data remains in the file or 0
(false) if readable data remains in the file.
Specify the number of the file opened with the OPEN command with the file# parameter.
ERASE
Deletes an array defined with the DIM command.
ERASE
array name [, array name...]
ERASE X,Y1$
Deletes arrays X and Y1$.
The DIM command deletes the array with the name specified by the array name parameter. The amount of memory equivalent to the size of the file is then available to store variables.
After an array is deleted, another array with the same name can be created. This allows the size of an array to be changed.
A Duplicate Definition error occurs if an array with the same name as an existing array is created without first deleting the original array with the ERASE command.
83
ERROR . . . Reference
ERL
(Function)
Action
Format
Example
ERR
(Function)
Action
Format
Example
ERRMSG
(Command)
ERROR
(Command)
Description
Description
Action
Format
Example
Description
Action
Format
Example
Section 4
ERror Line
Determines the line number where an error occurred.
ERL
L%=ERL
Assigns the line number where the error occurred to the variable L%.
The ERL function returns the line number where an error occurred.
The ERL function is normally used inside an error processing routine in combination with program flow control statements. It is used for flow control in error recovery processing and for recovery after the error is reset.
ERRor code
Determines the error code after an error occurs.
ERR
C%=ERR
Assigns the error code to the variable C%.
The ERR function returns the error code.
The ERR function is normally used inside an error processing routine in combination with program flow control statements. It is used for flow control in error recovery processing and for recovery after the error is reset.
ERRor MeSsaGe
Defines the operation when an error occurs.
ERRMSG
[message] [, [buzzer] [, error signal control]]
ERRMSG ,1
The buzzer sounds and an error message is displayed when error occurs.
The ERRMSG command defines the message format, buzzer alarm, and error signal control method when an error occurs.
Set the message parameter to 0 to specify a Japanese error message or to 1 to specify an English error message.
Set the buzzer parameter to 0 to stop buzzer operation when an error occurs.
Set the buzzer parameter to 1 to sound the buzzer when an error message is displayed.
If the error signal control parameter is set to 0, the error signal does not turn on when an error occurs. Set the error signal control parameter to 1, to turn the error signal on when an error occurs.
The previous setting remains unchanged if the buzzer or error signal control parameter is omitted.
ERROR
Generates a pseudo-error.
ERROR
(numeric expression)
ERROR 2
Generates error code 2: Syntax error.
84
EVENTIN . Reference
Description
ERROUT
(Command)
Action
Format
Example
Description
EVENTIN
(Command)
Action
Section 4
The ERROR command generates the error specified with the numeric expression. When an error is generated which corresponds to a predefined system error code, program execution is interrupted and the appropriate error message is displayed.
Specify the numeric expression as an integer between 0 and 255. This range of integers includes the system error codes.
Refer to the Error Message Table on page 213 for details of the error codes.
ERRor OUT
Controls the error output.
ERROUT
0 or 1
ERROUT 1
Turns ON the power supply unit ERROR signal.
The ERROUT command controls the ON/OFF status of the power supply unit
ERROR signal. Set to 0 to turn the ERROR signal OFF or set to 1 to turn the signal ON.
EVENT IN
Format
Example
Description
Sets the image input mode for input to the image memory due to event synchronization.
EVENTIN
[input mode [, [page#] [, input path]]]
EVENTIN 2
The image is input to page 0 of the image memory when the STEP signal is input.
The EVENTIN command sets the mode to input the image to the input memory in synchronization with the STEP signal or MEASURE command.
Set the input method parameter to one of the following values to specify the image input method.
0: No image input
1: Input image synchronized with MEASURE command execution.
2: Image input synchronized with the STEP signal.
The default value is 0.
Omit the page# or set to 0.
Inputting the image to the image memory in synchronization with the MEASURE command allows comparatively high-speed measurements.
The image can be successfully input to the image memory with the strobe by synchronizing the image input with the STEP signal in combination with the
FLASH command.
The input path parameter specifies the bus to input the image. The default value is 0.
0: Image bus 1
1: Image bus 0
The EVENTIN command must be executed each time before executing the
MEASURE command or the STEP signal is input.
85
EXIT DEF/DO/FOR/SUB Reference
The read timing for each input mode is shown below.
Input Mode 1:
1 field
(1/60 s)
Section 4
Measure
Image input interval
Input Mode 2:
1 field
(1/60 s)
STEP signal
Image input interval
EXIT DEF/DO/FOR/SUB
(Command)
Action
Exits a control block.
Format
Example
Description
EXIT DEF/DO/FOR/SUB
Format 1:
EXIT DEF
Format 2:
EXIT DO
Format 3:
EXIT FOR
Format 4:
EXIT SUB
FOR I=0 TO A
.
IF I>MAX THEN
PRINT ”ERROR”
.
.
END IF
EXIT FOR
NEXT
Operation leaves the FOR–NEXT control loop if the value of variable I exceeds the value of the variable MAX.
Format 1: Exits a user function.
Format 2: Exits a DO-LOOP loop.
Format 3: Exits a FOR-NEXT loop.
Format 4: Exits a structural subroutine.
86
FIELD # . . Reference
EXP
(Function)
Action
Format
Example
Description
FIELD #
(Command)
Action
Format
Example
Section 4
EXPonential
Determines the value of the natural number e raised to an exponential power.
EXP
(numeric expression)
A!=EXP(2)
Assigns the value of e raised to the power of 2 (e
2
) to the variable A!.
The EXP function returns the value of e (
≠
2.71828) raised to the specified power.
The numeric expression may be in the form of an integer, long integer, or a single or double-precision real number.
The LOG function has the opposite action to the EXP function. The EXP function can be used to create other mathematical functions, such as the hyperbolic sine function (sinhX).
FIELD
Allocates the variable areas to the file buffer of the random access file.
FIELD
file#, field length, AS character variable [, field length, AS character
variable...]
FIELD #1,30 AS NAME$,4 AS AGE$,6 AS SEX$
Allocate 30 bytes for the NAME$ variable, 4 bytes for the AGE$ variable, and 6 bytes for the SEX$ variable in the input buffer of the random access file opened as #1.
NAME$ AGE$ SEX$
30
Description
4 6 216
Units: bytes
256
To use a file buffer as the input buffer for a random access file, the areas to store character data (variable areas) must be allocated in the file buffer.
Specify the file# as the number in which the file was opened with the OPEN statement.
Specify the length allocated for the character variable with the field length parameter as a positive integer between 1 and 255.
Multiple character variables can be allocated. However, the total of the field lengths specified for all variables must not exceed 256 bytes. The total of the field lengths specified with a FIELD# command must equal the length of one record for random access file I/O.
The FIELD# command is used only to define the character variable names and variable areas in the file buffer. The LSET and RSET commands are used to to set data in the allocated variable areas. The GET# and PUT# statements are used for data random access file I/O. It is not possible to assign data to the character variables defined with the FIELD# command with any commands except LSET and RSET. Multiple FIELD# commands can be executed to allocate different character variables to a single file buffer.
87
FILTER . . . Reference
FILES
(Command)
Action
Format
Example
Description
Section 4
FILES
Displays the memory card file directory, showing the file names, sizes, and creation dates.
FILES
(drive name)
FILES
Displays the file directory for the memory card (drive C).
The FILES command displays the file directory for the specified drive name, showing the file names, sizes, and creation dates.
The default drive name is drive C.
The initial file creation date is 00/00/00 on 80/01/01 when the power supply is turned on. Use the DATE$ function to apply the correct creation date to the file.
FILTer DATA FILTDATA
(Command)
Action
Format
Example
Description
Specifies the line filter factors.
FILTDATA
data 0, data 1, ... , data 8 [, global factor]
FILTDATA –8,1,1,1,1,1,1,1,1,4
Sets the line filter to a negative Laplacian result divided by 4.
The FILTERDATA command sets the line filter factors. It is used with the FILTER command to set the image filtering. Line filter must be selected with the FILTER function to enable the filter specified with the FILTDATA command.
The factors are specified with the parameters data 0 to data 8. The positional relationship of these pixels is shown in the diagram below.
Data 1 Data 2 Data 3
Data 4 Data 0 Data 5
Data 6 Data 7 Data 8
The nine parameters from data 0 to data 8 can be set to the values 0, +1, +2, +4.
However, data 0 can also be set to +8.
A filter result of 256 or higher is rounded to 255 while negative values are rounded to 0. In cases where it is desirable to restrict filtering results to 255, the filtering results can be divided by the global constant.
The global constant parameter can be set to 0, 1, 2, 4, 8, or 16. The output becomes 0 if the global constant is set to 0. The default value is 1.
FILTER FILTER
(Command)
Action
Format
Example
Sets the image filtering function and LUT function.
FILTER
function [, [LUT function,] [, [bias] [, peripheral pixels]]]
FILTER 2,1
Sets the sharpened image and LUT function.
88
FIND . . . . . Reference
Description
FILTERIN
(Command)
FIND
(Command)
Action
Format
Example
Description
Action
Format
Example
Section 4
The FILTER command sets the image filtering function for the camera image and frame memory image.
Set the function parameter to a number corresponding to one of the following filtering methods:
0: raw image
1: shading mask image
2: sharpened image
3: shading compensation image
4: sobel image
5: line filter image
6: (not used)
7: compound edge image
Set LUT function to 1 to enable the LUT function. The default value is 0.
The peripheral pixels parameter defines the output density (as 0 or 255) of the
2-pixel unstable border which arises due to filtering. The previous setting remains unchanged if the set values is not 0 or 255 or if the parameter is omitted.
The specified bias value is added to the image density after filtering. Specify a value between –128 and 127.
FILTER IN
Selects the input path of the image to be displayed and measured.
FILTERIN
path [, page#]
FILTERIN 1
The image memory contents are output to image bus#1.
The FILTERIN command selects the camera image or an image from image memory as the image to be displayed and measured. This image is subjected to the selected filtering function.
Set the path parameter to 0 to select the camera image or 1 to select the image from the image memory. The image selected by the path parameter is output to image bus#1 and is also subjected to filtering before being output to image bus#0.
Omit the page# or set to 0.
FIND
Searches for a specified character string and displays the line containing the character string.
Format 1:
FIND
search character string [, line# 1] [– [line# 2]] [, A]
Format 2:
FIND
FIND ”WHILE”
Displays the first line in the text program containing “WHILE”.
FIND ”WHILE”, 100–200,A
Displays the all lines between line 100 and line 200 in the text program containing “WHILE”.
FIND
Continue the previous find operation.
89
FLASH . . . Reference
Description
FIX
(Function)
FLASH
(Command)
Action
Format
Example
Description
Action
Format
Example
Description
Section 4
The FIND command searches for the specified search character string between
line#1 and line#2 and displays the line containing the character string. If more than one line contains the specified search character string, the first line found is displayed.
Input the FIND command with no parameters to continue a previous find operation.
If the A option is specified, each line containing the specified search character
string is displayed.
FIX
Rounds down a value to an integer.
FIX
(numeric expression)
A=FIX(–3.3)
Rounds down the value of the numeric expression –3.3 to an integer (–3) and assigns it to the integer variable A.
The FIX function rounds down the specified numeric expression and returns an integer.
The INT and CINT functions are similar to the FIX function. Like the FIX function
,the INT function also rounds down the specified value, but the INT function never returns a value larger than the value specified with the numeric expres-
sion. The CINT function rounds off the decimal places of the specified numeric
expression (i.e., up or down to the nearest integer) and returns an integer.
Examples of the actions of the FIX, INT, and CINT function are shown in the table below.
Expression
Positive numeric expression
Specified function
FIX (1.7)
INT (1.7)
CINT (1.7)
Negative numeric expression FIX (–1.7)
INT (–1.7)
CINT (–1.7)
1
1
2
–1
–2
–2
Returned value
FLASH
Flashes the strobe and simultaneously reads the image to the Camera I/F Unit internal memory.
FLASH
mode [, period]
FLASH 2
The strobe flash and image input to the Camera I/F Unit internal memory are synchronized to the STEP input.
The FLASH command flashes the strobe and inputs the image to the Camera I/F
Unit internal memory.
Set the mode parameter to one of the following values:
0: Stop
1: Operation on FLASH command only
2: Operation synchronized to STEP input
3: Operation each specified period
90
GATE . . . . . Reference
Section 4
The period parameter setting is only valid when mode 3 (operation each specified period) is selected. The period is specified as a number of fields between 0 and 65535 fields. The default value is 2 fields (1 frame). Operation stops if a period of 0 is specified.
FOR..TO..STEP–NEXT
(Command)
Action
FOR..TO..STEP–NEXT
Repeats the commands between the FOR and NEXT statements.
Format
Example
FOR
numeric variable = initial value
TO
final value [
STEP
increment] to
NEXT
[numeric variable [, numeric variable ... ]]
100 FOR I=1 TO 10
FRE
(Function)
GATE
(Command)
Description
Action
Format
Example
Description
Action
Format
Example
200 NEXT I
Repeats the statements between line 100 and line 200 ten times.
The FOR–NEXT loop is formed by a series of statements starting with the FOR statement and ending with the NEXT statement. The series of statements inside the FOR–NEXT loop is executed the specified number of times. Normally, each
FOR statement has a corresponding NEXT statement.
The specified numeric variable counts the number of times the FOR–NEXT loop is executed. Consequently, the same numeric variable name must be specified for both the FOR and NEXT statements.
The units to calculate the loop execution can be specified with STEP and an
increment parameter. Both STEP and the increment parameter can be omitted.
The default value of the increment is +1. Each time the FOR–NEXT loop is executed, the increment is added to the current value of the numeric variable
(starting from the initial value the first time the loop is executed) then assigned to the numeric variable again.
FREe memory
Determines the amount of free space in each control area.
FRE
(function)
PRINT FRE(2)
Prints the free memory size of each program area.
The FRE function determines the free memory area in bytes of the control area specified with the function parameter.
Specify the function parameter as a value between 0 and 3, as follows:
0: Determines the free area in variable table region.
1: Determines the free area in character-string array region.
2: Determines the free area in program region.
3: Determines the total free area for functions 0 to 2.
GATE
Controls the GATE signal.
GATE
0 or 1
GATE 1
Turns on all GATE signals for the Terminal Block Units and Parallel I/O Units.
91
GCOPY2 . . Reference
Description
GCOPY
(Command)
Action
Format
Example
Description
GCOPY2
(Command)
Action
Format
Example
Description
Section 4
The GATE command controls the GATE signal ON/OFF status of the Terminal
Block Units and Parallel I/O Units.
Set to 0 to turn the signal OFF or to 1 to turn the signal ON.
When multiple units are connected, the GATE signals are controlled simultaneously for all units.
Gray COPY
Copies the raw image in VRAM.
GCOPY
VRAM1, [page# 1], VRAM2, [page# 2] [, [X1] [, [Y1] [, [X2] [, [Y2] [, [X] [,
[Y]]]]]]]
GCOPY 2,0,3,0
Copies the entire contents of the window memory to the image memory.
The GCOPY command copies the raw image in VRAM.
Specify the copy source and destination VRAMs (VRAM1 and VRAM2). A plane
VRAM cannot be specified. Use the numbers as follows:
2: Window memory
3: Image memory
4: Shading memory
Omit page# 1 and page# 2 or set to 0.
To limit the rectangular region to be copied, specify the top-left coordinates of the rectangle as X1, Y1 and the bottom-right coordinates as X2, Y2. The default values for X1, Y1 are 0, 0 and the default values for X2, Y2 are 511, 511. Specify the top-left coordinates of the copy destination rectangle as X, Y. The default values for X, Y are 0, 0.
The contents of planes write protected with the MASKBIT command remain unchanged.
Gray COPY
Makes enlarged and reduced copies of raw images in VRAM.
GCOPY2
VRAM1, [page# 1], VRAM2, [page# 2] [, [XS1] [, [YS1] [, [XS2] [,
[YS2] [, [XD1] [, [YD1] [, [XD2] [, [YD2]]]]]]]]]
GCOPY2 3,,4,,200,200,300,300
Makes an enlarged copy of the image contained in the image memory rectangle with coordinates (200, 200), (300, 300) to the entire shading memory.
The GCOPY2 command makes enlarged or reduced copies of the raw image in
VRAM.
Specify the copy source and destination VRAMs (VRAM1 and VRAM2). A plane
VRAM cannot be specified. Use the numbers as follows:
2: Window memory
3: Image memory
4: Shading memory
Omit page# 1 and page# 2 or set to 0.
Specify the top-left coordinates of the copy source rectangular region as XS1,
YS1 and the bottom-right coordinates as XS2, YS2. The default values for XS1,
YS1 are 0, 0 and the default values for XS2, YS2 are 511, 511.
92
GET@ . . . . Reference
GET #
(Command)
GET@
(Command)
Action
Format
Example
Description
Action
Format
Example
Description
Section 4
Specify the top-left coordinates of the copy destination rectangular region as
XD1, YD1 and the bottom-right coordinates as XD2, YD2. The default values for
XD1, YD1 are 0, 0 and the default values for XD2, YD2 are 511, 511.
The contents of planes write protected with the MASKBIT command remain unchanged.
GET #
Reads data from a random file to the file buffer.
GET#
file# [, numeric expression]
GET #1,8
Reads the #8 record from the random access file opened as file #1 to the file buffer.
The GET# command reads data from the random access file specified with the file# to the file buffer.
Specify the file# as the number in which the random access file was opened with the OPEN statement. After using a random access file, it must be closed with the
CLOSE statement.
Specify the number of the record to be read with the numeric expression. If omitted, the record after the record# used with the previous GET# or PUT# command is read.
The data in the file buffer is assigned to the character variables allocated to variable areas with the FIELD# command. The character variables are then transferred to the program.
GET@
Reads image data from a VRAM to an array variable.
GET@
X1, Y1, X2, Y2, array name, VRAM [, [page#] [, plane#]]
GET@ 20,20,200,200,DATA1% 3,,2
Reads image data from the rectangular region of image memory, plane# 2, bounded by the corner coordinates (20, 20), (200, 200) to the array variable
DATA1%.
The GET@ command reads image data from the rectangular region defined by the corner coordinates (X1, Y1), (X2, Y2) to the array variable with the name indicated by the array name.
Specify the VRAM where the data is stored with a number, as follows:
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
A frame type memory is specified as the VRAM along with a plane# to store the data in the plane as binary data. The data is stored as raw image data if the
plane# is omitted.
If a plane memory is specified, the number of binary image pixels equals the number of bits in a single data array and the number of bytes in the array to store the data is given by the following equation:
((horiz. pixels + 7) ¥ 8) * vert. pixels + 4
93
GETDLUT . Reference
GETBLUT
(Command)
Action
Format
Example
Description
GETDLUT
(Command)
Action
Format
Example
Description
Section 4
If the array is D%, for example, the qualifier is calculated as follows:
Number bytes required ¥ 2 + 1
This applies when the qualifier minimum value is set to 0 with the OPTION BASE command.
If a frame memory is specified, the number of raw image pixels equals the number of bytes in a single data array and the number of bytes in the array to store the data is given by the following equation: horiz. pixels
*
vert. pixels + 4
If the array is D%, for example, the number of dimensions is calculated as follows:
Number bytes required ¥ 2 + 1
This applies when the qualifier minimum value is set to 0 with the OPTION BASE command.
The final 4 bytes in the equation above represents the 4 bytes at the start of array where the array width and height are stored, as follows:
D% (0) = horizontal pixels (2 bytes)
D% (1) = vertical pixels (2 bytes)
D% (2) = 1st pixels
D% (3) = 2nd pixels
GET Binary LUT
Reads the contents of the present binary-coded LUT value as an array variable.
GETBLUT
binary image plane#, array name [, [qualifier] [, size]]
GETBLUT 4,A
Reads the binary LUT contents of binary image plane# 4 to array variable A.
The GETBLUT command reads the contents of the binary LUT specified with the
binary image plane# to the array specified with the array name.
The qualifier specifies the first element in the data array to store the data. The default value is 0.
The difference between the set qualifier value and the maximum qualifier value for the array must exceed the number of bytes set with the size parameter. When the binary LUT data is written to the array variable, either 256 or 512 elements are written from the start element specified by the qualifier. Other parts of the array remain unchanged.
GET Display LUT
Reads the current display LUT data to an array variable.
GETDLUT
region, array name [, [qualifier]
GETDLUT 1,A
Reads the display LUT data from inside the window to array variable A.
The GETDLUT command reads the current display LUT data to the array specified with the array name.
Individual display LUTs are available for inside and outside the window. Specify which LUT is required with the region parameter. Set region to 0 to read the LUT data from outside the window or 1 to read the data from inside the window.
The qualifier specifies the first element in the data array to store the LUT data.
The default value is 0.
94
GOSUB . . . Reference
GETDLVL
(Command)
Action
Format
Example
GETLUT
(Command)
GOSUB
(Command)
Description
Action
Format
Example
Description
Action
Format
Example
Description
Section 4
GET Display LeVeL
Determines the display level of the image.
GETDLVL
(image type)
GETDLVL(3)
Determines the displayed brightness of white in the binary image.
The GETDLVL function determines the displayed brightness of the image specified by the image type parameter, as follows:
0: Character memory
1: Graphic memory
2: Mask image
3: Binary image, white
4: Binary image, black
5: Window memory increments
6: Paint/pattern matching window memory increments
GET LUT
Reads the current filtering LUT data to an array variable.
GETLUT
array name [, [qualifier] [, size]]
GETLUT A
Reads the filtering LUT data to array variable A.
The GETLUT command reads the current filtering LUT data to the array specified with the array name.
The qualifier specifies the first element in the data array to store the LUT data.
The default value is 0.
The size parameter specifies the number of data bytes to be stored. Set the size to 0 to store 256 bytes or to any other value to store 512 bytes. The default value is 0.
The difference between the set qualifier value and the maximum qualifier value for the array must exceed the number of bytes set with the size parameter. When the filtering LUT data is written to the array variable, either 256 or 512 elements are written from the start element specified by the qualifier. Other parts of the array remain unchanged.
GOSUB
Branches to a specified subroutine.
GOSUB
line# or label
GOSUB
*
START
Branches to the subroutine starting from the line labelled
*
START.
The GOSUB command branches control to the subroutine starting with the specified line number or label. Control returns to the GOSUB statement position when the RETURN statement at the end of the subroutine is executed.
Specify the first line of the subroutine with the line# or label name as the GOSUB command parameter.
95
HELP ON/OFF/STOP . . . Reference
Section 4
When subroutines are nested, GOSUB and RETURN statements must always be used in pairs.
GO TO GOTO
(Command)
Action
Format
Example
Description
Unconditionally jumps to a specified line.
FORMAT1:
GO TO
line# or label
FORMAT2:
GOTO
line# or label
GOTO
*
START
Program operation jumps to the line labelled
*
START.
The GOTO command unconditionally jumps control to the line with the specified line number or label.
The action of the GOTO and GO TO statements is identical.
HELP
(Command)
Action
Format
Example
Description
HELP
Displays help messages.
HELP
[”command or function name”]
HELP ”A
*
”
Displays help messages for the commands and functions beginning with “A”.
The HELP command displays help messages for the commands and functions specified with the command name parameter.
The wildcard characters (?, * ) can be used in the command name.
A list of command and function names is displayed if the command name parameter is omitted. No message is displayed if an unregistered command or function name is specified with the command name.
HELP ON/OFF/STOP
(Command)
Action
HELP key ON/OFF/STOP
Disables, enables, or stops interrupts from the HELP Key.
Format
Example
HELP ON
or
OFF
or
STOP
HELP ON
Operation branches to an interrupt processing routine when the HELP Key is pressed.
96
HISTGRAM . . . . . Reference
Description
HELP ON:
HELP OFF:
HELP STOP:
Section 4
The HELP command controls branching to an interrupt processing routine when the HELP Key is pressed.
The HELP ON statement enables the interrupt processing routine when the
HELP Key is pressed. When the HELP Key is pressed, operation branches to the interrupt processing routine at the line# or label defined with the ON HELP
GOSUB statement.
The HELP OFF statement disables the interrupt processing routine when the
HELP Key is pressed. When the HELP Key is pressed, operation does not branch to an interrupt processing routine.
The HELP STOP statement stops interrupt processing when the HELP Key is pressed. When the HELP Key is pressed, operation does not immediately branch to the interrupt processing routine. However, immediately branching is enabled by the HELP ON statement, operation branches to the interrupt processing routine at the line# or label defined with the ON HELP GOSUB statement.
HEX$ HEX$
(Function)
Action
Format
Example
Description
Converts a numeric expression to a hexadecimal character string.
HEX$
(numeric expression)
A$=”&H”+HEX$(100)
Converts the decimal value 100 to a hexadecimal character string, concatenates this character string with the character string “ &H”, and assigns the result to the character variable A$. This equation is identical to A$ = ” &H64”.
The HEX$ function converts a decimal value to a hexadecimal character string.
It does not add the “ &H” prefix to indicate a hexadecimal character string.
Specify the numeric expression as a decimal numeric constant or numeric variable between –2147483648 (–2
31
) and 2147483647 (2
31
–1). Any decimal places in the specified numeric expression are rounded off to create an integer which is converted to the hexadecimal character string.
The relationship between the decimal numeric expression and hexadecimal character string is as follows:
Numeric expression (decimal)
–2147483648 to –1
0 to 2147483647
Hexadecimal character string
“80000000” to “FFFFFFFF”
“0” to “7FFFFFFF”
To convert a hexadecimal character string back to numeric data, append the “
&H” prefix to indicate a hexadecimal character string, then convert the character string with the VAL function.
HISToGRAM HISTGRAM
(Command)
Action
Format
Example
Description
Reads the density histogram from the image memory.
HISTGRAM
[page#], X1, Y1, X2, Y2, array name [, qualifier]
HISTGRAM ,0,0,100,100,H
Stores the density histogram contained in the image memory rectangle with corner coordinates (0, 0), (100, 100) to array name H.
The HISTGRAM command reads the density histogram from the image in the image memory.
Omit the page# or set to 0.
97
IF..THEN–ELSE . . Reference
Section 4
The density histogram is read from the rectangular region with the specified corner coordinates X1, Y1 and X2, Y2.
Specify the name of the array to store the density histogram with the array name parameter.
The qualifier specifies the first element in the data array to store the density histogram. The default value is 0.
The array must have at least 256 elements between the specified qualifier value and the maximum qualifier value.
IF..GOTO–ELSE
(Command)
Action
IF..GOTO–ELSE
Controls the program flow with a specified condition.
Format
Example
Description
IF
conditional expression
GOTO
line # or label
ELSE
statement or line # or
label
IF A=1 GOTO 100 ELSE 200
Branches to line 100 if variable A equals 1 and branches to line 200 if variable A is not equal to 1.
The IF ... GOTO–ELSE command control the program flow with the specified
conditional expression.
If the conditional expression is true (not 0), program operation jumps to the line# or label specified after GOTO. The statement, line# or label specified after ELSE is ignored.
If the conditional expression is false (0), program operation jumps to the line# or label specified after ELSE or executes the statement specified after ELSE. The line# or label specified after GOTO is ignored.
The ELSE statement can be omitted.
IF..THEN–ELSE
(Command)
Action
IF..THEN–ELSE
Controls the program flow with a specified condition.
Format
Example
Description
IF
conditional expression
THEN
statement or line # or label
ELSE
state-
ment or line # or label
IF A$=”y”THEN GOSUB
*
START ELSE B=B+1
Branches to the subroutine labelled * START if variable A$ equals “ y”, otherwise increments variable B by 1.
The IF ... THEN–ELSE command control the program flow with the specified
conditional expression.
If the conditional expression is true (not 0), program operation jumps to the line# or label specified after THEN or executes the statement specified after THEN.
The statement, line# or label specified after ELSE is ignored.
If the conditional expression is false (0), program operation jumps to the line# or label specified after ELSE or executes the statement specified after ELSE. The
statement, line# or label specified after THEN is ignored.
The ELSE statement can be omitted.
98
IMGLOAD . Reference
IF..THEN–ELSEIF–ELSE–END IF
(Command)
Action
Evaluates specified conditions.
Format
IF
conditional expression
THEN
Statement in THEN block
ELSEIF
conditional expression
THEN
Statement in ELSE IF block
Example
Description
IMGLOAD
(Command)
Action
Format
Example
Description
Section 4
[
ELSE
Statement in ELSE block]
END IF
IF ERR=0 THEN
PRINT ”NORMAL”
ELSEIF ERR=2 THEN
PRINT ”SYNTAX ERROR”
ELSEIF ERR=13 THEN
PRINT ”TYPE MISMATCH”
ELSE
END IF
PRINT ”OTHER ERROR”
Defines different actions when the variable ERR equals 0, 2, 13, or some other value.
The IF ... THEN–ELSEIF–ELSE–END IF commands evaluate specified condi-
tional expressions.
Executes the subsequent Statement in THEN block if the specified conditional
expression is true (not 0). Jumps to the next ELSE IF, ELSE, or END statement if the conditional expression is false (0).
Multiple ELSE IF statements may be used or they may be omitted.
The ELSE statement may be omitted.
The END IF statement is required. It cannot be omitted.
The GOTO command must not be used to jump into or out of a IF ... THEN–EL-
SEIF–ELSE–END IF statement block.
IMaGe LOAD
Loads image data to VRAM.
IMGLOAD
file name, X, Y, VRAM, [, [page#] [, plane#]]
IMGLOAD ”IMG1”,0,0,2,,5
Writes the file IMG1 from the memory card to the rectangular region with top-left coordinates (0, 0) in window memory plane 5.
The IMGLOAD command loads image data saved with the IMGSAVE command to VRAM.
Specify the image data with the file name parameter.
The data is saved to rectangular region. Specify the top-left coordinates of this rectangular region with the X, Y parameters.
99
INKEY$ . . . Reference
IMGSAVE
(Command)
Action
Format
Example
Description
INKEY$
(Function)
Action
Format
Example
Section 4
Specify the VRAM where the data is loaded with a number, as follows:
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
Specify the plane# when loading binary image data to a frame VRAM. An error occurs if an attempt is made to write raw image data to a plane VRAM. If image data is written to a frame VRAM, it cannot be loaded to planes write protected with the MASKBIT command.
IMaGe SAVE
Saves image data from VRAM.
IMGSAVE
file name X1, Y1, X2, Y2, VRAM, [, [page#] [, plane#]] [, compres-
sion function]]]
IMGSAVE ”IMG1”,10,10,100,100,2,,3
Saves the rectangular region with corner coordinates (10, 10), (100, 100) from the window memory plane 3 to the file IMG1 in the memory card with no compression.
The IMGSAVE command saves image data from VRAM.
The contents of the image memory are saved to a file in the memory card with the specified file name. Only the image inside the rectangular region with corner coordinates (X1, Y1), (X2, Y2) is saved.
Specify the VRAM from which the data is saved with a number, as follows:
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
Specify the plane# when saving binary image data or window data from a single plane of a frame VRAM. The data is treated as raw image data if the plane# is omitted.
Specify the compression function, as follows:
0: When saving binary image data (No compression)
1: When saving binary data (Compression using run-length method)
2: When saving shading data and raw image data (High compression)
The default value is 0. When the value 2 is specified, the rectangular region must be set to (0,0), (511,511).
INput KEY$
Determines the character input from the keyboard.
INKEY$
A$=INKEY$
Assigns the key character of the key pressed on the keyboard to variable A$.
100
INPUT# . . . Reference
Section 4
Description
The INKEY$ function returns the key character of the key pressed when the function is executed. The function returns a null string (” ”) if no key is pressed
(that is, the keyboard buffer is empty). Refer to the Note below.
Data input with the INKEY$ function is not displayed on the screen. Unlike other input commands, operation does not wait for a key to be pressed after the function is executed.
Note Information on the pressed keys is stored in the keyboard buffer even if no key input statement is executed. If data remains in the keyboard buffer when the INKEY$ function is executed, the function returns the first key character from the keyboard buffer, regardless of the key pressed at that time.
INPUT INPUT
(Command)
Action
Format
Example
Description
Assigns data input from the keyboard to a variable.
INPUT
[prompt character string{ , or ;}] variable [, variable...]
INPUT ”NAME”;B$
Displays “NAME” on the screen and waits for keyboard input of the character data to be assigned to the character variable B$.
Operation waits for data input from the keyboard when the INPUT command is executed. Enter data delimited by commas (,) for the specified number of variables and press the Return Key to assign the data to the variables.
Specify a character string for the prompt character string. This character string is displayed to prompt for input of the required data.
The prompt character string must be separated from the subsequent variable by a comma (,) or semicolon (;). The specified prompt character string only is displayed if a comma is used. The specified prompt character string followed by a question mark (?) and a single space is displayed if a semicolon is used. If no specified prompt character string is specified, a question mark (?) and a single space are displayed.
Multiple variables can be specified delimited by commas (,). The variables can be either numeric or character variables.
If the Return Key is pressed without entering values, zero (0) is assigned to numeric variables and a null string (” ”) is assigned to character variables.
INPUT#
(Command)
Action
Format
Example
INPUT#
Description
Reads data from a sequential access file and assigns it to variables.
INPUT #
file#, variable [, variable...]
INPUT #1,A$,B,C
Reads three data items (character, numeric, numeric) sequentially from file #1 and assigns the data to variable A$ (character variable), B (numeric variable), and C (numeric variable).
Specify the file# as the number in which the random access file was opened with the OPEN statement.
The variables can be specified either as numeric or character variables. The specified variable format must match the corresponding data format.
The data is read from the file as numeric or character variables, complying with the rules governing these data types. Unlike the INPUT command, the INPUT# command displays no prompt message or question mark (?).
101
INPUT WAIT . . . . Reference
Section 4
Numeric Variables: Leading spaces are ignored and the data is read in from the first non-blank character. The data up to the next blank, comma (,), or linefeed character (&HA) is assigned to the numeric variable.
Character Variables:Leading spaces are ignored and the data is read in from the first non-blank character. The data up to the next blank, comma (,), or linefeed character (&HA) is assigned to the character variable.
If the first character is a double-quotation mark (”), subsequent data is considered to be contained in double-quotation marks (”) and all characters and blanks up to the next double-quotation mark (”) are assigned to the character variable. Therefore, a comma (,) or linefeed character (&HA) must be enclosed in double-quotation marks (”) to be assigned to a variable.
INPUT$
(Function)
Action
INPUT$
Format
Example
Description
Reads a specified length of data from a sequential access file, the RS-232C port, or the keyboard.
INPUT$
(character string length [, file#])
A$=INPUT$(5,#3)
Reads 5 characters from file #3 and assigns them to variable A$.
Specify the file# to read the data from with the file# parameter.
Data is read from the keyboard if the file# parameter is omitted. Unlike data input with the INPUT or LINE INPUT command, data input from the keyboard using the INPUT$ function is not displayed on the screen.
Specify the character string length as a positive integer value. The program operation waits for input of the specified number of characters.
If the length of the data input from the RS-232C port exceeds the number of characters specified with the character string length, the remaining data is read to the next INPUT$ function.
INPUT WAIT
(Command)
Action
Format
INPUT WAIT
Example
Description
Inputs data from the keyboard with a time limitation.
INPUT WAIT
wait time, [prompt character string{ , or ;}] variable [, vari-
able..]
INPUT WAIT 150,”ANSWER”;AN$
Displays the input prompt message “ANSWER” on the screen and waits 15 seconds for keyboard input of the character data to be assigned to the character variable A$.
Operation waits for the specified wait time for data input from the keyboard when the INPUT WAIT command is executed. Enter data delimited by commas (,) for the specified number of variables and press the Return Key within the specified
wait time to assign the data to the variables.
The INPUT WAIT command is identical to the INPUT command, except for the time limit. If the Return Key is pressed without entering values for the variables, zero (0) is assigned to numeric variables and a null string (” ”) is assigned to character variables. If the time specified by wait time passes, the variables will not change.
Specify the wait time in units of 0.1 second.
102
INT . Reference
INSTR
(Function)
Action
Format
Example
INT
(Function)
Description
Action
Format
Example
Description
Section 4
IN STRing
Determines the position of the specified characters in the character string
INSTR
([start position,] character string 1, character string 2)
X=INSTR(,A$,”XYZ”)
Determines the position of character string XYZ from the start of the character string A$ and assigns the position as a number of bytes to variable X.
The INSTR function finds a specified character string 2 in a character string 1 of one-byte characters and returns the position of character string 2 in bytes from the start of character string 1.
The function returns the value 0 if the specified character string 2 does not exist in character string 1. The INSTR function still returns the number of 1-byte characters if it is used to find a character string in a string of 2-byte characters. In this case, use the KINSTR function instead.
Specify a value with the start position parameter to set the the position to start searching character string 1. Specify the value between 1 and the number of characters in character string 1. If omitted, searching starts from the beginning of the character string. The function returns the value 0 if the specified start posi-
tion is larger than the number of characters in character string 1.
Specify a character constant or a character variable for character string 1, the character string to search. The function returns the value 0 if the specified char-
acter string 1 is a null string (” ”).
Specify a character constant or a character variable for character string 2, the character string to be searched for. The function returns the specified start posi-
tion value if character string 2 is specified as a null string (” ”).
INTeger
Rounds down a value to an integer.
INT
(numeric expression)
A=INT(3.3)
Rounds down the value of the numeric expression 3.3 to an integer 3 and assigns it to the integer variable A.
The INT function rounds down the specified numeric expression and returns an integer not exceeding the value specified with the numeric expression.
The FIX and CINT functions are similar to the INT function. However, the FIX function simply cuts off (rounds down) the decimal places from the specified value. The CINT function rounds off the decimal places of the specified numeric
expression (i.e., up or down to the nearest integer) and returns an integer.
Examples of the actions of the FIX, INT, and CINT function are shown in the table below.
Expression
Positive numeric expression
Specified function
FIX (1.7)
INT (1.7)
CINT (1.7)
Negative numeric expression FIX (–1.7)
INT (–1.7)
CINT (–1.7)
1
1
2
–1
–2
–2
Returned value
103
IPL . Reference
Section 4
INTR ON/OFF/STOP
(Command)
Action
INTeRrupt ON/OFF/STOP
Disables, enables, or stops interrupts with the STEP signal.
Format
Example
Description
INTR ON
or
OFF
or
STOP
INTR ON
Enables STEP interrupts.
The INTR command control execution of the interrupt subroutine defined with the ON INTR GOSUB command when a STEP input is generated from a
Terminal Block Unit or Parallel I/O Unit. The rising edge of the STEP input signal is detected.
The INTR ON statement enables the STEP interrupt processing. When the
STEP signal is input, the interrupt routine is executed immediately.
The INTR OFF statement disables the STEP interrupt processing. The STEP input is ignored.
The INTR STOP statement stops STEP interrupt processing. An input STEP signal is stored in memory, and when STEP interrupt processing is enabled again with the INTR ON command, operation immediately branches to the
STEP interrupt processing routine. Operation jumps to the STEP interrupt processing routine only once, regardless of the number of times the STEP signal was input.
Initial Program Loading IPL
(Command)
Action
Format
Example
Description
Sets the OVL boot-up mode.
IPL
[[0 or 1 or file name], [numeric value 1], [numeric value 2], [numeric value
3], [numeric value 4], [numeric value 5]]
IPL 1
Automatic boot-up of the program in the text region when the power is turned on.
IPL ”C:FILE”
Loads and executes “C:FILE” when the power is turned on.
IPL
Displays the current OVL boot-up mode.
Set the IPL command initial parameter to 1 to automatically load and boot-up the program in the text region. Set the parameter to 0 to disable automatic boot-up.
Set a file name as the parameter to load and execute a saved file.
The numeric value 1 parameter specifies the number of files which can be open simultaneously. Set a value between 1 and 11.
The numeric value 2 parameter specifies the size of the array variable or character variable region in Kbytes. Set a value between 1 and 62 Kbyte.
The numeric value 3 parameter specifies the size of the user stack region in
Kbytes. Set a value between 1 and 2 Kbyte.
The numeric value 4 parameter specifies the size of the compile region in
Kbytes. Set a value between 2 and 8 Kbyte.
The numeric value 5 parameter specifies the number of lines displayed on the screen. Set the value to 20 or 25.
If all parameters are omitted, the current OVL boot-up mode status is displayed.
104
KEXT$ . . . . Reference
JIS$
(Function)
Action
Format
Example
Description
KACNV$
(Function)
KEXT$
(Function)
Action
Format
Example
Description
Action
Format
Example
Description
Section 4
JIS$
Determines Shift JIS code for a 2-byte character.
JIS$
(character string)
J$=JIS$ (”ABC”)
Assigns the Shift JIS code (8260) corresponding to the first character of the character string ”ABC”.
The JIS$ function returns the hexadecimal character for the first 2-byte character in the specified character string.
If the specified character string contains 1-byte characters, the code is returned for the first and second bytes of the string. An error occurs if a null string (” ”) or a string containing one byte is specified.
The KNJ$ function has the opposite function to the JIS$ function. The KNJ$ function returns the 2-byte character corresponding to the specified 4-digit hexadecimal Shift JIS code. The F300 uses the Shift JIS codes.
Kanji Ank CoNVert$
Converts 2-byte characters in a character string to 1-byte characters.
KACNV$
(character string)
C$=KACNV$(”OMRON ”)
Converts the 2-byte characters “OMRON” in the character string
”OMRON ” to the 1-byte characters
” ”
and assigns the entire character string to variable C$.
The KACNV$ function converts an alphabetic, numeric, or kana 2-byte character to a 1-byte character of identical meaning. The KACNV$ function returns a character string containing only 1-byte characters.
Specify the character string with a character constant or character variable as a character string containing alphabetic, numeric, and kana characters defined with both 1-byte and 2-byte character codes.
An error occurs if the character string contains a Kanji character or a 2-byte character for which no 1-byte character is defined.
The AKCNV$ function has the opposite action to the KACNV$ function. The
AKCNV$ function converts 1-byte alphabetic, numeric, and kana characters in a character string to equivalent 2-byte characters.
Kanji EXTract $
Extracts either 1-byte or 2-byte characters from the character string.
KEXT$
(character string, function)
K$=KEXT$
(
”OMRON ”
)
Assigns only the 1-byte characters to variable K$. In this case, K$ contains the string
” ”
.
The KEXT$ function extracts either the 1-byte or 2-byte characters from a character string containing by character types.
Specify the character string from which the characters are selected as a character constant or a character variable.
105
KEY ON/OFF/STOP . . . . . Reference
Section 4
Specify the function parameter as either 0 or 1. The meanings of these settings are described in the table.
0
1
Function Description
Extract the 1-byte characters
Extract the 2-byte characters
The KEXT$ function returns a null string (” ”) if the type of character specified with the function parameter does not exist in the character string.
KEY KEY
(Command)
Action
Format
Example
Description
Assigns any character string to the function keys.
KEY
[key#, character expression]
KEY 1,”TOTAL”
Sets the character string “TOTAL” to function key 1 and displays this character string on in the input guide.
The KEY command sets the display for the function key (F1 to F10) with the specified key# using a character string or control code.
Specify the key# parameter as a value between 1 and 10. This number corresponds to one of the functions keys (F1 to F10).
Specify the character expression with up to 15 1-byte characters and control codes (CHR$ (1) to CHR$(31) and CHR$(127)).
The control codes cannot be input from the keyboard. Specify the codes using the CHR$ function with character codes linked by “+” signs. Each control code occupies one byte. The input guide displays the first five standard-sized characters.
If the key# and character expression parameters are omitted, the settings revert to the settings when the OVL was booted up.
KEY LIST
(Command)
Action
Format
Example
Description
KEY LIST
Displays the function key settings on the screen.
KEY LIST
KEY LIST
Displays the settings of all the function keys on the screen.
The KEY LIST command displays the present settings of the ten function keys.
KEY ON/OFF/STOP
(Command)
Action
KEY ON/OFF/STOP
Disables, enables, or stops interrupts from the function keys.
Format
Example
Description
KEY
[(key#)]
ON
or
OFF
or
STOP
KEY(10)ON
Operation branches to an interrupt processing routine when the function key#
10 (F10) is pressed.
The KEY command controls branching to an interrupt processing routine when a function key is pressed.
Specify the key# parameter as a value between 1 and 10 corresponding to a function key number. The KEY ON/OFF/STOP command applies to all keys if the key# is not specified.
106
KILL Reference
Section 4
KEY ON:
KEY OFF:
The KEY ON statement enables the interrupt processing routine when the function key is pressed. When the function key is pressed, operation branches to the interrupt processing routine at the line# or label defined with the ON KEY
GOSUB statement.
The KEY OFF statement disables the interrupt processing routine when the function key is pressed. When the function key is pressed, operation does not branch to an interrupt processing routine.
KEY STOP: The KEY STOP statement stops interrupt processing when the function key is pressed. When the function key is pressed, operation does not immediately branch to the interrupt processing routine but the pressed status is stored in memory. Immediately branching is enabled by the KEY ON statement, operation branches to the interrupt processing routine at the line# or label defined with the
ON KEY GOSUB statement.
Note The interrupt subroutine must be defined with the ON KEY GOSUB statement before a KEY ON/OFF/STOP command is executed.
KEYIN
(Function)
Action
KEYIN
Reads the input status of the console keys.
Format
Example
KEYIN
(input mode)
A=KEYIN(1)
Waits for a key input from the console and assigns the input status to variable A.
Description
Returns the input status of the console keys.
If the input mode parameter is set to 0, the function returns 0 is no key is pressed at the time the function is executed. If the input mode parameter is set to 1, operation waits until a key is pressed.
The function returns a value between 0 and 255. Each bit of the binary representation of the returned value corresponds to a pressed key, as follows:
Bit 0:
j
Bit 4: ENT
Bit 1:
Q
Bit 5: ESC
Bit 2: A Bit 6: HELP
Bit 3: i Bit 7: SHIFT (see note)
Note The status of the SHIFT Key is returned only when it is pressed simultaneously with another key.
KILL KILL
(Command)
Action
Format
Example
Description
Deletes the file with the specified filename from the memory card.
KILL
filename
KILL ”BASIC.DAT”
Delete the file BASIC.DAT from the memory card.
Specify the name of a file existing in the memory card as a character string with the filename parameter. An error occurs if the specified filename does not exist in the memory card.
The filename parameter can specify any program or data file in the memory card. However, an error occurs if the KILL command is executed on a write-protected file.
107
KLEN . . . . . Reference
KINPUT
(Command)
KINSTR
(Function)
KLEN
(Function)
Action
Format
Example
Description
Action
Format
Example
Description
Action
Format
Example
Section 4
An error occurs if the KILL command is executed on a file opened with the OPEN statement. Close the file with the CLOSE statement before deleting it with the
KILL command. A file cannot be deleted with the KILL command if the file attribute is set to write-protected with the SET command. Use the SET command to remove the write protection before deleting the file with the KILL command.
Kanji INPUT
Automatically sets the Japanese input mode and reads data from the keyboard.
KINPUT
character variable
KINPUT KANJI$
Waits for keyboard input of the Japanese character data to assign to the character variable KANJI$.
The Japanese input mode is selected automatically when the KINPUT command is executed and the system waits for input of a Japanese (2-byte) character from the keyboard. After the data is input, it is assigned to the charac-
ter variable when the Return Key is pressed.
Kanji IN STRing
Determines the position of the specified characters in the character string
KINSTR
([start position,] character string 1, character string 2)
K=KINSTR
(
2, A$, JAPAN
)
Searches for the character string “JAPAN” from the second character of the character string A$ and assigns the position from the start of the array as a number of bytes to variable K.
The KINSTR function finds a specified character string 2 in a character string 1 and returns the position of character string 2 from the start of character string 1.
1-byte and 2-byte characters are each counted as a single character.
Specify a value with the start position parameter to set the the position to start searching character string 1. Specify the value between 1 and the number of characters in character string 1. If omitted, searching starts from the beginning of the character string. The function returns the value 0 if the specified start posi-
tion is larger than the number of characters in character string 1.
Specify a character constant or a character variable for character string 1, the character string to search. The function returns the value 0 if the specified char-
acter string 1 is a null string (” ”).
Specify a character constant or a character variable for character string 2, the character string to be searched for. The function returns the specified start posi-
tion value if character string 2 is specified as a null string (” ”).
The function returns the value 0 if the specified character string 2 does not exist in character string 1.
Kanji LENgth
Determines the number of characters in a character string including 2-byte characters.
KLEN
(character string [, function])
L=KLEN (”BASIC”)
Assigns the length of the character string “BASIC” (5) to variable L.
108
KNJ$ . . . . . Reference
Description
KMID$
(Function)
KNJ$
(Function)
Action
Format
Example
Description
Action
Format
Example
Description
Section 4
The KLEN function returns the length of a specified character string. 1-byte and
2-byte characters are each counted as a single character.
Specify a character constant or a character variable for character string 1, the character string to search. The character string can contain both 1-byte and
2-byte characters.
Specify the function parameter as an integer. The default value is 0. The meaning of the function parameter is shown below.
Function
0
1
2
3
Description
Determines the total number of 1-byte and 2-byte characters in the character string.
Determines the total number of 1-byte characters only.
Determines the total number of 2-byte characters only.
Determines the total number of wide characters only.
Kanji MIDdle $
Extracts part of a character string containing 2-byte Japanese characters.
KMID$
(character variable, start position [, number of characters])
KA$=KMID$(K$,1,10)
Extracts 10 characters from the first character of the character string K$ and assigns them to the character string KA$.
Extracts a specified length of character string from a character string containing
2-byte Japanese characters.
Specify a character constant or a character variable for character variable to search. Do not specify a null string (” ”).
Specify the number of characters to be extracted with the number of characters parameter. The function returns a null string (” ”) if the specified number of characters is negative or exceeds the actual number of characters between the
start position and the right end of the character variable. Set the start position to
1 to select a string from the start of the specified character variable.
Specify the number of characters to be extracted with the number of characters parameter. All characters to the right of the start position are replaced if the num-
ber of characters is omitted or if the number of characters exceeds the actual number of characters between the start position and the right end of the charac-
ter variable.
KaNJi$
Determines the character corresponding to a Shift JIS character code.
KNJ$
(character string)
K$=KNJ$(”8260”)
Assigns 2-byte character “A” corresponding to the Shift JIS code 8260 to variable K$.
The KNJ$ function returns the 2-byte character corresponding to the specified
4-digit hexadecimal Shift JIS code.
Specify a Shift JIS code with the character string.
109
KPOS . . . . . Reference
Section 4
The JIS$ function has the opposite function to the KNJ$ function. The JIS$ function returns a 4-digit hexadecimal Shift JIS code corresponding to the first
2-byte character in a character string.
Kanji Pattern LOAD KPLOAD
(Command)
Action
Format
Example
Description
Registers user-defined character patterns in the F300.
KPLOAD
character code, integer array name
KPLOAD &HEC40,CHRPTN%
Register the Kanji pattern defined in array CHRPTN% as the Kanji code
&HEC40.
The KPLOAD command registers user-defined character patterns in the F300.
Specify the code to be registered with the character code parameter. Use the codes between &HF8 and &HFF for standard characters and the codes between &HEB9F and &HEBFC or between &HEC40 and &HEC61 for wide characters. An error occurs if the character code is specified outside these ranges.
Specify the array variable containing the character pattern with the integer array name. The array variable must previously be declared with the DIM command as a one-dimensional array with 16 elements.
Store the dot image of the character pattern in elements 1 to 16 of the array variable in the format shown below:
.
.
Array element 1 = &H1281
Array element 2 = &H2242
.
Array element 16 = &H0
Kanji POSition KPOS
(Function)
Action
Format
Example
Description
Determines the number of bytes to the specified character position in the character string which includes 2-byte Japanese characters.
KPOS
(character string, character position)
K = KPOS (”ABC ”, 5)
Assigns the number of bytes (8) up to the 5th character position in the character string
”ABC ”
to variable K.
The specified character string may contain a mixture of 1-byte and 2-byte characters. The KPOS function returns the number of bytes up to the specified char-
acter position in the character string.
Specify the position of a character in the character string with the character posi-
tion parameter.
The function returns 0 if the number of characters in the character string is less than the character position.
110
LABEL . . . . Reference
KTYPE
(Function)
Action
Format
Example
LABEL
(Command)
Description
Action
Format
Example
Description
Section 4
Kanji TYPE
Determines the type of character at a specified position in the character string.
KTYPE
(character string, character position)
T=KTYPE(K$,3)
Determines the type of the 3rd character in the character string and assigns the corresponding number to variable T.
The KTYPE function determines the type of character at a specified character
position in the character-string as a value between 0 and 2. The meanings of the returned numbers is shown below.
0
Returned value
1
2
Description
1-byte alphanumeric standard-sized character
2-byte double-sized character
2-byte standard-sized character
Specify the character string as a character constant or a character variable containing a mixture of 1-byte and 2-byte characters.
Specify the position of the required character from the start of the character
string as an integer with the character position parameter. Specify the character
position between 0 and the length of the character string. Count both 1-byte and
2-byte characters as one character.
The KLEN function can be used to determine the number of characters in a
character string.
LABELing
Carries out labelling based on the detailed runlength data measured with the
MEASURE command.
LABEL
[link evaluation constant]
LABEL
Labels using eight-neighbor evaluation of the linked status.
The LABEL command carries out labelling based on the detailed runlength data measured with the MEASURE command. Labelling data is read with the LDATA function or LPOINT function.
The RMODE command and MEASURE command must be executed each time before the LABEL command is executed.
The specified link evaluation constant specifies the link evaluation method, as follows:
0: eight-neighbor evaluation
1: four-neighbor evaluation
The default value is 0.
The following commands and functions are related to the labelling carried out with the LABEL command:
LPUTIMG
LDATA
LSORT
LPOINT
111
LDATA . . . . Reference
LBOUND
(Function)
Action
Format
Example
Description
LCASE$
(Function)
Action
Format
Example
Description
Section 4
Lower BOUNDary
Determines the lower boundary of an array dimension qualifier.
LBOUND
(array name [, number of dimensions])
I=LBOUND(A,1)
Assigns the lower limit of the qualifier of the 1-dimensional array A to variable I.
The LBOUND function returns the lower boundary of an array dimension qualifier.
Specify the name of the array for which the qualifier is to be determined with the
array name parameter.
Specify the number of dimensions of the array with the number of dimensions parameter. The default value is 1.
The returned value is either 0 or 1, as set when the OPTION BASE command was executed.
Lower CASE$
Converts uppercase letters in the character string to-lower case letters.
LCASE$
(character string)
INPUT ”string:”,A$
IF LCASE$(A$)=”end” THEN END
If the character string input as A$ is “END”, the character string is converted to
“end.”
The LCASE$ function converts uppercase letters in the character string to-lower case letters. Existing lowercase letters remain unchanged.
Label DATA LDATA
(Function)
Action
Format
Example
Description
Measures data for the labelled image obtained with the LABEL command.
LDATA
(label#, item)
X=LDATA(2,1)
Assigns the value of the center of gravity in the X direction of the image labelled
#2 to variable X.
The LDATA function measures data from an image labelled with the LABEL command.
Specify the number of the labelled image as the label#. The label numbers
(label#) start from 1.
112
LET Reference
LEFT$
(Function)
LEN
(Function)
LET
(Command)
Action
Format
Example
Description
Action
Format
Example
Description
Action
Format
Section 4
Specify the item with one of the following numbers:
0: Area
1: Center of gravity X
2: Center of gravity Y
3: Main axis angle
4: Peripheral length
5: Area after filling
6: Number of holes
7: X coordinate of top-left corner of external box
8: Y coordinate of top-left corner of external box
9: X coordinate of bottom-right corner of external box
10: Y coordinate of bottom-right corner of external box
The LABEL command must be executed before the LDATA function is used.
LEFT$
Extracts a character string with the specified length from the left end of the specified character string.
LEFT$
(character string, character string length)
B$=LEFT$(A$,3)
Extracts 3 characters from the left end of character string A$ and assigns them to variable B$.
Extracts a character string of any length from the start of the specified character
string.
The character string can be specified as a character constant or character variable. A null string (” ”) cannot be specified.
Specify the length of the extracted character string in bytes with the character
string length parameter as a value between 1 and the length of the character
string. A null string is returned if 0 is specified for the character string length. The entire specified character string is returned if the character string length is greater than the length of the specified character string.
LENgth
Determines the number of bytes in a character string.
LEN
(character string)
L=LEN(”F300 OVL”)
Assigns the length of the character string “F300 OVL” (8 bytes) to variable L.
The LEN function returns the length of a specified character string in bytes.
Use the KLEN function to return the length of a string containing 2-byte characters.
LET
Assigns the expression at the right to the variable at the left.
[
LET
]
variable = expression
113
LINE . . . . . Reference
Example
Description
Section 4
LET A=(B+C)/2
or
A=(B+C)/2
Assigns the sum of the numeric variables B and C divided by 2 to variable A.
Assigns the expression at the right to the variable at the left. It is not possible to specify a variable at the right or an expression at the left.
The function name LET can be omitted. LET is normally omitted in a program.
The variable can be a numeric variable or a character variable. Similarly, the
expression can be a numeric expression or a character expression. However, the types must match on the left and right. If a numeric variable is specified at the left, a numeric expression must be specified to the right. Similarly, if a character variable is specified at the left, a character expression must be specified to the right.
LEVEL
(Command)
Action
Format
Example
LEVEL
Description
Sets the binary level for each binary image plane.
LEVEL
binary image plane#, lower limit, upper limit [, mode]
LEVEL 3,100,200
Set the binary level limits for the binary image plane 3 to 100 and 200, respectively.
The LEVEL command sets the binary level for each binary image plane.
Specify the binary image plane for which the level is set with the binary image
plane# parameter. Set the binary image plane# to –1 to set all binary image planes to the same binary level.
The gradations of the raw input image are converted to a binary image with all values between the specified lower limit and upper limit represented as 1.
Set the binary conversion mode with the mode parameter. The new binary level is calculated by a logical operation on the present binary level. The present setting is cancelled if the mode parameter is omitted. Before setting a value with the LEVEL command, cancel the setting that has been made.
OR: set the specified range to 1
NOT: set the specified range to 0
XOR: reverse the specified range
LINE LINE
(Command)
Action
Format
Example
Draws a straight line in VRAM.
LINE
X1, Y1, X2, Y2, VRAM [, [page#] [,drawing density or drawing mode]]
LINE 45,35,200,250,2,,255
Draws a straight line with drawing density 255 in the window memory between the start point (45, 35) and end point (200, 250).
114
LINE INPUT . . . . . Reference
Description
Section 4
The LINE command draws a straight line between the start and end points.
Specify the VRAM where the line is drawn with a number, as follows:
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
The drawing density parameter specifies the density between 0 and 255 when drawing to the window, image, or shading memory. The default value is 255. The
drawing density parameter has the following effect when set for the character or graphic memory:
0 : 0 written to memory
1: 1 written to memory
When writing to a frame memory, the contents of planes write protected with the
MASKBIT command remain unchanged.
LINE INPUT LINE INPUT
(Command)
Action
Format
Example
Description
Assigns a line of data input from the keyboard to a character variable.
LINE INPUT
[prompt character string{, or ;}] character variable
LINE INPUT ”DATA”;A$
Displays “DATA” on the screen and waits for keyboard input of the line of character data to be assigned to the character variable A$.
Operation waits for data input from the keyboard when the LINE INPUT command is executed. Enter the line of data and press the Return Key to assign the data to the variable.
Specify a character string for the prompt character string. This character string is displayed to prompt for input of the required data. The prompt character string must be separated from the subsequent character variable by a semicolon (;).
The specified prompt character string only is displayed when the LINE INPUT command is executed.
Input the character variable as up to 255 1-byte characters, blanks, commas (,), double quotation marks (”), and numbers. All characters entered from the time the prompt is displayed until the Return Key is pressed are handled as a single character string.
If the Return Key is pressed without entering characters, a null string (”) is assigned to the character variable.
115
LIST Reference
Section 4
LINE INPUT WAIT
(Command)
Action
LINE INPUT WAIT
Inputs one line of data from the keyboard with a time limitation.
Format
Example
Description
LINE INPUT WAIT
wait time, [prompt character string;] character
variable
LINE INPUT WAIT 70,”ANSWER”;AN$
Displays the input prompt message “ANSWER” on the screen and waits 7 seconds for keyboard input of the character data to be assigned to the character variable AN$.
Operation waits for the specified wait time for data input from the keyboard when the LINE INPUT WAIT command is executed. Enter the line of character data and press the Return Key within the specified wait time to assign the data to the
character variable.
The LINE INPUT WAIT command is identical to the LINE INPUT command, except for the time limit. If the Return Key is pressed without entering characters, a null string (”) is assigned to character variable. If the time specified by wait time passes, the variables will not change.
Specify the wait time in units of 0.1 second.
LINE INPUT#
(Command)
Action
LINE INPUT#
Format
Example
Description
Reads a line of data from a sequential access file and assigns it to a character variable.
LINE INPUT
#
file#, character variable
LINE INPUT #1,L$
Reads a line of data from file #1 and assigns the data to character variable L$.
Specify the file# as the number in which the random access file was opened with the OPEN statement.
All characters including blanks, commas (,), double quotation marks (”), and numbers between the first character read (including a blank) and the carriage return (CHR$(13)) are read to the character variable.
The LINE INPUT# command can be used in combination with the FOR ... NEXT statements to read consecutive lines of a file up to each carriage return
(CHR$(13)) to successive character variables.
The LINE INPUT# command is ideal for reading a line of data up to the carriage return (CHR$(13)) from a random access file containing both character and numeric variables delimited by blanks or commas (,).
Unlike the LINE INPUT command, the LINE INPUT# command displays no prompt message.
LIST LIST
(Command)
Action
Format
Example
Description
Displays all or part of the program contents.
LIST
[line# 1] [–line# 2]
LIST 100–190
Displays the program between line 100 and line 190 on the screen.
Displays the program between line# 1 and line# 2 on the screen.
The entire program is displayed if the line# 1 and line# 2 parameters are omitted.
Only line# 1 is printed if line# 2 is not specified. Lines from the start of the program to line# 2 are printed if line# 1 is not specified.
116
LOC Reference
Section 4
Use a period (.) instead of line# 1 or line# 2 to specify the current program line.
The current line is indicated by the pointer. The current line is the last line input during program creation or the last line displayed with the LIST command.
Label NUMber LNUM
(Function)
Action
Format
Example
Description
Determines the number of labelled images.
LNUM
LN=LNUM
Assigns the number of labelled images to variable LN.
The LNUM functions determines the number of images labelled with the LABEL command.
The LABEL command must be executed before the LNUM function is used.
–1 is returned if over 255 labels exist.
LOAD LOAD
(Command)
Action
Format
Example
Description
Loads a program from disk to memory.
LOAD
file name [, R]
LOAD ”C:PRO1”
Loads the file PRO1 from the memory card.
The LOAD command loads the file specified with the file name parameter. The currently loaded program is deleted from memory.
If the R option is specified, the program is run with the currently open files immediately it is loaded.
Use the MERGE command to load a program without deleting the currently loaded program.
LOC
(Function)
LOCation
Action
Format
Example
Description
File Type
Random access file
Sequential access file
RS-232C
Determines the current I/O position within the specified file.
LOC
(file#)
L=LOC(1)
Assigns the current position of I/O operation in file#1 to variable L.
Specify the file# as the number in which the file was opened with the OPEN statement.
The position returned by the LOC function depends on the type of file, as defined in the table below.
Value returned by LOC
Returns the last record# read or written with the GET# or PUT# command as an integer value.
Returns the number of records read or written since the file was opened as an integer value.
Returns the number of bytes remaining in the communication buffer as an integer value.
117
LOG Reference
Section 4
LOCATE
(Command)
Action
LOCATE
Format
Example
Description
Sets the cursor position on the text display and whether the cursor is displayed.
LOCATE
[column] [, line] [, cursor display switch]
LOCATE 5, 20
Moves the cursor position to the character 5 position (6th character from the left) on line 20 (21st line from the top).
The LOCATE command moves the cursor on the text display and turns the cursor display on or off.
Specify the horizontal (X) coordinate with the column parameter between 0 and
63. The default value is 0.
Specify the vertical (Y) coordinate with the line parameter between 0 and 24. If this value is omitted, the cursor remains in the line position when the LOCATE command was executed.
Specify the cursor display switch parameter as 0 or 1. The meaning of this setting is shown in the table below. If this value is omitted, the cursor display status when the LOCATE command was executed is maintained.
Cursor display switch parameter
0
1
Description
No cursor is displayed on the screen.
A cursor is displayed on the screen.
Note It is not possible to omit the X coordinate, Y coordinate, and cursor display switch with a LOCATE command.
LOF
(Function)
Length Of File
Action
Format
Example
Description
Determines the size of a file.
LOF
(file#)
SIZE=LOF(1)
Assigns the size of file#1 open for I/O operation to variable SIZE.
Specify the file# as the number in which the file was opened with the OPEN statement.
The size returned by the LOF function depends on the type of file, as defined in the table below.
File Type
Random access file
Sequential access file
RS-232C
Value returned by LOF
Returns the file size as the maximum record number.
Returns the file size as a number of bytes.
Returns the free space in the communication buffer as a number of bytes.
LOGarithm LOG
(Function)
Action
Format
Example
Determines the natural logarithm of a number.
LOG
(numeric expression)
A=LOG(B)
Assigns the natural logarithm of variable B to variable A.
118
LPUTIMG . Reference
Description
Section 4
The LOG function returns the natural logarithm (to base e = 2.71828) of the nu-
meric expression parameter. The numeric expression must be specified as a positive value.
The numeric expression may be in the form of an integer, long integer, or a single or double-precision real number. The LOG function always returns a doubleprecision real number.
The EXP function has the opposite action to the LOG function.
Label POINT LPOINT
(Function)
Action
Format
Example
Description
Determines the label number of a labelled image at a specified position.
LPOINT
(X, Y)
N=LPOINT(128,256)
Assigns the label number from the labelled image at coordinates (128, 256) to variable N.
The LPOINT function finds the label number at a specified coordinate position from the label number data obtained with the LABEL command
The function returns 0 if no labelled image or a hole in a labelled image exists at the specified coordinates.
The LABEL command must be executed before the LPOINT command is used.
Label PUT IMaGe LPUTIMG
(Command)
Action
Format
Example
Description
Draws a labelled image in VRAM.
LPUTIMG
label#, VRAM [, [page#] [, plane#]]
LPUTIMG 2,3,,2
Draws the image with label #2 to plane 2 of the image memory.
The LPUTIMG command draws labeled image data obtained with the LABEL command to VRAM.
Specify the label number of the image to be drawn with the label# parameter.
Specify the VRAM where the image is drawn with a number, as follows:
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
Specify the plane# when writing to a frame memory. Specify –1 to write the image to all planes. The image is not written to planes write protected with the
MASKBIT command.
The LABEL command must be executed before the LPUTIMG command is used.
119
MASKBIT . Reference
LSET
(Command)
Action
LSORT
(Command)
Format
Example
Description
Action
Format
Example
Description
LTRIM$
(Function)
Action
Format
Example
Description
MASKBIT
(Command)
Action
Format
Example
Section 4
Left SET
Writes left-justified character data to a variable area defined with the FIELD command.
LSET
character variable = character string
LSET A$=”BASIC”
Left justifies the character string “BASIC” and writes it to the variable area defined with the variable name A$.
Specify a character variable name defined with the FIELD command with the
character variable parameter.
Specify a character constant or character variable as the character string.
Excess characters are lost from the right of the character string if the length of the specified character string exceeds the length of the character variable defined with the FIELD command. Conversely, if the length of the specified char-
acter string is less than the length of the character variable, the remaining positions are filled with blanks.
Label SORT
Renumbers labels in order of area.
LSORT
mode
LSORT 0
Renumbers the label numbers in descending order of area.
The LSORT command sorts the labeled image data obtained with the LABEL command into order of area.
Specify the mode parameter to 0 to sort the label numbers in descending order or to 1 to sort the label numbers in ascending order.
The LABEL command must be executed before the LSORT command is used.
Left TRIM$
Deletes spaces to the left of a character string.
LTRIM$
(character string)
A$=LTRIM$(” JAPAN”)
Assigns “JAPAN” to variable A$.
Returns the character string (1- or 2-byte characters) with the spaces removed from the left.
MASKBIT
Disables writing to specific planes in the frame memory.
MASKBIT
VRAM, [page#], bit data
MASKBIT 2,,&HFF
Disables writing to the window memory.
120
MDATA2 . . Reference
Description
MDATA
(Function)
Action
Format
Example
Description
MDATA2
(Function)
Action
Format
Example
Description
Section 4
The MASKBIT command enables or disables writing to each plane of the frame memory.
Specify the VRAM with the VRAM parameter, as follows:
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
Specify the plane to be write disabled with the bit data parameter. Set the bit corresponding to a plane to 1 to disable writing or to 0 to enable writing.
Measure DATA
Reads the measured results, such as area, center of gravity, and axis angle.
MDATA
(binary image plane#, measured data)
A=MDATA(0,2)
Assigns the center of gravity X coordinate of the binary image in plane 0 in pixels to variable A.
The MDATA function reads the area, center of gravity, and the axis angle results measured with the MEASURE command.
Specify the binary image plane# as the plane number from which the data is read.
Specify the measured data with one of the values listed below to determine the the type of measured data to read. The calibration is based on the current scene data, which is specified with the CHANGE command.
0: Area (pixel units)
1: Area after calibration
2: Center of gravity X (pixel units)
3: Center of gravity X after calibration
4: Center of gravity Y (pixel units)
5: Center of gravity Y after calibration
6: Axis angle (pixel units)
7: Axis angle after calibration
The MMODE and MEASURE commands must be executed before the MDATA function is used.
Measure DATA2
Reads the edge angle measurement results.
MDATA2
(binary image plane#, X array, Y array, function)
A=MDATA2(0,X,Y,0)
Assigns the edge angle in the rectangular region defined by X array and Y array on binary image plane 0 to variable A.
The MDATA2 function reads the edge angle results measured with the
MEASURE command.
Specify the top-left coordinates of the rectangle where the edge angle is to be determined with X array and the bottom-right coordinates with Y array. These coordinates are matched to the rectangular window.
121
MERGE . . . Reference
MEASURE
(Command)
MENU
(Command)
Action
Format
Example
Description
Action
Format
Example
Description
MERGE
(Command)
Action
Format
Example
Description
Section 4
Set the function parameter to 0 to determine uncalibrated (pixel) data or to 1 to determine calibrated data.
The calibration is based on the current scene data, which is specified with the
CHANGE command.
The MMODE command must be used to turn on the run function and the
MEASURE command executed before the MDATA2 function is used.
MEASURE
Measures the area, center of gravity, axis angle, simple run length, and detailed run length.
MEASURE
MEASURE
Measures under the conditions set using MMODE or RMODE.
The MEASURE command measures the area, center of gravity, axis angle, simple run length, and detailed run length under the conditions set using
MMODE and RMODE command.
Set the measurement conditions with the MMODE command before measuring the area, center of gravity, or axis angle. Turn on the run function and set the measurement conditions with the MMODE command before measuring the simple run length.
Set the measurement conditions with the RMODE command before measuring the detailed run length.
MENU
Returns to the Menu mode.
MENU
MENU
Returns to the Menu mode.
Quits the OVL mode and returns to the Menu mode.
MERGE
Merges a program from the memory card with the program in memory.
MERGE
filename
MERGE ”C:PRO1”
Merges the program PRO1 from the memory card.
Merges the program currently loaded in memory with the program specified by the filename parameter from the memory card. The program is reorganized into line number order after merging.
Existing lines in memory are deleted if line numbers are duplicated in the programs in memory and in the memory card.
The program cannot be executed automatically after merging. Use the CHAIN command to automatically execute programs.
122
MKD$ . . . . Reference
MID$
(Function, Command)
Action
Format
MKD$
(Function)
Example
Description
Action
Format
Example
Description
Section 4
MIDdle$
Extracts part of a character string. Changes part of a character string, if required.
Format 1 (function):
Format 2 (command):
MID$
(character variable, start position [, number of
characters])
MID$
(character variable, start position [, number of
characters]) = character string
MID$(A$,6,8)=”F300 OVL”
Replaces the 8 characters starting from the 6th character with the character string “F300 OVL” (8 characters).
Format 1
Extracts the specified number of characters from the start position of the charac-
ter variable.
Specify the position of the first character in the character variable to be extracted as a value between 1 and the number of characters in the character variable.
Specify the number of characters to be extracted with the number of characters parameter. All characters to the right of the start position are extracted if the
number of characters is omitted or if the number of characters exceeds the actual number of characters between the start position and the right end of the
character variable.
Format 2
Replaces the specified number of characters from the start position of the char-
acter variable with the character string.
Specify the position of the first character in the character variable to be replaced as a value between 1 and the number of characters in the character variable.
Specify the number of characters to be replaced with the number of characters parameter. All characters to the right of the start position are replaced if the num-
ber of characters is omitted or if the number of characters exceeds the actual number of characters between the start position and the right end of the charac-
ter variable.
Specify the character string as a character constant or a character variable.
MaKe Double$
Converts a double-precision value to internal character-type representation.
MKD$
(double-precision value)
C$=MKD$(C#)
Converts the specified double-precision real number variable C# to a character string and assigns it to variable C$.
Because numeric data cannot be handled in a random access file, the doubleprecision numeric data must be converted to character-type numeric data with the MKD$ function before it can be written to a random access file. This character-type numeric data is then converted to a character string corresponding to the internal representation (binary representation) of the number type, which is used in the random access file.
The MKD$ function converts a double-precision real number to an 8-byte character string.
The CVD function reverts a character-type double-precision number converted with the MKD$ function to a numeric value.
123
MKL$ Reference
MKDIR
(Command)
Action
Format
Example
MKI$
(Function)
MKL$
(Function)
Description
Action
Format
Example
Description
Action
Format
Example
Description
Section 4
MaKe DIRectory
Creates a new directory for the memory card.
MKDIR
directory name
MKDIR ”BASIC”
Creates a new directory named “BASIC” under the current directory.
Specify the name of the new directory name with the directory name parameter.
An error occurs if a directory with the specified name already exists in the same path.
The new directory is created under the current directory if no new path is specified with the directory name.
If a new path is specified with the directory name, the new directory is created outside the current directory.
Use the ¥ symbol to delimit directories.
MaKe Integer$
Converts an integer value to internal character-type representation.
MKI$
(integer)
A$=MKI$(A%)
Converts the specified integer variable A% to a character string and assigns it to variable A$.
Because numeric data cannot be handled in a random access file, the integer data must be converted to character-type numeric data with the MKI$ function before it can be written to a random access file. This character-type numeric data is then converted to a character string corresponding to the internal representation (binary representation) of the number type, which is used in the random access file.
The MKI$ function converts an integer to a 2-byte character string.
The CVI function reverts a character-type integer number converted with the
MKI$ function to a numeric value.
MaKe Long $
Converts a long integer value to internal character-type representation.
MKL$
(long integer)
A$=MKL$(A&)
Converts the specified long integer variable A& to a character string and assigns it to variable A$.
Because numeric data cannot be handled in a random access file, the long
integer data must be converted to character-type numeric data with the MKL$ function before it can be written to a random access file. This character-type numeric data is then converted to a character string corresponding to the internal representation (binary representation) of the number type, which is used in the random access file.
The MKL$ function converts a long integer to a 4-byte character string.
The CVL function reverts a character-type long integer number converted with the MKL$ function to a numeric value.
124
MMODE . . Reference
MKS$
(Function)
Action
Format
Example
Description
MMODE
(Command)
Action
Format
Example
Description
Section 4
MaKe Single$
Converts a single-precision value to internal character-type representation.
MKS$
(single-precision value)
B$=MKS$(B!)
Converts the specified single-precision real number variable B! to a character string and assigns it to variable B$.
Because numeric data cannot be handled in a random access file, the singleprecision numeric data must be converted to character-type numeric data with the MKS$ function before it can be written to a random access file. This character-type numeric data is then converted to a character string corresponding to the internal representation (binary representation) of the number type, which is used in the random access file.
The MKS$ function converts a single-precision real number to a 4-byte character string.
The CVS function reverts a character-type single-precision number converted with the MKS$ function to a numeric value.
Measure MODE
Sets the basic measurement mode for each binary image plane.
MMODE
binary image plane#, measured pixels [, [window function] [, [paint
function] [, [fill function] [, run function]]]]
MMODE 0,0,1
Sets measurement of black pixels for binary image plane 0, with the window function on.
The MMODE command sets the conditions for measurement with the
MEASURE command for each of the 8 binary image planes. Specify the binary image plane for which the measurement conditions are set with the binary image
plane# parameter. Set the binary image plane# to –1 to set the conditions for all binary image planes simultaneously.
Set the measured pixels parameter to set which pixels to measure, as follows:
0: Black pixels
1: White pixels
Normally set the window function parameter to 1.
Set the paint function parameter to set the paint and pattern matching functions, as follows:
0: No painting or pattern matching
1: Carry out painting
2: Carry out pattern matching
The default value is 0.
Set the fill function parameter to set the contour measurement, as follows:
0: Normal
All of the white pixels in the window will be taken as the object for measurement.
1: Fill
All of the white pixels between the starting and ending points along the horizontal axis will be measured.
The default value is 0.
125
NPIECE . . . Reference
NAME
(Command)
NEW
(Command)
(Function)
Action
Format
Example
Description
Action
Format
Example
Description
NPIECE
Action
Format
Example
Description
Section 4
Set the run function parameter to set the simple run length data measurement, as follows:
0: Do not measure the simple run length data
1: Measure the simple run length data
The default value is 0.
NAME
Renames files stored in the memory card.
NAME
old filename
AS
new filename
NAME ”ABC” AS ”DEF”
Renames the file name ABC as the file name DEF.
Specify the old filename as the name of an existing file in the memory card as a character string. An error occurs if the specified filename does not exist.
Specify the new name of the file with the new filename parameter. Use only
1-byte characters. An error occurs if a file with the same name as the specified new filename already exists.
A filename cannot be renamed with the NAME command if the file attribute is set to write-protected with the SET command. Use the SET command to remove the write protection before renaming the file with the NAME command.
NEW
Deletes the program from memory.
NEW
NEW
Deletes the program from memory.
The NEW command deletes the program from memory and resets numeric constants to 0 and character constants to a null string (” ”).
Any open I/O files are closed.
The Direct mode is selected after the NEW command is executed.
Number of PIECE
Determines the number of smaller character strings the specified character string is divided into by the delimiters.
NPIECE
(character string, delimiter)
A=NPIECE(”OMRON F300”,” ”)
Because the space character is set as the delimiter, OMRON and F300 are considered as separate character strings, so 2 is assigned to variable A.
The NPIECE function determines the number of small character strings separated by the delimiters in the specified character string.
Returns the number of character strings divided by the delimiters.
The function returns 1 if the delimiter character is not contained in the character
string.
126
ON COM GOSUB . Reference
Section 4
OCT$
(Function)
Action
Format
Example
Description
OCTal$
Converts a decimal number to an octal character string.
OCT$
(numeric expression)
A$=”&O”+OCT$(10)
Converts the decimal value 10 to the octal character string 12, concatenates this character string with the character string “ &O”, and assigns the result (&O12) to the character variable A$.
The OCT$ function converts a decimal value to an octal character string. It does not add the “ &O” prefix to indicate an octal character string.
Specify the numeric expression as a decimal numeric constant or numeric variable between –2147483648 (–2
31
) and 2147483647 (2
31
–1). Any decimal places in the specified numeric expression are rounded off to create an integer which is converted to the octal character string.
The relationship between the decimal numeric expression and octal character string is as follows:
Numeric expression (decimal)
–2147483648 to –1
0 to 2147483647
Octal character string
“20000000000” to “37777777777”
“0” to “17777777777”
To convert an octal character string back to numeric data, append the “ &O” prefix to indicate an octal character string, then convert the character string with the VAL function.
ON COM GOSUB
SUBroutine
(Command)
Action
Format
Example
Description
ON COMmunication GO to
Defines the jump destination of the interrupt subroutine when data is received at the communication port.
ON COM
(RS-232C port#)
GOSUB
line# or label
ON COM(1) GOSUB
*
PROCESS
Defines the jump destination of the interrupt subroutine when data is received by the RS-232C channel 0 as the label name
*
PROCESS.
Specify the RS-232C port# as 1 or 2. The default value is 1. The ON COM
GOSUB commands define the jump destination of the interrupt subroutine executed when data is received at the specified communication port. Interrupt operation starts when it is enabled by the COM ON command. Operation returns when the RETURN command is executed.
10
20
30
50
90
OPEN ”COM:” AS #1
ON COM GOSUB * LABEL1
COM ON
* LABEL1
RETURN
Interrupt subroutine
127
ON INTR GOSUB . Reference
Section 4
ON ERROR GOTO
(Command)
Action
ON ERROR GOTO
Defines the first line of the error processing routine executed when an error occurs.
Format
Example
Description
ON ERROR GOTO
line# or label or 0
ON ERROR GOTO 1000
Defines the jump destination when an error occurs as line# 1000.
The ON ERROR ... GOTO command defines the jump destination of the error processing routine executed when an error occurs. When an error occurs, operation jumps to the specified jump destination and the error routine is executed to reset the error.
Specify the first line of the error processing routine with the line# or label parameter.
Specify 0 instead of the line# or label to cancel the error processing routine jump destination defined previously with the ON ERROR GOTO command. If an error subsequently occurs, an error message is displayed and program operation stops. When an error occurs, the error code and line number where the error occurred are assigned to the system variables ERR and ERL.
Operation returns to the original program when the RESUME command at the end of the error processing routine is executed.
ON HELP GOSUB
(Command)
Action
ON HELP key GO to SUBroutine
Defines the first line of the interrupt subroutine executed when the HELP Key is pressed.
Format
Example
ON HELP GOSUB
line# or label
Description
ON HELP GOSUB
*
SHORI
Defines the jump destination when the HELP Key is pressed as the label name
*
SHORI.
The line# or label parameter defines the jump destination of the interrupt subroutine executed when the HELP Key is pressed.
The interrupt subroutine defined by the line# or label parameter is executed when the HELP Key is pressed during program execution if the interrupt operation is enabled with the HELP ON command.
The ON HELP GOSUB command is one type of key input interrupt routine. It is used as an aid to program operation by explaining how to use the program and input data.
Operation returns to the original program when the RETURN command at the end of the interrupt subroutine is executed. Operation can be transferred to a different position from the position where the interrupt occurred by specifying a line# or label parameter with the RETURN command.
ON INTR GOSUB ON INTeRrupt GO to SUBroutine
(Command)
Action
Defines the first line of the interrupt subroutine executed when a STEP interrupt occurs.
Format
Example
ON INTR GOSUB
line# or label
ON INTR GOSUB 2000
Defines the first line of the interrupt subroutine executed when a STEP interrupt occurs as line# 2000.
128
ON STOP GOSUB Reference
Section 4
Description
The ON INTR GOSUB command defines the line# or label of the first line of the interrupt subroutine executed when a STEP interrupt occurs. Any further STEP interrupt occurring during execution of the interrupt subroutine is ignored.
ON KEY GOSUB ON function KEY GO to SUBroutine
(Command)
Action
Defines the first line of the interrupt subroutine executed when a function key is pressed.
Format
Example
Description
ON KEY GOSUB
line# or label [, line# or label...]
ON KEY GOSUB ,,
*
PROCESS
Defines the jump destination when a function key (F3) is pressed as the label name
*
PROCESS.
The line# or label parameter defines the jump destination of the interrupt subroutine executed when a function key is pressed.
Up to ten line# or label parameters can be specified delimited by commas (,).
The order of the line# or label parameters corresponds to the function key numbers.
The interrupt subroutine defined by the line# or label parameter is executed only when the corresponding function key is pressed during program execution.
The ON KEY GOSUB command is one type of key input interrupt routine. Defining frequently executed routines or frequently input data in the interrupt subroutines makes the function keys a convenient aid to programming.
Operation returns to the original program when the RETURN command at the end of the interrupt subroutine is executed. Operation can be transferred to a different position from the position where the interrupt occurred by specifying a
line# or label parameter with the RETURN command.
ON STOP GOSUB
(Command)
Action
ON STOP key GO to SUBroutine
Defines the first line of the interrupt subroutine executed when the STOP Key is pressed.
Format
Example
Description
ON STOP GOSUB
line# or label
ON STOP GOSUB
*
PROCESS
Defines the jump destination when the STOP Key is pressed as the label name
*
PROCESS.
The line# or label parameter defines the jump destination of the interrupt subroutine executed when the STOP Key is pressed.
The interrupt subroutine defined by the line# or label parameter is executed when the STOP Key is pressed during program execution if the interrupt operation is enabled with the STOP ON command.
The ON STOP GOSUB command is one type of key input interrupt routine. Defining how to stop a specified operation in the interrupt subroutine at the specified jump destination allows the operation to be stopped by pressing the
STEP Key.
Operation returns to the original program when the RETURN command at the end of the interrupt subroutine is executed. Operation can be transferred to a different position from the position where the interrupt occurred by specifying a
line# or label parameter with the RETURN command.
129
ON GOSUB Reference
Section 4
ON TIME$ GOSUB
(Command)
Action
ON TIME$ GO to SUBroutine
Defines the time when the timer interrupt is generated and the first line of the interrupt subroutine.
Format
Example
ON TIME$
= “HH:MM:SS”
GOSUB
line# or label
ON TIME$=”02:00:00” GOSUB 1000
Sets the interrupt to be generated at 02:00:00 and defines the first line of the interrupt subroutine executed at this time as line# 1000.
Description
The ON TIME$ GOSUB command sets the time when the timer interrupt is generated and defines the line# or label of the first line of the interrupt subroutine executed at the set time. If branching is enabled with the TIME$ ON command, the specified interrupt routine is executed when the set time is reached.
Set the time in the format: HH:MM:SS. Set the hour between 00 and 23 and set the minutes and seconds between 00 and 59.
Example 1:
ON TIME$ = “01:00:00” GOSUB 1000 ... interrupt generated at 1 am.
Example 2:
ON TIME$ = “10:30:00” GOSUB 1000 ... interrupt generated at 10.30 am.
The HH:MM:SS set with this command does not affect the setting of the internal clock.
The line# or label parameter defines the first line of the interrupt subroutine.
Operation returns to the original program when the RETURN command at the end of the interrupt subroutine is executed. Operation can be transferred to a different position from the position where the interrupt occurred by specifying a
line# or label parameter with the RETURN command.
The time setting is 00:00:00 after the F300 power is turned on.
ON GO to SUBroutine ON GOSUB
(Command)
Action
Format
Example
Description
Branches program operation according to specified conditions.
ON
expression
GOSUB
[line# or label] [, line# or label...]
ON S GOSUB
*
STARTRTN,
*
ENDRTN,
*
ERRRTN
Branches to subroutine * STARTRTN when the variable S equals 1, to
* ENDRTN when S equals 2, and to * ERRRTN when S equals 3.
Program operation branches to subroutines specified by a line# or label according to the value of the expression.
The subroutine defined with the first line# or label parameter is executed when the expression equals 1, the subroutine defined with the second line# or label parameter is executed when the expression equals 2, and so on.
Program operation flows to the next line if the expression equals 0 or if the line# and label parameters are omitted.
When the RETURN command at the end of the subroutine is executed, program operation jumps back to the line after the ON GOSUB command. If a line# or
label parameter is specified with the RETURN command, operation jumps to the specified line.
130
OPEN(1) . . Reference
ON GOTO
(Command)
Action
Format
Example
Description
Branches program operation according to specified conditions.
ON
expression
GOTO
[line# or label] [, line# or label...]
ON T GOTO 200,500,900
Branches to line 200 when the variable T equals 1, to line 500 when T equals 2, and to 900 when T equals 3.
Program operation branches to the line specified by a line# or label according to the value of the expression. Operation jumps to the line defined with the first
line# or label parameter when the expression equals 1, the second line# or label parameter when the expression equals 2, and so on.
Program operation flows to the next line if the expression equals 0 or if the line# and label parameters are omitted.
OPEN OPEN(1)
Command
Action
Format
Example
Section 4
ON GO TO
Description
Opens a file.
OPEN
filename [FOR {OUTPUT or INPUT or APPEND}]
AS
file#
OPEN ”DATA01” FOR OUTPUT AS #1
Opens the sequential access file DATA01 in the memory card as file#1 to output data to the file.
A sequential access file or random access file in the memory must be opened using the OPEN command with a specified file# before file I/O operations are possible. Use the CLOSE command to close the file after I/O operations are complete.
When opening a sequential access file, the I/O mode must be specified, as one of the following:
INPUT ... read data from the file
OUTPUT ... write data to the file
APPEND ... append data to an existing file
Do not specify the I/O mode when opening a random access file. If the I/O mode is specified, the random access file is treated as a sequential access file with the same name, so that an error occurs when I/O operations are attempted with the
GET# and PUT# commands.
Specify the file# as a positive integer between 1 and 13. The same file# cannot be applied to more than one open file simultaneously. The file# assigned to the file can be used instead of the filename for all I/O operations until the file is closed with the CLOSE command.
Use the INPUT# and LINE INPUT# commands and the INPUT$ function to read data from a sequential access file and the PRINT#, PRINT# USING, and
WRITE# command to write data to the sequential access file.
Define the file buffer with the FIELD command before I/O operations with a random access file. Use the LSET and RSET commands to set data in the file buffer and the PUT# and GET# commands to read and write data to and from the file.
131
OPTION BASE . . . Reference
OPEN(2)
(Command)
Action
Format
Example
Description
OPTION BASE
(Command)
Action
Format
Example
Description
Section 4
OPEN
Opens the RS-232C port.
OPEN
”COM [RS-232C port#]: [baud rate [parity [data length [stop bits [XON
switch]]]]]” [FOR OUTPUT or INPUT] AS [#] file#
OPEN ”COM:” FOR OUTPUT AS #1
Opens the RS-232C channel 0 for data output.
Specify the RS-232C port# as 1 or 2, as follows:
1: channel 0
2: channel 1
The default value is 1.
The OPEN command opens the RS-232C port for data I/O. When data I/O is complete, close the RS-232C port with the CLOSE command.
Set the baud rate, parity, data length, stop bits, and XON switch parameters to match the specifications of the device communicated with. Refer to the following table for details of these settings. The default value shown in the table is automatically set if the parameter is omitted.
Parameter
Baud rate
XON switch
Setting
1200
---
S
N
2
X
8
1
N
7
E
O
2400
4800
9600
19200
Description
1,200 bps
2,400 bps
4,800 bps
9,600 bps
19,200 bps
Even parity check
Odd parity check
No parity check
Each character 7 bits
Each character 8 bits
One stop bit
Two stop bits
XON/XOFF control enabled
XON/XOFF control disabled
ON
OFF
Default value
9600
N
8
1
---
N
OPTION BASE
Declares minimum value of the array qualifier.
OPTION BASE
0 or 1
OPTION BASE 0
Declares the minimum value of the array qualifier as 0.
The OPTION BASE command declares the minimum value of the array qualifier as 0 or 1.
The qualifier minimum value is automatically set to 0 if an array variable is declared with the DIM command in a program containing no OPTION BASE
132
POINT . . . . Reference
PIECE$
(Function)
PIN
(Function)
Action
Format
Example
Description
Action
Section 4
command. The OPTION BASE command is used to set the qualifier minimum value to 1. After setting the qualifier minimum value with the OPTION BASE command, do not execute the OPTION BASE command again in the same program to change the minimum value.
PIECE$
Extracts partial character strings divided by the delimiter characters from the specified character string.
PIECE$
(character string, delimiter character string [, start# [, end#]])
A$=PIECE$(”F300 OVL”,” ”,2)
Assigns the second partial character string “OVL” from the character string
“F300 OVL” to variable A$.
The PIECE$ function returns the partial character strings between the specified
start# and end # divided by the delimiter characters from the specified character string.
If the end# is omitted, the single partial string corresponding to the start# is returned. The first partial character string is returned if both the start# and end# are omitted. The entire character string is returned if it is not divided by the specified delimiter character.
Port IN
POINT
(Function)
Format
Example
Description
Action
Format
Example
Reads the bit status of a specified bit of the Terminal Block Unit or Parallel I/O
Unit input port.
PIN
(bit address)
A=PIN(12)
Assigns the bit status of bit 12 of the Terminal Block Unit or Parallel I/O Unit input port to variable A.
The PIN function reads the bit status of the Terminal Block Unit or Parallel I/O
Unit input port bit specified with the bit address parameter. The function returns a value, as follows:
1: bit status ON
2: bit status OFF
If both Terminal Block Units and Parallel I/O Units are connected, the PIN function does not differentiate between the two. The bit status can be specified up to the total number of input bits for all units.
Bit address 0 is the lowest terminal number of the lowest numbered slot.
POINT
Determines the density of the specified coordinates in VRAM.
POINT
(X, Y, VRAM [, page#])
G=POINT(128,255,3,0)
Assigns the density at image memory coordinates (128, 255) to variable G.
133
POLYLINE Reference
Description
POLYGON
(Command)
Action
Format
Example
Description
POLYLINE
(Command)
Action
Format
Example
Section 4
The POINT function reads the density at the specified coordinates (X, Y) in the specified VRAM.
Specify the VRAM with the VRAM parameter, as follows:
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
The function returns either 0 or 1 if a plane VRAM is specified or a value between
0 and 255 if a frame VRAM is specified.
Omit the page# or set to 0.
POLYGON
Draws a polygon in VRAM.
POLYGON
number of data, X array, Y array, VRAM [, [page#] [, [drawing den-
sity or drawing mode] [, lineart]]]
POLYGON 28, XD, YD, 3,,128,0
Draws a polygon with drawing density 128 in image memory with the points at the coordinates defined in the arrays XD and YD with 28 data items.
The POLYGON command draws a polygon with points at the coordinates in the
X array and Y array from the start of the array to the number of points specified with the number of data parameter.
Specify the number of data as a value up to 64.
Specify the VRAM where the polygon is drawn with a number, as follows:
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
Specify the drawing method with the drawing density or the drawing mode. The default value is drawing mode, OR.
The drawing density parameter specifies the density between 0 and 255 when drawing to the window, image, or shading memory. The default value is 255. The
drawing density parameter has the following effect when set for the character or graphic memory:
0 : 0 written to memory
1: 1 written to memory
POLYLINE
Draws a polyline in VRAM.
POLYLINE
number of data, X array, Y array, VRAM [, [page#] [, [drawing
density or drawing mode]]]
POLYLINE 28, XD, YD, 2,,128
Draws a polyline with drawing density 128 in window memory plane 7 with the points at the coordinates defined in the arrays XD and YD with 28 data items.
134
PRINT . . . . Reference
Description
POS
(Function)
POUT
(Command)
(Command)
Action
Format
Example
Description
Action
Format
Example
Description
Action
Format
Example
Section 4
The POLYLINE command draws a polyline with points at the coordinates in the
X array and Y array from the start of the array to the number of points specified with the number of data parameter.
Specify the number of data as a value up to 64.
Specify the VRAM where the polyline is drawn with a number, as follows:
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
Specify the drawing method with the drawing density or the drawing mode. The default value is drawing mode, OR.
When writing to a frame memory, the contents of planes write protected with the
MASKBIT command remain unchanged.
POSition
Determines the current cursor column position.
POS
(numeric expression)
HP%=POS(0)
Assigns the current cursor column position (0 to 63) to the variable HP%.
The POS function determines the position of the character cursor in the X direction (along the line).
The parameter of the POS function is a dummy. It has no special significance, but cannot be omitted. Normally, set the dummy parameter to 0.
Use the CSRLIN function to determine the line where the cursor is positioned.
Port OUT
Controls the bit status of a specified bit of the Terminal Block Unit or Parallel I/O
Unit output port.
POUT
bit address, 0 or 1
POUT 2,1
Turns ON bit 2 of the Terminal Block Unit or Parallel I/O Unit output port.
The POUT function controls the bit status of the Terminal Block Unit or Parallel
I/O Unit output port bit specified with the bit address parameter.
If both Terminal Block Units and Parallel I/O Units are connected, the POUT function does not differentiate between the two. The bit status can be specified up to the total number of input bits for all units. Specify the bit address of the bit to control as a value between 0 and (maximum bit address – 1).
Bit address 0 is the lowest terminal number of the lowest numbered slot.
Displays data on the text display.
[expression] [; or , [expression]..] [; or ,]
PRINT A$,B$
Displays the character data defined by the character expressions A$ and B$ sequentially on the text display.
135
PRINT USING . . . Reference
Description
Section 4
The expression parameter can be specified as a character expression or a numeric expression.
Delimit multiple expressions by commas (,) or semicolons (;). The display depends on the delimiter character used, as follows:
Comma (,)
14 characters are automatically allocated for each expression. An expression less than 14 characters in length is separated from the next expression by blanks.
Semicolon (;)
The expressions are displayed closed together. No fixed data length is allocated to the expressions. Numeric data is displayed preceded by a space for the sign and followed by a blank delimiter character.
Character returns are added automatically under the conditions described below.
Only a character return is displayed if all expression parameters are omitted. If no semicolon (;) is included after the final expression parameter, the character return is added after all the expressions are displayed. If a semicolon (;) is included after the final expression parameter, no character return is added after all the expressions are displayed and the first expression specified with a subsequent PRINT command is displayed consecutively.
A character return is added if the number of spaces remaining in the displayed line is less than the number of characters in the specified expression. Character data is displayed in the spaces remaining in the displayed line.
PRINT USING
(Command)
Action
Format
PRINT USING
Example
Description
Displays formatted data on the text display.
PRINT USING
format control character string ; expression [{; or ,}
expression ...] [; or ,]
PRINT USING ”& &###”;A$,B
Displays the character data and numeric data defined by the character expression A$ and numeric data B sequentially on the text display, with 4 characters for A$ and 3 characters for B.
Specify the format control character string in double quotations (”). The specified characters themselves are not displayed on the text display. The specified for-
mat control character string determines the number of characters and format in the display of the expressions.
Specify the character string defining character data or numeric string defining numeric data with the expression parameters.
Delimit multiple expressions by commas (,) or semicolons (;). The delimiter character used does not affect the display.
The format control character string may contain two types of characters: one type to control the display of character data and the other type to control the display of numeric data. The specified format control character string characters must match the type of data displayed. The control characters are described in the following tables.
136
PRINT # . . . Reference
Section 4
Format Control Character Strings for Displaying Character Data
Character Description
!
&(n blanks)&
@
_
Display only the first character of the character string.
The number of characters displayed is defined by the number of blanks (n) contained between the ampersands (&). A total of (n+2) characters is displayed from the start of the character string. The remaining characters are ignored if the character string contains more than (n+2) characters. The remaining character spaces are filled with blanks if the character string contains less than (n+2) characters.
Display the character string unchanged.
The character following the underscore character is not only a format control character and is printed.
,
.
Format Control Character Strings for Displaying Numeric Data
Character Description
#
+
–
**
¥¥
**
¥
^ ^ ^ ^
_
The number of # characters specifies the number of numeric data digits, including the +/– sign. If the specified number of characters is less than the number of numeric characters, the displayed data is right justified with blanks to the left.
Insert the decimal point (.) in combination with the # characters to specify the decimal position.
Redundant decimal places are filled with zeros.
Specify the + sign as a prefix or suffix of the format control character string to print the + sign before or after the numeric data. If two or more + signs are specified consecutively, the second (and subsequent) + sign is considered to be outside the format control character string.
Specify the – sign as a suffix of the format control character string, the minus sign for negative numeric data is output to the right of the number (i.e., after the number) If two or more – signs are specified consecutively, the second (and subsequent) – sign is considered to be outside the format control character string.
Specify two or more asterisks ( * ) at the start of the format control character string to output asterisks instead of blanks to the left of the numeric data. The asterisks ( * ) fill all blanks in the specified number of characters.
Specify two or more yen signs (¥) at the start of the format control character string to output a yen sign in the blank space to the left of the numeric data. The two yen signs (¥) occupy two character spaces and one of these is used to print the yen sign.
Specify two or more asterisks (
*
) plus a single yen sign (¥) at the start of the format control character string to output asterisks instead of blanks to the left of the numeric data and a yen sign in the blank space immediately to the left of the numeric data. The two asterisks (
*
) and the yen sign (¥) occupy three character spaces and one of these is used to print the yen sign.
Use a comma (,) in combination with the # number characters to delimit each 3 digits of the integer portion of the number. If the comma (,) is specified to the right of the decimal point (.), the comma (,) is output after the numeric data.
Specify four carets (^) after the # number characters to output the number in exponential format.
The character following the underscore character is not only a format control character and is printed.
A non-control character in the format control character string is displayed before or after the character or numeric data.
A percent sign (%) is displayed in front of the numeric data if the digits of the numeric data format specified with the expression parameters exceed the size of the region specified by the format control characters.
PRINT #
(Command)
Action
Format
Example
PRINT #
Writes data to a sequential access file.
PRINT#
file# [, expression[{ ; or ,} expression ...]] [; or ,]
PRINT #1,A$,B$
Organizes the character data defined by the character expressions A$ and B$ into sequential data in the order A$, B$, and writes the data to file#1.
137
PSET Reference
Section 4
Description
PRINT# USING
(Command)
Action
Format
Specify the file# as the number in which the sequential access file was opened for output with the OPEN statement. After writing to the sequential access file is complete, the file must be closed with the CLOSE statement.
Except for the fact that the PRINT# command writes data to a file instead of displaying data on the screen, the command is identical to the PRINT command.
Refer to the PRINT command for information on specifying the expressions, on the meaning of the delimiter characters, and on the rules covering the carriage return characters.
PRINT# USING
Example
Description
Writes formatted data to a sequential access file.
file#,
USING
format control character string ; expression [{; or ,}
expression ...] [; or ,]
PRINT #1,USING ”& &###”;A$,B
Organizes the data defined by the character expression A$, formatted as 4 characters, and the numeric data B, formatted as 3 characters, into sequential data in the order A$, B, and writes the data to file#1.
Specify the file# as the number in which the sequential access file was opened for output with the OPEN statement. After writing to the sequential access file is complete, the file must be closed with the CLOSE statement.
Except for the fact that the PRINT# USING command writes data to a file instead of displaying data on the screen, the command is identical to the PRINT USING command. Refer to the PRINT USING command for information on specifying the format control character string and expressions, on the meaning of the delimiter characters, and on the rules covering the carriage return characters.
Point SET PSET
(Command)
Action
Format
Example
Description
Draws a point in VRAM.
PSET
X, Y, VRAM [, [page#] [, drawing density or drawing mode]]
PSET 100,300,2,,128
Draws a point with drawing density 128 in the window memory at coordinates
(100, 300).
The PSET command draws a point at the specified coordinates.
Specify the VRAM where the point is drawn with a number, as follows:
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
Specify the drawing method with the drawing density or the drawing mode. The default value is drawing mode, OR.
The drawing density parameter specifies the density between 0 and 255 when drawing to the window, image, or shading memory. The default value is 255. The
drawing density parameter has the following effect when set for the character or graphic memory:
0 : 0 written to memory
1: 1 written to memory
138
PUT@ Reference
PUT #
(Command)
PUT@
(Command)
Action
Format
Example
Description
Action
Format
Example
Description
Section 4
The drawing mode settings operate as follows:
OR: The current contents of the image memory ORed with 255 are written to memory.
NOT: 0 is written to memory
XOR: The current contents of the image memory are inverted.
The default value for the drawing mode is OR.
When writing to a frame memory, the contents of planes write protected with the
MASKBIT command remain unchanged.
PUT #
Writes data from the file buffer to a random access file.
PUT
#
file# [, numeric expression]
PUT #1,8
Writes data from the file buffer to the #8 record in the random access file opened as file #1.
The PUT# command writes the data stored in the file buffer to the random access file specified with the file#.
Specify the file# as the number in which the random access file was opened with the OPEN statement.
Specify the number of the record to be written to the file with the numeric expres-
sion. If omitted, the record after the record# used with the previous GET# or
PUT# command is read.
PUT@
Draws the array variable data stored in the image memory to VRAM.
PUT@
X, Y, array name, VRAM [, [page#] [, plane#]]
PUT@ 100,300,A,2
Draws the contents of the array A to a rectangular region of the window memory with top-left coordinates (100, 300).
The PUT@ command draws (overwrites) data from the specified array to a rectangular area with the top-left coordinates (X, Y).
Specify the VRAM where the data is drawn with a number, as follows:
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
Specify the plane number if a frame VRAM is specified with the VRAM parameter (2 to 4).
If a frame VRAM is specified, the contents of planes write protected with the
MASKBIT command remain unchanged.
139
READ Reference
RANDOMIZE
(Command)
Action
Format
Example
Description
RDATA
(Function)
Action
Format
Example
Description
READ
(Command)
Action
Format
Example
Description
Section 4
RANDOMIZE
Initializes random number generation.
RANDOMIZE
[numeric expression]
RANDOMIZE 10
Sets the seed value to initialize random number generation to 10.
The RANDOMIZE command sets a new seed value to initialize random number generation. The RANDOMIZE command only initializes random number generation; use the RND function to generate random numbers.
Specify the seed value with the numeric expression between –32768 to 32767. If the numeric expression is omitted, a message is displayed and the system waits for a seed value between –32768 to 32767 to be input from the keyboard.
Runlength DATA
Reads the detailed run length data.
RDATA
(XY coordinate, run#, measured data)
N=RDATA(0,2,2)
Assigns the edge start coordinate of the #2 run at XY coordinate position 0.
The RDATA command reads measurement data based on the detailed run length data obtained with the MEASURE command.
Specify the coordinates where the run data (line length) is to be read. Set the Y coordinate if the RMODE measuring direction was set to the X direction, or set the X coordinate if the measuring direction was set to the Y direction.
Specify the number of the run data to be read at the specified XY coordinate position with the run# parameter. The function returns 0 if the specified run# exceeds the number of existing runs. The run# starts from 0.
Specify the type of data to be read from the specified run with the measured data parameter, as follows:
0: Number of runs 1: Run length
2: Edge coordinate (start point)
3: Edge coordinate (end point)
The run# is ignored if the measure data is set to 0.
READ
Reads data defined with the DATA statement to a variable.
READ
variable [, variable...]
READ A,B
Reads data to the numeric variables A and B.
The READ command reads the data defined with the DATA statement to sequentially specified variables. Consequently, the READ command must be used with the DATA statement.
Specify the variables separated by commas (,). The format of the variables must match the format specified with the DATA statement.
140
REPLACE . Reference
REM
(Command)
RENUM
(Command)
(Command)
Action
Format
Example
Description
Action
Format
Example
Description
REPLACE
Action
Format
Example
Section 4
If the number of variables specified for the READ command is less than the number specified for the DATA statement, the remaining data is read by the next
READ command. The remaining data is ignored if no further READ command is specified. The number of variables specified to be read must not exceed the number specified with the DATA statement. Take care when programming successive READ commands.
Execute the RESTORE command before the READ command to specify the line containing the DATA statement to read. If no RESTORE command is used before the READ command, the READ command reads the next data after the previously read data (if any), otherwise it reads the data specified with the first
DATA statement in the program. Therefore , it is possible for READ commands on different lines of the program to read the same data several times.
REMark
Inserts remarks into the program.
{
REM
or
,
}remark
REM PROGRAM NAME PROGRAM01 or ’PROGRAM NAME PROGRAM01
The REM statement is non-executable and has not effect on the operation of the program.
It is used to insert remarks and explanations into the program text.
A single-quotation mark (’) can be used instead of the REM statement.
All characters and symbols specified as the parameter are handled as a remark.
Commands and functions included in the remark are not executed. A colon (:) is also considered as part of the remark and cannot be used to continue the line onto the next line.
RENUMber
Renumbers the lines in all or part of the program.
RENUM
[new line#] [, [old line#] [, increment]]
RENUM 1000,100
Renumbers the current line 100 as line 1000 and renumbers all subsequent lines to the end of the program in increments of 10.
The RENUM command renumbers the old line# as the new line# and renumbers all subsequent lines to the end of the program by the specified increment. The default value for the increment is 10.
The program is renumbered from the first line if the old line# is omitted. The default value of the new line# is 10.
REPLACE
Searches for the specified old character string between line# 1 and line# 2 and replaces the it with the new character string.
REPLACE
old character string, new character string [, [line# 1 or label 1]
[–[line# 2 or label 2]]]
REPLACE ”FALSE”,”TRUE”,50–100
Replaces the word “FALSE” with “TRUE” between lines 50 and 100.
141
RETURN . . Reference
Description
RESTORE
(Command)
Action
Format
Example
RESUME
(Command)
(Command)
Description
Action
Format
Example
Description
RETURN
Action
Format
Example
Section 4
The REPLACE command replaces the old character string with the new charac-
ter string between line# 1 (or label 1) and line# 2 (or label 2) and replaces the it with the new character string.
The search and replace operation starts from the first line of the program if the
line# 1 (or label 1) parameter is omitted. The search and replace operation continues to the last line of the program if the line# 2 (or label 2) parameter is omitted.
RESTORE
Specifies the line with the DATA statement to be read by the READ command.
RESTORE
[line# or label]
RESTORE 150
Specify the DATA command in line 150 to be read by the READ command.
The RESTORE command specifies the DATA statement to be read by a subsequent READ command with a line# or label. If a line# is specified, the
DATA statement in the specified line is read by the READ command. If a label is specified, the DATA statement declared after the label is read.
If the line# and label are omitted, subsequent READ commands read the DATA statement on the line with the smallest line number.
RESUME
Ends an error processing routine and restarts the operation before the error occurred.
RESUME
[line# or label or 0 or
NEXT
]
RESUME 1500
Return operation to line 1500.
The RESUME command ends an error processing routine and returns operation to the position where the error occurred. The RESUME command must be executed within an error processing routine.
The line# or label specifies the jump destination after the error processing routine execution is complete. Normally, a line# or label would be specified to repeat the series of processes which led to the error. If the line# and label are omitted or if 0 is specified, operation returns to the statement where the error occurred.
If
NEXT
is specified, operation returns to the statement after the statement where the error occurred.
RETURN
Ends a subroutine and returns operation to the position where the subroutine was called or to a specified line.
RETURN
[line# or label]
RETURN
Returns operation to the line after the line where the subroutine was called.
142
RMDIR . . . Reference
Description
RIGHT$
(Function)
Action
Section 4
The RETURN command ends a subroutine and returns operation to the position where the subroutine was called (the line after the GOSUB command) or to a specified line.
More than one RETURN command can be contained in a single subroutine.
The line# or label can be specified to force operation to jump to the specified position. The specified line# or label must be identical to the label called with the original GOSUB command. Correct operation cannot be guaranteed if the specified line# or label differs from the label specified with the GOSUB command, due to the loss of the correlation between the GOSUB and RETURN commands. Take care when executing a GOSUB command inside a FOR–NEXT loop if GOSUB commands are nested.
RIGHT$
Format
Example
Description
Extracts a character string with the specified length from the right end of the specified character string.
RIGHT$
(character string, character string length)
B$=RIGHT$(”F300-OVL”,3)
Extracts 3 characters from the right end of character string “F300-OVL” and assigns them to variable B$.
Extracts a character string of any length from the end of the specified character
string.
The character string can be specified as a character constant or character variable. A null string (” ”) cannot be specified.
Specify the length of the extracted character string in bytes with the character
string length parameter as a value between 1 and the length of the character
string. A null string is returned if 0 is specified for the character string length. The entire specified character string is returned if the character string length is greater than the length of the specified character string.
ReMove DIRectory RMDIR
(Command)
Action
Format
Example
Description
Deletes a directory from the memory card.
RMDIR
directory name
RMDIR ”BASIC”
Deletes the directory named BASIC from the current directory.
Specify the directory name as the name of a directory in the memory card with a character string. An error occurs if the specified directory does not exist.
The directory specified with the directory name cannot be deleted if it contains files. The files in the directory must be deleted with the KILL command before using the RMDIR command.
Do not specify the current directory as the directory name parameter for the
RMDIR command. To delete the current directory, first use the CHDIR command to change the current directory to another directory (normally one directory up the hierarchy) before using the RMDIR command.
143
RND Reference
RMODE
(Command)
Action
Format
RND
(Function)
Example
Description
Action
Format
Example
Section 4
Runlength MODE
Sets the measurement mode for detailed run length data.
RMODE
binary image plane#, measured pixels [, [window function] [,
[direction] [, [noise] [, image cutout]]]]
RMODE 3,0,1,0
Sets measurement of black pixels for binary image plane 3, with the window function on, X-direction measurement, no noise filtering, and image cutout turned off.
The RMODE command sets the conditions for measurement of the detailed runlength with the MEASURE command. Specify the binary image plane for which the measurement conditions are set with the binary image plane# parameter.
Set the measured pixels parameter to set which pixels to measure, as follows:
0: Black pixels
1: White pixels
Set the window function to specify measurement in the window, as follows:
0: Measure the whole screen.
1: Measure in window only
Set the direction parameter to specify the measurement direction of the detailed run length data, as follows:
0: X direction
1: Y direction
The default value is 0.
Measurement must be made in the X direction before measuring in the Y direction.
Set the noise parameter to specify a number of pixels between 0 and 3 to ignore as noise. This number or less of consecutive pixels is not considered as run length data.
Set the image cutout to 1 to recognize all parts outside the window as part of the run.
The RMODE command must be executed before the MEASURE command.
RaNDom
Generates a random number between 0 and 1.
RND
[(numeric expression)]
A=RND(1)
Assigns the next random number in the current random number sequence to variable A%.
144
RUN Reference
Section 4
Description
Returns a random number between 0 and 1. The random number is generated with 1 as the random number seed until the seed is changed with the
RANDOMIZE command.
The returned random number depends on the specified numeric expression.
The meaning of the specified numeric expression is described in the table below.
Value
Negative value
0
Description
Returns the first random number from the current random number sequence.
Returns the previous random number in the current random number sequence.
Positive value or omitted Returns the next random number in the current random number sequence.
RSET
(Command)
Action
Right SET
Format
Example
Description
Writes right-justified character data to a variable area defined with the FIELD command.
RSET
character variable = character string
RSET A$=”BASIC”
Right justifies the character string “BASIC” and writes it to the variable area defined with the variable name A$.
Specify a character variable name defined with the FIELD command with the
character variable parameter.
Specify a character constant or character variable as the character string.
Excess characters are lost from the left of the character string if the length of the specified character string exceeds the length of the character variable defined with the FIELD command. Conversely, if the length of the specified character
string is less than the length of the character variable, the remaining positions are filled with blanks.
Right TRIM$ RTRIM$
(Function)
Action
Format
Example
Description
Deletes spaces to the right of a character string.
RTRIM$
(character string)
A$=RTRIM$(”JAPAN ”)
Assigns “JAPAN” to variable A$.
Returns the character string (1- or 2-byte characters) with the spaces removed from the right.
RUN RUN
(Command)
Action
Format
Example
Description
Runs a program.
Format 1:
RUN
[line#]
Format 2: filename [, R]
RUN ”PRO1”
Load and execute the program PRO1 on the memory card.
The command in Format 1 runs the program from the specified line#. The program runs from the first line if the line# is omitted.
The command in Format 1 loads the program with the specified filename from the memory card and runs if from the first line. If the R option is specified, files previously opened for I/O are kept open.
The RUN signal turns ON when the RUN command is executed.
145
SBANK . . . Reference
RUNL
(Function)
Action
Format
Example
Description
Reads the simple run length data.
RUNL
(binary plane#, Y coordinate, measured data)
L=RUNL(2,128,0)
Assigns the simple runlength data from Y coordinate 128 of the binary image plane 2 to variable L.
The RUNL command reads the simple run length data obtained for each binary image plane with the MMODE command run function parameter set to 1. Set the number of the binary image plane for which the data is required with the binary
plane# parameter.
Specify the Y coordinate of the run data to be read with the Y coordinate parameter.
Specify the type of data to be read with the measure data parameter, as follows:
0: Run length
1: Start X coordinate
2: End X coordinate
3: Error data (The function returns –1 if more than one run exists.)
Set the MMODE command run function parameter set to 1 before using the
RUNL function.
SAVE SAVE
(Command)
Action
Format
Example
Section 4
RUN Length
Description
Saves an OVL program from memory to the memory card.
SAVE
filename [, P]
SAVE ”MYPROG”
Save the OVL program in memory with the filename MYPROG.BAS.
The SAVE command saves a program in memory in ASCII format to the file specified with the filename in the memory card or RS-232C port. If the name of an existing file is specified as the filename, the old contents of the file are deleted.
The file is coded if the P option is specified.
An error (Illegal function call) occurs if the LOAD, LIST, or EDIT command is executed on a file saved using the P option. An error (Access denied) also occurs if the OPEN command is executed on a file saved using the P option.
Shading memory BANK SBANK
(Command)
Action
Format
Example
Selects the shading memory bank number.
SBANK
(bank#)
SBANK 0
Switches to shading memory bank 0.
146
SCANSET . Reference
Description
SCAN
(Command)
Action
Format
Example
Description
SCANSET
(Command)
Action
Format
Example
Description
Section 4
The SBANK command switches to the shading memory bank 0 or 1 specified with the bank#.
SCAN
Conducts scan measurement of a binary image.
SCAN
VRAM, [page#], [plane#], measured pixels [, [window function] [,
[
NOISE
], [, [X-coordinate compensation] [, [Y-coordinate compensation]]]]
SCAN 3,,5,0,0,,20,–15
Sets measurement of black pixels for binary image plane 5, with the window function on, no noise filtering, +20 X coordinate compensation, and –15 Y coordinate compensation.
The SCAN command conducts scan measurement of a binary image under the conditions specified by the SCANSET command. Read the measured results using the SDATA1 and SDATA2 functions.
Specify the VRAM to be scanned with a number, as follows:
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
The plane# is ignored if a plane VRAM is specified, but the plane# must be set if a frame VRAM is specified.
Set the measured pixels parameter to 0 to measure black pixels or 1 to measure white pixels.
Set the window function to 1 scan the specified region of the image or to 0 to scan the entire screen. The default value is 1.
Set the noise parameter to specify a number of pixels between 0 and 3 to ignore as noise. This number or less of consecutive pixels is not considered as scan data. The default value is 0.
Specify the X-coordinate compensation or Y-coordinate compensation parameter to a displacement offset value between –256 and 255. The default value is 0.
SCANSET
Sets the conditions for scan measurement.
SCANSET
shape, number of array data elements, X array, Y array
SCANSET 0,2,X,Y
Sets scan measurement around an ellipse.
The SCANSET commands sets the conditions for scan measurement.
Specify the shape of the series of pixels to be scanned with the shape parameter, as follows:
0: Ellipse (including circle)
1: Polygonal line
2: Polygon
147
SCNLEVEL Reference
SCNCALIB
(Command)
Action
Format
Example
Description
SCNCAM
(Function)
Action
Format
Example
Description
SCNLEVEL
(Function)
Action
Format
Example
Section 4
Define the scanned shape with the parameter arrays X array and Y array.
For an ellipse, specify the center coordinates and the X and Y half axes.
X array (0): X coordinate of center Y array (0):
X array (1): X axis half axis Y array (1):
Y coordinate of center
Y axis half axis
For non-ellipse shapes, specify X and Y coordinate series.
X array (0): X coordinate of point 0
X array (1): X coordinate of point 1
X array (2): X coordinate of point 2 to
X array (n): X coordinate of point n
Y array (0): Y coordinate of point 0
Y array (1): Y coordinate of point 1
Y array (2): Y coordinate of point 2
Y array (n): Y coordinate of point n
Specify the qualifier (i.e., the number of data elements) in X array and Y array.
SCeNe CALIBration
Specifies the scene and camera# used for the measured value calibration data.
SCNCALIB
scene#, camera#
SCNCALIB 0,3
Sets the scene 0, camera 3 data as the calibration data used to calculate the calibrated data read with the MDATA function.
Specifies the camera# to be calibrated.
The SCNCALIB command sets the scene specified by the scene# and the camera specified by the camera# as the data used for measurement calibration.
The SCNCALIB command is used to specify the scene calibration data set from the menu mode, when calibrated data is read with the MDATA function.
Both the scene# and camera# are set to 0 when OVL is booted up.
SCeNe CAMera
Reads the camera setting data for the specified scene and binary image plane#.
SCNCAM
(scene#, binary image plane#, data type)
L=SCNCAM(3,4,0)
Assigns the camera number of scene 3, binary plane 4, to variable L.
The SCNCAM function reads the camera setting data for the binary image plane specified by the binary image plane# in the scene specified by the scene#.
Specify the type of data to read with the data type parameter using a number, as follows:
0: Camera number
1: Camera magnification
2: Camera angle in degrees
SCeNe LEVEL
Determines the binary level data for a binary image plane of a specified scene.
SCNLEVEL
(scene#, binary image plane#, data type)
L=SCNLEVEL(3,4,0)
Assigns the binary level (lower limit) of scene 3, binary plane 4, to variable L.
148
SDATA1 . . . Reference
Description
SCNLOAD
(Command)
Action
Format
Example
Description
SCNLUT
(Command)
Action
Format
Example
Description
SCNSAVE
(Command)
Action
Format
Example
Description
SDATA1
(Function)
Action
Format
Example
Section 4
The SCNLEVEL function reads the binary level data for the binary image plane specified by the binary image plane# in the scene specified by the scene#.
Specify the type of binary level data to read with the data type parameter using a number, as follows:
0: Binary level (lower limit)
1: Binary level (upper limit)
SCeNe LOAD
Loads the scene measuring condition from a file.
SCNLOAD
file name , scene#
SCNLOAD ”file”
Load the data from the file named “ file” in the memory card as the scene data for scene 0.
The SCNLOAD command loads the data from the file specified with the file
name parameter as scene data and stores it as the measuring conditions for the scene specified by the scene#.
Scene data can be loaded with the SCNLOAD function only from a file saved with the SCNSAVE command or saved in the menu mode.
SCeNe LUT
Sets the binary level of all binary planes in the specified scene to the binary LUT.
SCNLUT
scene#
SCNLUT 6
Sets the binary level of all binary planes in the scene #6 to the binary LUT.
The SCNLUT command batch sets the binary level of all binary planes in the scene specified with the scene# to the binary LUT.
SCeNe SAVE
Saves the scene measuring condition data to a file.
SCNSAVE
file name, scene#
SCNSAVE ”file”,0
Saves the scene data for scene 0 to the file named “ file” in the memory card.
The SCNSAVE command saves the scene data specified with the scene# parameter to the file specified by the file name.
Scan DATA1
Reads the scan measurement data statistics.
SDATA1
(data type)
ED=SDATA1(2)
Assigns the maximum scan length measured by the SCAN command to variable
ED.
149
SEARCH . . Reference
Description
SDATA2
(Function)
(Function)
Action
Format
Example
Description
SEARCH
Action
Format
Example
Description
Section 4
The SDATA1 function reads the scan measurement data statistics measured with the SCAN command. All values are returned in units of pixels.
Specify the statistic required with the data type parameter using one of the following numbers:
0: Number of scans
1: Average scan length
2: Maximum scan length
3: Minimum scan length
4: Median scan length
5: Scan number with the maximum length
6: Scan number with the minimum length
7: Scan number with the median length
Scan DATA2
Reads the individual scan data measurement items.
SDATA2
(scan#, data type)
ED=SDATA2(2,2)
Assigns the start point Y coordinate to variable ED.
The SDATA2 function reads the individual scan data measurement items of the specified scan# measured with the SCAN command. All values are returned in units of pixels.
Specify the date item.
0: Scan length
1: Start point X coordinate
2: Start point Y coordinate
3: End point X coordinate
4: End point Y coordinate
5: Length from scan origin to start point
6: Length from scan origin to end point
SEARCH
Searches for an integer in an integer array and determines the number of the array element where the integer is found.
SEARCH
(integer array name, value to find [, [start element#] [, increment]])
S%=SEARCH(TE%,60)
Searches for the integer 60 in the integer array (100) and assigns the number of the first element where the integer 60 is stored to variable S%.
The SEARCH function finds the specified value in the integer array and returns the the number of the array element where the value is found as an integer. –1 is returned if the specified value is not found in the array.
Specify the integer array name as the name of an array variable defined as a one-dimensional array with the DIM command. Only one-dimensional array variables may be specified.
Specify the integer to be found with the value to find parameter. To find a singleor double-precision integer value, first convert the value to an integer.
Specify the number of array element to start the search with the start element# parameter. Specify any value between the minimum and maximum qualifier val-
150
SET Reference
Section 4
ue. The search starts from the start of the array variable if this parameter is omitted. The minimum qualifier value is declared with the OPTION BASE command.
Specify the increment as a positive integer. The increment sets the counter between the searched array elements. The increment is added to the number of a searched element to determine the number of the next element to search. Intermediate elements are not searched. The default value is 1 if the parameter is omitted and all elements after the start element# are searched.
SELECT...CASE–CASE ELSE–END SELECT
SELECT...CASE–CASE ELSE–END SELECT
(Command)
Action
Provides multiple branching depending on the result of a conditional expression.
Format
SELECT
expression
[
CASE
item [, item...]
Statement in CASE block
CASE ELSE
Statement in CASE ELSE block]
END SELECT
Example
Description
SELECT A
CASE 0
PRINT ”ZERO”
CASE 1,3,5,9
PRINT ”ODD”
CASE 2,4,6,8,
PRINT ”EVEN”
END SELECT
Branches program execution depending on the value of variable A.
The SELECT command branches program execution depending on the value of the specified expression.
The expression can be defined as a numeric or character expression. The program branches as defined when the value of the expression matches the specified CASE value.
Multiple CASE statements may be defined. The CASE and CASE ELSE statement may be omitted.
The END SELECT statement is required; it must not be omitted.
If more than one CASE statement matches the result of the expression, the first of the CASE statements is executed.
Do not use the GOTO command to jump into or out of the SELECT block.
SET
(Command)
Action
Format
Example
Sets the write-protect attribute for a file.
SET
filename or file#, attribute character
SET ”FILE”, ”P”
Write protect the file named FILE.
SET #1, ” ”
Write enable file #1.
SET
151
SETDLUT . Reference
Section 4
Description
Sets the write-protect attribute (write protect or write enable) with the attribute
character for the file specified with the filename or file#. The attribute is applied to the specified file only. Other files in the memory card remain unchanged.
Specify the filename parameter as the name of an existing file with a character string. After the write-protect attribute is set for a file specified with a filename it remains unchanged until cancelled with the SET command.
Specify the file# as the number in which the file was opened with the OPEN command. This attribute is maintained only while the file is open.
Specify the attribute character as either P or a null string or single space. Other characters cause an error. The key to the attribute characters is shown in the table below.
Attribute character
“P”
Null string or single space
Attribute setting
Writing disabled to the file specified with the filename of file#. No data output to the file with file output commands (PRINT#/PUT#/WRITE#).
Cancels write protection for the file specified with the filename of file# to enable data to be written to the file.
SETBLUT
(Command)
Action
Format
Example
SET Binary LUT
Description
Sets array data as binary LUT data.
SETBLUT
binary image plane#, array name [, [qualifier] [, size]]
SETBLUT 2,A
Set the 256 array elements from the start of array A as binary LUT.
The SETBLUT command sets the array specified by the array name as the binary LUT data for the specified binary image plane#.
The qualifier specifies the first array element to be set as the binary LUT data.
The default value is 0.
The size parameter specifies the number of array elements, as follows:
0: 256
1: 512
The default value is 0.
The array data corresponds to the binary LUT data, as follows:
0: 0 set to the LUT non-0: 1 set to the LUT
SET Display LUT SETDLUT
(Command)
Action
Format
Example
Description
Sets an array variable in the display LUT.
SETDLUT
region, array name, [, qualifier]
SETDLUT 1,A
Sets 256 elements of array A as the display LUT for inside the window.
The SETDLUT command sets the values in the array variable specified by the
array name as the display LUT data.
Separate display LUTs are provided for inside and outside the window. Specify the display LUT for inside or outside the window with the region, parameter. Enter 0 to set the display LUT for outside the window or 1 for inside the window.
152
SFTBLUT . Reference
SETDLVL
(Command)
Action
Format
Example
Description
SETLUT
(Command)
Action
Format
Example
Description
SFTBLUT
(Command)
Action
Format
Example
Description
Section 4
The qualifier specifies the first array element to be set as the display LUT. The default value is 0.
SET Display LeVeL
Sets the display level for each display image.
SETDLVL
image type [, gradation]
SETDLVL 1,20
Set the graphic memory display level to 20.
The SETDLVL command sets the display brightness for the image specified with the image type parameter.
0: Character memory
1: Graphic memory
2: Mask image
3: Binary image, white
4: Binary image, black
5: Window memory increment
6: Paint/pattern matching window memory increment
Set the required display level with the gradation parameter. If omitted, the setting reverts to the setting at OVL boot-up.
SET LUT
Sets array data as the filter LUT data.
SETLUT
array name, [, [qualifier] [, size]]
SETLUT A
Sets 256 elements of array A as the filter LUT.
The SETLUT command sets the array data variable specified by the array name as the filter LUT data.
The qualifier specifies the first array element to be set as the filter LUT data. The default value is 0.
The size parameter specifies the number of array elements, as follows:
0: 256
1: 512
The default value is 0.
ShiFT Binary LUT
Shifts the binary LUT contents for each binary image plane.
SFTBLUT
binary image plane#, shift
SFTBLUT 1,–12
Shifts the binary LUT for binary image plane# 1 by –12.
The SFTBLUT command shifts the contents of the binary LUT for the specified binary image plane# by the amount specified with the shift parameter.
The shift operation with positive and negative shift parameters is shown below.
153
SFTLUT . . Reference
Section 4
Before shifting:
Output image gradation
1
0
–256
Positive shift:
0 255
Input image gradation
SFTLUT
(Command)
Action
Format
Example
Description
Output image gradation
1
0
–256
Negative shift:
0 255
Input image gradation
Output image gradation
1
0
–256 0 255
Input image gradation
ShiFT LUT
Shifts the filter LUT.
SFTLUT
shift
SFTLUT –12
Shifts the filter LUT by –12.
The SFTLUT command shifts the contents of the filter LUT by the amount specified with the shift parameter.
The shift operation with positive and negative shift parameters is shown below.
Before shifting:
Output image gradation
255
0
–256 0 255
Input image gradation
154
SIN . Reference
Section 4
Positive shift:
Output image gradation
255
0
–256
Negative shift:
0 255
Input image gradation
SGN
(Function)
Action
Format
Example
Description
SIN
(Function)
Action
Format
Example
Description
Output image gradation
255
0
–256 0 255 Input image gradation
SiGN
Determines the positive or negative sign of a numeric expression.
SGN
(numeric expression)
A=SGN(–35)
Assigns –1 to variable A to indicate that the numeric expression –35 is negative.
The SGN function returns a value (–1, 0, 1) to indicate the sign of the numeric expression. The relationship between the sign of the numeric expression and returned value is shown below.
Numeric expression Returned value
Positive
0
Negative
1
0
–1
SINe
Determines the sine of a numeric expression.
SIN
(numeric expression)
A=SIN(30
*
3.14159/180)
Assigns the sine of 305 to variable A.
The SIN function returns a value between –1 and +1. The numeric expression must be set in radians. Convert an angle in degrees to radians by multiplying by
π
/180.
The numeric expression may be in the form of an integer, long integer, or a single or double-precision real number. The SIN function always returns a double-precision real number.
155
SPC Reference
SPACE$
(Function)
Action
SPC
(Function)
Format
Example
Description
Action
Format
Example
Description
Section 4
SPACE$
Creates a character string comprised of the number of spaces specified by the numeric expression.
SPACE$
(numeric expression)
A$=SPACE$(3)
Creates a character string containing 3 space characters and assigns it to variable A$.
The SPACE$ function returns a character string containing the number of space characters (CHR$(32)) specified by the numeric expression.
Specify the numeric expression as a value between 0 and 255.
The STRING$ function is similar to the SPACE$ function. In the following examples, the STRING$ and SPACE$ functions return the same character string.
A$=SPACE$(10) .... assigns 10 spaces to variable A$
A$=STRING$(10, 32) .... assigns 10 spaces (CHR$(32)) to variable A$
SPaCe
Outputs the specified number of spaces.
SPC
(numeric expression)
PRINT ”OMRON”;SPC(10);”F300”
”OMRON” and ”F300” are displayed on the screen separated by 10 spaces.
The SPC function creates a character string containing the number of spaces specified by the numeric expression. The SPC function cannot be used alone.
Use it together with the PRINT command.
Specify the numeric expression as an integer between –32768 (–2
15
) and
32767 (2
15
–1). A negative numeric expression (–2
15
to –1) is treated as 0. If the designated characters do not fit in one line, the remainder obtained by dividing the number of the designated characters by the number of characters fitting in one line shall be used as the set value. An example is seen in the following.
512 characters
PRINT ”A”; SPC (520); ”B”
A
________
B
PRINT “A”; SPC (520); “B”
The number of characters in one line is 512.
520/512 = 1
(the remainder is 8)
The screen output is as follows:
A
________
B
(8 spaces between A and B)
156
SPLINE . . . Reference
SPCLOSE
(Command)
Action
Format
Example
Description
SPLINE
(Command)
Action
Format
Example
Description
Section 4
SPline CLOSE
Draws a region bounded by a spline curve in VRAM.
SPCLOSE
number of data, X array, Y array, VRAM, [, [page#] [, [density or
drawing mode] [, lineart]]]
SPCLOSE 28,XD,YD,3,,128,0
Draws a region in image memory with drawing density 128 bounded by a spline curve defined by the 28 coordinate points contained in arrays XD and YD.
The SPCLOSE command draws a region bounded by a spline curve. The spline curve is defined by the coordinate points in X array and Y array between the first array element and the element defined by the number of data parameter.
The number of data must not exceed 64.
Specify the VRAM where the region is drawn with a number, as follows:
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
Specify the drawing method with the drawing density or the drawing mode. The default value is drawing mode, OR.
Specify with the lineart parameter if the spline curve is an outline only or filled.
0: Filled spline curve
1: Spline curve outline only
The default value is 0.
When writing to a frame memory, the contents of planes write protected with the
MASKBIT command remain unchanged.
SPLINE
Draws a spline curve in VRAM.
SPLINE
number of data, X array, Y array, VRAM, [, [page#] [, [density or
drawing mode]
SPLINE 28,XD,YD,3,,128
Draws a spline curve in image memory defined by the 28 coordinate points contained in arrays XD and YD with drawing density 128.
The SPLINE command draws a spline curve defined by the coordinate points in
X array and Y array between the first array element and the element defined by the number of data parameter.
The number of data must not exceed 64.
Specify the VRAM where the spline curve is drawn with a number, as follows:
0: Character memory
1: Graphic memory
2: Window memory
3: Image memory
4: Shading memory
Omit the page# or set to 0.
157
STOP Reference
SQR
(Function)
Action
Format
Example
Description
SSCROLL
(Command)
STOP
(Command)
Action
Format
Example
Description
Action
Format
Example
Section 4
Specify the drawing method with the drawing density or the drawing mode. The default value is drawing mode, OR.
When writing to a frame memory, the contents of planes write protected with the
MASKBIT command remain unchanged.
SQuare Root
Determines the square-root of a numeric expression.
SQR
(numeric expression)
A=SQR(100)
Assigns 10, the square root of 100, to variable A.
The SQR function determines the square-root of the specified numeric expres-
sion. The numeric expression must be 0 or a positive value.
The numeric expression may be in the form of an integer, long integer, or a single or double-precision real number. The SQR function always returns a doubleprecision real number.
Shading memory SCROLL
Scrolls the shading master memory.
SSCROLL
X, Y [, center of rotation X, center of rotation Y, angle of rotation]
SSCROLL 50,100,256,256,30
Rotates the shading master memory 30 % clockwise about the coordinates (256,
256) and scrolls it 50 pixels in the X direction and 100 pixels in the Y direction.
The SSCROLL command scrolls the shading master memory in the X, Y, and
θ directions.
Specify the amount of scroll in the X direction with the X parameter and the amount of scroll in the Y direction with the Y parameter. Specify the scroll amounts as a number of pixels between –1024 and +1023.
Specify the amount of rotational scroll in degrees with the angle of rotation parameter and the coordinates of the center of rotation with center of rotation X and center of rotation Y. No rotation occurs if these parameters are omitted.
Specify the center of rotation X and center of rotation Y as a number of pixels between –1024 and +1023.
Scrolling is completed in the order: rotation, X, Y.
STOP
Stops program execution.
STOP
IF A$=”ST” THEN STOP
Stops program execution if A$ = “ST”.
158
STR$ Reference
Section 4
Description
The STOP command stops program execution. It can be used anywhere inside the program.
STOP ON/OFF/STOP
(Command)
Action
STOP key ON/OFF/STOP
Disables, enables, or stops interrupts from the STOP Key.
Format
Example
STOP ON
or
OFF
or
STOP
STOP OFF
Disables branching to the interrupt processing routine when the STOP Key is pressed.
Description
STOP ON:
STOP OFF:
STOP STOP:
The STOP command controls branching to an interrupt processing routine when the STOP Key is pressed.
The STOP ON statement enables the interrupt processing routine when the
STOP Key is pressed. When the STOP Key is pressed, operation branches to the interrupt processing routine at the line# or label defined with the ON STOP
GOSUB statement.
The STOP OFF statement disables the interrupt processing routine when the
STOP Key is pressed. When the STOP Key is pressed, program operation stops but does not branch to an interrupt processing routine.
The STOP STOP statement stops interrupt processing when the STOP Key is pressed. When the STOP Key is pressed, operation does not immediately branch to the interrupt processing routine. However, immediately branching is enabled by the STOP ON statement, operation branches to the interrupt processing routine at the line# or label defined with the ON STOP GOSUB statement.
Note that if the STOP OFF/STOP command is used the STOP Key does not function as normal to stop program execution.
The interrupt subroutine must be defined with the ON STOP GOSUB statement before a STOP ON/OFF/STOP command is executed.
STRing$ STR$
(Function)
Action
Format
Example
Description
Converts a number to character string representation.
STR$
(numeric expression)
A$=STR$(5692)
Converts the value 5692 to a character string and assigns it to variable A$.
The STR$ function converts the numeric expression to a character string. A
numeric expression cannot be directly assigned to a character variable. First convert the numeric expression with the STR$ function before assigning it to a character variable.
The first character in the character string is a space if the numeric expression is positive. The space is replaced by a minus sign if the numeric expression is negative.
The VAL function has the opposite action to the STR$ function.
159
STRMODE Reference
STRCHK
(Function)
Action
Format
Example
STRING$
(Function)
Description
Action
Format
Example
Description
STRMODE
(Command)
Action
Format
Example
Section 4
STRobe CHecK
Checks for incorrect strobe flashing.
STRCHK
D=STRCHK
Assigns the result of the strobe check to variable D.
The STRCHK function checks for incorrect strobe flashing. The function returns a number as follows:
0: Normal strobe flash non-0: No strobe flash or disconnected strobe cable.
The bit position corresponds to the strobe number.
STRING$
Creates a character string containing the specified number of the specified character.
STRING$
(number of characters, character string or numeric expression 2)
A$=STRING$(10,”
*
”)
Assigns a character string containing 10 asterisks to variable A$.
The STRING$ function returns a character string containing the number of specified 1-byte characters specified by the numeric expression. 2-byte characters may not be specified.
Specify the number of characters as a value between 1 and 255.
Specify the character to fill the character string with the character string or nu-
meric expression 2 parameter.
Specifying character string:
Specify the character string as a single 1-byte character.
Only the leading character is valid if more than one character string is specified. The STRING$ function returns a character string filled with the leading character.
Specifying numeric expression 2:
Specify the numeric expression 2 as the decimal character code for a 1-byte character as an integer between 0 and 255.
The SPACE$ function is similar to the STRING$ function. In the following examples, the STRING$ and SPACE$ functions return the same character string.
A$=STRING$(10, 32) .... assigns 10 spaces (CHR$(32)) to variable A$
A$=SPACE$(10) .... assigns 10 spaces to variable A$
STRobe MODE
Enables and disables strobe flashing on the FLASH command.
STRMODE
strobe#, switch
STRMODE 1,1
Strobe 1 flashes when the FLASH command is executed.
160
TAB Reference
Description
SUB–END SUB
(Command)
Action
Format
SWAP
(Command)
Example
Description
Action
Format
Example
Description
TAB
(Function)
Action
Format
Example
Section 4
The STRMODE command enables and disables strobe flashing when the
FLASH command is executed.
Specify the number of the strobe as a value between 0 and 7 with the strobe# parameter. Set strobe# to –1 to specify all the strobes. The specified strobe flashes when the FLASH command is executed if the switch parameter is set to
1. Set the switch parameter is set to 0 to disable the strobe flashing.
All strobes enabled with the STRMODE command flash simultaneously when the FLASH command is executed.
SUB–END SUB
Defines a structural subroutine called by the CALL command.
SUB
label (argument [, argument...])
Statement in
SUB
block
END SUB
SUB * SUB1(A$,B%,C#)
B$ = A$ + ”OMRON”
END SUB
Defines the label * SUB1 as a structural subroutine.
The block between SUB–END SUB defines the structural subroutine called by the CALL command.
All variables used in a subroutine are treated as local variables. The variables specified by the arguments are assigned the values of the local variables after execution of the subroutine.
The label defines the name of the subroutine. This name is used to call the subroutine with the CALL command.
The arguments can be specified as any type of variables, except array variables.
No logical limitation is placed on the number of arguments. However, the command line can physically accommodate up to 255 characters only.
No further SUB–END SUB command may be nested inside a subroutine block.
Statements in subprogram blocks must be located after the main program.
SWAP
Switches two variables.
SWAP
variable 1, variable 2
SWAP A#,B#
Switches the values of variables A# and B#.
The SWAP command switches the contents of variable 1 and variable 2. Both variables must be of the same type.
TABulate
Specifies the position to display characters.
TAB
(numeric expression)
PRINT ”1234567”;TAB(10);”XYZ”
Displays “1234567” from the left-hand character position (character 0) and
“XYZ” from the character 10 position.
161
TIME$ . . . . Reference
Section 4
Spaces
Line feed
Description
The TAB function moves the cursor along a line by the specified number of characters from the left-hand position. If the character position specified by the
numeric expression is less than the current cursor position, the cursor moves to the specified character position on the next line.
The TAB function cannot be used alone. Use it together with the PRINT command.
A negative numeric expression is treated as 0. If a positive numeric expression is specified which exceeds the number of character in a line, the number of characters in a line is subtracted from the specified numeric expression to determine the cursor position.
The differences between the TAB function and the similar SPC function are shown in the following table.
TAB function
Outputs the number of spaces determined by subtracting the number of previously output characters from the numeric expression.
Cursor moves to the next line if the character position specified by the numeric expression is less than the current cursor position.
SPC function
Outputs the number of spaces specified by the numeric-expression from the current cursor position.
No line feed.
TAN
(Function)
Action
Format
Example
Description
TIME$
(Function, Command)
Action
Format
Example
Description
TANgent
Determines the tangent of a numeric expression.
TAN
(numeric expression)
A=TAN(45
*
3.14159/180)
Assigns the tangent of 45 % to variable A.
The TAN function returns an integer between –1.701411834604692D+38 and
+1.701411834604692D+38. The numeric expression must be set in radians.
Convert an angle in degrees to radians by multiplying by
π
/180.
The numeric expression may be in the form of an integer, long integer, or a single or double-precision real number. The TAN function always returns a double-precision real number.
TIME$
Displays and sets the time in the internal clock.
Format 1:
TIME$
Format 2:
TIME$
=
”HH:MM:SS”
CLOCK$=TIME$
Assigns the time returned in TIME$ to the character variable CLOCK$.
Format 1
Reads the time from the F300.
162
TIMER . . . . Reference
Section 4
A character string in the format HH:MM:SS is returned when the TIME$ function is executed.
HH:MM:SS
Seconds: 2 characters between 00 and 59
Minutes: 2 characters between 00 and 59
Hours: 2 characters between 00 and 23
The clock is set to 00:00:00 when the F300 power supply is turned on.
Format 2
Sets the F300 clock:
Set the hours between 00 and 23 with 2 characters.
Set the minutes between 00 and 59 with 2 characters.
Set the seconds between 00 and 59 with 2 characters.
The time must be in the format HH:MM:SS. No part can be omitted.
TIME$ ON/OFF/STOP
(Command)
Action
TIME$ ON/OFF/STOP
Disables, enables, or stops timer interrupts.
Format
Example
Description
TIME$ ON:
TIME$ OFF:
TIME$ STOP:
TIME$ ON
or
OFF
or
STOP
TIME$ ON
Enables branching to the interrupt processing routine due to the timer.
The TIME$ command controls branching to an interrupt processing routine due to the timer.
The TIME$ ON statement enables the interrupt processing routine on timer operation. When timer set with the ON TIME$ GOSUB command is reached, operation branches to the interrupt processing routine at the line# or label defined with the ON TIME$ GOSUB statement.
The TIME$ OFF statement disables the interrupt processing routine on timer operation. All timer interrupts are ignored.
The TIME$ STOP statement stops interrupt processing on timer operation.
When the set time is reached, operation does not immediately branch to the interrupt processing routine. However, immediately branching is enabled by the
TIME$ ON statement, operation branches to the interrupt processing routine at the line# or label defined with the ON TIME$ GOSUB statement.
TIMER TIMER
(Function, Command)
Action
Format
Example
Description
Reads and sets the 10 ms timer.
Format 1:
TIMER
Format 2:
TIMER
= numeric expression
T&=TIMER
Assigns the 10 ms timer PV to variable T&.
Format 1
Reads the 10 ms timer PV. The timer PV is 0 when the power is turned on and increases by 1 every 10 ms.
163
UCASE$ . . Reference
TROFF
(Command)
Action
Format
Example
Description
TRON
(Command)
Action
Format
Example
Description
UBOUND
(Function)
Action
Format
Example
Description
UCASE$
(Function)
Action
Format
Example
Section 4
Format 2
Sets the 10 ms timer to the value between 0 and 2147483647. specified with the
numeric expression.
TRace OFF
Exits the Trace mode.
TROFF
TROFF
Cancels the Trace mode.
The TROFF command cancels the Trace mode.
The Trace mode is cancelled by the TROFF command only. It is not cancelled when a program is executed, completed, interrupted, or re-executed.
TRace ON
Enters the Trace mode.
TRON
TRON
Enters the Trace mode.
The TRON command enters the Trace mode.
When a program is executed in the Trace mode, the line numbers are displayed continuously on the screen as an aid to debugging.
Displays from the program are unchanged in the Trace mode. However, program outputs become mixed with the line numbers. The Trace mode is cancelled by the TROFF command only. It is not cancelled when a program is executed, completed, interrupted, or re-executed.
Upper BOUND
Determines the upper boundary of an array dimension qualifier.
UBOUND
(array name [, number of dimensions])
I=UBOUND(A,1)
Assigns the upper limit of the qualifier of the 1-dimensional array A to variable I.
The UBOUND function returns the upper boundary of an array dimension qualifier.
Specify the name of the array for which the qualifier is to be determined with the
array name parameter.
Specify the number of dimensions of the array with the number of dimensions parameter. The default value is 1.
Upper CASE $
Converts lowercase letters in the character string to uppercase letters.
UCASE$
(character string)
A$=UCASE$(B$)
Converts all lowercase letters in the character string B$ to uppercase letters and assigns the new character string to variable A$.
164
VIDEOIN . Reference
Description
VAL
(Function)
Action
Format
Example
Description
VDWAIT
(Command)
Action
Format
Example
Description
VIDEOIN
(Command)
Action
Format
Example
Description
Section 4
The UCASE$ function converts lowercase letters in the character string to uppercase letters. Existing uppercase letters remain unchanged.
VALue
Converts a number represented as a character string to a number.
VAL
(character string)
A=VAL(”10”)
Converts the character string “10” to the number 10 and assigns it to variable A.
The VAL function converts the character string to a real number.
The character string must be specified as a character variable or character constant starting with +, –, & or a digit between 0 and 9. The VAL function returns
0 if the character string does not conform to this format.
If the character string contains a character which cannot be converted to a number, the characters before the unconvertable character are converted.
Spaces in the character string are ignored and the positions of the spaces are closed in the returned number.
The STR$ function has the opposite action to the VAL function.
VD WAIT
Delays the VD interrupt the specified number of times.
VDWAIT
number of times
VDWAIT 3
Delays the VD interrupt processing by 3 VD interrupts (approx. 50 ms).
The VDWAIT command counts the number of VD interrupts and delays VD interrupt processing the specified number of VD interrupts. Each VD interrupt is equivalent to 1/60 second (approx. 16.7 ms).
Program operation cannot be interrupted with the STOP Key or CNTRL+C Keys during VDWAIT operation.
VIDEO IN
Inputs an image to the image memory.
VIDEOIN
[page#] [, input path]
VIDEOIN 0,0
Input the image from image bus 1 to the image memory.
The VIDEOIN command reads image data to the image memory. This command is used to store an image before carrying out multiple measurements on the same image.
Omit the page# or set to 0.
Input the path from which the image is loaded with a number, as follows:
0: image bus 1
1: image bus 0
The default value is 0.
165
WHILE–WEND . . Reference
The image input timing in each input mode is shown below.
1 field
(1/60 s)
Section 4
VIDEOIN executed
WDISP
(Command)
Action
Format
Example
Description
WHILE–WEND
(Command)
Action
Format
Example
Image input interval
Image input from image bus 0 is disabled while the image memory contents are displayed.
Window DISPlay
Sets the type of image display in a window.
WDISP
window plane#, image type [, [display or not] [, binary reverse]]
WDISP 2,1,1
Display the binary image plane#2 window plane and set a binary image in the window.
The WDISP command sets the type of image display inside the window plane specified by the window plane#. Set window plane# to –1 to specify all window planes.
Set the image type to 0 to display the same image type inside the window as outside the window. Specify 1 to display a binary image in the window.
Specify whether the window itself is displayed with the display or not item. Set to
1 to display the window or to 0 to hide the window. The default value is 0. If window display is selected, the window gradations are increased, or made lighter, to display the window.
Set the binary reverse parameter to 1 to reverse the displayed image or to 0 for a normal displayed image. The default value is 0. The binary reverse setting is valid only when the image type is set to 1 (binary image).
WHILE–While END
The commands between the WHILE and WEND statements are executed repeatedly while a condition remains fulfilled.
WHILE
logical expression
WEND
100 WHILE KAI<10
200 WEND
Executed the lines from 100 to 200 repeatedly while the value assigned to variable KAI is less than 10.
166
WRITE . . . . Reference
Description
WINDOW
(Command)
WRITE
(Command)
Action
Format
Example
Description
Action
Format
Example
Description
Section 4
The commands between the WHILE and WEND statements (WHILE–WEND loop) are executed repeatedly while the logical expression remains true (non-0).
The logical expression declared with the WHILE statement provides the condition for the commands to be executed. The WHILE–WEND loop is executed repeatedly while the logical expression remains true (non-0). Control is transferred to the line after the WEND statement when the logical expression becomes false (0).
The WHILE–WEND loop is not executed if the logical expression is initially false
(0). Control jumps immediately to the line after the WEND statement. Other
WHILE–WEND loops may be nested inside a WHILE–WEND loop. The nested
WHILE–WEND loops must have a one-to-one correspondence between the
WHILE and WHEN statements from the inside of the nested loops toward the outside. WEND statements must not be omitted.
WINDOW
Draws the window set for the specified scene to the window memory.
WINDOW
scene#
WINDOW 3
Draws the window set for scene #3.
The WINDOW command refers to the window data previously set in the Menu mode. It draws the window data for all windows for the scene (0 to 15) specified with the scene# parameter. The previous window memory contents are deleted.
To draw a complex window, it is convenient to set the window while looking at the workpiece in the Menu mode before executing the WINDOW command.
WRITE
Displays data on the display.
WRITE
expression list [{, or ;} expression]
WRITE A$,B
Writes the data defined in variables A$ and B to the text display.
Displays the numeric data and character data specified with the expression list on the text display.
List the numeric and character expressions in the expression list delimited by commas (,) or semicolons (;). Commas (,) or semicolons (;) are identical in function. If the expressions in the expression list are delimited by commas (,), the data items are displayed on the screen separated by commas (,). A character string is displayed enclosed in double-quotations (“ ”).
If a numeric expression is specified, spaces in front of the data are deleted on the display.
A carriage return character is inserted automatically after all the expressions are displayed.
The PRINT command is similar to the WRITE command but differs as follows:
• comma (,) and semicolon (;) delimiter characters differ in function
• no commas (,) displayed between data items on the screen
• double-quotations (”) not displayed
167
WSCROLL . Reference
WRITE #
(Command)
Action
Format
Example
Description
WSCROLL
(Command)
Action
Format
Example
Description
Section 4
• spaces in front of numeric data are displayed.
WRITE #
Writes data to a sequential file.
WRITE
#
file#, expression list [{, or ;} expression]
WRITE #1,J,K,A$
Concatenates the numeric data and character data defined with the expressions
J (numeric), K (numeric), and A$ (character) and writes it to file #1.
Specify the file# as the number in which the output file was opened with the
OPEN command. Specify the same file# with the CLOSE command to close the file after output is complete.
List the numeric and character expressions in the expression list delimited by commas (,) or semicolons (;). Commas (,) or semicolons (;) are identical in function. If the expressions in the expression list are delimited by commas (,), the data items are written to the file separated by commas (,).
A character string is automatically enclosed in double-quotations (”) when written to a file.
If a numeric expression is specified, spaces in front of the data are deleted when the data is written to the file. Consequently, the file area used is less than with the
PRINT# command which writes leading spaces to the file.
The WRITE# command automatically inserts a linefeed character (CHR$(10)) after writing the last expression to the file.
The PRINT# command is similar to the WRITE# command but differs as follows:
• comma (,) and semicolon (;) delimiters differ in function.
• commas (,) and double quotations (”) are not automatically inserted.
• spaces in front of numeric data are also written to a file.
Window SCROLL
Scrolls the window memory.
WSCROLL
X, Y [, center of rotation X, center of rotation Y, angle of rotation]
WSCROLL 50,100,256,256,30
Rotates the window memory 30 % clockwise about the coordinates (256, 256) and scrolls it 50 pixels in the X direction and 100 pixels in the Y direction.
The WSCROLL command scrolls the window memory in the X, Y, and
θ
directions.
Specify the amount of scroll in the X direction with the X parameter and the amount of scroll in the Y direction with the Y parameter. Specify the scroll amounts as a number of pixels between –1023 and +1023.
Specify the amount of rotational scroll in degrees with the angle of rotation parameter and the coordinates of the center of rotation with center of rotation X and center of rotation Y. No rotation occurs if these parameters are omitted.
Specify the center of rotation X and center of rotation Y as a number of pixels between –1023 and +1023.
Scrolling is completed in the order: rotation, X, Y.
168
PART II
Version 2.00
SECTION 1
OVL Version 2.00 Improvements
This section describes the additional functions and improvements found in OVL Version 2.00.
1-1 Overview of Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-1-1 Summary of Additional OVL Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-1-2 Alphabetical Listing of New Functions & Commands . . . . . . . . . . . . . . . . . . . . .
1-1-3 Changes in Specifications
1-1-4 Increased Processing Speed
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2 Additional OVL Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2-1 Multiple-window Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2-2 Window Enlargement/Reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2-3 Binary Image Processing
1-2-4 Raw Image Processing
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2-5 Image-to-image Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2-6 High-speed Array Operations
1-2-7 Renumbering Labels
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2-8 Zooming Window & Shading Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2-9 Filtering Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2-10 Checking Menu Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2-11 Calculations using Simple Run Length
1-2-12 BCD/Binary Conversion
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2-13 Console Key Interrupts
1-2-14 Memory Card Operations
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2-15 Camera Synchronization
1-2-16 System Information
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2-17 Standard I/O Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2-18 Loading/Saving Programs through RS-232C . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2-19 Binary Level Setting Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
177
177
179
180
180
180
181
181
181
181
182
174
174
175
175
175
176
176
170
170
171
172
172
172
172
169
Overview of Improvements
Section 1-1
1-1 Overview of Improvements
1-1-1 Summary of Additional OVL Capabilities
The following capabilities have been added for Version 2.00. These improvements are described in detail in PART II 1-2 Additional OVL Capabilities.
Multiple Window Functions
The area, center of gravity, and axis angle can be calculated quickly with 9 or more windows.
Window
Enlargement/Reduction
Binary Image Processing
Raw Image Processing
Image-to-image Calculations Image-to-image calculations can be performed on binary and raw images.
High-speed Array
Operations
Renumbering Labels
A single command can be used to perform high-speed operations between array variables.
Labels can be renumbered based on the windows’ center of gravity or location on the screen.
Zooming Window &
Shading Memory
Filtering Selection
Obtain Menu Settings
Calculations using Simple
Run Length
Window memory and shading memory can be enlarged and reduced. It is possible to switch quickly between several windows for measurements.
Previously, image filtering functions could only be set in the menu. These functions can now be selected in OVL as well.
The criteria and reference image data set in the menu can now be obtained from
OVL.
A variety of measurements can be made based on the simple run length. This function can be used for quickly measuring dimensions, counting the number of
IC pins, etc.
BCD/Binary Conversion
Window size can be enlarged and reduced to check for omission or blurring of characters.
Binary image processing such as edge detection, changing line thickness, zooming, elimination of isolated points, filling in holes, and elimination of surrounding graphics can be performed.
Raw image processing such as Sobel processing and 3
×
3 mask processing can be performed.
Console Key Interrupts
Memory Card Operations
Camera Synchronization
System Information
Standard I/O Settings
Loading/Saving Programs through RS-232C
Binary Level Setting Range
Two functions have been added to convert numerical values between BCD and binary. These functions are useful when outputting data from Parallel I/O Units or Terminal Block Units.
Several commands have been added to control Console key interrupts and define interrupt routines.
The Memory Card can be formatted and the Memory Card’s battery voltage can be checked from OVL.
A command has been added that selects the method of camera synchronization
(internal or external).
A new function has been added that displays the model and version of the system. This function can be used to ensure compatibility when writing programs.
Instructions can be input through the RS-232C port instead of a keyboard, and the video monitor output can be output to the RS-232C port, so an OVL program can be developed without a keyboard.
The $1A code at the end of files is now recognized when loading or saving programs through the RS-232C port using LOAD” COM:” or SAVE” COM:”.
The binary level range has been doubled, so the maximum binary level setting is now 511 rather than 255.
170
Overview of Improvements
Section 1-1
1-1-2 Alphabetical Listing of New Functions & Commands
The following table lists the functions and commands that have been added for
OVL Version 2.00. (New features have been added to FILTDATA, IPL, LEVEL, and LSORT.)
D DILA
EDGRJECT
E ELIM
EROS
FILTDATA
F FILTSEL
FORMAT
GETMDATA
G GETVER
GMFUNC
H HFILL
I IPL
L LEVEL
LSORT
MASK3
M MWMEAS
MWSET
O ON CONKEY
GOSUB
R RUNL2
Command/Function
A ARRYFUNC
BATCHK
BCDTOBIN
B BEDGE
BINTOBCD
BMFUNC
CAMSYNC
C CONKEY ON/
OFF/STOP
S
SCNJUDGE
SCNSTAND
SOBEL
SZOOM
T THIN
WDILA
W WEROS
WZOOM
Operation Type
Performs high-speed operations between the variables of up to 4 arrays.
Command
Checks the voltage of the Memory Card’s battery.
Function
Converts BCD data to binary.
Detects edge of a binary image.
Converts binary data to BCD.
Performs logic operations on binary images.
Selects camera synchronization method.
Enable and disable input of Console key interrupt. CONKEY STOP masks input of Console key interrupt. (Interrupt is recorded by not executed until
CONKEY ON is executed.)
Function
Command
Function
Command
Command
Command
Expands a binary image.
Deletes the graphics surrounding a binary image.
Eliminates isolated points from a binary image.
Reduces a binary image.
Specifies the line filter factors. (With Sobel processing)
Selects image filtering functions.
Formats the Memory Card.
Obtains measurement data (MDATA) in a batch.
Command
Command
Command
Command
Command
Command
Command
Command
Obtains the system’s version.
Performs logic operations on raw images.
Fills holes in binary images.
Sets the OVL boot-up mode. (Loads and executes the designated file.)
Sets the binary level for each binary image plane.
Renumbers the assigned label numbers.
Performs 3
×
3 mask filtering on raw images.
Performs multiple-window measurements.
Defines windows for use in MWMEAS command.
Defines the interrupt subroutine that will be executed when a Console key interrupt input is received.
Performs secondary processing at high speed on data obtained with the
RUNL function.
Reads the criteria that were set in the menu mode.
Reads the reference image data that were set in menu mode.
Performs Sobel processing.
Zooms (reduces/enlarges) the shading memory.
Reduces line thickness in a binary image.
Enlarges the binary image in window memory.
Reduces the binary image in window memory.
Zooms (reduces/enlarges) the window memory.
Function
Command
Command
Command
Command
Command
Command
Command
Command
Command
Function
Function
Function
Command
Command
Command
Command
Command
Command
Page
184
185
185
185
186
186
186
187
198
198
199
199
200
200
200
201
201
192
193
193
194
195
195
195
196
197
197
187
188
188
189
189
190
191
191
171
Additional OVL Capabilities
Section 1-2
1-1-3 Changes in Specifications
File Delimiters
The following changes have been made in OVL specifications.
The following table shows the delimiters used with OVL Versions 1.
jj
and
2.00. Relevant files are data files and programs transferred via RS-232C or between the CPU and a Memory Card.
Compile Work Space
File I/O
Input
Output
Version 1.
jj
CR+LF or LF
CR+LF
Delimiters used
Version 2.00
CR+LF or CR
CR+LF
As shown in the table, Version 2.00 cannot handle version 1.
jj
files that use
LF as a delimiter. Be sure to change these delimiters to CR or CR+LF before inputting the files to OVL Version 2.00.
The factory setting for compile work space has been increased from 4K bytes to
8K bytes in order to prevent “Out of compile work space” errors. The maximum possible setting for compile work space is 16K bytes.
1-1-4 Increased Processing Speed
The following improvements have been made to increase processing speed.
Memory Card Access Speed
Data in Memory Cards is accessed 1.5 times faster (on average) when loading/ saving programs or reading/writing data files. The increase in the access speed varies depending on the operation being performed.
Labelling Speed
The labelling operation performed with the LABEL command is 1.5 times faster
(on average), although the increase in the labelling speed varies depending on the conditions.
The LDATA function obtains center-of-gravity data 1.5 times faster (on average), although any data less significant than 0.0001 is truncated.
1-2 Additional OVL Capabilities
This section describes the additional capabilities of OVL Version 2.00. Refer to
PART II 1-1-1 Summary of Additional OVL Capabilities for a summary of these improvements.
1-2-1 Multiple-window Functions
This section describes how to use the new multiple-window functions added for
OVL Version 2.00.
Multiple-window Features
The multiple-window functions allow high-speed measurements to be made with 9 or more windows. The basic features of multiple-window functions are listed below:
1, 2, 3...
1. The possible number of windows is limited only by memory capacity.
2. Arbitrary window graphics are possible.
3. The items that can be measured are the area, center of gravity, and axis angle within individual windows.
4. The measurement results are brought together and stored in array variables at high speed.
5. X and Y position compensation functions are provided.
6. White or black pixels can be specified for measurements.
7. Binary image planes can be specified for measurements.
8. The X center of gravity and Y center of gravity can be measured simultaneously.
172
Additional OVL Capabilities
Section 1-2
Multiple-window Applications The multiple-window functions are useful in the following kinds of situations:
•
There are a large number of relatively small measurement regions.
•
Position compensation is performed in a large window, but the measurement region is small after position compensation.
•
The presence of an object is measured by a large number of points.
Using Multiple Windows
The basic procedure for using multiple-window functions is listed below:
1, 2, 3...
1. If measurements will be made in a window that is not rectangular, the window graphic must be drawn in the window memory beforehand. It is not necessary to draw rectangular windows in window memory.
2. Before beginning the measurement, set the binary image plane and measurement region (window) to be used in the measurement. Once these settings have been made, they are usually valid thereafter.
3. Input the binary image in image memory. The image is normally input through image bus 0.
4. Make the multiple-window measurement on the binary image that was input in step 3.
5. Process the results of the multiple-window measurement.
There are two ways to specify the measurement region (window):
•
The window’s coordinates can be set one-by-one by the program. This method is convenient if the window coordinates are known beforehand.
•
A window that has been set in menu mode can be registered as a measurement region. Use the labelling function and the window’s coordinates will be calculated automatically by a program. A program that automatically calculates the coordinates is required, but this is a very easy and convenient way to set a window.
Refer to the sample programs in PART II 3-1 Determination of Windows’ ON/
OFF Status for a more detailed description of using multiple windows.
Precautions for Multiple
Windows
Take the following points into consideration when using multiple-window functions:
1, 2, 3...
1. The processing time is proportional to the size of the rectangle that encloses the measurement region (window).
2. Measurements are made on the rectangle that encloses the measurement region. Consequently, if a second window is drawn within the rectangle that encloses an L-shaped window, the second window will be measured as the same window.
W1 W1
W0
W0 W2
If W0 and W1 are set within the same window plane as shown in the diagram on the left, W1 will be within the rectangle that encloses W0. When W0 is measured, the processing will use W0 and part of W1 as the measurement region.
In these cases, split the window as shown in the diagram on the right. Splitting the window like this will increase the processing speed. Another solu-
173
Additional OVL Capabilities
Section 1-2
tion would be to draw W0 and W1 in separate window planes and perform the multiple-window measurement twice.
3. Multiple-window measurements cannot be performed in windows that have been enlarged or reduced with the WZOOM command, so do not use the multiple-window functions and WZOOM together.
1-2-2 Window Enlargement/Reduction
Windows can be enlarged with the WDILA command and reduced with the
WEROS command. This enlargement and reduction is useful when checking for omission or blurring of characters.
10000 ’For the label with the largest area, draw an
10010 ’enlarged reverse window in window plane 7
10020 ’and a reduced window in window plane 6.
10030 DISPLAY 31,0 ’Binary image display
’Window display 10040 WDISP –1,1,1
10050 CLS 2
10060 RMODE 0,0,0
10070 MEASURE
10080 LABEL
’Measure black pixels
’Measure
’Labelling
10090 IF LNUM<0 THEN 10040
10100 LSORT 0 ’Sort by area
10110 ’Find coordinates of the enclosing rectangle.
10120 X1=LDATA(1,7)–10:Y1=LDATA(1,8)–10
10130 X2=LDATA(1,9)+10:Y2=LDATA(1,10)+10
10140 IF X1<1 THEN X1=1
10150 IF Y1<1 THEN Y1=1
10160 IF X2>510 THEN X2=510
10170 IF Y2>510 THEN Y2=510
10180 LPUTIMG 1,2,0,7 ’Draw in window memory
10190 WDILA 7,X1,Y1,X2,Y2,,3 ’Expand 3 times
10200 MASKBIT 2,0,&H7F ’Mask planes other than plane 7.
10210 BOX X1,Y1,X2,Y2,2,0,XOR ’Reverse window memory.
10220 MASKBIT 2,0,0
10230 LPUTIMG 1,2,0,6 ’Draw in window memory
10240 WEROS 6,X1,Y1,X2,Y2,,3 ’Reduce 3 times.
1-2-3 Binary Image Processing
Various kinds of binary image processing can be performed on binary images stored in image memory.
10000 ’Detect edge in plane 7 in image memory.
10010 DISPLAY 31,3 ’Binary image: bus 1
10020 BACKDISP 1,7 ’Binary display plane 7.
10030 LEVEL 7,100,255 ’Binary level setting.
10040 VIDEOIN 0,1:VDWAIT 3 ’Input image
10050 FILTERIN 1 ’Display image memory contents
10060 BEDGE 0,7 ’Edge detection for entire image
174
Additional OVL Capabilities
Section 1-2
1-2-4 Raw Image Processing
The MASK3 command performs 3
×
3 mask processing on raw images stored in image memory.
The SOBEL command performs sobel processing on raw images stored in image memory.
The FILTDATA and FILTER commands can be used for filter processing, but the
FILTER command processing is performed with hardware using the high-speed interlaced method. On the other hand, the MASK3 and SOBEL command processing is performed with the non-interlaced method.
10000 ’Sobel processing on a rectangular region.
10010 DISPLAY 31
10020 FILTERIN 0
’Raw image display.
’Camera image display.
10030 VIDEOIN:VDWAIT 3 ’Input image
10040 FILTERIN 1 ’Display image memory contents
10050 SOBEL 0,100,100,300,300 ’Sobel processing of rectangular region
1-2-5 Image-to-image Calculations
The BMFUNC command can perform calculations between binary images.
The GMFUNC command can perform calculations between raw images, but only with F300-C11E models equipped with 2 image memories.
10000 ’Displays only the part change in 1 second.
10010 DISPLAY 31,3
10020 BACKDISP 1,7
’Binary image: bus 1
’Binary display plane 7.
10030 MASKBIT 3,0,&H7F ’Mask planes other than plane 7.
10040 VIDEOIN 0,1 ’Input binary image.
10050 VDWAIT 60 ’Wait 1 second.
10060 MASKBIT 3,0,&HBF ’Mask planes other than plane 6.
10070 VIDEOIN 0,1
10080 VDWAIT 3
’Input binary image.
’Wait for image to be input.
10090 FILTERIN 1
10100 BMFUNC 2,0,6,2,0,7
’Display image memory contents
’Use XOR to calculate parts that don’t match.
1-2-6 High-speed Array Operations
The ARRYFUNC command can be used to perform a variety of array operations at high speed. Be sure to declare the array variables with the DIM command before using ARRYFUNC.
The following examples show 5 applications of the ARRYFUNC command.
Example 1
The content of array variable A is copied to array variable B.
ARRYFUNC 12,100,B,A
Example 2
Example 3
The content of array variable A is divided by 100.
FOR I=0 TO 99
B(I)=100
NEXT
ARRYFUNC 6,100,A,A,B
The area within each window is compared to the lower and upper limits and the result of the comparison is stored in array variable JG.
GETMDATA 0,AR
ARRYFUNC 10,8,JG,AR,LO,HI
175
Additional OVL Capabilities
Section 1-2
Example 4
Example 5
The ON/OFF status in each window is output to a Terminal Block Unit.
GETMDATA 0,AR
ARRYFUNC 11,8,JG&,AR,LO,HI
DOUT JG&(0),0,32
The ON/OFF status in 64 multiple windows is output to a Parallel I/O Unit.
MWMEAS 0,0,0,1,0,0,0,AR
ARRYFUNC 11,64,JG&,AR,LO,HI
DOUT JG&(0),0,32
VDWAIT 1
DOUT JG&(1),0,32
1-2-7 Renumbering Labels
Previously, label numbers could be sorted according to their area only, but the
LSORT command can renumber the labels according the windows’ center of gravity or position on the screen.
The diagram on the left shows labelling according to screen position, beginning in the upper left corner. The diagram on the right shows labelling according to the location of the X center of gravity, beginning on the left. (The numbers indicate the renumbered labels.)
1
1
2 3 4
6
4
2
5 5
7
3
7
6
Screen position
(horizontal numbering from upper-left)
X center-of-gravity position (from the left)
1-2-8 Zooming Window & Shading Memory
Window memory can be enlarged and reduced with the WZOOM command.
Window memory can be used like a bank if the WZOOM and WSCROLL commands are used together.
512
512
No. 1
No. 2
No. 3 No. 4
176
Additional OVL Capabilities
Section 1-2
When windows have been drawn as in the diagram above, the following commands would expand and measure window No. 1.
WZOOM 2
WSCROLL 0,0
MEASURE
The following commands would expand and measure window No. 3.
WZOOM 2
WSCROLL 0,–512
MEASURE
The coordinates specified by the WSCROLL command are performed on the coordinate space zoomed by the WZOOM command. If it is expanded by 2, the space would be (0,0) to (1023,1023). If it is reduced by 2, the space would be
(0,0) to (255,255).
Operation of the SZOOM command is identical to that of the WZOOM command.
1-2-9 Filtering Selection
Image filtering functions can be selected easily with the FILTSEL command.
Images are output from image bus 0 after image filtering.
When vertical edge or horizontal edge filtering are selected, the contents of the
LUT (look-up table) for binary conversion are overwritten. With vertical edge or horizontal edge filtering it is necessary to set the binary conversion level for the negative portion of grayness.
Execute the following commands when setting the binary conversion level from
L1 to L2:
LEVEL –1,L1,L2:LEVEL –1,512–L2,512–L1,OR
To display a raw image with strong smoothing:
DISPLAY 31,0
FILTSEL 2,0
To display a binary image with strong smoothing:
DISPLAY 31,0
FILTSEL 2,1
LEVEL –1,100,255
’Not necessary when specified beforehand.
To display a raw image with vertical edge filtering:
DISPLAY 31,0
FILTSEL 9,0
’Contents of the LUT for binary conversion are overwritten.
To display a binary image with vertical edge filtering:
DISPLAY 31,0
FILTSEL 9,1
LEVEL –1,100,512–100 ’Absolutely necessary.
1-2-10 Checking Menu Settings
The criteria set with the menu can be read with the SCNJUDGE function.
This function is useful in a measurement program used for discrimination based on the criteria, when only the criteria are set in menu mode.
Example 1
10000 CHANGE 0 ’Switch to scene 0.
10010 HI=SCNJUDGE(0,0,0,0)
10020 LO=SCNJUDGE(0,0,0,1)
’Upper limit for area of scene 0, window 0.
’Lower limit for area of scene 0, window 0.
177
Additional OVL Capabilities
10030 MEASURE
10040 A=MDATA(0,0)
’Measure.
’Obtain area.
10050 IF LO<=A AND A<=HI THEN PRINT ”OK” ELSE PRINT ”NG”
10060 GOTO 10030
Section 1-2
Example 2
10000 ’Display the criteria set with the menu.
10010 K$(0)=”Area”
10020 K$(1)=”X grav cent”
10030 K$(2)=”Y grav cent”
10040 K$(3)=”Axis angle”
10050 K$(4)=”Edge angle”
10060 K$(5)=”X center coor.”
10070 K$(6)=”Y center coor.”
10080 K$(7)=”Angle of inclination”
10090 K$(8)=”Cross point X coordinate”
10100 K$(9)=”Cross point Y coordinate”
10110 U$(0)=”%”
10120 U$(1)=”
±
PIX”:U$(2)=”
± mm”:U$(3)=”
±_
”
10130 U$(4)=”PIX”:U$(5)=”mm”:U$(6)=”
_
”
10200 FOR I=0 TO 9
10210
10220
10230
HI=SCNJUDGE(0,0,I,0)
LO=SCNJUDGE(0,0,I,1)
UN=SCNJUDGE(0,0,I,2)
10240
10250
PRINT USING ”@ UPPER LIMIT=######.### @”;K$(I),HI,U$(UN)
PRINT USING ”@ LOWER LIMIT=######.### @”;K$(I),LO,U$(UN)
10260 NEXT
The reference image data set with the menu can be read with the SCNSTAND function.
This function is useful when comparing the reference image data set with the menu or performing position compensation. All of the measurement item data will be renewed when reference image data is registered with the menu.
10000 ’Display the reference image data set with the menu.
10010 DIM K$(11)
10020 K$(0)=”Area reference”
10030 K$(1)=”X grav cent reference”
10040 K$(2)=”Y grav cent reference”
10050 K$(3)=”Axis angle reference”
10060 K$(4)=”Edge angle reference”
10070 K$(5)=”X center coor. reference”
10080 K$(6)=”Y center coor. reference”
10090 K$(7)=”Angle of inclination reference”
10100 K$(8)=”Cross point X coor. reference”
10110 K$(9)=”Cross point Y coor. reference”
10120 K$(10)=”X position compensation”
10130 K$(11)=”Y position compensation”
10140 FOR I=0 TO 11
10150 PRINT USING ”@ #####.##”;K$(I),SCNSTAND(0,0,I)
10160 NEXT
178
Additional OVL Capabilities
Section 1-2
1-2-11 Calculations using Simple Run Length
The RUNL2 function can be used to calculate a variety of values using the simple run length.
Window
1
2
Work piece
3
4
5
6
7
YS7
YE7
When the work piece and window are set up as shown in the diagram above, the various measurements described below can be made using RUNL2. The rectangular pieces projecting to the right from the work piece are known as legs. The
Y coordinate of the upper edge of each leg is labelled YSn, and the Y coordinate of each lower edge is labelled YEn.
There are 17 types of measurements possible with RUNL2. These measurements, specified by numbers 0 to 16, are described below.
0: Area
1: Number of Runs
The total area of the legs (area of the work piece within the window).
The number of horizontal lines = the total height of the legs =
Σ
(YEn–YSn+1).
The average length of all legs.
2: Average Run Length
3: Maximum Run Length
4: Minimum Run Length
5: Median Run Length
The length of the longest leg (leg 5 in the diagram above).
The length of the shortest leg (leg 1 in the diagram above).
The length of the median leg (the middle of the group, ordered by length).
6: Max. Run Length Y Coor.
The Y coordinate of the longest leg. (YS5 in the diagram above)
7: Min. Run Length Y Coor.
The Y coordinate of the shortest leg. (YS1 in the diagram above)
8: Med. Run Length Y Coor.
The Y coordinate of the median leg.
9: Number of Run Groups
Number of legs.
10: Average Run Group Width The average width of the legs.
11: Max. Run Group Width
The maximum value of leg width. (In the diagram above, leg 7’s width =
YE7–YS1+1.)
179
Additional OVL Capabilities
Section 1-2
12: Min. Run Group Width
The minimum value of leg width. (In the diagram above, leg 1’s width = YE1–
YS1+1.)
13: Median Run Group Width The median leg width.
14: Max. Run Group Width
Y Coordinate
The Y coordinate of the leg with the maximum width. (YS7 in the diagram above)
15: Min. Run Group Width
Y Coordinate
The Y coordinate of the leg with the minimum width. (YS1 in the diagram above)
16: Median Run Group
Width Y Coordinate
The Y coordinate of the leg with the median width.
1-2-12 BCD/Binary Conversion
The BCDTOBIN function converts BCD values to binary and the BINTOBCD function converts binary values to BCD. These functions are useful when BCD measurement results need to be output in binary. The BCD values must be 8 digits or less.
’Scene 0 measurement conditions.
10000 CHANGE 0
10010 MEASURE ’Measure.
10020 AREA=BINTOBCD(MDATA(0,0)) ’Converts area to BCD.
10030 DOUT AREA,0,32 ’8-digit BCD data is output in 32 bits.
1-2-13 Console Key Interrupts
The CONKEY ON, CONKEY OFF, and CONKEY STOP commands control
Console key interrupts and the ON CONKEY GOSUB command defines the interrupt subroutine. Operation of the interrupt is identical to that of ON HELP GO-
SUB.
10000 ON CONKEY GOSUB *CONKEYINT
10010 CONKEY ON
10020 GOTO 10020
20000 *CONKEYINT
20010
20020
PRINT ”Console key interrupt occurred.”
PRINT ”The key code was: ”;HEX$(KEYIN(0))
20030 RETURN
1-2-14 Memory Card Operations
The BATCHK function is used to check the Memory Card’s battery voltage. This is a convenient way to determine when the battery needs to be replaced.
SELECT BATCHK(”C:”)
CASE 0:PRINT ”Low voltage. Replace battery.”
CASE 1:PRINT
”Insufficient voltage. Replace battery soon.”
CASE 1:PRINT ”Battery voltage O.K.”
END SELECT
The Memory Card can be formatted with the FORMAT command. All data (such as scene data saved in menu mode) will be erased when the Memory Card is formatted.
When FORMAT is executed, a prompt will appear to confirm that the Memory
Card will be formatted. Input “Y” to proceed or “N” to cancel.
180
Additional OVL Capabilities
Section 1-2
1-2-15 Camera Synchronization
The CAMSYNC command can be used to set the camera synchronization method to internal synchronization or external synchronization. When internal synchronization is selected, some time is required for the camera image to stabilize.
The selected synchronization method is valid for all cameras. It is not possible to set the synchronization of any particular camera or have some cameras with internal synchronization and some with external synchronization.
10000 ’Switch to internal synchronization.
10010 CAMERA 0 ’Select internal synchronization camera.
10020 CAMSYNC 1
10030 VDWAIT 3
’Select internal synchronization.
’Wait for image to stabilize.
1-2-16 System Information
The GETVER function can be used to display the OVL version and other system information. This function is useful when writing programs, since it can be used to ensure compatibility.
10000 IF GETVER(1)=11 THEN PRINT ”There are 2 image memories.”
10010 PRINT ”OVL Version = ”;GETVER(2)
10020 PRINT ”System Version = ”;GETVER(3)
10030 IF GETVER(2)<2.00 THEN
10040 PRINT ”Multiple-window functions cannot be used.”
10050 END IF
1-2-17 Standard I/O Settings
Instead of using a keyboard, commands can be input from a device connected to the RS-232C port. Instead of using a video monitor, data can be output to a device connected to the RS-232C port.
With standard I/O specified, settings can be made with IPL commands or the menu mode’s “Y. System” “M.Initial Mode”. The settings will be effective the next time that OVL is booted up, and will continue to be effective even after the power is turned off.
For a standard I/O device connected through the RS-232C port, channel 0 is fixed to 9600 baud, 8 data bits, no parity, and 1 stop bit. Screen control, such as clearing the screen, cannot be performed just by outputting characters through the RS-232C.
RS-232C file control cannot be performed on channel 0 when the RS-232C port is specified for standard I/O device.
1-2-18 Loading/Saving Programs through RS-232C
LOAD” COM:” and SAVE” COM:” can be used to load and save programs through the RS-232C port. The communications protocol is 9600 baud, 8 data bits, no parity, and 1 stop bit.
Programs are input through the RS-232C port with LOAD” COM:”. The LOAD command ends when the file’s end code (1A$ in hexadecimal) is received. Programs are output through the RS-232C port with SAVE” COM:”.
The following commands can be used to load and save screen data and image data through the RS-232C port. They are used just like LOAD” COM:” and
SAVE” COM:”.
SCNLOAD ”COM:” Loads screen data.
SCNSAVE ”COM:”
IMGLOAD ”COM:”
IMGSAVE ”COM:”
Saves screen data.
Loads image data.
Saves image data.
181
Additional OVL Capabilities
Section 1-2
1-2-19 Binary Level Setting Range
In previous versions of OVL, the LEVEL command’s binary level range was 0 to
255. In Version 2.00, this range has been doubled to 0 to 511. When filtering has been performed with the FILTDATA and FILTER commands, these values are used when pixel values (grayness values) are negative. The upper and lower limits 256 to 511 set with the LEVEL command correspond to pixel values (grayness values) of –256 to –1.
182
SECTION 2
Reference
This section provides detailed information on the new Version 2.00 commands and functions. Examples are also provided.
183
ARRYFUNC . . . . . Reference
ARRYFUNC
(Command)
Action
Format
Example
Description
Section 2
ARRaY FUNCtion
Performs a variety of array operations at high speed.
ARRYFUNC
operation, data elements, array name 1, array name 2 [, array
name 3 [, array name 4]]
ARRYFUNC 10, 8, JUDGE, AREA, LO, HI
The ARRYFUNC command performs an operation between the variables of 2 to
4 arrays at one time, speeding up processing by eliminating the need for FOR-
NEXT or other loop processing. For example, this function is useful when comparing measurement results to upper and lower limit values.
Specify the data elements as the number of array variables that will be used in the operation. The number of array variables must be declared beforehand using the DIM command, and the number of array variables must be greater than the specified number of data elements.
It is not necessary to include qualifiers or parentheses in the array name. When decimal points aren’t used, the processing speed can be increased by using integer type arrays or long integer type arrays.
Specify the operation with one of the values listed below to determine the type of operation that will be performed. (A1 refers to array name 1, A2 refers to array name 2, A3 refers to array name 3, and A4 refers to array name 4.)
0: A1 = A2 AND A3
1: A1 = A2 OR A3
2: A1 = A2 XOR A3
3: A1 = A2 + A3
4: A1 = A2 – A3
5: A1 = A2
×
A3
6: A1 = A2
÷
A3
7: A1 = –1 (A2 = A3)
= 0 (A2 <> A3)
8: A1 = –1 (A2 y
A3)
= 0 (A2 < A3)
9: A1 = –1 (A2 x
A3)
= 0 (A2 > A3)
10: A1 = –1 ((A3 x
A2) AND (A2 x
A4))
= 0 ((A2 < A3) OR (A4 < A2))
11: The results of operation 10 (above) are substituted for A1 as a bit string.
(This operation is described in more detail below.)
12: A1 = A2
Details of Operation 11
Note
1. If A3 is 0 in the division in operation 6, the result will be 0.
2. Overflow processing is not performed.
The right sides (comparison results of A2, A3, and A4) are stored in the left side’s array variable beginning with the least significant bit or in numerical order beginning with the one with the smallest element number.
When the right side’s operation result is true, the bit value is 1. When the operation result is false, the bit value is 0.
When the left side’s array variable is the integer type, the results of the right side’s element numbers 0 to 15 are stored in element number 0, and the results of element numbers 16 to 31 are stored in element number 1. Thereafter the process is repeated.
184
BEDGE . . . . . . . . . Reference
BATCHK
(Function)
BEDGE
(Command)
Action
Format
Example
Description
BCDTOBIN
(Function)
Action
Format
Example
Description
Action
Format
Example
Description
Section 2
When the left side’s array variable is the long integer type, the results of the right side’s element numbers 0 to 31 are stored in element number 0. Thereafter the process is repeated.
If this function is used, each window’s area discrimination result is stored as bit information, so it is easy to determine each windows’ OK/ON discrimination by outputting this bit information through an output port.
BATtery CHecK
Checks the voltage of the Memory Card’s battery.
BATCHK
(drive)
BAT=BATCHK(”C:”)
Checks the voltage of the Memory Card’s battery. One of the values listed below will be returned to indicate the battery status.
0: Low voltage (Battery must be replaced.)
1: Insufficient voltage (Battery should be replaced soon.)
2: Normal voltage (Battery is O.K.)
The Memory Card is the “C” drive. An error will occur if a drive other than “C” is specified.
BCD TO BINary
Converts BCD data to binary.
BCDTOBIN
(data)
A=BCDTOBIN(&H123)
Converts BCD data to binary. BCD values between 0 and &H99999999 can be specified. This function is useful when inputting BCD data that was input to Terminal Block Units or Parallel I/O Units.
Binary EDGE
Detects edges of a binary image.
BEDGE
[page#], binary image plane# [, [X1] [, [Y1] [, [X2] [, [Y2] [, link evalua-
tion constant]]]]]
BEDGE 0,7,0,0,200,200
BEDGE 0,7
Extracts edges from the binary image in image memory within the region defined by (X1, Y1) and (X2, Y2). This command is useful for detecting the outline of a work piece.
The page# specifies the page number (0 or 1) in image memory. The default page number is 0.
The binary image plane# specifies the binary image plane in which edges will be detected.
The start point (X1, Y1) and end point (X2, Y2) of a rectangular region can be specified to reduce the search region. The coordinates can be set in the range 1 to 510. The default points are (1, 1) and (510, 510).
The link evaluation constant specifies the number of linkages that will be used in processing. There will be 8 linkages when the link evaluation constant=0, and 4 linkages for any setting besides 0. The default value is 0.
In edge detection processing, pixels with a value of 1 that are adjacent to a pixel with a value of 0 are set aside, and the other pixels are set to 0.
185
CAMSYNC . . . . . . Reference
BINTOBCD
(Function)
Action
Format
Example
Description
Converts binary data to BCD.
BINTOBCD
(data)
A=BINTOBCD(100)
Converts binary data to BCD. This function is useful when outputting measurement data to Terminal Block Units or Parallel I/O Units. Data values between 0 and 99999999 can be specified.
Binary Memory image FUNCtion BMFUNC
(Command)
Action
Format
Section 2
BINary TO BCD
Example
Description
Performs logic operations on two binary images.
BMFUNC
operation, [page#1], plane#1, [page#2], plane#2 [, [X1] [, [Y1] [, [X2]
[,Y2]]]]
BMFUNC 0,,0,,7
BMFUNC performs a logic operation on two binary images in plane#1 and
plane#2. The result of the operation is written to page number 2, plane number 2 of image memory.
Three operations (AND, OR, and XOR) are available. Specify the operation by setting the operation parameter to one of the values listed below.
0: AND
1: OR
2: XOR
Specify the desired image memory page numbers with page#1 and page#2.
The default value is 0 for both page#1 and page#2.
The logic operation will be performed within the rectangular region specified by start point (X1, Y1) and end point (X2, Y2). The coordinates can be set in the range 0 to 511. The default points are (0, 0) and (511, 511).
CAMSYNC
(Command)
Action
Format
Example
Description
CAMera SYNChronization
Selects the method of camera synchronization.
CAMSYNC
sync mode
CAMSYNC 0
Set the synchronization mode to 0 to specify external synchronization, set a value other than 0 to specify internal synchronization.
The selected synchronization method is valid for all cameras. It is not possible to set the synchronization mode of particular cameras.
186
DILA . . . . . Reference
Section 2
CONKEY ON/OFF/STOP
(Command)
Action
CONsole KEY ON/OFF/STOP
The CONKEY ON command enables Console key interrupts, the CONKEY OFF command disables Console key interrupts, and the CONKEY STOP command masks Console Key interrupts.
Format
CONKEY ON
CONKEY OFF
CONKEY STOP
Example
Description
CONKEY ON
The CONKEY ON command enables Console key interrupts. When Console key interrupts are enabled, pressing the Console key will interrupt the main program and execute the interrupt subroutine defined by the ON CONKEY GOSUB command. CONKEY OFF disables Console key interrupts and CONKEY STOP masks Console Key interrupts.
The following commands are related to CONKEY ON, CONKEY OFF, and CON-
KEY STOP:
ON CONKEY GOSUB
DILAte DILA
(Command)
Action
Format
Example
Description
Expands a binary image.
DILA
[page#], binary image plane# [, [X1] [, [Y1] [, [X2] [, [Y2] [,[ link evalua-
tion constant] [, enlargements]]]]]]
DILA 0,7,0,0,200,200
DILA 0,7
Enlarges the binary image in image memory within the region defined by (X1,
Y1) and (X2, Y2).
The page# specifies the page number (0 or 1) in image memory. The default page number is 0.
The binary image plane# specifies the binary image plane in which the binary image will be expanded.
The start point (X1, Y1) and end point (X2, Y2) can be input to specify a rectangular region that will be expanded. The coordinates can be set in the range 1 to
510. The default points are (1, 1) and (510, 510).
The link evaluation constant specifies the number of linkages that will be used in processing. There will be 8 linkages when the link evaluation constant=0, and 4 linkages for any setting besides 0. The default value is 0.
The enlargements setting specifies the number of times that the image will be enlarged. The default value is 1.
When a pixel within the rectangular region has a value of 0 and the adjacent pixel has a value of 1, enlargement processing will replace it with a value of 1.
The specified rectangular region cannot be exceeded in enlargement. Enlargement processing will end before the enlargements setting is reached if it is not possible to enlarge the image further.
187
ELIM . . . . . Reference
EDGRJECT
(Command)
Action
Format
Example
Description
Deletes exterior graphics from a binary image.
EDGRJECT
[page#], binary image plane# [, [X1] [, [Y1] [, [X2] [, [Y2] [, link
evaluation constant]]]]]
EDGRJECT 0,7,0,0,200,200
EDGRJECT 0,7
Deletes exterior graphics from the binary image in image memory within the region defined by (X1, Y1) and (X2, Y2).
The page# specifies the page number (0 or 1) in image memory. The default page number is 0.
The binary image plane# specifies the binary image plane in which the exterior graphics will be deleted.
The start point (X1, Y1) and end point (X2, Y2) can be input to specify a rectangular region in which the exterior graphics will be deleted. The default points are
(0, 0) and (511, 511).
The link evaluation constant specifies the number of linkages that will be used in processing. There will be 8 linkages when the link evaluation constant=0, and 4 linkages for any setting besides 0. The default value is 0.
A “Vision error” will occur if the number of the diagram’s borderlines exceeds 255 or the length of the diagram’s borderline exceeds 4096.
ELIMinate ELIM
(Command)
Action
Format
Section 2
EDGe ReJECT
Example
Description
Eliminates isolated points from a binary image.
ELIM
[page#], binary image plane# [, [X1] [, [Y1] [, [X2] [, [Y2] [, link evalua-
tion constant]]]]]
ELIM 0,7,0,0,100,100
ELIM 0,7
Eliminates isolated points from a binary image in image memory within the region defined by (X1, Y1) and (X2, Y2).
The page# specifies the page number (0 or 1) in image memory. The default page number is 0.
The binary image plane# specifies the binary image plane in which the isolated points will be eliminated.
The start point (X1, Y1) and end point (X2, Y2) can be input to specify a rectangular region the isolated points will be eliminated. The coordinates can be set in the range 1 to 510. The default points are (1, 1) and (510, 510).
The link evaluation constant specifies the number of linkages that will be used in processing. There will be 8 linkages when the link evaluation constant=0, and 4 linkages for any setting besides 0. The default value is 0.
188
FILTDATA . . . . . . Reference
EROS
(Command)
Action
Format
Example
Description
Reduces a binary image.
EROS
[page#], binary image plane# [, [X1] [, [Y1] [, [X2] [, [Y2] [,[ link evalua-
tion constant] [, reductions]]]]]]
EROS 0,7,0,0,200,200
EROS 0,7
Reduces the binary image in image memory within the region defined by (X1,
Y1) and (X2, Y2).
The page# specifies the page number (0 or 1) in image memory. The default page number is 0.
The binary image plane# specifies the binary image plane in which the binary image will be reduced.
The start point (X1, Y1) and end point (X2, Y2) can be input to specify a rectangular region that will be reduced. The coordinates can be set in the range 1 to
510. The default points are (1, 1) and (510, 510).
The link evaluation constant specifies the number of linkages that will be used in processing. There will be 8 linkages when the link evaluation constant=0, and 4 linkages for any setting besides 0. The default value is 0.
The reductions setting specifies the number of times that the image will be reduced. The default value is 1.
When a pixel within the rectangular region has a value of 1 and the adjacent pixel has a value of 0, reduction processing will replace it with a value of 0.
The specified rectangular region cannot be exceeded in reduction. Reduction processing will end before the reductions setting is reached if it is not possible to reduce the image further.
FILTer DATA FILTDATA
(Command)
Action
Format
Example
Description
Section 2
EROSion
Specifies the line filter factors.
FILTDATA
data 0, data 1, ... , data 8 [, [global factor] [, sobel processing]]
FILTDATA 0,1,1,1,1,1,1,1,1,8
The FILTDATA command sets the line filter factors. Either “2: sharpened image” or “5: line filter image” must be selected with the FILTER command to enable the line filter factors specified with the FILTDATA command.
If “2: sharpened image” or “5: line filter image” have been selected with the
FILTER command, filtering will be performed according to the following equation:
Pixel grayness = (
∑
data n
×
M n
)
÷
(global factor)
(M n
indicates the grayness of the pixel itself and the adjacent pixels.)
The line filter factors are specified with the parameters data 0 to data 8. The positional relationship of these pixels is shown in the diagram below.
Data 1 Data 2 Data 3
Data 4 Data 0 Data 5
Data 6 Data 7 Data 8
189
FILTSEL . . . . . . . . Reference
Section 2
The line filter factors for data 1 to data 8 can be set to 0,
±
1,
±
2, or
±
4. The line filter factor for data 0 can also be set to
±
8.
The global constant parameter can be set to 0, 1, 2, 4, 8, or 16. The default value is 1.
Set the sobel processing parameter to 0 to disable sobel integration, set a value other than 0 to enable sobel integration. The default value is 0.
When sobel integration is enabled, the original image will undergo line filtering and then sobel processing. Sobel integration is effective only when “2: sharpened image” has been selected with the FILTER command.
FILTer SELect FILTSEL
(Command)
Action
Format
Example
Description
Specifies the type of image filtering.
FILTSEL
type [, image type]
FILTSEL 2
The FILTSEL command specifies the type of image filtering. The image filtering specified with this command is the same as the filtering selected through the menu.
The type parameter specifies the type of filtering. Specify one of the values listed below:
0: OFF
1: Weak smoothing
2: Strong smoothing
3: Edge enhancement level 1
4: Edge enhancement level 2
5: Edge enhancement level 3
6: Edge enhancement level 4
7: Edge enhancement level 5
8: Relief
9: Vertical edges
10: Horizontal edges
11: All edges
When the FILTSEL command is executed, the information set with the FILTER and FILTDATA commands is overwritten and invalidated. When “9: Vertical edges” or “10: Horizontal edges” is selected, the binary level (contents of look-up table for binary conversion) is overwritten. The binary level must be set again.
The image type parameter determines whether the image is binary or raw. If necessary, specify the image type according to the current image display. (The default value is 0.)
0: Raw image (LUT OFF)
1: Binary image (LUT ON)
190
GETMDATA . . . . . Reference
FORMAT
(Command)
Action
Format
Example
Description
Formats a Memory Card.
FORMAT
drive
FORMAT ”C:”
The FORMAT command formats a Memory Card. When the FORMAT command is executed, a prompt will appear (Are you sure? (Y/N)) to confirm that the
Memory Card will be initialized. Press Y to proceed or N to cancel.
GET Measure DATA GETMDATA
(Command)
Action
Format
Example
Description
Section 2
FORMAT
Obtains data generated by the MDATA function.
GETMDATA
data type, array name [, subscript]
GETMDATA 0,MD
The MDATA function obtains data one-by-one, and the GETMDATA command obtains this data in a batch of 8 windows and stores the data in array variables.
The data type parameter specifies the type of data. Specify one of the values listed below:
0: Area (pixel units)
1: Area after calibration
2: X center of gravity (pixel units)
3: X center of gravity after calibration
4: Y center of gravity (pixel units)
5: Y center of gravity after calibration
6: Axis angle (pixel units)
7: Axis angle after calibration
8: X center of gravity, Y center of gravity (pixel units)
9: X center of gravity, Y center of gravity after calibration
10: All (pixel units)
11: All after calibration
The array name parameter indicates the array variables in which the data will be stored. The number of array variables in the specified array must be declared beforehand using the DIM command. (It is not necessary to include qualifiers or parentheses in the array name.)
The number of array variables declared in DIM command must be greater than the number of data elements being obtained.
The first location in the array in which data will be stored can be specified in the
qualifier parameter. The default location is the beginning of the array.
When the data type parameter is set to 0, data will be stored as follows:
A(0): Area of plane 0
A(1): Area of plane 1
.
.
.
.
.
.
.
.
.
A(7): Area of plane 7
191
GETVER . . . . . . . . Reference
Section 2
When the data type parameter is set to 8, data will be stored as follows:
A(0): X center of gravity in plane 0
A(1): X center of gravity in plane 1
.
.
.
.
.
.
.
.
.
A(7): X center of gravity in plane 7
A(8): Y center of gravity in plane 0
.
.
.
.
.
.
.
.
.
A(15): Y center of gravity in plane 7
When the data type parameter is set to 10, data will be stored as follows:
A(0): Area of plane 0
A(1): Area of plane 1
.
.
.
.
.
.
.
.
.
A(7): Area of plane 7
A(8): X center of gravity in plane 0
.
.
.
.
.
.
.
.
.
A(31): Axis angle in plane 7
GET VERsion GETVER
(Function)
Action
Format
Example
Description
Obtains system version and other data.
GETVER
(type)
MACHINE=GETVER (0)
The GETVER function can determine the system version and other data. This function can be used to create a single program that automatically compensates for hardware and software differences so that it can be run on different systems.
The type parameter specifies the type of data that will be obtained, as shown in the following table.
2
3
0
1
Type Data obtained
Series-type
IMP Unit code
OVL version
System version
Examples of returned values
300 indicates the F300.
10: F300-C10EV2
11: F300-C11E
Actual version number, such as 1.03 or 2.00
Actual version number, such as 1.05 or 2.00
192
HFILL . . . . . . . . . . Reference
GMFUNC
(Command)
Action
Format
Example
Description
Performs operations on two raw images.
GMFUNC
operation, page#1, page#2 [, [X1] [, [Y1] [, [X2] [,Y2]]]]
GMFUNC 7,0,1
GMFUNC performs an operation on two raw images within the rectangular region specified by start point (X1, Y1) and end point (X2, Y2). The result of the operation is written to page number 2 of image memory.
The following ten operations are available. Specify the operation by setting the
operation parameter to the corresponding value from 0 to 9.
0: AND
1: OR
2: XOR
3: Addition 1 (Result set to 255 if greater than 255.)
4: Addition 2 (Remainder of results divided by 256 if greater than 255.)
5: Subtraction 1 (Result set to 0 if less than 0.)
6: Subtraction 2 (Remainder of results divided by 256 if less than 0.)
7: Maximum value
8: Minimum value
9: Absolute value (Absolute value of the difference of the two values.)
Specify the desired image memory page numbers with page#1 and page#2.
The same page can be specified for both page numbers.
The operation will be performed within the rectangular region specified by start point (X1, Y1) and end point (X2, Y2). The coordinates can be set in the range 0 to 511. The default points are (0, 0) and (511, 511).
Hole FILL HFILL
(Command)
Action
Format
Section 2
Gray Memory image FUNCtion
Example
Description
Fills holes in a binary image.
HFILL
[page#], binary image plane# [, [X1] [, [Y1] [, [X2] [, [Y2] [, link evalua-
tion constant]]]]]
HFILL 0,7,0,0,100,100
HFILL 0,7
The HFILL command fills holes in a binary image in image memory within the region defined by (X1, Y1) and (X2, Y2).
The page# specifies the page number (0 or 1) in image memory. The default page number is 0.
The binary image plane# specifies the binary image plane in which the binary image will be processed.
The start point (X1, Y1) and end point (X2, Y2) can be input to specify a rectangular region that will be processed. The default points are (0, 0) and (511, 511).
The link evaluation constant specifies the number of linkages that will be used in processing. There will be 8 linkages when the link evaluation constant=0, and 4 linkages for any setting besides 0. The default value is 0.
A “Vision error” will occur if the number of hole borderlines exceeds 255 or the length of the hole’s borderline exceeds 4096.
193
IPL . . . . . . . Reference
IPL
(Command)
Action
Format
Example
Description
Section 2
Initial Program Loading
Sets the OVL boot-up mode. (Loads and executes the designated file.)
IPL
[{0|1|file name}] [, [value 1] [, [value 2] [, [value 3] [, [value 4] [, [value 5] [,
[standard input device] [, standard output device]]]]]]]
IPL 1
IPL ”SAMPLE”
IPL ,,,,,,1
The IPL command sets the OVL boot-up mode. The new settings are valid the next time that OVL is booted up, and the settings are retained even when the power is turned off.
The 0|1|file name parameters specify the OVL boot-up procedure used when the power is turned on. (If a filename is specified, that file will be loaded and executed automatically.)
0: OVL will not be booted automatically.
1: The program in the IMP Unit will be booted automatically.
The value 1 through value 5 parameters specify various OVL settings, as shown below:
Value 1: Number of files that can be open simultaneously. (1 to 11)
Value 2: Array variable, character variable area (1K bytes to 62K bytes)
Value 3: User stack area (1K bytes or 2K bytes)
Value 4: Compiler area (2K bytes to 16K bytes)
Value 5: Number of image display lines (20 or 25)
The standard input device parameter specifies the standard input device used when OVL has been started.
0: Keyboard
1: RS-232C
The standard output device parameter specifies the standard output device used when OVL has been started.
0: Video monitor
1: RS-232C
The settings will be displayed if no parameters are entered. The factory settings for these parameters are shown below:
Parameter
Value 1
Value 2
Value 3
Number of files that can be open
Array variable, character variable area
User stack area
Use
Value 4
Value 5
Compiler area
Number of image display lines
Standard input Standard input device
Standard output Standard output device
Factory setting
11
32 (K-bytes)
2 (K-bytes)
8 (K-bytes)
25
0 (Keyboard)
0 (Video monitor)
194
MASK3 . . . . . . . . . Reference
LEVEL
(Command)
Action
Format
Example
Description
LSORT
(Command)
Action
MASK3
Format
Example
Description
(Command)
Action
Format
Example
Description
Section 2
LEVEL
Sets the binary level for each binary image plane.
LEVEL
binary image plane#, lower limit, upper limit [, mode]
LEVEL –1,128,255
LEVEL 0,0,255,XOR
The LEVEL command sets the binary level for each binary image plane.
Specify the binary image plane (0 to 7) for which the level is set with the binary
image plane# parameter. Set the binary image plane# to –1 to set all binary image planes to the specified binary level.
The lower limit and upper limit parameters specify the range for the binary level.
Each parameter can be set from 0 to 511. When the level is within the range, the pixel is given a value of 1 (usually white).
The mode parameter specifies the following operations. The default setting is
“overwrite”.
OR: set the specified range to pixel value 1 (white).
NOT: set the specified range to pixel value 0 (black).
XOR: reverse the specified range
Label SORT
Renumbers the assigned label numbers.
LSORT
mode
LSORT 0
LSORT 8
The LSORT command reorders and renumbers the labeled image data according to the specified ordering mode. The mode parameter specifies one of the 10 ordering modes listed below.
0: Area, descending
1: Area, ascending
2: X center of gravity, descending
3: X center of gravity, ascending
4: Y center of gravity, descending
5: Y center of gravity, ascending
6: From upper left of screen, vertically
7: From lower right of screen, vertically
8: From upper left of screen, horizontally
9: From lower right of screen, horizontally
Be sure that the LABEL command has been executed before executing LSORT.
MASK 3
×
3
Performs 3
×
3 mask filtering on raw images.
MASK3
[page#], X1, Y1, X2, Y2, array name [, global factor]
MASK3 0,100,100,200,200,TABLE,2
The MASK3 command performs 3
×
3 mask filtering on raw images in image memory within the region defined by (X1, Y1) and (X2, Y2).
The page# specifies the page number (0 or 1) in image memory. The default page number is 0.
195
MWMEAS . . . . . . . Reference
Section 2
The start point (X1, Y1) and end point (X2, Y2) can be input to specify a rectangular region that will be processed. The default points are (1, 1) and (511, 511).
The coordinates can be set in the range 1 to 511.
The elements of the array can have values from –8 to +8. The following table shows the relationship between the array elements and the pixels.
TABLE (1) TABLE (2) TABLE (3)
TABLE (4) TABLE (0) TABLE (5)
TABLE (6) TABLE (7) TABLE (8)
The global factor parameter can be set to 0, 1, 2, 4, 8, or 16. The default value is
1.
Multiple Window MEASure MWMEAS
(Command)
Action
Format
Example
Description
Takes measurements of multiple windows.
MWMEAS
[page#], binary image plane#, pixel type [, [window operation] [,
[X compensation] [, [Y compensation]]], data type, data array
MWMEAS 0,0,1,1,0,0,0,MDAT
Takes measurements of characteristics within windows registered with the
MWSET command, and stores the results in array variables.
The page# specifies the page number (0 or 1) in image memory. The default page number is 0.
The binary image plane# specifies the binary image plane (0 to 7) in which the measurements will be taken.
The pixel type parameter specifies whether black or white pixels will be measured. Set this parameter to 0 to specify black pixels. A setting other than 0 specifies white pixels.
The window operation parameter determines whether the measurement will be made on the rectangular region defined in MWSET (window operation=0), or on the result of an AND between this region and the content of window memory
(window operation=1).
The X compensation and Y compensation parameters can specify X and Y offsets from –512 to 511. The position compensation parameters cannot be used when the window operation parameter is set to 0.
The data type parameter specifies the type of data that will be measured. Specify one of the values listed below:
0: Area (pixel units)
1: Area after calibration
2: X center of gravity (pixel units)
3: X center of gravity after calibration
4: Y center of gravity (pixel units)
5: Y center of gravity after calibration
6: Axis angle (pixel units)
7: Axis angle after calibration
8: X, Y center of gravity (pixel units)
9: X, Y center of gravity after calibration
The data array parameter indicates the name of the array variables in which the data will be stored.
196
ON CONKEY GOSUB . . . Reference
Section 2
Data will be stored in the array in the order that the windows were registered with the MWSET command. When the data type parameter is set to X, Y center of gravity measurement, data will be stored as follows:
1 st
array element: X center of gravity for window 0
2 nd
array element: Y center of gravity for window 0
3 rd
array element: X center of gravity for window 1
4 th
array element: Y center of gravity for window 1
.
.
.
.
.
.
.
.
.
Array element 2n+1: X center of gravity for window n
Array element 2n+2: Y center of gravity for window n
Multiple Window SET MWSET
(Command)
Action
Format
Example
Description
Registers windows for multiple-window measurements.
MWSET
binary image plane#, number of windows, X1 array, Y1 array,
X2 array, Y2 array
MWSET 0,10,X1,Y1,X2,Y2
The MWSET command registers windows for multiple-window measurements by the MWMEAS command.
The binary image plane# parameter specifies the binary image plane (0 to 7) in which the measurements will be taken.
The number of windows parameter specifies the number of windows that will be registered.
The X1 and Y1 arrays define the coordinates of upper left corners of the windows and the X2 and Y2 arrays define the coordinates of the lower right corners of the windows. The coordinates must be within the range 0 to 511.
The number of array variables in the specified arrays must be declared beforehand using the DIM command. (It is not necessary to include qualifiers or parentheses in the array name.)
The number of array variables declared in DIM must be greater than the number of windows that are being registered.
ON CONKEY GOSUB
(Command)
Action
ON CONsole KEY GOSUB
Specifies the starting line number of the interrupt subroutine called by pressing the Console key.
Format
Example
Description
ON CONKEY GOSUB
line number or label
ON CONKEY GOSUB *CKEYINT
The ON CONKEY GOSUB command specifies the starting line number of the interrupt subroutine called by pressing the Console key. A label can be used instead of a line number to specify the start of the interrupt subroutine.
The following commands are related to ON CONKEY GOSUB:
CONKEY ON
CONKEY OFF
CONKEY STOP
197
SCNJUDGE . . . . . Reference
RUNL2
(Function)
Action
Format
Example
Description
SCNJUDGE
(Function)
Action
Format
Example
Description
Section 2
RUN Length 2
Performs high-speed processing on data obtained by the RUNL function.
RUNL2
(binary image plane#, Y1, Y2, data measured)
A=RUNL2 (0,100,200,0)
The RUNL2 function processes the simple run length data to obtain more detailed information. In order to use the RUNL2 function, the run function must be turned on with the MMODE command and the simple run length data must be measured.
The Y1 and Y2 parameters define the measurement range (on the Y-axis) and must be within the range 0 to 479.
The data measured parameter specifies the type of data that will be measured.
Specify one of the values listed below:
0: Area
1: Number of runs
2: Average run length
3: Maximum run length
4: Minimum run length
5: Median run length
6: Y coordinate of maximum run length
7: Y coordinate of minimum run length
8: Y coordinate of median run length
9: Number of run groups
10: Average run group width
11: Maximum run group width
12: Minimum run group width
13: Median run group width
14: Y coordinate of maximum run group width
15: Y coordinate of minimum run group width
16: Y coordinate of median run group width
SCeNe JUDGEment
Obtains the criteria that were set in menu mode.
SCNJUDGE
(scene number, binary image plane#, item, data type)
LO=SCNJUDGE (0,0,0,1)
The SCNJUDGE function obtains the criteria for measurement items that were set in menu mode.
The scene number parameter specifies the scene number (0 to 15).
The binary image plane# parameter specifies the binary image plane (0 to 7).
The item parameter specifies the measurement item. Specify one of the values listed below:
0: Area
1: X center of gravity
2: Y center of gravity
3: Axis angle
4: Edge angle
5: X center coordinate
6: Y center coordinate
7: Angle of inclination
8: Cross point X coordinate
9: Cross point Y coordinate
198
SOBEL . . . . . . . . . . Reference
Section 2
The data type parameter specifies the type of data:
0: Upper limit
1: Lower limit
2: Unit
When “2: Unit” is specified for the data type, the SCNJUDGE function will return one of the following values:
0: % of reference image
1: Pixel difference to reference image (pixel units)
2: Pixel difference to reference image after calibration
3: Angle difference to reference image
4: Actual work measurement in pixels (pixel units)
5: Actual work measurement after calibration
6: Actual work measurement in degrees
SCeNe STANDard SCNSTAND
(Function)
Action
Format
Example
Description
Obtains the reference image data that were set in menu mode.
SCNSTAND
(scene number, binary image plane#, data type)
AR=SCNSTAND (0,0,0)
The SCNSTAND function obtains the reference image data that were set in menu mode.
The scene number parameter specifies the scene number (0 to 15).
The binary image plane# parameter specifies the binary image plane (0 to 7).
The data type parameter specifies the type of data. Specify one of the values listed below:
0: Area
1: X center of gravity
2: Y center of gravity
3: Main axis angle
4: Edge angle
5: X center coordinate
6: Y center coordinate
7: Angle of inclination
8: X coordinate of cross point
9: Y coordinate of cross point
10: Reference X coordinate for X compensation
11: Reference Y coordinate for Y compensation
SOBEL SOBEL
(Command)
Action
Format
Example
Description
Performs sobel processing.
SOBEL
[[page#] [, [X1] [, [Y1] [, [X2] [, Y2]]]]]
SOBEL ,100,100,200,200
The SOBEL command performs sobel processing within the rectangular region defined by (X1, Y1) and (X2, Y2).
The page# specifies the page number (0 or 1) in image memory. The default page number is 0.
The start point (X1, Y1) and end point (X2, Y2) can be input to specify a rectangular region that will be processed. The coordinates can be set in the range 1 to
510. The default points are (1, 1) and (510, 510).
199
WDILA . . . . . . . . . Reference
SZOOM
(Command)
Action
Format
Example
Description
Zooms (enlarges or reduces) the shading memory.
SZOOM
[zoom factor [, X reference coordinate, Y reference coordinate]]
SZOOM 4
The SZOOM command zooms (enlarges or reduces) the shading memory.
The zoom factor parameter specifies the factor by which the shading memory will be magnified (0.25 to 512.00). The default zoom factor is 1.
The X and Y reference coordinates define the point of reference for zooming.
The default point is (0,0).
THIN THIN
(Command)
Action
Format
Section 2
Shading memory ZOOM
Example
Description
Reduces line thickness for a binary image in image memory.
THIN
[page#], binary image plane# [, [X1] [, [Y1] [, [X2] [, [Y2] [, link evalua-
tion constant]]]]]
THIN 0,7,0,0,100,200
THIN 0,7
The THIN command reduces line thickness for binary images in image memory within the rectangular region defined by (X1, Y1) and (X2, Y2).
The page# specifies the page number (0 or 1) in image memory. The default page number is 0.
The binary image plane# specifies the binary image plane in which the binary image will be processed.
The start point (X1, Y1) and end point (X2, Y2) can be input to specify a rectangular region that will be processed. The coordinates can be set in the range 0 to
511. The default points are (0, 0) and (511, 511).
The link evaluation constant specifies the number of linkages that will be used in processing. There will be 8 linkages when the link evaluation constant=0, and 4 linkages for any setting besides 0. The default value is 0.
Window DILAte WDILA
(Command)
Action
Format
Example
Description
Enlarges the binary image in window memory.
WDILA
binary image plane# [, [X1] [, [Y1] [, [X2] [, [Y2] [,[link evaluation
constant] [, enlargements]]]]]]
WDILA 7,0,0,100,100
WDILA 7,0
The WDILA command enlarges the binary image in window memory within the region defined by (X1, Y1) and (X2, Y2).
The binary image plane# specifies the binary image plane in which the binary image will be reduced.
The start point (X1, Y1) and end point (X2, Y2) can be input to specify a rectangular region that will be enlarged. The default points are (1, 1) and (510, 510).
The coordinates can be set in the range 1 to 510.
200
WZOOM . . . . . . . . Reference
Section 2
The link evaluation constant specifies the number of linkages that will be used in processing. There will be 8 linkages when the link evaluation constant=0, and 4 linkages for any setting besides 0. The default value is 0.
The enlargements setting specifies the number of times that the image will be enlarged. The default value is 1.
When a pixel within the rectangular region has a value of 0 and the adjacent pixel has a value of 1, enlargement processing will replace it with a value of 1.
The specified rectangular region cannot be exceeded in enlargement. Enlargement processing will end before the enlargements setting is reached if it is not possible to enlarge the image further.
Window EROSion WEROS
(Command)
Action
Format
Example
Description
Reduces the binary image in window memory.
WEROS
binary image plane# [, [X1] [, [Y1] [, [X2] [, [Y2] [, [link evaluation
constant] [, reductions]]]]]]
WEROS 7,0,0,100,100
WEROS 7,0
Reduces the binary image in window memory within the region defined by (X1,
Y1) and (X2, Y2).
The binary image plane# specifies the binary image plane in which the binary image will be reduced.
The start point (X1, Y1) and end point (X2, Y2) can be input to specify a rectangular region that will be reduced. The coordinates can be set in the range 1 to
510. The default points are (1, 1) and (510, 510).
The link evaluation constant specifies the number of linkages that will be used in processing. There will be 8 linkages when the link evaluation constant=0, and 4 linkages for any setting besides 0. The default value is 0.
The reductions setting specifies the number of times that the image will be reduced. The default value is 1.
When a pixel within the rectangular region has a value of 1 and the adjacent pixel has a value of 0, reduction processing will replace it with a value of 0.
The specified rectangular region cannot be exceeded in reduction. Reduction processing will end before the reductions setting is reached if it is not possible to reduce the image further.
Window memory ZOOM WZOOM
(Command)
Action
Format
Example
Description
Zooms (enlarges or reduces) the window memory.
WZOOM
[zoom factor [, X reference coordinate, Y reference coordinate]]
WZOOM 4
The WZOOM command zooms (enlarges or reduces) the window memory.
The zoom factor parameter specifies the factor by which the window memory will be magnified (0.25 to 512.00). The default zoom factor is 1.
The X and Y reference coordinates define the point of reference for zooming.
The default point is (0,0).
201
WZOOM . . . . . . . . Reference
Section 2
When the WZOOM command is executed, WSCROLL 0,0 is executed internally. After the WZOOM command has been executed, the scroll quantities and rotation center specified with the WSCROLL command are specified for the coordinate space after zooming.
Measurements can be made on the zoomed window image (the image displayed on the screen).
202
SECTION 3
Sample Programs
This section provides sample programs using the new Version 2.00 commands and functions.
3-1 Determination of Multiple Windows’ ON/OFF Status
3-1-1 Introduction
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-1-2 Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-2 Shape Inspection using Window Enlargement/Reduction . . . . . . . . . . . . . . . . . . . . . . . . . .
3-2-1 Introduction
3-2-2 Program
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
204
204
204
208
208
208
203
Determination of Multiple Windows’ ON/OFF Status
Section 3-1
3-1 Determination of Multiple Windows’ ON/OFF Status
3-1-1 Introduction
This program uses the multiple-window functions to determine the ON/OFF status of each window. Perform the operations below in menu mode beforehand.
1, 2, 3...
1. Set up several windows for multiple-window use in window plane 0.
2. Set up a window in window plane 7 for position compensation.
3. Set the binary level.
4. If necessary, register a reference image for position compensation.
Once the program has been executed, the ON/OFF status of each window can be determined using the following operations:
Measurement
Measure when the Console’s Enter Key is pressed or the STEP signal goes ON.
Measure the area of black pixels in the window. The percentage of black pixels should be greater than 50% in each window. The results are output to the screen and Parallel I/O Unit. The output to the Parallel I/O Unit will be ON if the result for that window is OK, and OFF if the result is not NG.
Reference Image Registration Register the reference image when the Console’s Shift+Enter Keys are pressed or DI5 is ON and the STEP signal goes ON. Window plane 7’s center of gravity coordinates are recorded as the reference position.
3-1-2 Program
10000 ’
******************************************************************
10010 ’ (c)Copyright OMRON Co. 1992
10020 ’ All Rights Reserved
10030 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10040 ’ F300 Sample Program
10050 ’Multiple-window sample program #1
10060 ’ Determines whether the area in each window is OK/NG.
10070 ’ It is OK if 50% or more of the area is black.
10080 ’ Results output to the screen and Parallel I/O.
10090 ’Set the following conditions in menu mode for scene 0:
10100 ’ Window plane 0: Multiple windows
10110 ’ Window plane 7: Window for position compensation
10120 ’Procedure details
10130 ’ ******************************************************************
10140 ’==================================================================
10150 ’Data definitions
10160 ’==================================================================
10170 CLEAR
10180 W.SCN=0 ’Scene number
10190 W.MAX=255
10200 N=W.MAX
’Max. number of windows
10210 DIM W.X1%(N),W.Y1%(N)
10220 DIM W.X2%(N),W.Y2%(N)
10230 DIM W.WA%(N)
10240 DIM W.AR%(N)
’Start points defining multiple windows
’End points defining multiple windows
’Areas of multiple windows
’Reference areas of multiple windows
204
Determination of Multiple Windows’ ON/OFF Status
Section 3-1
10250 DIM W.LO%(N),W.HI%(N)
10260 DIM W.JG&(N/32)
10270 W.LO=50
10280 W.HI=100
10290 W.BW0=0
10300 W.BW7=0
10310 W.SX=0:W.SY=0
’Upper/lower limits for area discr.
’Storage of discrimination results
’Lower limit reference % for area discr.
’Upper limit reference % for area discr.
’Black/white specification of plane 0
’Black/white specification of plane 7
’Reference image X,Y
10320 W.DX=0:W.DY=0 ’Compensation X,Y
10330 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10340 ’Main process
10350 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10360
*
MAIN
10370 GOSUB
*
HWINIT
10380
10390
GOSUB
*
INITIAL
GOSUB
*
MWINDSET
10400 ON INTR GOSUB * INTR1:INTR ON
10410 ON CONKEY GOSUB
*
INTR2:CONKEY ON
10420 WHILE (1)
10430 WEND
10440 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10630
10640
10650
10660
10670
10680
10690
10700
10450 ’Initialization process
10460 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10470
*
INITIAL
10480 CONSOLE ,,0:LOCATE ,,0
10490
10500
10510
10520
DISPLAY 31
WINDOW W.SCN
CAMMODE 1
FLASH 2
’Displays the camera image
’Window drawing
’Output of frame buffer contents
’Shutter with STEP synchronization
10530
10540
MMODE 7,W.BW7,1 ’Measurement mode for plane 7
W.SX=SCNSTAND(W.SCN,7,1) ’Obtain reference X center of gravity
10550 W.SY=SCNSTAND(W.SCN,7,2) ’Obtain reference Y center of gravity
10560 RETURN
10570 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10580 ’Hardware initialization
10590 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10600
*
HWINIT
10610
10620
CAMERA 0:CAMMODE 0:FLASH 1:FILTERIN 0:FILTER 0,1,0
MASKBIT 2,0,0:MASKBIT 3,0,0:MASKBIT 4,0,0
CLS 0:CLS 1:CLS 2:CLS 3:SBANK 1:CLS 4:SBANK 0:CLS 4
LEVEL –1,128,255:WSCROLL 0,0:SSCROLL 0,0:WZOOM:SZOOM
DIM LUTDATA0%(256),LUTDATA1%(256)
FOR I=0 TO 255
LUTDATA0%(I)=(I * 160)/255:LUTDATA1%(I)=(I * 192)/255
NEXT
SETDLUT 0,LUTDATA0%:SETDLUT 1,LUTDATA1%
ERASE LUTDATA0%,LUTDATA1%
205
Determination of Multiple Windows’ ON/OFF Status
Section 3-1
10710
10720
10730
FOR I=0 TO 6
SETDLVL I
NEXT
10740 DISPLAY 16:WDISP –1,0,0:BACKDISP 0
10750 RETURN
10760 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10770 ’Multiple window coordinate, area discrimination value settings
10780 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10790
*
MWINDSET
10800
10810
FILTERIN 1:CLS 3:BACKDISP 1,0 ’Display window only
WDISP –1,0,0:WDISP 0,1,1 ’Display plane 0
10820
10830
LEVEL –1,511,511
RMODE 0,0,1:MEASURE:LABEL:LSORT 8
10840
10850
10860
10870
10880
10890
10900
W.MAX=LNUM
IF W.MAX<1 THEN
PRINT ”WINDOWS ARE NOT SET.”
END
END IF
FOR I=1 TO W.MAX
W.WA%(I–1)=LDATA(I,0)
’Obtain circumscribed coordinates
10910
10920
10930
10940
W.X1%(I–1)=LDATA(I,7):W.Y1%(I–1)=LDATA(I,8)
W.X2%(I–1)=LDATA(I,9):W.Y2%(I–1)=LDATA(I,10)
NEXT
MWSET 0, W.MAX, W.X1%, W.Y1%, W.X2%, W.Y2%
10950
10960
FILTERIN 0:CLS 3:BACKDISP 0
WDISP –1,1,1
10970
10980
10990
11090
SCNLUT W.SCN
FOR I=0 TO W.MAX–1
’Returns binary level
’Sets the area discrimination value
W.LO%(I)=W.WA%(I)
*
W.LO/100
W.HI%(I)=W.WA%(I)
*
W.HI/100+1
11010 NEXT
11020 RETURN
11030 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
11040 ’STEP interrupt process
11050 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
11060
*
INTR1
11070
11080
IF PIN(5) THEN
GOSUB
*
STANDMEAS ’Reference registration
11090
11110
11110
ELSE
GOSUB
*
MEAS
END IF
’Measurement
11120 RETURN
11130 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
11140 ’Console Key interrupt process
11150 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
11160
*
INTR2
206
Determination of Multiple Windows’ ON/OFF Status
Section 3-1
11170
11180
11190
K=KEYIN(0)
IF K=&H90 THEN GOSUB
*
STANDMEAS
’Shift+Enter Reference regist.
IF K=&H10 THEN GOSUB
*
MEAS ’Enter Measurement
11200 RETURN
11210 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
11220
’Reference image registration (Records center of gravity coordinates for position compensation.)
11230 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
11240
*
STANDMEAS
11250 WSCROLL 0,0
11260
11270
11280
11290
MEASURE
W.SX=MDATA(7,2)
W.SY=MDATA(7,4)
LOCATE 0,0:PRINT ”Reference registration completed.”
11300 RETURN
11310 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
11320 ’Measurement
11330 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
11340 * MEAS
11350 TIM0&=TIMER
11360 WSCROLL 0,0 ’Moves to window’s origin.
11370
11380
11390
11400
EVENTIN 1,0,1:MEASURE ’Center of gravity measurement
W.DX=MDATA(7,2)–W.SX
’Position compensation calculation
W.DY=MDATA(7,4)–W.SY
WSCROLL W.DX, W.DY
’Position compensation
11410
11420
MWMEAS 0, 0, W.BW0, 1, W.DX, W.DY, 0, W.AR%
ARRYFUNC 11, W.MAX, W.JG&, W.AR%, W.LO%, W.HI%
11430
11440
11450
11460
TIM&=TIMER–TIM0&
LOCATE 0,0:PRINT USING ”Processing time=####ms”;TIM&
*
10
GOSUB
*
JUDGDISP
GOSUB
*
JUDGOUT
11470 RETURN
11480 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
11490 ’Discrimination results display process
11500 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
11510
*
JUDGDISP
11520 FOR I=0 TO W.MAX–1
11530
11540
J=W.JG7(FIX(I/32)) AND 2^(I MOD 32 )
IF J THEN
11550
11560
11570
COLOR 0:J$=”OK”
ELSE
COLOR 7:J$=”NG”
11580
11590
11600
11610
11620 RETURN
END IF
PRINT USING ”No ### @”;I,J$
COLOR 0
NEXT
207
Shape Inspection using Window Enlargement/Reduction
Section 3-2
11630 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
11640 ’Discrimination results terminal output process
11650 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
11660 * JUDGOUT
11670 FOR I=0 TO FIX((W.MAX–1)/32)
11680 DOUT W.JG&(I),0,32
11690 NEXT
11700 RETURN
3-2 Shape Inspection using Window Enlargement/Reduction
3-2-1 Introduction
The window enlargement/reduction functions are used to determine whether a work piece’s shape matches the shape of a reference work piece. Perform the operations below in menu mode beforehand.
1, 2, 3...
1. Set up a window in window plane 0 for use as a measurement region. (Do not specify the entire screen, however.)
2. Set the binary level.
Once the program has been executed, the following operations can be used to determine if a work piece is acceptable (OK) or unacceptable (NG):
Measurement
Measure when the Console’s Enter Key is pressed or the STEP signal goes ON.
If the work piece is larger than the reference piece, the blurred area is measured.
If the work piece is smaller than the reference piece, omission inspection is measured. The blurred area and omission area are compared to the reference area to determine whether the work piece is acceptable or not.
Reference Image Registration Register the reference image when the Console’s Shift+Enter Keys are pressed or DI5 is ON and the STEP signal goes ON. A window for blurring inspection is automatically drawn in window plane 7, and a window for omission inspection is automatically drawn in window plane 6.
3-2-2 Program
10000 ’
******************************************************************
10010 ’ (c)Copyright OMRON Co. 1992
10020 ’ All Rights Reserved
10030 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10040 ’ F300 Sample Program
10050 ’ Shape Inspection using Window Zooming
10060 ’ Useful for operations such as character identification.
10070 ’ Before program execution, set up (in menu mode) a window in
10080 ’ window plane 0 for use as a processing region.
10090 ’
10100 ’
Window plane 7: Blurring inspection
Window plane 6: Omission inspection
10110 ’ Window plane 0: Processing region
10120 ’
******************************************************************
10130 DCNT=3 ’Number of enlargements
10140 ECNT=1 ’Number of reductions
10150 JDG7=10 ’Number of pixels for determining blurring
208
Shape Inspection using Window Enlargement/Reduction
Section 3-2
10160 JDG6=10 ’Number of pixels for determining omission
10170 BW=0 ’Pixels measured (0=black, 1=white)
10180 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10190 ’Main process
10200 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10210
*
MAIN
10220 GOSUB
*
HWINIT
10230
10240
GOSUB
*
INITIAL
GOSUB
*
WINDAREA
10250
10260
10270
10280
GOSUB
*
WINDSET
ON INTR GOSUB
*
INTR1:INTR ON
ON CONKEY GOSUB
*
INTR2:CONKEY ON
WHILE (1)
10290 WEND
10300 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10310 ’Initialization process
10320 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10330 * INITIAL
10340 CONSOLE ,,0:LOCATE ,,0
10350 DISPLAY 31,0 ’Binary display within window
10360
10370
10380
10390
CAMMODE 1
FLASH 2
WINDOW 0
MMODE 7,BW,1
’Output of frame buffer contents
’Shutter with STEP synchronization
’Draws window of scene 0
’Measurement mode for blurring
’Measurement mode for omission 10400 MMODE 6,NOT BW,1
10410 RETURN
10420 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10430 ’Establishment of the measurement processing region
10440 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10450
*
WINDAREA
10460
10470
FILTERIN 1:BACKDISP 1,0
WDISP –1,0,0:WDISP 0,1,1
’Display window only
’Display plane 0
10480
10490
10500
10510
10520
10530
10540
10550
10560
LEVEL –1,511,511
RMODE 0,0,1:MEASURE:LABEL:LSORT 8
W.MAX=LNUM
IF W.MAX<1 THEN
PRINT ”WINDOWS ARE NOT SET.”
END
END IF
LSORT 0
W.X1=LDATA(1,7):W.Y1=LDATA(1,8) ’Set measurement region.
10570
10580
10590
10600
W.X2=LDATA(1,9):W.Y2=LDATA(1,10)
BOX W.X1, W.Y1, W.X2, W.Y2, 1,,,1
FILTERIN 0:BACKDISP 0:SCNLUT 0
WDISP –1,0,0:WDISP 6,1,1:WDISP 7,1,1
10610 RETURN
209
Shape Inspection using Window Enlargement/Reduction
Section 3-2
10670
10680
10690
10700
10710
10720
10730
10740
10750
10760
10770
10620 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10630 ’Hardware initialization
10640 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10650
*
HWINIT
10660 CAMERA 0:CAMMODE 0:FLASH 1:FILTERIN 0:FILTER 0,1,0
MASKBIT 2,0,0:MASKBIT 3,0,0:MASKBIT 4,0,0
CLS 0:CLS 1:CLS 2:CLS 3:SBANK 1:CLS 4:SBANK 0:CLS 4
LEVEL –1,128,255:WSCROLL 0,0:SSCROLL 0,0:WZOOM:SZOOM
DIM LUTDATA0%(256),LUTDATA1%(256)
FOR I=0 TO 255
LUTDATA0%(I)=(I
NEXT
FOR I=0 TO 6
SETDLVL I
*
160)/255:LUTDATA1%(I)=(I
SETDLUT 0,LUTDATA0%:SETDLUT 1,LUTDATA1%
ERASE LUTDATA0%,LUTDATA1%
*
192)/255:
10780
10790
NEXT
DISPLAY 16:WDISP –1,0,0:BACKDISP 0
10800 RETURN
10810 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10820 ’STEP interrupt process
10830 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10840
*
INTR1
10850 IF PIN(5) THEN
10860
10870
GOSUB
*
WINDSET
ELSE
10880
10890
GOSUB
*
MEAS
END IF
’Window setup
’Measurement
10900 RETURN
10910 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10920 ’Console Key interrupt process
10930 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
10940
*
INTR2
10950 K=KEYIN(0)
10960
10970
IF K=&H90 THEN GOSUB
*
WINDSET
IF K=&H10 THEN GOSUB
*
MEAS
’Shift+Enter Window setup
’Enter Measurement
10980 RETURN
10990 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
11090 ’Measurement window setup
11010 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
11020 * WINDSET
11030 MASKBIT 2,0,1:CLS 2:MASKBIT 2,0,0 ’Deletes other than window 0
11040
11050
11060
* LLOOP
RMODE 0,BW,1
MEASURE
11070 LABEL
210
Shape Inspection using Window Enlargement/Reduction
Section 3-2
11080
11090
11100
11110
11120
11130
11140
11150
11160
11170
11180
IF LNUM<1 THEN PRINT ”ERRO”:GOTO
*
LLOOP
FOR I=1 TO LNUM
LPUTIMG I,2,0,7
NEXT
’Draws figure in window mem.
WDILA 7,W.X1, W.Y1, W.X2, W.Y2,,DCNT
MASKBIT 2,0,&H7F ’Masks other than plane 7
BOX W.X1, W.Y1, W.X2, W.Y2,2,0,XOR ’Reverses window memory
MASKBIT 2,0,0
FOR I=1 TO LNUM
LPUTIMG I,2,0,6
NEXT
’Draws figure in window mem.
11190 WEROS 6,W.X1, W.Y1, W.X2, W.Y2,,ECNT
11200 RETURN
11210 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
11220 ’Measurement process
11230 ’––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
11240
*
MEAS
11250 LOCATE 0,0
11260 MEASURE
11270
11280
11290
11300
11310
A7=MDATA(7,0)
IF A7>JDG7 THEN J7$=”NG” ELSE J7$=”OK”
A6=MDATA(6,0)
IF A6>JDG6 THEN J6$=”NG” ELSE J6$=”OK”
PRINT USING ”Blurred pixels=###### @”:A7,J7$
11320 PRINT USING ”Omitted pixels=###### @”:A6,J6$
11330 RETURN
211
Appendix A
Table of Error Messages
I
A
B
C
D
E
F
L
M
N
Error message
Access denied
Application error (polish)
Application error (accum)
Bad drive specification
Bad file name
Bad file number
Can’t continue
CASE without END SELECT
CASE without SELECT
Channel number error
Checksum error
Compile timing error
DEF FN without END DEF
Direct statement in file
Disk full
Disk I/O error
Disk offline
Division by zero
DO without LOOP
Duplicate definition
Duplicate label
ELSE IF without END IF
ELSE IF without IF
ELSE without END IF
ELSE without IF
END DEF without DEF FN
END IF without IF
END SELECT without SELECT
END SUB without SUB
EXIT without DEF
EXIT without DO
EXIT without FOR
EXIT without SUB
Feature not available
FIELD overflow
File already exist
File already open
File not found
File not open
File write protect
FOR without NEXT
IF without END IF
Illegal direct
Illegal function call
Illegal jump
Input past end
Line buffer overflow
Local variable overflow
LOOP without DO
Missing operand
NEXT without FOR
No RESUME
128
12
5
137
55
53
60
61
26
33
50
65
54
134
57
68
64
62
11
135
10
31
17
124
121
202
117
119
129
125
130
126
120
127
122
133
138
141
140
139
Error code
85
101
102
70
56
52
23
131
136
22
1
19
213
Table of Error Messages
T
U
O
P
R
S
V
W
Error message
Out of compile work space
Out of DATA
Out of memory
Out of string space
OV
Overflow
Parameter overflow
Path not found
Path/File access error
Rename across disks
RESUME without error
RETURN without GOSUB
SELECT without END SELECT
Sequential I/O only
String too long
SUB without END SUB
Subscript out of range
Syntax error
Type mismatch
Undefined label
Undefined line number
Undefined user function
Unit error
Unprintable error
Vision error
WEND without WHILE
WHILE without WEND
13
32
8
18
201
99
200
30
29
Error code
110
14
100
4
7
6
118
76
75
73
20
3
123
59
15
132
9
2
Appendix A
214
Appendix B
Reserved Words
I
H
J
K
A
B
C
D
E
F
G
L
M
N
FIELD
FILTERIN
FN
GATE
GET@
GETLUT
HELP
IF
INPUT
INTR
JIS$
KACNV$
KILL
KMID$
KTYPE
LABLE
LEFT$
LFILES
LLIST
LOCATE
LPOINT
LSET
MASKBIT
MENU
MKD$
MMODE
NAME
ABS
ARC
ATTR$
BACKDISP
BEEP
BUSY
CALL
CANCEL
CHANGE
CIRCLE
CLS
COMMON
COS
CVD
DATA
DEFDBL
DEFSTR
DGOTO
DNEXT
DSKF
EDIT
END
ERL
ERROUT
KEXT$
KINPUT
KNJ$
LBOUND
LEN
LHELP
LNUM
LOF
LPOS
LSORT
MDATA
MERGE
MKI$
MON
NEW
ELLIPSE
ENHANCE
ERR
EVENTIN
FILES
FIND
FOR
GCOPY
GETBLUT
GOSUB
HEX$
IMGLOAD
INPUT$
IPL
AKCNV$
AS
AUTO
Reserved words
ALL
ASC
AUTOLVL
BASE
BLOAD
BCOPY
BOX
CAMCHK
CASE
CHDIR
CLEAR
COLOR
CONSOLE
CSNG
CVI
DATE$
DEFINE
DELETE
DIM
DO
CAMERA
CDBL
CHR$
CLNG
COLOR@
CONT
CSRLIN
CVL
DCASE
DEFLNG
DENY
DIN
DOUT
ELSE
EOF
ERRMSG
EXIT
FILTDATA
FIX
FRE
GCOPY2
GETDLUT
GO
HISTGRAM
IMGSAVE
INSTR
KEY
KINSTR
KPLOAD
LCASE$
LET
LINE
LOAD
LOG
LPRINT
LTRIM$
MDATA2
MID$
MKL$
NPIECE
KEYIN
KLEN
KPOS
LDATA
LEVEL
LIST
LOC
LOOP
LPUTIMG
MEASURE
MKDIR
MKS$
APPEND
ATN
BCOPY2
BSAVE
CAMMODE
CHAIN
CINT
CLOSE
COM
COPY
CURSOR
CVS
DEF
DEFSNG
DEVICE
DISPLAY
DSA
ELSEIF
ERASE
ERROR
EXP
FILTER
FLASH
GET
GETDLVL
GOTO
INKEY$
INT
215
Reserved Words
O
P
T
U
R
S
V
W
OCT$
OPTION
PEEK
POKE
POUT
PUT@
RANDOMIZE
RENUM
RESUME
RMODE
RTRIM$
SAVE
SCNCAM
SCNLOAD
SDATA2
SET
SETLUT
SIN
SPLINE
STOP
STRMODE
TAB
THEN
UBOUND
USR
USR3
USR7
VAL
VENUS
WAIT
WIDTH
WSCROLL
ON
OUTPUT
Reserved words
OFF
PIECE$
POLYGON
PIN
POLYLINE
PSET
RDATA
REPEAT
RETURN
RND
RUN
SBACK
SCNCALIB
SCNLUT
SEARCH
SETBLUT
SFTBLUT
SPACE$
SQR
STR$
SUB
TAN
TO
UCASE$
USR0
USR4
USR8
VARPTR
WDISP
WINDOW
WEND
WPBIT
READ
REPLACE
RIGHT$
RNEXT
RUNL
SCAN
SCNJUDG
SCNSAVE
SEGPTR
SETDLUT
SFTLUT
SPC
SSCROLL
STRCHK
SWAP
TIME$
TROFF
UNTIL
USR1
USR5
USR9
VDWAIT
OPEN
POINT
POS
PUT
REM
RESTORE
RMDIR
RSET
SCANSET
SCNLEVEL
SDATA1
SELECT
SETDLVL
SGN
SPCLOSE
STEP
STRING$
SYSTEM
TIMER
TRON
USING
USR2
USR6
VIDEOIN
WHILE
WRITE
Appendix B
216
Appendix C
Induction Functions
Function
log a X sec X cosec X cot X sin
–1
X cos
–1
X sec
–1
X cosec
–1
X cot
–1
X sinh X cosh X tanh X sech X cosech X coth X sinh
–1
X cosh
–1
X tanh
–1
X sech
–1
X cosech
–1
X coth
–1
X
Induction formula
LOG(X)/LOG(a)
1/COS(X)
1/SIN(X)
1/TAN(X)
ATN(X/SQR(–X * X+1))
–ATN(X/SQR(–X
*
X+1))+P#/2
ATN(SQR(X * X–1)+(SGN(X)–1) * P#/2
ATN(1/SQR(X
*
X–1)+(SGN(X)–1)
*
P#/2
–ATN(X)+P#/2
(EXP(X)–EXP(–X))/2
(EXP(X)+EXP(–X))/2
–EXP(–X)/(EXP(X)+EXP(–X)) * 2+1
2/(EXP(X)+EXP(–X))
2/(EXP(X)–EXP(–X))
EXP(–X)/(EXP(X)–EXP(–X))
*
2+1
LOG(X+SQR(X * X+1))
LOG(X+SQR(X * X–1))
LOG((1+X)/(1–X))/2
LOG(SQR(–X * X+1)+1)+1/X
LOG((SGN(X)
*
SQR(X
*
X+1)+1)/X))
LOG((X+1)/(X–1))/2
(P# =
π
= 3.14159265358979)
217
A
ABS, 54
AKCNV$, 54 alphabetical listing, of version 2.00 functions & commands,
171
ARC, 54 arguments, 31 array operations, using ARRYFUNC, 175, 184
ARRYFUNC, 184
ASC, 55
ATN, 55
ATTR, 55
AUTO, 56
AUTOLVL, 56
B
BACKDISP, 56
BATCHK, 185
BCD, converting to binary, 180, 185
BCDTOBIN, 185
BCOPY, 57
BCOPY2, 58
BEDGE, 185
BEEP, 58 binary, converting to BCD, 180, 186 binary image planes, memory, 43 binary images deleting exterior graphics, 188 eliminating isolated points, 188 enlarging in window memory, 200 expanding, 187 filling holes in, 193 logic operations between, 175, 186 processing, 174 reducing, 189 reducing in window memory, 201 reducing line thickness, 200 setting binary level, 195 binary level setting, 195 setting range with version 2.00, 182
BINTOBCD, 186 block diagrams, 40
BMFUNC, 186 boot-up mode, setting, 194
Index
BOX, 59
BUSY, 59
C
CALL, 60
CAMCHK, 60
CAMERA, 60 camera synchronization, setting with CAMSYNC, 181, 186
CAMMODE, 60
CAMSYNC, 186
CDBL, 61
CHAIN, 61
CHANGE, 62 character strings, 21 characters, 20
CHDIR, 62
CHR$, 63
CINT, 63
CIRCLE, 64
CLEAR, 65
CLNG, 65
CLOSE, 65
CLS, 66
COLOR, 66
COLOR@, 66
COM ON/OFF/STOP, 67 command
ARC, 54
ARRYFUNC, 184
AUTO, 56
BACKDISP, 56
BCOPY, 57
BCOPY2, 58
BEDGE, 185
BEEP, 58
BMFUNC, 186
BOX, 59
BUSY, 59
CALL, 60
CAMERA, 60
CAMMODE, 60
CAMSYNC, 186
CHAIN, 61
CHANGE, 62
CHDIR, 62
CIRCLE, 64
CLEAR, 65
CLOSE, 65
219
CLS, 66
COLOR, 66
COLOR@, 66
COM ON/OFF/STOP, 67
COMMON, 67
CONKEY ON/OFF/STOP, 187
CONSOLE, 68
CONT, 68
CURSOR, 69
DATA, 72
DEF FN, 73
DEF FN...END DEF, 74
DEFDBL, 74
DEFINT, 74
DEFLNG, 75
DEFSNG, 75
DEFSTR, 75
DELETE, 76
DEVICE, 76
DILA, 187
DIM, 76
DISPLAY, 77
DO REPEAT–LOOP, 79
DO UNTIL–LOOP, 80
DO WHILE–LOOP, 80
DO–LOOP REPEAT, 78
DO–LOOP UNTIL, 78
DO–LOOP WHILE, 79
DOUT, 80
EDGRJECT, 188
EDIT, 81
ELIM, 188
ELLIPSE, 82
END, 82
ENHANCE, 83
ERASE, 83
EROS, 189
ERRMSG, 84
ERROR, 84
ERROUT, 85
EVENTIN, 85
EXIT DEF/DO/FOR/SUB, 86
FIELD #, 87
FILES, 88
FILTDATA, 88, 189
FILTER, 88
FILTERIN, 89
FILTSEL, 190
FIND, 89
FLASH, 90
FOR..TO..STEP–NEXT, 91
FORMAT, 191
GATE, 91
GCOPY, 92
GCOPY2, 92
GET #, 93
GET@, 93
GETBLUT, 94
GETDLUT, 94
GETDLVL, 95
GETLUT, 95
GETMDATA, 191
GMFUNC, 193
GOSUB, 95
220
Index
GOTO, 96
HELP, 96
HELP ON/OFF/STOP, 96
HFILL, 193
HISTGRAM, 97
IF..GOTO–ELSE, 98
IF..THEN–ELSE, 98
IF..THEN–ELSEIF–ELSE–END IF, 99
IMGLOAD, 99
IMGSAVE, 100
INPUT, 101
INPUT WAIT, 102
INPUT#, 101
INTR ON/OFF/STOP, 104
IPL, 104, 194
KEY, 106
KEY LIST, 106
KEY ON/OFF/STOP, 106
KILL, 107
KINPUT, 108
KPLOAD, 110
LABEL, 111
LET, 113
LEVEL, 114, 195
LINE, 114
LINE INPUT, 115
LINE INPUT WAIT, 116
LINE INPUT#, 116
LIST, 116
LOAD, 117
LOCATE, 118
LPUTIMG, 119
LSET, 120
LSORT, 120, 195
MASK3, 195
MASKBIT, 120
MEASURE, 122
MENU, 122
MERGE, 122
MKDIR, 124
MMODE, 125
MWMEAS, 196
MWSET, 197
NAME, 126
NEW, 126
ON COM GOSUB, 127
ON CONKEY GOSUB, 197
ON ERROR GOTO, 128
ON GOSUB, 130
ON GOTO, 131
ON HELP GOSUB, 128
ON INTR GOSUB, 128
ON KEY GOSUB, 129
ON STOP GOSUB, 129
ON TIME$ GOSUB, 130
OPEN(1), 131
OPEN(2), 132
OPTION BASE, 132
POLYGON, 134
POLYLINE, 134
POUT, 135
PRINT, 135
PRINT #, 137
PRINT USING, 136
PRINT# USING, 138
PSET, 138
PUT #, 139
PUT@, 139
RANDOMIZE, 140
READ, 140
REM, 141
RENUM, 141
REPLACE, 141
RESTORE, 142
RESUME, 142
RETURN, 142
RMDIR, 143
RMODE, 144
RSET, 145
RUN, 145
SAVE, 146
SBANK, 146
SCAN, 147
SCANSET, 147
SCNCALIB, 148
SCNLOAD, 149
SCNLUT, 149
SCNSAVE, 149
SELECT...CASE–CASEELSE–END SELECT, 151
SET, 151
SETBLUT, 152
SETDLUT, 152
SETDLVL, 153
SETLUT, 153
SFTBLUT, 153
SFTLUT, 154
SOBEL, 199
SPCLOSE, 157
SPLINE, 157
SSCROLL, 158
STOP, 158
STOP ON/OFF/STOP, 159
STRMODE, 160
SUB–END SUB, 161
SWAP, 161
SZOOM, 200
THIN, 200
TIME$ ON/OFF/STOP, 163
TROFF, 164
TRON, 164
VDWAIT, 165
VIDEOIN, 165
WDILA, 200
WDISP, 166
WEROS, 201
WHILE–WEND, 166
WINDOW, 167
WRITE, 167
WRITE #, 168
WSCROLL, 168
WZOOM, 201 command–function, DATE$, 73
COMMON, 67 compile work space, changes in version 2.00, 172
CONKEY ON/OFF/STOP, 187
CONSOLE, 68
Index
console key, interrupts, 180, 187, 197 constants, 21 character, 21 character strings, 21 numeric, 22 integer, 22 long integer, 22 real number, 23
CONT, 68 conversion, numeric data, 25
COS, 69 criteria, checking with SCNJUDGE, 177, 198
CSNG, 69
CSRLIN, 69
CURSOR, 69
CVD, 70
CVI, 71
CVL, 71
CVS, 71
D
DATA, 72 data, measured, flow, 41
DATE$, 73
DEF FN, 73
DEF FN...END DEF, 74
DEFDBL, 74
DEFINT, 74
DEFLNG, 75
DEFSNG, 75
DEFSTR, 75
DELETE, 76
DEVICE, 76
DILA, 187
DIM, 76
DIN, 77
DISPLAY, 77 display LUT, 39
DO REPEAT–LOOP, 79
DO UNTIL–LOOP, 80
DO WHILE–LOOP, 80
DO–LOOP REPEAT, 78
DO–LOOP UNTIL, 78
DO–LOOP WHILE, 79
DOUT, 80 drawing density, 46
221
drawing mode, 46
DSA, 81
DSKF, 81
E
EDGRJECT, 188
EDIT, 81
ELIM, 188
ELLIPSE, 82
END, 82
ENHANCE, 83
EOF, 83
ERASE, 83
ERL, 84
EROS, 189
ERR, 84
ERRMSG, 84
ERROR, 84 error messages, table, 213
ERROUT, 85
EVENTIN, 85
EXIT DEF/DO/FOR/SUB, 86
EXP, 87 expressions, 29 character, 29 functions, 31 logical, 29 numeric, 29 relational, 29
F
FIELD #, 87 file delimiters, changes in version 2.00, 172
FILES, 88 fill measurement, 50
FILTDATA, 88, 189
FILTER, 88 filter, 39
3x3 mask filtering, 195 selecting filtering functions, 177, 190 setting line filter factors, 189
FILTERIN, 89
FILTSEL, 190
FIND, 89
FIX, 90
FLASH, 90
222
Index
FOR..TO..STEP–NEXT, 91
FORMAT, 191
FRE, 91
GETVER, 192
HEX$, 97
INKEY$, 100
INPUT$, 102
INSTR, 103
INT, 103
JIS$, 105
KACNV$, 105
KEXT$, 105
KEYIN, 107
KINSTR, 108
KLEN, 108
KMID$, 109
KNJ$, 109
KPOS, 110
KTYPE, 111
LBOUND, 112
LCASE$, 112
LDATA, 112
LEFT$, 113
LEN, 113
LNUM, 117
LOC, 117
LOF, 118
LOG, 118
LPOINT, 119
LTRIM$, 120
MDATA, 121
MDATA2, 121
MKD$, 123 function
ABS, 54
AKCNV$, 54
ASC, 55
ATN, 55
ATTR, 55
AUTOLVL, 56
BATCHK, 185
BCDTOBIN, 185
BINTOBCD, 186
CAMCHK, 60
CDBL, 61
CHR$, 63
CINT, 63
CLNG, 65
COS, 69
CSNG, 69
CSRLIN, 69
CVD, 70
CVI, 71
CVL, 71
CVS, 71
DIN, 77
DSA, 81
DSKF, 81
EOF, 83
ERL, 84
ERR, 84
EXP, 87
FIX, 90
FRE, 91
G
GATE, 91
GCOPY, 92
GCOPY2, 92
GET #, 93
GET@, 93
GETBLUT, 94
GETDLUT, 94
GETDLVL, 95
GETLUT, 95
GETMDATA, 191
GETVER, 192
GMFUNC, 193
GOSUB, 95
MKI$, 124
MKL$, 124
MKS$, 125
NPIECE, 126
OCT$, 127
PIECE$, 133
PIN, 133
POINT, 133
POS, 135
RDATA, 140
RIGHT$, 143
RND, 144
RTRIM$, 145
RUNL, 146
RUNL2, 198
SCNCAM, 148
SCNJUDGE, 198
SCNLEVEL, 148
SCNSTAND, 199
SDATA1, 149
SDATA2, 150
SEARCH, 150
SGN, 155
SIN, 155
SPACE$, 156
SPC, 156
SQR, 158
STR$, 159
STRCHK, 160
STRING$, 160
TAB, 161
TAN, 162
UBOUND, 164
UCASE$, 164
VAL, 165 function, command
MID$, 123
TIME$, 162
TIMER, 163 functions, 31 induction, 217
Index
GOTO, 96 gray-scale images, logic operations between, 193
H
HELP, 96
HELP ON/OFF/STOP, 96
HEX$, 97
HFILL, 193
HISTGRAM, 97
I
IF..GOTO–ELSE, 98
IF..THEN–ELSE, 98
IF..THEN–ELSEIF–ELSE END IF, 99 image cut-off, 50 images cameras display status, 40 measurement status, 40 data flow, 36 display LUT, 39 filter, 39
LUT, 38 memory display status, 41 measurement status, 41
VRAM, 36 character memory, 36 graphic memory, 37 image memory, 37 shading memory, 38 window memory, 37
IMGLOAD, 99
IMGSAVE, 100 induction functions, 217
INKEY$, 100
INPUT, 101
INPUT WAIT, 102
INPUT#, 101
INPUT$, 102 inspection, for character blurring/omission, 174
INSTR, 103
INT, 103 integer constants, 22 format decimal, 22 hexadecimal, 22 octal, 22 interrupts, 32 console key, 180, 187, 197
223
INTR ON/OFF/STOP, 104
IPL, 104, 194
JIS$, 105
J
K
KACNV$, 105
KEXT$, 105
KEY, 106
KEY LIST, 106
KEY ON/OFF/STOP, 106
KEYIN, 107
KILL, 107
KINPUT, 108
KINSTR, 108
KLEN, 108
KMID$, 109
KNJ$, 109
KPLOAD, 110
KPOS, 110
KTYPE, 111
L
LABEL, 111 labelling, 48 renumbering labels, 176, 195 labels, 32
LBOUND, 112
LCASE$, 112
LDATA, 112
LEFT$, 113
LEN, 113
LET, 113
LEVEL, 114, 195
LINE, 114
LINE INPUT, 115
LINE INPUT WAIT, 116
LINE INPUT#, 116 lines definition, 20 format, 20 numbers, 20 statements, 20
224
Index
LIST, 116
LNUM, 117
LOAD, 117
LOC, 117
LOCATE, 118
LOF, 118
LOG, 118 long integer constants, 22 format decimal, 22 hexadecimal, 23 octal, 22
LPOINT, 119
LPUTIMG, 119
LSET, 120
LSORT, 120, 195
LTRIM$, 120
LUT, 38
M mask bits, memory, 43
MASK3, 195
MASKBIT, 120
MDATA, 121
MDATA2, 121
MEASURE, 122 measurement fill, 50 scan, 51 memory binary image planes, 43 frame, 43 image, 37 shading, 38 window, 37 mask bits, 43 plane, 43 character, 36 graphic, 37
Memory Card checking battery voltage, 180, 185 formatting, 180, 191
MENU, 122
MERGE, 122
MID$, 123
MKD$, 123
MKDIR, 124
MKI$, 124
MKL$, 124
MKS$, 125
MMODE, 125 multiple-window functions measurements, 196 registering windows, 197 use in sample program, 204 version 2.00 addition, 172
MWMEAS, 196
MWSET, 197
N
NAME, 126
NEW, 126
NPIECE, 126
O
OCT$, 127
ON COM GOSUB, 127
ON CONKEY GOSUB, 197
ON ERROR GOTO, 128
ON GOSUB, 130
ON GOTO, 131
ON HELP GOSUB, 128
ON INTR GOSUB, 128
ON KEY GOSUB, 129
ON STOP GOSUB, 129
ON TIME$ GOSUB, 130
OPEN(1), 131
OPEN(2), 132 operations priority, 32 screen, 35 operators, 27 arithmetic, 27 logical, 28 relational, 28
OPTION BASE, 132
P
PIECE$, 133
PIN, 133 planes frame, 43 memory, 43
POINT, 133
Index
POLYGON, 134
POLYLINE, 134
POS, 135
POUT, 135
PRINT, 135
PRINT #, 137
PRINT USING, 136
PRINT# USING, 138 programs, samples for version 2.00, 203
PSET, 138
PUT #, 139
PUT@, 139
R
RANDOMIZE, 140 raw images logic operations between, 175 processing, 175
RDATA, 140
READ, 140 real number constants, 23 format double-precision, 23 single-precision, 23 reference image data, checking with SCNSTAND, 178, 199
REM, 141
RENUM, 141
REPLACE, 141 reserved words, table, 215
RESTORE, 142
RESUME, 142
RETURN, 142
RIGHT$, 143
RMDIR, 143
RMODE, 144
RND, 144
RS-232C, standard I/O settings, 181
RSET, 145
RTRIM$, 145
RUN, 145 run length, 47 detailed, 48 simple, 47 using for various calculations, 179, 198
RUNL, 146
RUNL2, 198
225
S sample programs, for version 2.00, 203
SAVE, 146
SBANK, 146
SCAN, 147 scan measurement, 51
SCANSET, 147
SCNCALIB, 148
SCNCAM, 148
SCNJUDGE, 198
SCNLEVEL, 148
SCNLOAD, 149
SCNLUT, 149
SCNSAVE, 149
SCNSTAND, 199 scrolling, 49 shading, 49 window, 49
SDATA1, 149
SDATA2, 150
SEARCH, 150
SELECT...CASE–CASEELSE–END SELECT, 151
SET, 151
SETBLUT, 152
SETDLUT, 152
SETDLVL, 153
SETLUT, 153
SFTBLUT, 153
SFTLUT, 154
SGN, 155 shading compensation frame memory, 38 scrolling, 49 shading memory, zooming, 200
SIN, 155
SOBEL, 199
SPACE$, 156
SPC, 156
SPCLOSE, 157 specifications, changes in version 2.00, 172
SPLINE, 157
SQR, 158
SSCROLL, 158 statements, 20
STOP, 158
226
Index
STOP ON/OFF/STOP, 159
STR$, 159
STRCHK, 160
STRING$, 160
STRMODE, 160
SUB–END SUB, 161
SWAP, 161 symbols, 20 syntax, 19
SZOOM, 200
T
TAB, 161
TAN, 162
THIN, 200
TIME$, 162
TIME$ ON/OFF/STOP, 163
TIMER, 163
TROFF, 164
TRON, 164
U
UBOUND, 164
UCASE$, 164
V
VAL, 165 variables, 23 arrays, 24 names, 24 reserved words, 24 system, 31 type declarators, 23
VDWAIT, 165 version, obtaining with GETVER, 192 version 2.00
alphabetical listing of functions & commands, 171
BCD/binary conversion, 180 binary image processing, 174 binary level setting range, 182 calculations using simple run length, 179 camera synchronization, 181 changes in specifications, 172 checking menu settings, 177 console key interrupts, 180 filtering selection, 177 high-speed array operations, 175 image-to-image calculations, 175
loading/saving programs through RS-232C, 181 memory card operations, 180 multiple-window functions, 172 obtaining system information, 181 raw image processing, 175 renumbering labels, 176 standard I/O settings, 181 summary of additional capabilities, 170 window enlargement/reduction, 174 zooming window & shading memory, 176
VIDEOIN, 165
VRAM, 36 character memory, 36 graphic memory, 37 image memory, 37 shading memory, 38 window memory, 37
W
WDILA, 200
Index
WDISP, 166
WEROS, 201
WHILE–WEND, 166
WINDOW, 167 window memory, zooming, 201 windows, 44 frame memory, 37 paint, 45 pattern matching, 45 planes, 44 scrolling, 49 zooming, 176
WRITE, 167
WRITE #, 168
WSCROLL, 168
WZOOM, 201
227
Revision History
A manual revision code appears as a suffix to the catalog number on the front cover of the manual.
Cat. No. Z92-E1-2
Revision code
The following table outlines the changes made to the manual during each revision. Page numbers refer to the previous version.
Revision code
1
1A
2
Date
October 1992
March 1993
March 1994
Revised content
Original production
Page 38: VRAM3 description has been changed from window memory to image memory.
Pages 67, 68: Sentence added to
COMMON
example section and the program example has been altered.
Page 76: Format of
DIM
has been corrected.
Page 77: Last sentence of
DIN
description has been corrected.
Page 100: Compression function specification has been corrected for
IMGSAVE
.
Pages 121, 122: Description for
MDATA2
has been changed.
Page 132: S parameter has been added to the table.
Page 173: Induction formulas have been changed for functions cosec
–1
X, coth X, tanh
–1
X, sech
–1
X, and coth
–1
X.
Version 2.00 of the F300 Visual Inspection System (OVL) added as Part II,
Sections 1 to 3.
Page 73: Format for the description corrected.
Page 74:
DEF FN...END DEF
example corrected.
Page 87: Middle paragraph for
EXP
description corrected.
Page 102: Middle paragraph for
INPUT WAIT
description corrected.
Page 116: Middle paragraph for
LINE INPUT WAIT
description corrected.
LINE INPUT#
description corrected.
Page 142: Middle paragraph for
RESUME
description corrected.
Page 149: Format and middle paragraph description corrected for
SCNLOAD
.
Page 151: Header and format for
SELECT...CASE–CASE ELSE–END
SELECT
corrected.
Page 160: Format for
STRING$
corrected.
229
广告