Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION Operation Manual page 158

Function blocks
Table of Contents

Advertisement

Structured Text (ST Language) Specifications
Numerical Functions
The following numerical functions can be used in structured text.
Numerical
Argument data type
functions
ABS (argument)
INT, DINT, LINT,
UINT, UDINT, ULINT,
REAL, LREAL
SQRT (argument)
REAL, LREAL
LN (argument)
REAL, LREAL
LOG (argument)
REAL, LREAL
EXP (argument)
REAL, LREAL
SIN (argument)
REAL, LREAL
COS (argument)
REAL, LREAL
TAN (argument)
REAL, LREAL
ASIN (argument)
REAL, LREAL
ACOS (argument)
REAL, LREAL
ATAN (argument)
REAL, LREAL
Note The data type returned for numerical functions is the same as that used in the argument. Therefore, vari-
ables substituted for function return values must be the same data type as the argument.
Arithmetic Functions
The following general exponential function can be used in structured text.
Exponential
Argument data type
function
EXPT (base, expo-
Base: REAL, LREAL
nent)
Exponent: INT, DINT,
LINT, UINT, UDINT,
ULINT
Note The data type returned for the general exponential function is the same as that used in the argument.
Therefore, variables substituted for function return values must be the same data type as the argument.
Return value
data type
INT, DINT, LINT,
Absolute value [argument] a: = ABS (b)
UINT, UDINT,
ULINT, REAL,
LREAL
REAL, LREAL
Square root:
argument
REAL, LREAL
Natural logarithm: LOG
argument
REAL, LREAL
Common logarithm:
LOG
argument
10
REAL, LREAL
Natural exponential: e
ment
REAL, LREAL
Sine: SIN argument
REAL, LREAL
Cosine: COS argument
REAL, LREAL
Tangent: TAN argument
REAL, LREAL
Arc sine: SIN
REAL, LREAL
Arc cosine: COS
ment
REAL, LREAL
Arc tangent: TAN
ment
Return value
data type
REAL, LREAL
Exponential: Base
Contents
(*absolute value of variable b
stored in variable a*)
a: = SQRT (b)
(*square root of variable b
stored in variable a*)
a: = LN (b)
e
(*natural logarithm of vari-
able b stored in variable a*)
a: = LOG (b)
(*common logarithm of vari-
able b stored in variable a*)
argu-
a: = EXP (b)
(*natural exponential of vari-
able b stored in variable a*)
a: = SIN (b)
(*sine of variable b stored in
variable a*)
a: = COS (b)
(*cosine of variable b stored
in variable a*)
a: = TAN (b)
(*tangent of variable b stored
in variable a*)
a: = ASIN (b)
1
argument
(*arc sine of variable b
stored in variable a*)
a: = ACOS (b)
1
argu-
(*arc cosine of variable b
stored in variable a*)
a: = ATAN (b)
1
argu-
(*arc tangent of variable b
stored in variable a*)
Contents
a: = EXPT (b, c)
exponent
(*Exponential with variable b
as the base and variable c as
the exponent is stored in
variable a*)
Appendix B
Example
Example
143

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-programmer 5.0Sysmac ws02-cxpc1-e-v50Cs1-hCj1-hCj1m

Table of Contents