Functions; User-Defined Functions; Built-In Functions - Mitsubishi Electric CR750-Q Instruction Manual

Cr750/cr751/cr760 series
Hide thumbs Also See for CR750-Q:
Table of Contents

Advertisement

4MELFA-BASIC V

4.7 Functions

A function carries out a specific operation for an assigned argument, and returns the result as a numeric
value type or character string type. There are built-in functions, that are preassembled, and user-defined
functions, defined by the user.

(1) User-defined functions

The function is defined with the Def FN statement.
Example) Def FNMADD(MA, MB)=MA+MB
The function name starts with FN, and the data type identification character (C: character string, M: numeric
value, P: position, J: joint) is described at the third character. The function is designated with up to eight
characters.

(2) Built-in functions

A list of assembled functions is given in
Table 4-11:List of built-in functions
Class
Function name (format)
Numeric func-
Abs (<Numeric expression>)
tions
Cint (<Numeric expression>)
Deg (<Numeric expression:radian>) Converts the angle unit from radian (rad) to degree (deg).
Exp (<Numeric expression>)
Fix (<Numeric expression>)
Int (<Numeric expression>)
Len(<Character string expression>) Produces the length of the character string.
Ln (<Numeric expression>)
Log (<Numeric expression>)
Max (<Numeric expression>...)
Min (<Numeric expression>...)
Rad (<Numeric expression: deg.>)
Sgn (<Numeric expression>)
Sqr (<Numeric expression>)
Strpos(<Character string expres-
sion>, <Character string expres-
sion>)
Rnd (<Numeric expression>)
Asc(<Character string expression>) Provides a character code for the first character of the character
Cvi(<Character string expression>)
Cvs(<Character string expression>) Converts a 4-byte character string into a single-precision real number.
Cvd(<Character string expression>) Converts an 8-byte character string into a double-precision real number.
Val(<Character string expression>)
SplSpd(<Spline No.>)
Trigonometric
ACos(<Numeric expression>)
functions
ASin(<Numeric expression>)
Atn(<Numeric expression>)
Atn2(<Numeric expres-
sion>,<Numeric expression>)
4-160 Functions
...........The function to obtain the total of two values is defined with FNMADD.
Table
Produces the absolute value
Rounds off the decimal value and converts into an integer.
Calculates the value of the expression's exponential function
Produces an integer section
Produces the largest integer that does not exceed the value in the
expression.
Produces the logarithm.
Produces the common logarithm.
Obtains the max. value from a random number of arguments.
Obtains the min. value from a random number of arguments.
Converts the angle unit from radian (rad) to degree (deg).
Checks the sign of the number in the expression
Calculates the square root
Obtains the 2nd argument character string position in the 1st argu-
ment character string.
Produces the random numbers.
string in the expression.
Converts a 2-byte character string into integers.
Converts a character string into a numeric value.
Obtains the maximum speed which can be specified without an
error from the path point data registered in a random spline file.
Calculates the arc cosine.
Definition range: -1.0 to +1.0, Value range: 0 to PI
Calculates the arc sine.
Definition range: -1.0 to +1.0, Value range: -PI/2 to +PI/2
Calculates the arc tangent. Unit: radian
Definition range: Numeric value, Value range: -PI/2 to +PI/2
Calculates the arc tangent.
THETA=Atn2(delta y, deltax)
Definition range: Numeric value of delta y or delta x that is not 0
Value range: -PI to +PI
4-11.
Functions
Unit: radian
Unit: radian
Unit: radian
Result
Page
398
Numeric
value
405
408
409
410
412
414
415
415
416
417
421
428
432
432
423
401
407
407
408
434
431
399
Numeric
value
402
402
402

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr750Cr751-qCr751-dCr760-dCr760-qCr750-d

Table of Contents