Industries & Solutions


MicroLogix 1500 : Using the Real Time Clock (RTC) to get the difference between two Time Stamps

How to use ladder code to snap shot of the time frame and calculate the time difference of the Micrologix 1500 Real Time Clock?

Addressing:

Time #1 : Address N20:0

Time #2 : Address N20:1

Time Difference : Address N20:2

Accumulate Time Difference : Address: N20:3


Strategy:



Multiple the RTC:0.HR to convert to minutes and add the RTC:0.MIN.
The stored valued will be at the address N10:1

Move the stored value to the address to N20:1 (Timer #2)



If N20:0 less than Zero, Move the stored value to N20: 0; therefore no calculation is necessary.



When the new time is logged, the new time is stored and moved to N20:1(Timer #2)



When N20: is no longer -1, calculation is necessary.

If timer #2 is less than timer #1, a 1440 (24hr X 60min) is added to cater 24hr .

Subtract timer #2 with timer #1 and store in N20:2 and accumulate in the N20:3



DISCLAIMER
This web site is intended to provide general technical information on a particular subject or subjects and is not an exhaustive treatment of such subjects. Accordingly, the information in this web site is not intended to constitute application, design, software or other professional engineering advice or services. Before making any decision or taking any action, which might affect your equipment, you should consult a qualified professional advisor.

ROCKWELL AUTOMATION DOES NOT WARRANT THE COMPLETENESS, TIMELINESS OR ACCURACY OF ANY OF THE DATA CONTAINED IN THIS WEB SITE AND MAY MAKE CHANGES THERETO AT ANY TIME IN ITS SOLE DISCRETION WITHOUT NOTICE. FURTHER, ALL INFORMATION CONVEYED HEREBY IS PROVIDED TO USERS "AS IS." IN NO EVENT SHALL ROCKWELL BE LIABLE FOR ANY DAMAGES OF ANY KIND INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS PROFIT OR DAMAGE, EVEN IF ROCKWELL AUTOMATION HAVE BEEN ADVISED ON THE POSSIBILITY OF SUCH DAMAGES.

ROCKWELL AUTOMATION DISCLAIMS ALL WARRANTIES WHETHER EXPRESSED OR IMPLIED IN RESPECT OF THE INFORMATION (INCLUDING SOFTWARE) PROVIDED HEREBY, INCLUDING THE IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, AND NON-INFRINGEMENT. Note that certain jurisdictions do not countenance the exclusion of implied warranties; thus, this disclaimer may not apply to you.