07-16-2020 12:11 PM - edited 07-16-2020 12:12 PM
@altenbach wrote:(I am pretty sure there is a loop-free solution ;))
That is what I was looking for, a loop-free way of doing it.
Sebastian, thanks. Your solution works nicely. Kudos 😁
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
07-16-2020 12:41 PM - edited 07-16-2020 12:48 PM
Here's Sebastian's code slightly simplified... (Please validate!)
(Note that I swapped the comparison so an exact translation would use "less or equal". Not sure what's correct. If the remainder is exactly 180, both directions are equally close).
07-16-2020 01:03 PM
@altenbach wrote:
Here's Sebastian's code slightly simplified... (Please validate!)
(Note that I swapped the comparison so an exact translation would use "less or equal". Not sure what's correct. If the remainder is exactly 180, both directions are equally close).
Looks like that does work, thanks altenbach!
If anyone is wondering what I'm doing, I'm building a routine for operators to perform an encoder verification test on a unit (the unit is a slip ring that has a built-in encoder). And I needed this as part of the algorithm telling the SmartMotor (another thing we make at a different facility) where to travel to next.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.