SysIntegrator
Member
Hello,
I've got a tricky math problem. I have a double integer that I need to divide by 10,000, and separate it into quotient and remainder. I have successfully done this with a regular integer by setting the destination as the Math Word S:13, then S:14 gives me my remainder, but if you use a float value or a Long integer in the DIV function you will only get get a rounded value in S:13.
I can think of a few ways to do this, but most involve some really cumbersome math. Anybody have a solution that's clean and simple?
If you're wondering what its for, I have a commanded position value in counts for a drive motor (Long integer) that needs to be converted to revolutions and counts so I can write it to a drive.
And as usual, help is always appreciated!
I've got a tricky math problem. I have a double integer that I need to divide by 10,000, and separate it into quotient and remainder. I have successfully done this with a regular integer by setting the destination as the Math Word S:13, then S:14 gives me my remainder, but if you use a float value or a Long integer in the DIV function you will only get get a rounded value in S:13.
I can think of a few ways to do this, but most involve some really cumbersome math. Anybody have a solution that's clean and simple?
If you're wondering what its for, I have a commanded position value in counts for a drive motor (Long integer) that needs to be converted to revolutions and counts so I can write it to a drive.
And as usual, help is always appreciated!