Math - Advanced for IEC

See also: IEC 61131 Language Editor Programming

See also: Project Toolbox for IEC

 

Topic Menu

 

Power of X

Also called: EXPT

Operator – This function raises IN to the EXPth power and places the result in Q.

 

Inputs

IN: Number which needs to be raised to EXP’th Power (TYPE : REALClosed These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types.)

EXP: Number used for increasing the Input IN to this power (TYPE : REAL)

 

Outputs

Q : The result of IN raised to the power of EXP. (TYPE : REAL)

Q = IN^^EXP

 

ST Language

Q = EXPT (IN, EXP)

 

FBD Language

 

LD Language

 

IL Language

Return to the Top: Math - Advanced for IEC

 

Power of e

Also called: EXT

Operator – This function determines the value of e (the base of natural logarithms) raised to the INth power and places the result in Q.

 

Inputs

IN: Number used for finding the natural log. (TYPE : REALClosed These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types.)

 

Outputs

Q : The result of e raised to the power of IN. (TYPE : REAL)

Q = EXT(IN)

 

ST Language

Q = EXT (IN) ;

 

FBD Language

 

LD Language

 

IL Language

Return to the Top: Math - Advanced for IEC

 

Base 10 Logarithm

LOG10

Function – Calculates the logarithm (base 10) of the input.

 

Inputs

IN: Input to determine LOG to base 10. ( TYPE : REALClosed These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types.)

 

Outputs

Q : Outputs LOG to base 10 for the Input at IN. (TYPE: REAL)

 

ST Language

Q := LOG10 (IN) ;

 

FBD Language

 

LD Language

(* The function is executed only if EN is TRUE *)

(* ENO keeps the same value as EN *)

 

IL Language

Return to the Top: Math - Advanced for IEC

 

Natural Logarithm

Also called: LOG

Function - Calculates the logarithm (base e) of the input.

 

Inputs

IN : REALClosed These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types. Real value

 

Outputs

Q : REAL Result: logarithm (base e) of IN

Remarks - In LD language, the operation is executed only if the input rung (EN) is TRUE. The output rung (ENO) keeps the same value as the input rung. In IL, the input must be loaded in the current result before calling the function.

 

ST Language

Q : = LOG (IN) ;

 

FBD Language

 

LD Language

(* The function is executed only if EN is TRUE *)

(* ENO keeps the same value as EN *)

 

IL Language

Return to the Top: Math - Advanced for IEC

 

Sine

Also called: SIN / SINL

Function - Calculate a sine.

 

Inputs

IN : REAL/LREALClosed These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types. Real value

 

Outputs

Q : REAL/LREAL Result: sine of IN

Remarks - In LD language, the operation is executed only if the input rung (EN) is TRUE. The output rung (ENO) keeps the same value as the input rung. In IL, the input must be loaded in the current result before calling the function.

 

ST Language

Q := SIN (IN) ;

 

FBD Language

 

LD Language

(* The function is executed only if EN is TRUE *)

(* ENO keeps the same value as EN *)

 

IL Language

Return to the Top: Math - Advanced for IEC

 

Cosine

Also called: COS

Function - Calculate a cosine.

 

Inputs

IN : REAL/LREALClosed These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types. Real value

 

Outputs

Q : REAL/LREAL Result: cosine of IN

Remarks - In LD language, the operation is executed only if the input rung (EN) is TRUE. The output rung (ENO) keeps the same value as the input rung. In IL, the input must be loaded in the current result before calling the function.

 

ST Language

Q := COS (IN) ;

 

FBD Language

 

LD Language

(* The function is executed only if EN is TRUE *)

(* ENO keeps the same value as EN *)

 

IL Language

Return to the Top: Math - Advanced for IEC

 

Tangent

Also called: TAN

Function - Calculate a tangent.

 

Inputs

IN : REALClosed These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types. Real value

 

Outputs

Q : REAL Result: tangent of IN

Remarks - In LD language, the operation is executed only if the input rung (EN) is TRUE. The output rung (ENO) keeps the same value as the input rung. In IL, the input must be loaded in the current result before calling the function.

 

ST Language

Q := TAN (IN) ;

 

FBD Language

 

LD Language

(* The function is executed only if EN is TRUE *)

(* ENO keeps the same value as EN *)

 

IL Language

Return to the Top: Math - Advanced for IEC

 

Inverse Sine

Also called: ASIN

Function - Calculate an arc-sine.

 

Inputs

IN : REAL/LREALClosed These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types. Real value

 

Outputs

Q : REAL/LREAL Result: arc-sine of IN

Remarks - In LD language, the operation is executed only if the EN is TRUE. The ENO keeps the same value as the EN. In IL, the input must be loaded in the current result before calling the function.

 

ST Language

Q := ASIN (IN) ;

 

FBD Language

 

LD Language

(* The function is executed only if EN is TRUE *)

(* ENO keeps the same value as EN *)

 

IL Language

Return to the Top: Math - Advanced for IEC

 

Inverse Cosine

Also called: ACOS

Function - Calculate an arc-cosine.

 

Inputs

IN : REAL Real value

 

Outputs

Q : REAL Result: arc-cosine of IN

Remarks - In LD language, the operation is executed only if the EN is TRUE. The ENO keeps the same value as the EN. In IL, the input must be loaded in the current result before calling the function.

 

ST Language

Q := ACOS (IN) ;

 

FBD Language

 

LD Language

(* The function is executed only if EN is TRUE *)

(* ENO keeps the same value as EN *)

 

IL Language

Return to the Top: Math - Advanced for IEC

 

Inverse Tangent

Also called: ATAN

Function - Calculate an arc-tangent.

 

Inputs

IN : REALClosed These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types. value

 

Outputs

Q : REAL Result: arc-tangent of IN

Remarks - In LD language, the operation is executed only if the EN signal is TRUE. The ENO keeps the same value as the EN. In IL, the input must be loaded in the current result before calling the function.

 

ST Language

Q := ATAN (IN) ;

 

FBD Language

 

LD Language

(* The function is executed only if EN is TRUE *)

(* ENO keeps the same value as EN *)

 

IL Language

Return to the Top: Math - Advanced for IEC

 

Convert to Radians

Also called: DegToRad

Operator – Converts Degrees to Radians.

 

Inputs

IN: Input in Degrees. ( TYPE : REALClosed These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types.)

 

Outputs

Q : Converted input to Radians. ( TYPE : REAL)

 

ST Language

Q := DegToRad (IN) ;

 

FBD Language

 

LD Language

 

IL Language

Return to the Top: Math - Advanced for IEC

 

Radians to Degrees

Also called: RadToDeg

Operator – Converts Radians to Degrees.

 

Inputs

IN: Input in Radians.( TYPE : REALClosed These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types.)

 

Outputs

Q : Converted input to Degrees. ( TYPE : REAL)

 

ST Language

Q := RadToDeg (IN) ;

 

 

FBD Language

 

LD Language

 

IL Language

Return to the Top: Math - Advanced for IEC