Clearing Register for Daily Data Logger

mromanzo

Member
Join Date
Nov 2019
Location
Utica
Posts
3
Hey guys,

I'm still pretty new to PLC's in general. For a program on RSLogix 500 with a micro1400 and pvp400, we are currently logging data for parts produced daily using integers and counters. Every day at 7am, the counter resets and logs a new file to start the next CSV file. Say we have 10,000 parts on the counter Saturday, shut off the machine. Turn it back on Monday, the register is still set at 10,000 and adds to Monday until it resets Tuesday.

Is there a way to have that register clear if the date changes?
 
Welcome to the club

Do they cycle the power on Monday? if yes you could use a CLR instruction with a first scan bit... but a word of caution if someone cycles power any other time it will also clear the register, you could also have a clear data button on the HMI? then the operator could clear it?
 
They turn the power on either Sunday evening or early Monday morning. I've discussed with the controls engineer that I work with how we could figure a way around the CLR instruction and we're both a little shy to use it. Mostly because the operators may cycle power on the machine during the week for any glitches they encounter or if something faults out & we're unavailable. Not sure if that would be an option but I could bring it up again.
 
I agree with the_msp, the 1400's have a real time clock built in to them so you just need to pick a time and day that would be best for you and use the CLR instruction to run at that time
 
You could also store the current value before you reset. That way if for some reason you did a reset by mistake, you would have the old value saved.


Sounds like you have something programmed already for 7am, but sometimes the machine is down until after 7am, so you miss the trigger.
You could set up logic to reset on first scan IF it is after 7am, that might be the ticket.
 
Last edited:
Since you are turning power off of the machine (PLC), you will have to copy the real time clock and then do a compare to see if the reset is required.
Altunatively, you could keep power on the PLC so that the reset would always happen.
Just a thought.
Regards,
 
We currently have logic written to reset at 7am everyday. The operators will shut them off on Saturdays or Friday's at random. What I might end up doing is going with Ken's suggestion. Having it scan to check the time & go from there. Still open for suggestions.

Thank you all.
 
In that scenario it is still possible that the machine got a reset at 7 am, then is for some reason shut off and reset at a later time same day. In that case you would not want another reset, right? If so, to make it yet a bit more robust, you can store a date/time stamp every time you reset. Use that to see if today has already had a reset. The two conditions to reset are then the default reset at 7 am, or the reset at startup. Both to be done only if the previous reset was not today.


As a side node: when using the RTC for logic like this, please keep in mind that it should keep the time. Any RTC will slowly drift away from the exact time. Also if a system is shut off for a longer time (e.g. some kind of seasonal shutdown) PLC's will reset the clock when an internal battery runs flat. You can either have the PLC synchronize its' RTC automatically against a time server or have an option in the HMI for the operator to adjust the clock.
 
Agree. Store the date of the last reset. If the reset occurred the same day, do not clear. That can also help with the possibility that the system was powered down at the time it should have reset.

You could even create a new data file and move that value into the next location in the file before it gets cleared. I usually use a FFL for this. This will give you a log of the values that have been reset. Just in case.

N38:0 Monday's value
N38:1 Tuesday's value
etc...

But of course that starts to get a bit more complex.

OG
 

Similar Topics

I'm online with a 90-30 using PAC ME 9.8 No one has gotten online with this PLC for many years and the the I/O fault table has a total of 1209...
Replies
6
Views
2,993
Using an L81 - I have the arrangement below that will try the Ethernet Radio first and if that fails use the Cellular Radio. The Failover works...
Replies
16
Views
3,367
Since this is the most helpful place on earth for us programmers, I'm back with another one. Using Logix v32 I've got an array with 100 elements...
Replies
9
Views
2,970
I am currently working in RSLogix 5000. I have a large data structure with the following general structure: UDT[0] Dataset1 Min Max Avg Data[90]...
Replies
14
Views
4,364
Say i have an Array[100] and i want to clear words [5]-[60] for example. How can i do that in the PLC without putting in a bunch of CLR commands...
Replies
5
Views
1,569
Back
Top Bottom