Generic Ethernet/IP and CIP Technical Information

From AdvancedHMI
Jump to: navigation, search

Generic Ethernet/IP and CIP Technical Information

This wiki area was created for documenting technical aspects of CIP devices which include Ethernet/IP, ControlNet, and DeviceNET.

CIP is a complex object oriented device specification used for a common ground of exchanging information between devices. The general specifications are documented in the ODVA documents of "THE CIP NETWORKS LIBRARY". These manuals spell out the common aspects across of CIP devices. CIP allows extensions of the specifications by use of Vendor specific and Device specific Objects, Services, and Attributes. The vendor specific items can sometimes be difficult to find documented details about. So it is the purpose of this wiki to fill in the blanks.

If you are new to CIP (Ethernet/IP), you may find it to be quite overwhelming to understand. The specifications are very abstract making it hard to relate to a byte stream on a wire or implementation in code. In my experience, it is easier to grasp when you do not try to think of it as software implementation or a stream of bytes being exchanged between devices, but instead think of it as a device containing multiple objects that respond to commands.

The Object
The first concept to understand is the object. A CIP device such as a ControlLogix PLC consists of several objects. An example of an Object within a ControlLogix would be the Identity Object.

Each object is a definition of the characteristics of that particular object. In order to use an object an instance must be created. To use a common analogy, you can think of an object as a person. The person object defines the characteristics about a person. An instance of a person object would be you. You are the same class as other people, but the values of those characteristics make you a unique instance, for example your age, height, race, etc.

CIP refers to everything as numbers. Each Object Class is given a number. Then each Object Instance is given a number. CIP specifications reserve Instance 0 as the default instance which is also referred to as the class level. Instance 0 is generally used to create and delete other instances of its class.

The Attribute
The next concept to understand is the attribute. In the world of OOP, the attribute would be equivalent to a property. Attributes are used to make an Instance unique. Back to the person analogy, Age would be an example of an attribute. In a ControlLogix, an Instance of the Identity Object will have a attribute of SerialNumber which hold the value of the device's serial number.

The Service
The last concept related to the object is the Service. This is basically the command the object will accept. Referring again to the Identity, a service it may support is GetAttributeSingle. This service is used to retrieve the value of and attribute. For example, if you wanted to know the serial number of your PLC, you would send the GetAttributeSingle service to the Identity Object with the parameter referring to SerialNumber.

Seeing These Concepts In Action
If you are like me, an actual example is tremendous help in understanding complicated concepts. So to help understand Objects, Instances, and Attributes, the following demo will let you see these in action. For this demo, you will need a ControLogix and CompactLogix PLC.

In the explanations above, one particular object was mentioned, the Identity Object. This particular object exists in the majority of CIP devices. This demo will show how to retrieve the serial number of the CIP device and the human readable description.

It is assumed you are familiar with RSLogix5000 software.

1) In RSLogix5000 create a new tag named SerialNumber of the type DINT
2) Add a rung to the program
3) In the new rung, add an MSG instruction
4) Set the MSG parameters to the following:

Message Type : CIP Generic
Service Type : Get Attribute Single
Class : 1
Instance : 1
Attribute : 6


Class Codes for ControlLogix