Extracting Energy Data from
MODBUS Devices Using CIP
Rick Blair
Schneider ElectricTechnical Trackwww.odva.org

MODBUS vs. CIP
MODBUS

Flat memory architecture
16-bit data organization *Registers) and bits
No definition for other data types
No predefined memory layouts
Inconsistent device identification

CIP



Object based\Consistent identification methods

Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 2www.odva.org

Current Situation
Many MODBUS devices exist thatmeasure power and energy
No consistent data representation

Across manufacturers
Within manufacturers

Need custom software interfaces
Popularity of MODBUS will result incontinued similar product offers

Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 3www.odva.org

CIP Energy Objects
Three new energy objects added to CIPBase Energy Object
Electrical Energy Object
Non-Electrical Energy Object

Defines standardized data sets andservices

Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 4www.odva.org

Base Energy Object
Energy Supervisor
Capabilities
 Accuracy
 Paths• To Subordinate Objects• To Aggregated Objects

Reports energy and/or power
 Standardized reporting units (kWh/kW)
Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 5www.odva.org

Electrical Energy Object
Subordinate to Base Energy Object


Associated Base Energy Object Path EPATH
Standardized reporting of electrical attributes• Energy• Power• Voltage• Current• Power Factor• etc.

Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 6www.odva.org

Non-Electrical Energy Object
Inclusive of all energy related resources

Not only electricity!
Native reporting units• Natural Gas in Therms, Chilled Water in Mbtu, etc.
• Units from ENGUNIT data type (Appendix D)• Or text stringStandardized reporting units• Conversion factor to kWh• Permits aggregation of diverse energy resources• Multiplier/divisor unit conversion factors

Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 7www.odva.org

Overview - MODBUS to CIP Energy
Data Extractor (MCEDE)
Collects energy data from
MODBUS devices and puts
it into CIP Energy objects
MODBUS port(s)SerialEthernet

MODBUS
Energy Device
CIP Device
MODBUSMODBUS
Energy Device

CIP port(s)EtherNet/IP
DeviceNet
Etc.

MCEDE
CIP Device

CIP
MODBUS
Energy Device

CIP Device

Implementation
Platform(s)MODBUS
Energy Device

PC
Dedicated

Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 8www.odva.org

Basic MCEDE Functions
A set of MODBUS energy device descriptions
A set of data type conversion functions
A configuration function
A method to add/delete MODBUS energy devicedescriptions
A scan function to periodically read MODBUS
dataA discovery function to search for MODBUS
devices (optional)
A MODBUS driver
A CIP driver
An energy object service handler

Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 9www.odva.org

MODBUS Energy Device Description
Device level descriptors

Number and type of CIP energy objects needed
Which MODBUS data should be extracted
Order of multi-register data values
MODBUS register blocks to read
How to identify the MODBUS energy device
Which CIP energy object services should be provided

For each CIP object attribute supported

MODBUS register address
Data typeUnits

Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 10www.odva.org

MODBUS Device Identification
Only recently standardized

Some MODBUS devices do not support
any method for identification
Some use register-based signatures
Standard method uses Read Device
Information (RDI) function code

Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 11www.odva.org

Data Order Considerations
MODBUS is a 16-bit register based
protocolNo standard for how to represent multiregister data
Different data order methods exist incurrent MODBUS devices
Assume consistent within a MODBUS
deviceTechnical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 12www.odva.org

Optimized MODBUS Data Collection
CIP Energy Object

MODBUS Energy
Data BlockMODBUS Energy
Data BlockMODBUS Energy
Data Block

Could read each MODBUS data item
- inefficientGroup multiple items into single read request,
even if some data is not used

Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 13www.odva.org

Describing the MODBUS Energy
DeviceUse MODBUS device description file
EDS
XML (preferred)

Embed In MODBUS deviceDescription file using MODBUS Read file function code
Use predefined registers and signature (e.g. SunSpec)
Enhance Read Device Information function code to include
mapping description

Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 14www.odva.org

Configuration
Add / remove MODBUS device
descriptions
Configure port settings
Map MODBUS devices to CIP object
instances
Configure scanning update rates

Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 15www.odva.org

MODBUS Device Identification
Scan for MODBUS devices to aid configuration
Make sure device matches associateddescription
Not possible for MODBUS devices with noresident identification method

Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 16www.odva.org

Data Conversion and Scaling
MODBUS data may be different data type and /or units
Implement conversion routines for each CIP
data type
Consider both decrease and increase in maxvalues
Use simple scaling factor for units conversion

Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 17www.odva.org

Scanning MODBUS Energy Devices
Simple scannerRead all from one device
Move to next device
Repeat until all devices readStart over at the beginning

Complex Scan

Allow choice of update time for each MODBUS device
Consider time management for possible scan rate conflicts

Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 18
www.odva.org

Updating CIP Objects
MODBUS data conversion may take time
Consider two copies of each instance tobetter support the Get_Attributes_Allservice
Update one copy and then switch
context
Supported services may vary per Energy
Object instanceTechnical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 19
www.odva.org

Energy Object Services
MCEDE requires dynamic creation /deletion of CIP Energy objects as
MODBUS devices are added / removed
Each instance may contain different
optional attributes

Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 20www.odva.org

Conclusion
MCEDE can be built using PC or
dedicated platform
Description file allows use of MODBUS
devices without modification
Data order, type and word order may not
be similar between MODBUS and CIP
MCEDE should support dynamic addition/ removal of MODBUS energy devices

Technical Track© 2012 ODVA, Inc.

2012 ODVA Industry Conference & 15th Annual Meeting
All rights reserved.

page 21www.odva.org