kolyur
Lifetime Supporting Member + Moderator
From RSLogix 500 online help for the DIV instruction:
(My goal here was to divide two numbers and get the unrounded quotient.)
I have found this not to be the case, on both a ML1500 and 1200. If I divide two numbers and put the result in an integer register, the math register is not changed (remains zero). The only way I can affect the math register is to set the destination of the DIV to the register itself, in which case both the high and low words will then be set as they should. So it does work but not as documented. Is this a bug or am I doing something wrong?When rung conditions are true, this output instruction divides Source A by Source B and stores the result in the destination and the math register. The value stored in the destination is rounded. The value stored in the math register consists of the unrounded quotient (placed in the most significant word) and the remainder (placed in the least significant word).
(My goal here was to divide two numbers and get the unrounded quotient.)