How do I save previous day counter value?

dylantzips

Member
Join Date
Jun 2018
Location
Ohio
Posts
27
Beginner here,

I need to count the number of rotations a turn table does per shift. When the shift is over I want to save the total number of rotations during the shift and transfer that number to a "Previous Shift Rotations" for use on the HMI. After that I want to reset the current counter so it is ready for the next day.

This screenshot of what I have so far might make some more sense:
http://prntscr.com/jto90u

Im not sure if my current setup would reset the previous day count to zero as soon as the reset is triggered.

If someone could tell me what to do it would be very appreciated. Thanks!
 
I will do it like this
hvs4nb.png
[/IMG]
 
Last edited:
you need to one shot your move and reset. Otherwise your next scan will write the reset value to the previous.
 
Yes that should work.

I would also make my one shot a DINT or DINT array. That way you do not have to create a new BOOL every time you need a one shot. If you make OneShot_Bit a DINT then you have 32 made. OneShot_Bit.0 thru OneShot_Bit.31 then you can just pick them as needed.
 
Yes that should work.

I would also make my one shot a DINT or DINT array. That way you do not have to create a new BOOL every time you need a one shot. If you make OneShot_Bit a DINT then you have 32 made. OneShot_Bit.0 thru OneShot_Bit.31 then you can just pick them as needed.

Especially since a single BOOL address like that uses the same amount of memory as a DINT anyway...
 
The first question to ask is are you turning the power off ant the end of the day or at an time.
If the power is cycled most plc's don't retain data and reload the default data on power up

On some PLC's you can install an EEPROM module to store the values with power off.
 
The first question to ask is are you turning the power off ant the end of the day or at an time.
If the power is cycled most plc's don't retain data and reload the default data on power up

On some PLC's you can install an EEPROM module to store the values with power off.


Exactly correct... You will need logic to determine that the shift has changed while power was off, the do your number recording as above before resetting the counters.


Easiest way is to look at the WallClock (Use GSV) and use LIM instructions on the hour to see what shift you are in.



Then you have to consider what happens when daylight savings time is implemented, do the people's shift start and end times get altered, or do they suffer a "short-shift" and a long-shift" when the hour changes.


While thinking about that, remember that the Logix5000 Wall Clock object does not automatically switch in and out Daylight Savings, you have to write code to do it if you want it to.


And, for reference, Counter values are retained in Logix5000 through a power-cycle, or mode-change, assuming there is enough power in the battery, if there is one, or the "storage module" in later series.
 
Incidentally, you can very easily record your counts for every day of the year, with a 3-shift pattern, using a 3-dimensional array ShiftData AS DINT[31,12,3] : Day_Number (1-31), Month (1-12), Shift(1-3) : all encapsulated in one tag...


17th January, Shift 2 data would be in



ShiftData[Day-1,Month-1,Shift-1] = ShiftData[16,0,1] : all very easy to manipulate. Your HMI could display the counts for any day, any shift, using the indirect references above.
 

Similar Topics

Hi; First of all, I am sorry that my post is not relevant with this forum. I have recently purchased Samsung cell phone. I have alreay saved...
Replies
1
Views
73
Hello! I have a datablock in a PLC witch contains about 700 variables. I must save this data once a day on a Windows PC in a XML or CSV file. Eg...
Replies
1
Views
471
Hello Folks! I have an issue and its very often but in this case i applied all the tricks and tips that i always do in similiar issues but in this...
Replies
2
Views
773
I'm a bit stuck again... See the redacted picture. At the moment, pressing F7 saves the "live" laser measurement into the boxes indicated by the...
Replies
9
Views
1,070
On my HMI-1200, I'm trying to assign the image of a floppy disk ("save" icon) to a function key. I couldn't find one in the default drop-down...
Replies
5
Views
577
Back
Top Bottom