Sign in to follow this  
Followers 0
monkey

DIV and Math Register

4 posts in this topic

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
I am using a SLC 5/04 and RSLogix 500 Ver. 5.50.00

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0