Professional Documents
Culture Documents
Time Stamps For Alarms and Events
Time Stamps For Alarms and Events
Application Note
#40041
5-22-2007
1 of 10
Time Stamping with Logix Alarms and Events
Purpose of this document: The purpose of this application note is to demonstrate how to publish a
time stamped event captured by an external device to the Alarms and Events Summary page of FTViewSE.
The mechanism that will be used to accomplish this task will be the new ALMD instruction found in V16 of
RS Logix 5000.
Background Information: Factory Talk Alarms and Events provide excellent resolution and accuracy
for time stamping of Alarms and Events. This maximizes your ability to build a very accurate time
sequence for events that led up to a failure or simply diagnose the exact order of their occurrence. Because
the alarms are generated by the controller, the time stamp accuracy is a function of the rate of the
controller’s ability to scan the alarm instruction + the accuracy of the controllers wall clock.
When an alarm instruction is evaluated in code and some alarm transition event occurs (goes into alarm,
acknowledged, suppressed, etc…) the instruction immediately grabs the current value of the controller’s
wall clock. This 64 bit microsecond resolution number reflects the time of the event relative to the
controller’s wall clock in UTC (Real Time) (no time zone or daylight savings information is included).
When this time stamp is viewed, either thru RSLogix 5000, or FactoryTalk View SE, the time zone of the
PC running the software is used to visualize the time value. This allows a distributed system that covers
multiple time zones, to still have a valid sequence of events display at an operator or maintenance station.
IMPORTANT: For higher precision requirements, options exist to customize the time stamp at the
controller. Time stamps from external devices, like a 1756-IB16ISOE module which provides 50
microsecond resolution for time stamps, can be pushed into the alarming system. This white paper provides
information on how to move these time stamps into the alarm instruction to replace the instruction based
time stamp.
In a large enterprise (or even a small one) individually hand setting the controllers wall clocks is
unreasonable, plus clock drift will eventually make these clocks even further apart. There are several
automated methods to manage the wall clock on multiple controllers. The resolution and cost of these
solutions vary from a high accuracy GPS driven system to a low accuracy SNTP solution. Use of these is
detailed in a white paper entitled Synchronizing Clocks with Control Logix for SOE Applications.
The accuracy of time synchronization varies based on many factors, including the network path and what
the controller is doing at the time synchronization takes place. Typical systems using this tool coordinate
clocks down to around 300ms.
2 of 10
Time Stamping with Logix Alarms and Events
The simplest way to solve this synchronization is to run the Logix5000 Clock Update Tool on the same
machine as the alarm server. This will assure the controller clocks all synchronize with the PC’s tag based
alarm server. Typical systems using this method will commonly get 300ms synchronization. Other higher
accuracy options exist and are outlined in a white paper entitled Synchronizing Clocks with Control Logix
for SOE Applications.
To gain a better understanding of how time is acquired and maintained in the Logix Environment, please
refer to the application note entitled: Manipulating Time in a Logix Environment.
To gain a better understanding of how to convert the Logix Coordinated System Time (CST) to Universal
Coordinated Time (UTC), better known as Real Time, please refer to application note entitled: Converting
CST to UTC (Real Time) using the Add_64 instruction.
Application Topic:
Basic function of the Alarm Discrete Instruction (ALMD)
Difference between an Instruction-Retrieved time stamp and a Program-Initiated timestamp.
Why a program-initiated timestamp?
What application could capture its own timestamp data?
Applying a Program-Initiated timestamp.
With the new ALMD instruction comes a new data type called a long integer or (Lint). A Lint is comprised
of 64 bits of information and used to describe time values. The value in a LINT data types represents the
number of microseconds that have occurred since the time base 0000 hours Jan 1, 1970. The radix of a
LINT data type can be changed from Dint to Date/Time so the time value can be viewed in a man readable
Date/Time format.
In their raw form, the LINT time stamps store the time of the event in UTC format with no time zone
information included. When this time stamp is interpreted however, by software such as Factory Talk View
3 of 10
Time Stamping with Logix Alarms and Events
SE or RSLogix 5000 it is interpreted using the time zone information of the PC running either the View
Client window, or the Logix5000 programming environment. Note the -5 GMT in the following time
stamp.
There are two types of timestamps that can be published by an ALMD instruction. There is the instruction-
retrieved timestamp and there is the program-initiated timestamp.
Instruction-Retrieved timestamp:
4 of 10
Time Stamping with Logix Alarms and Events
1. Configuration
The Message: “Valve 1 has Opened” has been typed in the ALMD’s configuration
window. This is the bare minimum needed to configure the ALMD instruction. This
message will be displayed with it’s timestamp on the FTViewSE alarms summary page as
seen below
2. Status
The timestamps will be displayed under the status tab.
3. Parameters
And the timestamps will also be displayed as tags under the parameters tab.
5 of 10
Time Stamping with Logix Alarms and Events
The end result is to have this same information show up on an HMI Alarm Summary screen.
Program-Initiated timestamp:
Because an alarming system is often the key to tracing the history of a process or application event, it is very
important for time stamps to be as accurate as possible. Instruction based timestamps are significantly more
accurate than traditional HMI driven timestamps. Instruction based timestamps do not have the overhead
associated with polling every controller in a serial fashion for alarms. While significantly more accurate,
they are limited to the detection ability of the controller. So an instruction based timestamp can not exceed
the accuracy of the actual rate that the instruction is scanned.
Improved accuracy can be obtained if the actual device or I/O module that is causing the alarm timestamps
the event. This takes the controllers scan time out of the equation and allows a significantly more accurate
time stamp for an event. For example the 1756-IB16ISOE is capable of time stamping events to 50
microsecond accuracy, significantly faster than the scan time on even the leanest controller
application code.
6 of 10
Time Stamping with Logix Alarms and Events
Power Substations:
In the Power Industry, where there is a need to understand what event happened first and when, sub
1 millisecond timestamps are the standard. These event and timestamps can be captured by 1756-
IB16ISOE modules, time stamping relays, or many other accurate time based devices. This device
based time stamping can provide extremely accurate SOE (Sequence of Events). These SOE
modules are usually connected to electrical breakers that help produce and distribute power to the
grid. Because of the extremely fast response time of these breakers, higher accuracy on the time
stamp of the event is necessary to re-create the cause of a system failure.
Pharmaceutical Industries:
Many regulated industries require a precise audit trail. Part of this trail requires an ability to
accurately identify when operators performed actions, when control systems responded, and proved
a very accurate picture of what occurred first.
SCADA Applications:
Distributed control systems require accurate time stamps that may cross many different time zones.
For example a pipeline with multiple pumping stations may require time stamps from multiple time
zones get consolidated into a common time reference. In these applications it is often required to
bring in a master time source (like a GPS) to coordinate clocks for time stamping.
7 of 10
Time Stamping with Logix Alarms and Events
In the example below, we will show how to pass a timestamp captured by an event from a 1756-IB16ISOE
module to the ALMD instruction which will then publish the event message and timestamp value to Factory
Talk Alarm Server.
Step1.
When SOEInput1.0, which is the alias for the 1756-IB16ISOE located at Local: 1:I:Data.0, goes high or
transitions from a value of (0) to a value of (1)
Step2.
Next, the SOEAlarm.UseProgTime bit will be set to a value of (1). This is the bit that will prepare the
ALMD to receive a program initiated timestamp. This can be seen under the ALMD parameters tab below.
Step3.
Next, the first Copy instruction will copy the SOE’s timestamp data located at Local:1:I.UTCTimestamp[0],
which is comprised of 2Dint values, to tag SOETimeStamp, which is a Lint data type. Notice the Length is a
value of (1), this is because the length is determined by the Destination, not the Source so both Dint’s will
be copied to the Lint.
IMPORTANT: In order for RSLogix5000 and FTViewSE to properly interpret a time stamp that time
stamp must be a UTC time with no time zone or Daylights Savings time information included. Details on
how to manage time from other devices, and how to have the 1756-IB16ISOE present time stamps in UTC
is covered in Converting CST Time to UTC (Real Time) using the ADD_64 Instruction.
8 of 10
Time Stamping with Logix Alarms and Events
Step4.
Next, the second Copy will copy SOETimeStamp, Lint timestamp data value, into the SOEAlarm.ProgTime
location. The SOEAlarm.ProgTime is the parameter of the ALMD that was designed to accept timestamps
from external devices. This can also be seen under the ALMD parameters tab below.
9 of 10
Time Stamping with Logix Alarms and Events
Step5.
And last but not least, the ALMD executes, and will publish the correct SOE Timestamp data to the
FTViewSE HMI and will be displayed on the Alarms summary page.
End of document…
10 of 10