FNXY – Evaluation of two-variables function

Block SymbolLicensing group: STANDARD
PIC

Function Description
The FNXY block evaluates basic math functions of two variables. The table below shows the list of supported functions with corresponding constraints. The ifn parameter determines the active function.
List of functions:




ifn: shortcut function constraints on u1, u2



1: atan2 arctangent u1u2
2: fmod remainder after division u1u2 u20.0
3: pow exponentiation of the inputs y = u1u2



The atan2 function result belongs to the interval π,π. The signs of both inputs u1 a u2 are used to determine the appropriate quadrant.

The fmod function computes the remainder after division u1u2 such that u1 = i u2 + y, where i is an integer, the signs of the y output and the u1 input are the same and the following holds for the absolute value of the y output: |y| < |u2|.

The error output is activated (E = on) in the case when the input value u2 does not meet the constraints or an error occurs during evaluation of the selected function (implementation dependent), e.g. division by zero. The output is set to substitute value in such case (y = yerr).

Inputs

u1

First analog input of the block

Double (F64)

u2

Second analog input of the block

Double (F64)

Outputs

y

Result of the selected function

Double (F64)

E

Error flag

Bool

off ..

No error

on ...

An error occurred

Parameters

ifn

Function type (see the table above)  1

Long (I32)

1 ....

atan2

2 ....

fmod

3 ....

pow

yerr

Substitute value for an error case

Double (F64)

2022 © REX Controls s.r.o., www.rexygen.com