0
Answered

JPOUT rounding versus MAC rounding

Rick 3 years ago in IQANdesign updated by Ulrik Zakariasson (Software development) 2 years ago 1

How does a JPOUT block exactly round its value? And did something change there recently (since IQAN 5.0 or 5.01)?


We didn't see this problem before on other (slightly older) machines, but recently we ran into CRC Checksum computation problems. And my guess is that the QCode that does the computation (can't use the IQAN CRC blocks unfortunately) produces a slight different number in a few rare cases.


(see pic) So, both the JPOUT & MAC block that will compute the checksum, are connected to another MAC "LeverPosition [%]" block, which is a Float. So the position could be 49,49999. Multiply that by 500, you get 24749,95. I assume JPOUT will round this UP to 24750, like the QCode does.


Yet, sometimes (every few minutes, but that is relative rare for a joystick position that is sent rapidly and changing constantly!) the receiving transmission unit complains about a bad checksum. The strange part is that this didn't happen before on multiple (IQAN 4.7 / 5.0) machines.



Eventually we "fixed" it by simply rounding the LeverPosition at forehand. The error was gone, yet I wonder why this happens...



Answered

Sorry for late reply. There should not be any changes affecting this in 5.00 or 5.01. Also, the same rounding is used both for MAC and JPOUT. Hard to say what caused your problem but I'm glad you found a workaround!