RSLogix 500 - Find Remainder when Dividing Integers

sbaum

Member
Join Date
Mar 2009
Location
Ontario
Posts
205
Working with a MicroLogix 1400 Ser B.
I have a Divide Instuction and need to know if the result is a whole number or has a remainder.
Currently the instruction just rounds the result.
I'm not so concerned if the result gets rounded but just need to know if there was a remainder at all.

Currently my values are Integers, but could use Floating Point if necessary.

This seems like it should be simple but I can't land on a method to do this with RSLogix500.
 
From the manual...

Use the DIV instruction to divide one value by another value (Source A/Source
B) and place the result in the Destination. If the Sources are single words and the
Destination is directly addressed to S:13 (math register), then the quotient is
stored in S:14 and the remainder is stored in S:13. If long words are used, then the
results are rounded

Floating point is a lot easier, IMHO.
 
Thanks guys.

I overlooked using S:13 as the Destination of the DIV instruction. Am too used to other platforms that just toggle a status bit.

Yes Mickey, this looks cumbersome for what I need to achieve. May convert to Float.
 
Take your floating point answer, subtract the whole number (integer) multiply back up by what you divided with.

ex. 6/5 = 1.2
1.2-1=.2
.2*5=1
 

Similar Topics

Hi Everyone, I am not proficient in RSLogix 500 so I have a question regarding the evaluation of N7:0 data as an input. So as I understand in...
Replies
1
Views
68
I have a little bit of experience with Allen-Bradley. I have a Micrologix 1500 (RSLogix 500) and a PanelView Plus 7 (FactoryTalk View Studio ME)...
Replies
3
Views
159
buen dia. tengo una falla al pasar los tags de mi plc SLC 5 0/4 a mi panel me aparece un error Problem writing value " " to item <tag name>...
Replies
1
Views
81
Will someone please convert this logic to pdf?
Replies
2
Views
127
Hello, Haven't been on in a while. I need to generate a bit level pdf of the I/O for RSLogix 500. I can generate a report but it just shows the...
Replies
1
Views
155
Back
Top Bottom