L D[AR2P#0.0]
Lifetime Supporting Member
..... sorry to report that your function fails big time. As you have converted it to use integer arithmetic, the processing involves dividing the input by 27648, which for all values other than 27648 produces zero. This function thus produces the LO_LIMIT for IN=0...27647, and the the HI_LIMIT for IN=27648
You should retain the floating point arithmetic and convert the integer parameters to reals at the start of the block, and convert the real output to an integer.
(NB this is a function (FC), function blocks (FB) are another story)
You should retain the floating point arithmetic and convert the integer parameters to reals at the start of the block, and convert the real output to an integer.
Code:
L iInteger
ITD
DTR
T rRealValue
Code:
L rValue
RND
T iValue
(NB this is a function (FC), function blocks (FB) are another story)