plc5 division remainder

sorry it took so long to reply, some good comments.

I am using an enhanced plc5;

Ken, I agree with Ron thanks you are a real asset to this site (not to minimize anyone else):

The modulo function is what I was looking for; CLX has a MOD block it as well as Rsview uses the mod operation in expressions. I am using an enhanced PLC5. I looked in the instruction list and there wasn’t a function for it. I did find it when I searched MOD (“modulus”) under topics. I tried it in a CPT function as suggested and it worked fine, although it is not listed in the operations available for that function.

Todster,

I tried your formula, it is like one I had experimented with but the PLC5 rounds an integer word up when the result of a division is greater than .5. example: 16 / 10 = 2, where 13 / 10 would = 1. My intent was to strip off the last digit of a number. Example: If the number was 1234 I want to get the 4. The problem with the way the plc solves the integer part of the calc will result in a correct answer for 1234 but a – 4 for 1236. At least that is how it came out when I programmed it. The Mod instruction works for my app but any suggestions (anyone) on how to make the formula work without major lim tests (just curious)? simialr to Alaric's comment
 

Similar Topics

I am using the following formula and I am getting error, Invalid Expression - too many closing parenthesis. when i copy the formula to notepad or...
Replies
4
Views
159
Preface: Kinda long, so I made section titles Intro: I just want to see if anyone here has seen anything similar. A PLC5-40 series C enhanced...
Replies
3
Views
378
Hi, can anyone help me get a pdf file for this RSP files. They are from a PLC5. Thanks
Replies
5
Views
532
Hello all, I am seeing this behaviour where an integer file (N46:33), has an integer in binary (11110) which is 30 in decimal. I did a...
Replies
7
Views
524
Back
Top Bottom