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
lrParam2LREALmultiplier of \(x^{2}\) (corresponds to \(a\))
lrParam1LREALmultiplier of \(x\) (corresponds to \(b\))
lrParam0LREALmultiplier of \(1\) (corresponds to \(c\))
Output
byRootsBYTEnumber of roots (0, 1, 2 or 255 in case of infinite roots)
lrRoot0LREALfirst root
lrRoot1LREALsecond root