143
ST Language Configuration
Section 5-4
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.
5-4-5
Standard Functions
Numerical Functions
Function type
Syntax
Numerical Functions
Absolute values, trigonometric functions, etc.
Arithmetic Functions
Exponential (EXPT)
Data Type Conversion Functions
Source_data_type
_TO_
New_data_type
(
Variable_name
)
Number-String Conversion Functions
Source_data_type
_TO_STRING (
Variable
_
name
)
STRING_TO_
New_data_type
(
Variable
_
name
)
Function
Argument data type
Return value
data type
Description
Example
ABS (
argument
)
INT, DINT, LINT,
UINT, UDINT, ULINT,
REAL, LREAL
INT, DINT, LINT,
UINT, UDINT,
ULINT, REAL,
LREAL
Absolute value [
argu-
ment
]
a: = ABS (b)
(*absolute value of variable
b
stored in variable
a
*)
SQRT (
argument
)
REAL, LREAL
REAL, LREAL
Square root:
√
argument
a: = SQRT (b)
(*square root of variable
b
stored in variable
a
*)
LN (
argument
)
REAL, LREAL
REAL, LREAL
Natural logarithm: LOG
e
argument
a: = LN (b)
(*natural logarithm of vari-
able
b
stored in variable
a
*)
LOG (
argument
)
REAL, LREAL
REAL, LREAL
Common logarithm:
LOG
10
argument
a: = LOG (b)
(*common logarithm of vari-
able
b
stored in variable
a
*)
EXP (
argument
)
REAL, LREAL
REAL, LREAL
Natural exponential: e
ar-
gument
a: = EXP (b)
(*natural exponential of vari-
able
b
stored in variable
a
*)
SIN (
argument
)
REAL, LREAL
REAL, LREAL
Sine: SIN argument
a: = SIN (b)
(*sine of variable
b
stored in
variable
a
*)
COS (
argument
)
REAL, LREAL
REAL, LREAL
Cosine: COS argument
a: = COS (b)
(*cosine of variable
b
stored
in variable
a
*)
TAN (
argument
)
REAL, LREAL
REAL, LREAL
Tangent: TAN argument
a: = TAN (b)
(*tangent of variable
b
stored
in variable
a
*)
ASIN (
argument
)
REAL, LREAL
REAL, LREAL
Arc sine: SIN
−
1
argument
a: = ASIN (b)
(*arc sine of variable
b
stored in variable
a
*)
ACOS (
argument
)
REAL, LREAL
REAL, LREAL
Arc cosine: COS
−
1
argu-
ment
a: = ACOS (b)
(*arc cosine of variable
b
stored in variable
a
*)
ATAN (
argument
)
REAL, LREAL
REAL, LREAL
Arc tangent: TAN
−
1
argu-
ment
a: = ATAN (b)
(*arc tangent of variable
b
stored in variable
a
*)
Summary of Contents for CX-PROGRAMMER V8.1
Page 3: ...iv...
Page 5: ...vi...
Page 7: ......
Page 15: ...xvi...
Page 19: ...xx...
Page 25: ...xxvi Application Precautions 4...
Page 26: ...Part 1 Function Blocks...
Page 27: ......
Page 153: ...128 Procedures Section 3 2...
Page 154: ...Part 2 Structured Text ST...
Page 155: ......
Page 159: ...134 CX Programmer Specifications Section 4 2...
Page 205: ...180 Procedures Section 6 1...
Page 207: ...182 System defined external variables supported in function blocks Appendix A...
Page 229: ...204 Revision History...
Page 230: ......