Standard Functions - Omron CX-PROGRAMMER V8.1 Operation Manual

Function blocks/ structured text
Table of Contents

Advertisement

ST Language Configuration
5-4-5

Standard Functions

Function type
Numerical Functions
Arithmetic Functions
Data Type Conversion Functions
Number-String Conversion Functions
Numerical Functions
Function
Argument data type
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
type variables A=3 and B= 2, if the operation (A/B)*2 is performed, the result
of A/B is 1 (1.5 with the value below the decimal discarded), so (A/B)*2 = 2.
Absolute values, trigonometric functions, etc.
Exponential (EXPT)
Source_data_type_TO_New_data_type (Variable_name)
Source_data_type_TO_STRING (Variable_name)
STRING_TO_New_data_type (Variable_name)
Return value
data type
INT, DINT, LINT,
UINT, UDINT,
ULINT, REAL,
LREAL
REAL, LREAL
REAL, LREAL
REAL, LREAL
REAL, LREAL
REAL, LREAL
REAL, LREAL
REAL, LREAL
REAL, LREAL
REAL, LREAL
REAL, LREAL
Syntax
Description
Absolute value [argu-
ment]
Square root:
argument
Natural logarithm: LOG
e
argument
Common logarithm:
LOG
argument
10
ar-
Natural exponential: e
gument
Sine: SIN argument
Cosine: COS argument
Tangent: TAN argument
1
Arc sine: SIN
argument
1
Arc cosine: COS
argu-
ment
1
Arc tangent: TAN
argu-
ment
Section 5-4
Example
a: = ABS (b)
(*absolute value of variable
b stored in variable a*)
a: = SQRT (b)
(*square root of variable b
stored in variable a*)
a: = LN (b)
(*natural logarithm of vari-
able b stored in variable a*)
a: = LOG (b)
(*common logarithm of vari-
able b stored in variable a*)
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)
(*arc sine of variable b
stored in variable a*)
a: = ACOS (b)
(*arc cosine of variable b
stored in variable a*)
a: = ATAN (b)
(*arc tangent of variable b
stored in variable a*)
143

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac ws02-cxpc1-v8Sysmac cx-programmer 8.1

Table of Contents