In the end I want to use the raw encoder feedback from a PF700 (param 414, DInt format) into the PMUL block. Right now I was just testing to make sure it would work how we thought.
From what I gather from the documentation on the block, the scan to scan change in relative mode cannot exceed half the word size of the input data. OK, so for a quick test I decided to rollover from 32767 to -32768. Every scan I added 258 (number picked from thin air) to my fake encoder input. When the word size is 9 or less, then the direction goes negative because as the documentation states, the scan to scan change is 258>256.
My real question is how does the block get the rollover correct? Change from 32767 to -32768 is very much greater than 256?? Yet the block gives the correct count change out per scan. Tried same test rolling over at 65535 as well, same results.
I believe right now I could put in this code and as long as I calculated out the scan to scan change of the encoder feedback at the desired line speed (via the mechanical gear in) and made sure my word size was set correctly for the count change due to run time speed, everything would be fine. I am just really curious as to how the rollover part seems to work?
From what I gather from the documentation on the block, the scan to scan change in relative mode cannot exceed half the word size of the input data. OK, so for a quick test I decided to rollover from 32767 to -32768. Every scan I added 258 (number picked from thin air) to my fake encoder input. When the word size is 9 or less, then the direction goes negative because as the documentation states, the scan to scan change is 258>256.
My real question is how does the block get the rollover correct? Change from 32767 to -32768 is very much greater than 256?? Yet the block gives the correct count change out per scan. Tried same test rolling over at 65535 as well, same results.
I believe right now I could put in this code and as long as I calculated out the scan to scan change of the encoder feedback at the desired line speed (via the mechanical gear in) and made sure my word size was set correctly for the count change due to run time speed, everything would be fine. I am just really curious as to how the rollover part seems to work?