This section discusses example applications that are shipped as part of the EtherNet/IP Adapter SDK. The directory structures below describe the location of all libraries and example source files required to build EtherNet/IP Adapter examples applications for different profiles as specfied in Chaper 6 Device Profiles of THE CIP NETWORKS LIBRARY – Volume 1.
The example applications are build from a set of C source and header files the are common for all different device profiles and code files that contain the actual device profile specific functionality such as particular objects, instance, attributes, and assemblies.
This structure can be extended with further device profiles examples over the time.
It is also suggested that device manufacturers integrate their specific implementations into this structure, if possible.
Figure below, gives an Overview of the EhterNet/IP adapter Demo folder structure, details about device profiles are described in separate section.
The tables below summarize the objects that are created in Stack and the instance attribute values that are applied from application (through EtherNet/IP Adapter APIs).
| Attribute ID | Name | Data Type | Value |
|---|---|---|---|
| 1 | Revision | UINT | 2 |
| Attribute ID | Name | Data Type | Value |
|---|---|---|---|
| 1 | Vendor ID | UINT | Default: 806 [0x0326] |
| 2 | Device Type | UINT | Default: depending on particular example |
| 3 | Product Code | UINT | Default: depending on particular example |
| 4 | Revision | UDINT | Default: depending on particular example |
| 5 | Status | WORD | |
| 6 | Serial Number | UDINT | |
| 7 | Product Name | SHORT_STRING | Default: depending on particular example |
| Attribute ID | Name | Data Type | Value |
|---|---|---|---|
| 1 | Revision | UINT | 1 |
| Attribute ID | Name | Data Type | Value |
|---|---|---|---|
| 1 | Revision | UINT | 1 |
| Attribute ID | Name | Data Type | Value |
|---|---|---|---|
| 1 | Revision | UINT | 4 |
| Attribute ID | Name | Data Type | Value |
|---|---|---|---|
| 1 | PTPEnable | BOOL | |
| 2 | IsSynchronized | BOOL | |
| 3 | SystemTimeMicroseconds | UTIME | |
| 4 | SystemTimeNanoseconds | STIME | |
| 5 | OffsetFromMaster | NTIME | |
| 6 | MaxOffsetFromMaster | ULINT | |
| 7 | MeanPathDelayToMaster | NTIME | |
| 8 | GrandMasterClockInfo | STRUCT | |
| 9 | ParentClockInfo | STRUCT | |
| 10 | LocalClockInfo | STRUCT | |
| 11 | NumberOfPorts | UINT | |
| 12 | PortStateInfo | STRUCT | |
| 13 | PortEnableCfg | STRUCT | |
| 14 | PortLogAnnounceIntervalCfg | STRUCT | |
| 15 | PortLogSyncIntervalCfg | STRUCT | |
| 16 | Priority1 | USINT | |
| 17 | Priority2 | USINT | |
| 18 | DomainNumber | USINT | |
| 19 | ClockType | WORD | |
| 20 | ManufactureIdentity | USINT[4] | |
| 21 | ProductDescription | STRUCT | |
| 22 | RevisionData | STRUCT | |
| 23 | UserDescription | STRUCT | |
| 24 | PortProfileIdentityInfo | STRUCT | |
| 25 | PortPhysicalAddressInfo | STRUCT | |
| 26 | PortProtocolAddressInfo | STRUCT | |
| 27 | StepsRemoved | UINT | |
| 28 | SystemTimeAndOffset | STRUCT |
EIP_TIME_SYNC=1 is defined in the list of predefined symbols of the main example project in Code Composer Studio (Properties → Build → Arm Compiler → Pedefined Symbols).| Attribute ID | Name | Data Type | Value |
|---|---|---|---|
| 1 | Revision | UINT | 3 |
| Attribute ID | Name | Data Type | Value |
|---|---|---|---|
| 1 | Network Topology | USINT | |
| 2 | Network Status | USINT | |
| 10 | Active Supervisor Address | STRUCT | |
| 12 | Capability Flags | DWORD | 0x82 (Beacon-based Ring Node, Flush_Table frame Capable) |
| Attribute ID | Name | Data Type | Value |
|---|---|---|---|
| 1 | Revision | UINT | 1 |
| Attribute ID | Name | Data Type | Value |
|---|---|---|---|
| 2 | DSCP PTP Event | USINT | Default: 59 ('111011') |
| 3 | DSCP PTP General | USINT | Default: 47 ('101111') |
| 4 | DSCP Urgent | USINT | Default: 55 ('110111') |
| 5 | DSCP Scheduled | USINT | Default: 47 ('101111') |
| 6 | DSCP High | USINT | Default: 43 ('101011') |
| 7 | DSCP Low | USINT | Default: 31 ('011111') |
| 8 | DSCP Explicit | USINT | Default: 27 ('011011') |
| Attribute ID | Name | Data Type | Value |
|---|---|---|---|
| 1 | Revision | UINT | 2 |
| Attribute ID | Name | Data Type | Value |
|---|---|---|---|
| 1 | Status | DWORD | Default: BOOTP/DHCP/NVS |
| 2 | Configuration Capability | DWORD | Default: 0x00000095 (BOOTP Client, DHCP Client, Configuration Settable, ACD Capable) |
| 3 | Configuration Control | DWORD | Default: 0x00000000 (Configuration Method: Static IP) |
| 4 | Physical Link Object | STRUCT | |
| 5 | Interface Configuration | STRUCT | Default IP Address: 192.168.1.10 Network Mask: 255.255.255.0 Gateway Address: 192.168.1.1 Name Server: 0.0.0.0 Name Server 2: 0.0.0.0 Domain Name: |
| 6 | Host Name | STRING | Default: |
| 8 | TTL Value | USINT | Default: 1 |
| 9 | Mcast Config | STRUCT | Default Num Mcast: 32 Mcast Start Addr: 239.192.2.32 |
| 10 | SelectAcd | BOOL | Default: 1 |
| 11 | LastConflictDetected | STRUCT | |
| 12 | EtherNet/IP QuickConnect | BOOL | Default: 0 |
| 13 | Encapsulation Inactivity Timeout | UINT | Default: 120 |
| Attribute ID | Name | Data Type | Value |
|---|---|---|---|
| 1 | Revision | UINT | 4 |
| 2 | Max Instance | UINT | 2 |
| 3 | Number of Instances | UINT | 2 |
| Attribute ID | Name | Data Type | Value |
|---|---|---|---|
| 1 | Interface Speed | UDINT | Default: |
| 2 | Interface Flags | DWORD | Default: |
| 3 | Physical Address | USINT[6] | |
| 4 | Interface Counters | STRUCT | |
| 5 | Media Counters | STRUCT | Allways 0 |
| 6 | Interface Control | STRUCT | |
| 7 | Interface Type | USINT | Default: Twisted-pair |
| 8 | Interface State | USINT | Default: |
| 9 | Admin State | USINT | Default: enable |
| 10 | Interface Label | SHORT_STRING | Default: Port 1|2 |
| 11 | Interface Capability | STRUCT | Default: Port 1|2 |
currently, there are two Examples provided, one is CIP Generic Device (Device Type 0x2B) and the second one is CIP General Purpose Discrete I/O Device (Device Type: 0x07) according to Volume 1 Chapter 6 of the CIP NETWORKS LIBRARY.
The Generic Device profile does not specify any instances of the Assembly Object or the type of application objects necessary for device operation. This portion of the device profile must be supplied by the product developer and in this example focuses on digital I/O functionality via an LED array available on the evaluation board. The Generic Device example does not cover CIP Sync functionality.
See Generic Device (Device Type: 0x2B) for details.
A General Purpose Discrete I/O device type interfaces to multiple discrete I/O device types that do not have network capabilities. Examples include sensors and actuators. The example provided with the EtherNet/IP adapter SDK implements Discrete Input Point Object (Class Code: 0x08), Discrete Output Point Object (Class Code: 0x09) and also Discrete Output Group (Class Code: 0x1E).
The configuration of assemblies is also handled through a simple API ( DIO_DEVICE_ASM_initInstance), although only a subset of all possible configuration is supported.
See General Purpose Discrete I/O Device (Device Type: 0x07) for details.
The EtherNet/IP stack contains an example how to implement a small HTTP server application. The corresonding code can be found in the files web_server.c, web_server.h, and web_server_data.h. The HTML definitions for the page layout are contained in web_server_data.h.
The web server and the corresponding background task are enabled by setting CPU_LOAD_MONITOR == 1 (default: CPU_LOAD_MONITOR == 0) in the list of predefined symbols of the main example project in Code Composer Studio (Properties → Build → Arm Compiler → Pedefined Symbols).
To reach the example web page enter the IP address of the EtherNet/IP Adapter device (default: 192.168.1.10) into a web browser.

As a less CPU intensive alternative to the Web-Server, it is possible to show the CPU load via UART Terminal, to enable this feature, UART_CPU_LOAD_MONITOR=1 must be defined in the list of predefined symbols. (Properties → Build → Arm Compiler → Pedefined Symbols).