Application and System
Diagnostic Framework on CIP
Joakim Wiberg
HMS Industrial Networks
Technical Trackwww.odva.org

AgendaIntroduction
 System overview
 Device heartbeat
 Aggregators
 Diagnostic object
 SummaryTechnical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 2www.odva.org

AgendaIntroduction
 System overview
 Device heartbeat
 Aggregators
 Diagnostic object
 SummaryTechnical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 3www.odva.org

IntroductionLongstanding topic at the EtherNet/IP Workshops• Troubleshooting• Diagnose Ethernet and TCP

The European series looked at a different type ofdiagnostics• Application• Device diagnostics• A working group was started

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 4www.odva.org

Introduction

Diagnostics and event logging as an integrated
part of the functionality of devices
Minimize the overall downtime
Increase flexibility of the manufacturing system
Maximize investment turnover

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 5www.odva.org

Introduction

Detect misaligned photo-eye• Log an high priority event– Service technician gets notified• Production stopped or run at a lower speed

A motor has been used under a certain load for acertain number of hours• A low priority event is logged– Service for the motor gets scheduled to the next
downtime period

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 6www.odva.org

AgendaIntroduction
 System overview
 Device heartbeat
 Aggregators Diagnostic object
 SummaryTechnical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 7www.odva.org

System overview

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 8www.odva.org

System overview

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 9www.odva.org

AgendaIntroduction
 System overview
 Device heartbeat
 Aggregators
 Diagnostic object
 SummaryTechnical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 10www.odva.org

Device heartbeat

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 11www.odva.org

Device heartbeat


Diagnostic Heartbeat delivery method• Unicast• Broadcast• MulticastAll have their pros and cons
Preferable method• Multicast– Can be filtered• Using IGMP Snooping– Already used on EtherNet/IP

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 12www.odva.org

Device heartbeat
Structure

Encapsulation
headerCommandspecific data

Technical Track© 2014 ODVA, Inc.

Field Name

Data Type

Field Value

CommandUINT

Device Heartbeat

LengthUINT

Length of the command specificdataSession
handleUDINT

Any value (ignored by receiver).

StatusUDINT

0SenderContext

ARRAY of octet

Value from request. Length of 8.

Options

UDINT

0Item Count

UINT

Number of target items to follow

STRUCT ofDevice Heartbeat Information

Target Items

UINT

Item ID

UINT

Item Length

ARRAY of octet

Item Data

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 13www.odva.org

Device heartbeat
Time To Live (TTL)• Part of the IP header• Defines how “far” an IP datagram can “travel”



By default set to one• Limits Device Heartbeats to the local network

Would have to be configurable• A new attribute in the TCP/IP Interface Object

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 14www.odva.org

Device heartbeat


IP Multicast Address• Can not use the same address as for Class 0 and Class 1– Different IP Multicast Addresses per deviceA new IP multicast address needs to be allocatedfrom the IPv4 Organizational Local Scope
Would have to be configurable• A new attribute in the TCP/IP Interface Object

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 15www.odva.org

Device heartbeat
Sent as Change-of-State• Speed up the delivery• The cyclic production interval is in seconds• An inhibit time is required– Defaults to ¼ of the heartbeat intervalTechnical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 16www.odva.org

Device heartbeat
76540123456AHReserved

Reserved

7Reserved

Reserved

Reserved

3210VS2VS1VS0SF

UFDFHeartbeat Sequence Count
Identity Object Instance ID

891011121314N

Technical Track© 2014 ODVA, Inc.

Device State
Severity Level
Reserved
VS3MAEV

Configuration Consistency Value
Device Heartbeat Instance ID (included if AH flag is set)
Path Size (included if AH flag is set)
Padded EPATH (included if AH flag is set)2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 17www.odva.org

AgendaIntroduction
 System overview
 Device heartbeat Aggregators
 Diagnostic object
 SummaryTechnical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 18
www.odva.org

Aggregators

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 19
www.odva.org

Aggregators

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 20www.odva.org

Aggregators


Aggregator Object• The Aggregator collects and store Device Heartbeat
messages here in• One instance per Device Heartbeat– Only new Device Heartbeat messages is stored• The object either add or prepend the EPATH to theoriginal producer with the address of the previous
producer and the entry port
• Once the Device Heartbeat messages is stored it’s
produced “upstream”

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 21www.odva.org

AggregatorsUpper layer tools making use of the Device
Heartbeat messages are responsible for deleting
consumed Device Heartbeat messages from theAggregator Object
The upper layer tools uses the Original DeviceHeartbeat Producer Path to drill down throughthe network hierarchy

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 22www.odva.org

AggregatorsPath in A1• Path Size: 01 00• Path:03 0B

Path in A2• Path Size: 08 00• Path:14 0B 31 39 32
2E 31 36 38 2E
30 2E 34 00 030B

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 23www.odva.org

Aggregators


Filtering options in Aggregator Object• An acceptance mask of the Flags in the Diagnostic
Heartbeat message– Applies as a logical AND– Defaults to all ones

Attr
ID

Need In
ImplemAccessRuleNV

Name

Data Type

Descriptionof
Attribute

Semantics ofValues

WORD

Filter mask
applied toDiagnostic
Flags onreceived
DeviceHeartbeatmessages

See semantics
section<snip>

8RequiredTechnical Track© 2014 ODVA, Inc.

Set

NV

Diagnostic Flag
Mask

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 24www.odva.org

Aggregators
Filtering options in Aggregator Object• Severity level acceptance– Only events with a severity level equal to or higher thanthe configured will be accepted

Attr
ID

Need In
ImplemAccessRuleNV

Name

Data Type

Descriptionof
Attribute

Semantics ofValues

USINT

Sets theminimum
Severity Levelof events thatshall beaccepted

See semantics
section<snip>
9RequiredTechnical Track© 2014 ODVA, Inc.

Set

NV

Severity Level
Filter2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 25www.odva.org

Aggregators


Filtering options in Aggregator Object• Device Heartbeat IP Address Mask
– Filters on the destination IP Address– Default the defined IP Multicast address used for Device
Heartbeat messages

AttrID

Need In
ImplemAccessRule

NVNameData Type<snip>STRUCT of:
10RequiredSet

NVDevice Heartbeat
IP Address Mask

UINTUDINTTechnical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

Descriptionof
Attribute

Semantics ofValues

List of IP
addressesthat shall bemasked
Number offilteredaddresses
DeviceHeartbeat IPAddress

See semantics
sectionpage 26
www.odva.org

Aggregators
Storage policy in Aggregator Object• It’s possible to define when new instances are created– One instance per Device Heartbeat producer– Keep creating new and overwrite old instances– Keep creating new until out of memory

AttrID

Need In
ImplemAccess
Rule

NV

Name

Data Type

Descriptionof
Attribute

Semantics ofValues

USINT

Defines how
instances will
be used tostore DeviceHeartbeat

See semantics
section<snip>
11Required

Technical Track© 2014 ODVA, Inc.

Set

NV

Device Heartbeat
Storage Policy

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 27www.odva.org

AgendaIntroduction
 System overview
 Device heartbeat
 Aggregators Diagnostic object
 SummaryTechnical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 28
www.odva.org

Diagnostic object
Event Log Object• Already exists and is defined– Seems logical to use because of the above• Contain some issues– Loosely defined– Defined in a generic way to support any kind of logging• Suggests defining a new object– The Diagnostic Object

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 29
www.odva.org

Diagnostic object
Device implementing the Device Heartbeat shallalso implement the Diagnostic Object
A small and light weight object• Yet flexible enough• Can be implemented in devices with limited resources

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 30
www.odva.org

Diagnostic object
One instance per bit in the Flag field of theDevice Heartbeat• Bit 15 excluded• Bit 0 corresponds to 1
• Bit 1 corresponds to 2
• And so on…

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 31www.odva.org

Diagnostic object
Event list attribute• Where all information about the logged events are stored• Comprise of a size member and an array of logged
events• Grow as new events are logged• New events are added to the end of the list

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 32
www.odva.org

Diagnostic object
Descripti
on ofAttribute

Semantics
ofValues

STRUCT of:

List of all
loggedeventsUINT
Number ofentries
diagnosticentries
ARRAY of STRUCT
Array ofof:diagnostic
entries
UINT
Identifier
uniquelyidentifying
thisdiagnostic
event
USINT
The
severity ofthe event
SHORT_STRING
Textualrepresentation of thediagnosticevent
DATE_AND_TIME Data andtime whenthe event
was loggedSeesemantics
section2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 33
www.odva.org

Attr
ID

Need In
ImplemAccess
Rule

NV

Name

Data Type

6

RequiredGetV<snip>
Event List
List Size

EventInformation
Event CodeSeverity TypeEvent CodeDescriptionTime

Technical Track© 2014 ODVA, Inc.

Diagnostic object
Severity levels• Discrete levels identifying the importance• Loosely based on the Syslog severity levels

CodeTechnical Track© 2014 ODVA, Inc.

Description

0Emergency

1Alert2

Critical

3

Error

4Warning

5Information2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 34
www.odva.org

Diagnostic object
The behavior of new events can be controlled• What to do with a full list
• How duplicates are handled

Attr
ID

Need In
ImplemAccess
Rule

NV

Name

Data Type3

RequiredSet

NV<snip>
List Full Action

USINT

4

RequiredSet

NV

Duplicate
ActionUSINT

Descripti
on ofAttribute

Semantics
ofValues

Configures
the action
to takewhen anew event
is detected
and thelog is full.
Configures
the action
to takewhen aduplicate
event isdetected.

Seesemantics
sectionSeesemantics
section<snip>

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 35
www.odva.org

Diagnostic object
A new object specific service• Used to read logged events• Return the last unread event logged

ServiceCode4Bhex

Technical Track© 2014 ODVA, Inc.

Need inImplementation
InstancClassen/aRequiredService nameDescription of Service

Get_Next_Unread_Me
mberReturns the next member inthe Event List Attribute thathas not been read yet.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 36www.odva.org

Diagnostic object
EDS construct• Make it possible to provide textual strings for the eventsin the EDS file
Field
NumberField Name

Data Type

Required/Optional

First Event Code

1UINT

RequiredFirst Event Code String

2

STRING

Required

Nth Event Code

3,5,7,…

UINT

Optional

Nth Event Code String

4,6,8,…

STRING

Conditional1

Table Footnotes
1 Required if preceding field is specified, not allowed if preceding field is not specified.

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 37
www.odva.org

AgendaIntroduction
 System overview
 Device heartbeat
 Aggregators
 Diagnostic object
 SummaryTechnical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 38
www.odva.org

Summary

A generic framework for diagnostic reporting andevent logging• Can be used for almost any type of application anddevice diagnostics and events• Functionality to report diagnostics• Store and publish diagnostics• Aggregate diagnostics through a network hierarchy• All based on standardized CIP functionality

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 39
www.odva.org

Thank you for your attention!

Technical Track© 2014 ODVA, Inc.

2014 Industry Conference & 16th Annual Meeting
All rights reserved.

page 40
www.odva.org