Skip to content

cBasedLibraryMethods

math."method"

abs

Returns the absolute value of x.

INPUT:
arg : TYPE_ANY [1:1]

RETURN TYPE:
Inherits type of input parameter "arg"

Return:

IMPLICIT_RETURN_TYPE

Parameters:

arg : TYPE_ANY

abs_dep

Returns the absolute value of a number.

INPUT:
in : TYPE_ANY [1:1]

RETURN TYPE:
UDINT

Return:

UDINT

Parameters:

in : TYPE_ANY

acos

Returns the arc cosine of x (measured in radians)
Input-Range [-1.0; 1.0]
Output-Range [0; pi]

INPUT:
arg : LREAL [1:1]

RETURN TYPE:
Inherits type of input parameter "arg"

Return:

IMPLICIT_RETURN_TYPE

Parameters:

arg : LREAL

acos_dep

REAL acos(DINT x)

Returns the arc cosine of x (measured in radians)
Input-Range [-1.0; 1.0]
Output-Range [0; pi]

INPUT:
arg : DINT [1:1]

RETURN TYPE:
REAL

Return:

REAL

Parameters:

arg : DINT

asin

Returns the arc sine of x (measured in radians)
Input-Range [-1.0; 1.0]
Output-Range [-pi/2; pi/2]

INPUT:
arg : LREAL [1:1]

RETURN TYPE:
Inherits type of input parameter "arg"

Return:

IMPLICIT_RETURN_TYPE

Parameters:

arg : LREAL

asin_dep

REAL asin(DINT x)

Returns the arc sine of x (measured in radians)
Input-Range [-1.0; 1.0]
Output-Range [-pi/2; pi/2]

INPUT:
arg : DINT [1:1]

RETURN TYPE:
REAL

Return:

REAL

Parameters:

arg : DINT

atan

Returns the arc tangent of x (measured in radians)
Input-Range [-1.0; 1.0]
Output-Range [-pi/2; pi/2]

INPUT:
arg : LREAL [1:1]

RETURN TYPE:
Inherits type of input parameter "arg"

Return:

IMPLICIT_RETURN_TYPE

Parameters:

arg : LREAL

atan_dep

REAL atan(DINT x)

Returns the arc tangent of x (measured in radians)
Input-Range [-1.0; 1.0]
Output-Range [-pi/2; pi/2]

INPUT:
arg : DINT [1:1]

RETURN TYPE:
REAL

Return:

REAL

Parameters:

arg : DINT

cos

Returns the cosine of x (measured in radians)

INPUT:
arg : LREAL [1:1]

RETURN TYPE:
Inherits type of input parameter "arg"

Return:

IMPLICIT_RETURN_TYPE

Parameters:

arg : LREAL

cos_dep

REAL cos(DINT x)

Returns the cosine of x (measured in radians)

INPUT:
arg : DINT [1:1]

RETURN TYPE:
REAL

Return:

REAL

Parameters:

arg : DINT

exp

Returns the base-e exponential of x.

INPUT:
arg : LREAL [1:1]

RETURN TYPE:
Inherits type of input parameter "arg"

Return:

IMPLICIT_RETURN_TYPE

Parameters:

arg : LREAL

exp_dep

REAL e^(DINT x)

Returns the base-e exponential of x.

INPUT:
arg : DINT [1:1]

RETURN TYPE:
REAL

Return:

REAL

Parameters:

arg : DINT

fabs_dep

REAL (|DINT x|)

Returns the absolute value of x.

INPUT:
arg : DINT [1:1]

RETURN TYPE:
REAL

Return:

REAL

Parameters:

arg : DINT

log

Returns the natural logarithm of x.

INPUT:
arg : LREAL [1:1]

RETURN TYPE:
Inherits type of input parameter "arg"

Return:

IMPLICIT_RETURN_TYPE

Parameters:

arg : LREAL

log_dep

REAL ln(DINT x)

Returns the natural logarithm of x.

INPUT:
arg : DINT [1:1]

RETURN TYPE:
REAL

Return:

REAL

Parameters:

arg : DINT

pow

Returns x raised to the power of y

INPUT:
base : LREAL [1:1]
exponent : TYPE_ANY [1:1]

RETURN TYPE:
Inherits type of input parameter "base"

Return:

IMPLICIT_RETURN_TYPE

Parameters:

base : LREAL
exponent : TYPE_ANY

pow_dep

REAL pow(DINT x, DINT y)

Returns x raised to the power of y (REAL)

INPUT:
base : DINT [1:1]
exponent : DINT [1:1]

RETURN TYPE:
REAL

Return:

REAL

Parameters:

base : DINT
exponent : DINT

sin

Returns the sine of x (measured in radians)

INPUT:
arg : LREAL [1:1]

RETURN TYPE:
Inherits type of input parameter "arg"

Return:

IMPLICIT_RETURN_TYPE

Parameters:

arg : LREAL

sin_dep

REAL sin(DINT x)

Returns the sine of x (measured in radians)

INPUT:
arg : DINT [1:1]

RETURN TYPE:
REAL

Return:

REAL

Parameters:

arg : DINT

sqrt

Returns the square root of x.

INPUT:
arg : LREAL [1:1]

RETURN TYPE:
Inherits type of input parameter "arg"

Return:

IMPLICIT_RETURN_TYPE

Parameters:

arg : LREAL

sqrt_dep

REAL sqrt(DINT x)

Returns the square root of x.

INPUT:
arg : DINT [1:1]

RETURN TYPE:
REAL

Return:

REAL

Parameters:

arg : DINT

tan

Returns the tangent of x (measured in radians)

INPUT:
arg : LREAL [1:1]

RETURN TYPE:
Inherits type of input parameter "arg"

Return:

IMPLICIT_RETURN_TYPE

Parameters:

arg : LREAL

tan_dep

REAL tan(DINT x)

Returns the tangent of x (measured in radians)

INPUT:
arg : DINT [1:1]

RETURN TYPE:
REAL

Return:

REAL

Parameters:

arg : DINT

trunc

Converts from type REAL or LREAL to an integer type. Only takes the value of the whole number part of the number. Therefore, the number is always rounded down.

INPUT:
in : LREAL [1:1]

RETURN TYPE:
DINT

Return:

DINT

Parameters:

in : LREAL

string."method"

strcat

The function strcat() concatenates two strings.

INPUT:
dest : STRING [1:1]
src : STRING [1:1]

RETURN TYPE:
VOID

Return:

VOID

Parameters:

dest : STRING
src : STRING

strcpy

The strcpy() function copies the source string to the destination string

INPUT:
dest : STRING [1:1]
src : STRING [1:1]

RETURN TYPE:
INT

Return:

INT

Parameters:

dest : STRING
src : STRING

strequals

The strcmp() function compares two strings and returns TRUE if both strings are identical.

INPUT:
str1 : STRING [1:1]
str2 : STRING [1:1]

RETURN TYPE:
BOOL

Return:

BOOL

Parameters:

str1 : STRING
str2 : STRING

strlen

The strlen() function calculates the length of a given string.

INPUT:
str : STRING [1:1]

RETURN TYPE:
UDINT

Return:

UDINT

Parameters:

str : STRING

strsplit

RETURN TYPE:
VOID

Return:

VOID

wstrassign

Assign a constant WString to a variable. Without the use of double quotes
e.g. wstVar = string.wstrassign('abcd')

INPUT:
str : STRING [1:1]

RETURN TYPE:
WSTRING

Return:

WSTRING

Parameters:

str : STRING

wstrcat

The function sstrcat() concatenates two wstrings.

INPUT:
dest : WSTRING [1:1]
src : WSTRING [1:1]

RETURN TYPE:
VOID

Return:

VOID

Parameters:

dest : WSTRING
src : WSTRING

wstrcpy

The wstrcpy() function copies the source wstring to the destination string

INPUT:
dest : WSTRING [1:1]
src : WSTRING [1:1]

RETURN TYPE:
INT

Return:

INT

Parameters:

dest : WSTRING
src : WSTRING

wstrequals

The wstrcmp() function compares two strings and returns TRUE if both wstrings are identical.

INPUT:
str1 : WSTRING [1:1]
str2 : WSTRING [1:1]

RETURN TYPE:
BOOL

Return:

BOOL

Parameters:

str1 : WSTRING
str2 : WSTRING

wstrlen

The wstrlen() function calculates the length of a given string.

INPUT:
str : WSTRING [1:1]

RETURN TYPE:
UDINT

Return:

UDINT

Parameters:

str : WSTRING