hour counter instruction (rslogix 500

I used a RTO with 3600 sec , but used a add 1 to display , but the only problem is I don't won't to reset and a add instrution. Value goes up to 37268? Any ideas
 
Dang I wish they'd give me 3.5 years...

That would be just about right.

Its been 1365 days since 4/27/09, or 32760 hours. Seven hours into the day and an N word is maxed out.

That is why an L address is recommended instead of an N address. An L address will out last the PLC at ~1/4 of a million years. 🍺
 
Last edited:
I was under the impression that the add instruction only goes up to 32768 +/- or is it the n address that only goes up to 32768
 
It has nothing to do with the math instruction.

N address are 16 bit integers. The range of numbers that you can represent using a 16 bit N word is -32,768 to +32,767.

To represent a larger number you need to use more bits.

L addresses are 32 bit integers. The range of numbers that you can represent using a 32 bit L word is -2,147,483,684 to +2,147,483,683
 
The range of numbers that you can represent using a 32 bit L word is -2,147,483,684 to +2,147,483,683

Small correction : 32-bit signed integer range is -2,147,483,648 to +2,147,483,647

It might make a difference to someone....

Interesting that the last digits are always 8 and 7 when the number of bits is wholly divisible by 8.

08 bits -128 to +127
16 bits -32,768 to +32,767
24 bits -8,388,608 to +8,388,607
32 bits -2,147,483,648 to +2,147,483,647
40 bits -549,755,813,888 to 549,755,813,887
etc.

I'm sure there must be a proof that this will always be the case, but it is beyond my maths capabilities to postulate one.
 
I was under the impression that the add instruction only goes up to 32768 +/- or is it the n address that only goes up to 32768

stu the ADD instruction on a 16-bit PLC (like SLC) works to (signed) 16-bit precision, on a 32-bit PLC (like Logix5000) it works to (signed) 32-bit precision.

You will get Overflow flag being set, if the add causes the result to exceed thw maximum positive value allowed, or if the destination data-type is "too small" to hold the result.
 
I plugged 231 into my calculator and looked at the right number and my lysdexia kicked in and I typed 84 instead of 48 o_O I double checked what I typed and saw 48, such is the nature of the human brain. Then I copied and pasted and subtracted 1, perpetuating the mistake. Thanks for catching that Daba.

cant_sleep.png
 
Last edited:

Similar Topics

HELLO i am working on a logic in which i have to record number of hours a DI bit is enabled and record it to vijeo citect 7.4. in simple words i...
Replies
3
Views
2,266
Hi, I am developing a HMI Screen using FTVIEW SE and collecting Data from GE PLC using Kepware. Now, I want to add a total hours Counter that...
Replies
2
Views
1,324
Hi! Even in the simple Siemens LOGO there was a hour counter, counting the time an, for example, input has been set. Where is this in S7-1200...
Replies
1
Views
2,762
Hey guys. I need an eksampel on how to make an minutes/hour counter in rslogix 500. I have 30 motors that runs on for 5min and 0ff for 1...
Replies
8
Views
2,851
Hello, I am trying to setup on plc so If I enter 60 jph (job per hour) it will send the vfd hertz based on what jph is entered by...
Replies
2
Views
151
Back
Top Bottom