Omron SYSMAC FH Series User Manual page 754

Vision sensor vision system
Hide thumbs Also See for SYSMAC FH Series:
Table of Contents

Advertisement

in the <negative> parameter).
Example: Specify the following parameters: Number of digits in the integer part: 3, number of digits in the
decimal part: 3
When <expression> parameter is 999.999, the changed numerical character string is "999.999"
When <expression> parameter is -999.999, the changed numerical character string is "-99.999"
If 0 is specified in the <fixed> parameter, the expression in the <expression> parameter is rounded off to the
nearest whole number and converted to the numeric character string.
If a smaller number than number of decimal places in the <expression> parameter is specified in the <fixed>
parameter, the expression in the <expression> parameter is rounded off to the nearest number that can be
expressed with a <fixed> number and converted to the numeral character string.
Example: Specify the following parameters: Number of digits in the integer part: 2, number of digits in the
decimal part: 4
When <expression> parameter is 10.12345, the changed numerical character string is "10.1235"
If a larger number than number of decimal places in the <expression> parameter is specified in the <fixed>
parameter, zeros are filled to the lower digit places of the converted numeral character string until the digit
place number reaches to the <fixed> parameter.
Example: Specify the following parameters: Number of digits in the integer part: 2, number of digits in the
decimal part: 5
When <expression> parameter is 10.123, the changed numerical character string is "10.12300"
If an incorrect data type is specified for a parameter, a "Type mismatch" error will occur.
If a non-existent number, numerical value, or combination of data types or values is specified for a parameter,
an "Illegal function call" error will occur.
If a value outside the range -2147483648 to 2147483647 is specified as an integer parameter, an "Overflow"
error will occur.
If a value outside the range -1.0E30 to 1.0E30 is specified for a double precision real number parameter, an
"Overflow" error might occur.
If a value is assigned to the return value variable or the variable is not used in an expression, a "Syntax error"
error will occur.
If the format is written incorrectly, such as writing the macro function name incorrectly, omitting a comma, or
omitting a half-width space, a "Syntax error" error will occur.
Usage Cautions
• None.
Example
Outputs the measured correlation value, measured position coordinates X and Y (Position X and Position Y)
with the search processing unit (Processing Unit number 5) to the system status console window. The
correlation value, measured position coordinates X and Y can be gotten with External Reference Data
numbers 5, 6, and 7 respectively.
Rem Get the measurement result of the processing unit.
GetUnitData 5, 6, X#
GetUnitData 5, 7, Y#
GetUnitData 5, 5, CR#
Rem Convert the measurement results to the numeric character strings in the specified format.
RESX$ = Str2$(X#, 3, 3, 0, 0)
RESY$ = Str2$(Y#, 3, 3, 0, 0)
RESCR$ = Str2$(CR#, 3, 0, 0, 0)
Rem Use the Print function to output the strings to the value to the system status console window.
Print RESX$ + "," + RESY$ + "," + RESCR$
752
Macro Reference
WWW.NNC.IR
Vision System FH/FZ5 Series
User's Manual (Z340)

Advertisement

Table of Contents
loading

Table of Contents