You can register global variables as external variables in a function variable table to access
global variables. We recommend that you create your functions so that they produce output val-
ues uniquely based on their input parameter values. Algorithms that access global variables and
use them to affect the output values are not recommended. When you check the program on the
Sysmac Studio, a message will appear that says that it is not recommended to use global vari-
ables in functions. Take appropriate measures if necessary.
ENO
• When ENO is FALSE, the previous values of all other output variables are retained.
External vari-
ables
No limit External variables access global variables.
EN 1 This is a BOOL input variable used to execute the function.
• The function is executed when EN is TRUE.
• You must have one EN variable. (This applies to both user-defined functions
and FUN instructions).
ENO 0 or 1 Generally, this is a BOOL output variable that is set to TRUE for a normal end,
and to FALSE for an error end.
• You can omit the ENO variable from user-defined functions.
• Refer to ENO, below, for details.
Return value 1 The return value is the value that is returned to the calling instruction. It repre-
sents the results of the process after the algorithm in the function is executed.
• Each function must have one return value.
• You can specify enumerations of all basic data types. You cannot specify an
array, structure, or union.
• If you do not set the return values for algorithms in user-defined functions, the
return values are not dependable. That is, the return values may be different
even if the values of the input parameters are the same. Therefore, if you use
the return value at the process that called the function, always set the return
value in the algorithm in the function.
• Refer to Return Values, below, for details.
Variables Number Specification