monkey
Dec 22 2004, 09:09 AM
I am using the DIV to divide a large number (2627948) by 1000. The DIV instruction automatically rounds the answer which is placed in the destination. The online help file for the instruction says that the unrounded quotient will be placed in the math register MSW (S:14). This works sometimes but mostly does not. (the math register remains unchanged) Does anyone know what would make this not work? I am trying to separate the number into 2 integer files for use with the stepper card (1 integer would be 2627 and the other would be 948).
P.S. I do have the Math Overflow Selected bit (S:2/14) set true.
mgvol
Dec 22 2004, 10:31 AM
Which platform are you using (PLC-5 or SLC)? Which processor and what ver of RSLogix? I just replicated your problem in a 5/04 using RSLogix 500 V6.20.00 and got the same result you did.
monkey
Dec 22 2004, 10:41 AM
I am using a SLC 5/04 and RSLogix 500 Ver. 5.50.00
mgvol
Dec 22 2004, 11:08 AM
O.K., according to the SLC 500 instruction set reference manual (pub. 1747-RM001C-EN-P of 9/2001):
For floating-point operation, the math register does not change. I assum you are using a floating-point register for Source A, since the number is too large for a constant or integer file.
I changed my DIV instruction per the example listed in the manual(Source A N7:0 = 11/Source B 2/Destination N7:2).
When I trigger the DIV, the math register functions as described in the manua and the online help. But you need to change the radix of the status Math tab to decimal from structured for the numbers to make sense.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.