Calculate/Find RedLion System OFF Time

whussain6

Member
Join Date
Oct 2013
Location
Newcastle
Posts
108
Dears,

I have Productivity station which is running specific code every midnight. Now if for example system is off for couple of days it will mess up the code.

So I want to find out the time it has stayed OFF (only the days, time may not matter) Then I will find out the number of days it has stayed off and will execute the code same number of times.

An idea comes in mind is that if we get the date just before turning off and then get date when it turns on and find the difference? not sure how it will work?
 
Create numeric Tag "LastDay", Set it as "Retentive"
Numeric Tag "NowDays" that define source as general : GetDays()
Numeric Tag "DaysOff" thst define source as general : NowDays - LastDay

Then at every midnight you run the script : LastDay = GetDays();

Assume if system is off across 1 midnight, After system is on "DaysOff" value will be 1.
and so on.


I didn't test this method but I hope it could help you.
 

Similar Topics

Hi everyone, This is my first time posting, so please forgive any omissions or mistakes. I am attempting to control the velocity of a stepper...
Replies
18
Views
916
Good morning, I have a question. I don't know much about ST yet I would like to calculate the average number of products per hour. how do I do...
Replies
22
Views
2,930
Can someone help me with this? I'm no good at SCL - virtually everything I've done so far has been ladder logic. The return value from the...
Replies
13
Views
1,093
I want to calculate the energy consumed from instantaneous power. Can this be done using the TOT block with timebase set to Hour?
Replies
2
Views
675
Hi everyone, I have to calculate the length in millimeters of a glass that enters a transport (I don't know the speed yet) through a barrier...
Replies
15
Views
3,452
Back
Top Bottom