Hi,
Still not quite there....
Below is the code with the If pid_Out.15 Then pid_Out = 0 included.
Code:
pid_Out = ABS pid_Out 'Convert from two's comp. to absolute
If pid_Out.15 Then pid_Out = 0
No, this completely defeats the purpose. You can't first say ABS and THEN check if it's negative - it'll NEVER be negative AFTER you've converted it to ABSsoulte. Simply remove the pid_Out = ABS pid_Out all together.
And you're still trying to squeeze the result of a LONG-LONG subtraction into a WORD sized variable and I'm not sure if or how that is going to work.
Bookmarks