EtherNet/IP - Sample Applications

Several sample applications are provided for port’s EtherNet/IP protocol stack. They show how to set up and use the stack. The following examples can be found in the folder goal/appl/goal_eip/

  • 00_rpc_cc – communication core application (for multicore targets only)

  • 01_simple_io – simple IO application

  • 02_dlr_dhcp – simple IO application with DHCP and DLR support.

  • 03_dhcp – simple IO application with DHCP support

  • 04_parameter – sample application with parameter

  • 05_acd_dhcp – simple IO application with Address Conflict Detection (ACD) and DHCP

  • 06_dlr_acd - application using Device Level Ring (DLR) and ACD

  • 07_simple_io_rpc - application using RPC for accessing Assemblies (for multicore targets only)

  • 08_acd_dhcp_dlr - uses ACD, DHCP and DLR

  • 09_acd - used ACD

DLR is only suitable for Multi-port devices.

The sample application can be found in the file goal_app_eip.c, located in the example folders except 00_rpc_cc. It sets the serial number to 123456789 and creates several assemblies and defines connections.

Assembly Instance 150 is an Output Assembly. It contains data received from a PLC. The first byte will be mirrored to the target’s LEDs. The second byte will be mirrored to second byte of Assembly Instance 100.

Assembly Instance 100 is an Input Assembly. It contains data that is sent to the PLC. Before it is sent the status of the target’s buttons are mapped to the first byte and the second byte of Assembly Instance 150 is mirrored.

The application folders also contain an EDS file that can be used by an EtherNet/IP Scanner.

By altering goal_app_eip.c changes to the assembly instances created, their size or what is done with their data are possible.

Default Identity

The identity Information of the CC is configured after startup and can be changed via API. It uses the following default values:

 

Table: Default identity values

Vendor ID

1114 (port GmbH)

Device Type

43 (Generic Device (keyable))

Product Code

1

Revision

1.1

Product Name

EtherNet/IP Adapter

 

 At first start up or after a factory reset the device

  • either issues DHCP requests to obtain an IP address. The device is only operable after a valid IP configuration was received from a DHCP server, if DHCP support is enabled;

  • or returns to the default IP address defined by GOAL_CONFIG_NET_ADDR_IP_DEFAULT (default value: 192.168.0.100), if DHCP support is not enabled.

Configuring the sample application

Changing MAC Address

Setting the MAC address at the application is described here: GOAL media (goal_media) | Configure MAC address.

Changing IP Address

Some of the applications providing a DHCP client. In order to change the IP address of these applications, please reconfigure the DHCP server.

All other applications start with a static IP address, which is extracted from stored GOAL CM-variables by bootup. If no valid IP address has been set in GOAL’s CM-variables before, GOAL_CONFIG_NET_ADDR_IP_DEFAULT is used instead. Please see Network handling for further information.

Changing the IP address via CIP is always possible. The TCP/IP Interface Object Attribute 3 has to be set to 0 (use static IP Address). Afterwards the IP address of the device is configurable by TCP/IP Interface Object Attribute 5.