Logix5000 Tag Data Help

bullman1083

Member
Join Date
Jan 2017
Location
tn
Posts
14
I currently have a REAL type data tag 'Roll_Yards' that gives me the yardage count of a roll of fabric. Each time the operator loads a new roll they press a reset button and reset it to 0. I would like to keep a running total of the yardage for and entire shift but cant seem to wrap my head around how to hold the values and add them up over a certain period of time. Any help would be appreciated. Thanks.
 
Have you considered using another REAL type tag "Roll_Yards_Day" that works like your Roll_Yards tag but doesn't clear when you press the reset button?

Are you adding to Roll_Yards on a per scan, per minute or some other basis?

How many yards are you expecting to run in a day?

If you add a very small REAL to a very large REAL, things tend to get messed up (hence the questions). There are ways around it though.
 
Easy. Give yourself three tags:
Roll_Yards (existing tag, yards since last reset)
Prev_Roll_Yards (total yards on previously run rolls)
Total_Yards (total yards this shift)


At all times, you add Prev_Roll_Yards to Roll_Yards and store the result in Total_Yards.

Your reset button performs two tasks:

ADD Prev_Roll_Yards Roll_Yards Prev_Roll_Yards
CLR Roll_Yards

Then at the end of your shift you zero out all three tags. If you wanted, you could move the Total_Yards to a Total_Yards_LastShift tag first.

Also, if you wanted, you could switch to metric units like the rest of the world and count in metres instead :D

One tip (as alluded to by RonJohn) - REAL values are not ideal for totaliser functions. Floating point math is always an approximation, and the bigger your numbers get, the less accurate that approximation is. I just recently set up a weight totaliser that receives kg to one decimal place for each batch. I multiply it by 10 and store it in a DINT, so if my batch weight was 123.4kg, I add 1234 to my DINT. Then on any HMI/SCADA that display the value, I scale it by a factor of 10 before displaying. This way I can count up to around 214 million kg and the value remains 100% accurate. Might be worth investigating a similar thing in your application, depending on accuracy requirements and how large the numbers you're getting are
 

Similar Topics

Hi, I am looking for a user manual or instructions on how to setup the Tag Data Monitor tool on RSLogix5000
Replies
0
Views
2,141
I'm currently working on an MES interface PLC which passes around a whole bunch of strings. A lot of these strings are really just to allow for an...
Replies
0
Views
1,099
I am having a problem understanding how to assign tags for a simple stop - start push buttons. The Logix 5000 routine to stop and start the pump...
Replies
17
Views
4,874
Hi all, I've been using Logix5000 for a while, first version 24 and recently version 32 as I had to update for working on the newer CPU modules...
Replies
2
Views
2,233
Hello, I am tasked to update a CompactLogix PLC program on a live system. The updates I need to make involve changing a user-defined data...
Replies
9
Views
2,033
Back
Top Bottom