WWW.NNC.IR
Macro Reference
624
Vision System FH/FZ5 Series
User’s Manual (Z340)
MOD
Gets the remainder.
Format
<expression1> MOD <expression2>
Parameter
Return value
Returns the remainder as an integer value.
Description
Gets the remainder from division of the expression specified in the <expression1> parameter by the
expression specified in the <expression2> parameter.
If double precision real number expressions are specified, the values are treated as values with digits to the
right of the decimal point rounded off.
If an incorrect data type is specified for a parameter, a "Type mismatch" error will occur.
If a value outside the range -2147483648 to 2147483647 is specified as an integer parameter, an "Overflow"
error will occur.
If 0 is specified in the <expression2> parameter, a "Division by zero" error will 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
Increments a counter from 0 to 100.
Useable Modules
Unit Calculation Macro / Scene Control Macro / Communication Command Macro / Unit Macro
Supported Versions
Version 3.50 or later
Related Items
Parameter
name
Data type Description
<expression1>
Integer type Expression of the dividend to calculate the remainder
<expression2>
Integer type Expression of the divisor to calculate the remainder
I& = (I&+1) MOD 100
Fix (Reference: X Details (p.524)) GetUnitData (Reference: X Details (p.552))
UnitData (Reference: X Details (p.778))