fmod (FUN) ¶ FUNCTION fmod : LREAL This function will return the modulo of the integral division \(\frac{x}{m}\) : \[x\ \mathrm{mod}\ m = x - \left \lfloor \frac{x}{m} \right \rfloor \cdot m\] Note The invalid input \(m=0\) will result in the return 0. InOut: Scope Name Type Comment Return fmod LREAL Input lrX LREAL Dividend \(x\) lrM LREAL Divisor \(m\)
analog monitors ¶ Hysteresis_DINT (FunctionBlock) Hysteresis_LREAL (FunctionBlock) LimitAlarm_DINT (FunctionBlock) LimitAlarm_LREAL (FunctionBlock) sgn (Function)
Hysteresis_DINT (FB) ¶ FUNCTION_BLOCK Hysteresis_DINT This function block will set the output variable to TRUE , if the integral value \(x \in \mathbb{Z}\) is smaller than an integral lower bound \(x_{u} \in \mathbb{Z}\) It will set the Boolean output variable to FALSE , if the input value \(x\) exceeds the integral upper bound \(x_{o} \in \mathbb{Z}\) . If \(x\) lies between the lower and upper bound, the value of the output will rest unchanged by the module. InOut: Scope Name Type Comment Input diValue DINT input value \(x \in \mathbb{Z}\) diLimitPos DINT upper bound \(x_{o} \in \mathbb{Z}\) diLimitNeg DINT lower bound \(x_{u} \in \mathbb{Z}\) Output xOut BOOL FALSE : If \(x > x_{o} \land x_{u} < x_{o}\) TRUE : If \(x < x_{u} \land x_{u} < x_{o}\) “ xOut ” else
Hysteresis_LREAL (FB) ¶ FUNCTION_BLOCK Hysteresis_LREAL This function block will set the output variable to TRUE , if the input value \(x \in \mathbb{R}\) is smaller than a lower bound \(x_{u} \in \mathbb{R}\) . It will set the output variable to FALSE , if the input value \(x\) exceeds the upper bound \(x_{o} \in \mathbb{R}\) . If \(x\) lies between the lower and the upper bound, the value of the output variable will rest unchanged by the module. InOut: Scope Name Type Comment Input lrValue LREAL input value \(x \in \mathbb{R}\) lrLimitPos LREAL upper bound \(x_{o} \in \mathbb{R}\) lrLimitNeg LREAL lower bound \(x_{u} \in \mathbb{R}\) Output xOut BOOL FALSE : If \(x > x_{o} \land x_{u} < x_{o}\) TRUE : If \(x < x_{u} \land x_{u} < x_{o}\) “ xOut ” else
LimitAlarm_DINT (FB) ¶ FUNCTION_BLOCK LimitAlarm_DINT This function block checks whether an integral value \(x \in \mathbb{Z}\) lies between an integral lower bound \(x_{u} \in \mathbb{Z}\) and an integral upper bound \(x_{o} \in \mathbb{Z}\) . The output value will be set according to the result. InOut: Scope Name Type Comment Input diValue DINT value \(x \in \mathbb{Z}\) to be tested diLimitPos DINT upper bound \(x_{o} \in \mathbb{Z}\) diLimitNeg DINT lower bound \(x_{u} \in \mathbb{Z}\) Output xExceedsPos BOOL TRUE : If \(x > x_{o}\) FALSE : Else xExceedsNeg BOOL TRUE : If \(x < x_{u}\) FALSE : Else xInLimits BOOL TRUE : If \(x_{u} \leq x \leq x_{u}\) FALSE : Else, also in the atypical case \(x_{o} < x_{u}\)
LimitAlarm_LREAL (FB) ¶ FUNCTION_BLOCK LimitAlarm_LREAL This function block checks whether the value \(x \in \mathbb{R}\) lies between an lower bound \(x_{u} \in \mathbb{R}\) and an upper bound \(x_{o} \in \mathbb{R}\) . The output value will be set according to the result. InOut: Scope Name Type Comment Input lrValue LREAL value \(x \in \mathbb{R}\) to be tested lrLimitPos LREAL upper bound \(x_{o} \in \mathbb{R}\) lrLimitNeg LREAL lower bound \(x_{u} \in \mathbb{R}\) Output xExceedsPos BOOL TRUE : If \(x > x_{o}\) FALSE : Else xExceedsNeg BOOL TRUE : If \(x < x_{u}\) FALSE : Else xInLimits BOOL TRUE : If \(x_{u} \leq x \leq x_{u}\) FALSE : Else, also in the atypical case \(x_{o} < x_{u}\)
sgn (FUN) ¶ FUNCTION sgn : INT This function will return the result of the signum function applied to input value \(x\) : \[\begin{split}\text{sgn}(x) = \begin{cases} -1 &\mbox{if } x < 0 \\0 &\mbox{if } x = 0 \\1 &\mbox{if } x > 0 \end{cases}\end{split}\] InOut: Scope Name Type Comment Return sgn INT Input lr LREAL input value \(x\)
analytical functions ¶ CalcRootLin (FunctionBlock) CalcRootParable (FunctionBlock) Derivative (FunctionBlock) Integral (FunctionBlock) PolynomialValue (Function)
CalcRootLin (FB) ¶ FUNCTION_BLOCK CalcRootLin By use of this function block the root of a linear function \(y = a \cdot x + b\) with \(a\mbox{, }b\mbox{, }x \in \mathbb{R}\) , if there is one, will be calculated. InOut: Scope Name Type Comment Input lrParam1 LREAL gradient of straight line (corresponds to \(a\) ) lrParam0 LREAL height at which line cuts the vertical y-axis (corresponds to \(b\) ) Output byRoots BYTE number of roots 0: If line is parallel, but not identical to horizontal x-axis | 255: If line is identical to x-axis 1: Else lrRoot LREAL root
CalcRootParable (FB) ¶ FUNCTION_BLOCK CalcRootParable By use of this function block the root of a linear function \(y = a \cdot x^{2} + b \cdot x + c\) with \(a\mbox{, }b\mbox{, }c\mbox{, }x \in \mathbb{R}\) , if there are some, are calculated. InOut: Scope Name Type Comment Input lrParam2 LREAL multiplier of \(x^{2}\) (corresponds to \(a\) ) lrParam1 LREAL multiplier of \(x\) (corresponds to \(b\) ) lrParam0 LREAL multiplier of \(1\) (corresponds to \(c\) ) Output byRoots BYTE number of roots (0, 1, 2 or 255 in case of infinite roots) lrRoot0 LREAL first root lrRoot1 LREAL second root