N5 Modbus RTU Online Manual

Configuring the Ethernet interface

Overview

Interface

The controller is equipped with a 10/100 MBit Ethernet interface. In this way it can be operated with all current Ethernet components (switches, PCs) and configured via the Plug & Drive Studio software.

Hardware address

The controller initially has no IP address, but is instead addressed via the printed hardware address (MAC address). This address consists of 6 hexadecimal numbers in form 44-AA-E8-xx-xx-xx.

The hardware address is unique and unchangeable and is assigned during production. In general, this is only needed during a firmware update. As soon as the boot loader has ended and the actual firmware begins to operate, subsequent communication takes place via the TCP/IP protocol.

IP address

The controller needs a valid IP address. This can be obtained in the following ways:

  • DHCP: A DHCP server assigns the IP address to the controller (default setting).
  • AutoIP: The controller automatically determines a suitable IP address. The prerequisite here is that the communication partners are in the same physical subnet and also use AutoIP.
  • Static IP address: This is defined by the user.

Which method is used depends on the network environment and is defined by the network administrator.

Establishing connection with the controller

Setting the IP address

Each of the connected devices (controller and communication partners) in an Ethernet network or with a point-to-point Ethernet connection requires a unique IP address. This can either be obtained automatically (DHCP) or generated (Auto-IP) or assigned statically. In the following, "communication partner" refers to a PC or laptop.

You can integrate the controller in an existing Ethernet network. To do this, you only need to establish the physical connection with a standard Ethernet cable. Provided DHCP is activated on the controller (factory setting), the controller is also automatically detected on the network and can immediately be operated via a PC located on the network.

Setting DHCP/Auto-IP

IP addresses can be obtained dynamically in a network from a DHCP server or, for example, in the case of a PC direct connection, can be automatically self-generated without DHCP by the two communication devices (e.g., PC and controller). DHCP is preset in the controller at the factory for automatically obtaining an IP address from a DHPC server or for automatic IP address generation. To establish the connection to the controller, it may only be necessary to make a few settings on the communication partner (e.g., PC or laptop). Settings using the Windows 7 operating system as an example:

  1. Press the Windows Start button and select Control Panel.
  2. Select Network and Sharing Center.
  3. Select Change adapter settings.
  4. A list of the available network adapters is displayed. Open the properties on the adapter to which the controller is connected (e.g., click with the right mouse button).
  5. Select Internet Protocol version 4 (TCP/IPv4) and press the Properties button.
  6. Select the Obtain an IP address automatically option.
  7. Confirm acceptance of the entries with the OK button.

Setting a static IP address

If static addresses are to be assigned to the controller and the communication partner, just a few settings need to be performed on the controller and the communication partner.

The controller can be assigned a static IP address and network mask (each IPv4) through OD entries. The following entries are relevant in the object dictionary:


Index Description
2010h

IP configuration, bit mask with the following meaning:

Bit 0: A static IP address from object 2011h and the network mask from object 2012h are used.

2011h Static IP address, 4 bytes in hex coding
2012h Static IP subnet mask, 4 bytes in hex coding
2013h Gateway address
2014h Active IP address, 4 bytes in hex coding
2015h Active IP subnet mask, 4 bytes in hex coding
2016h Currently used gateway address
200Fh MAC address

Notes:

  • If DHCP was activated and Auto-IP is not active, the controller uses the set static IP address if no address could be assigned via DHCP (e.g., because the DHCP service is temporarily unavailable).
  • If both objects 2010h and 2011h are set to the value "0", an incorrect configuration is assumed and DHCP and Auto-IP are switched on.
  • If bit 0 is set in object 2010h, the static IP address is used. DHCP and Auto-IP are not used in this case.
  • If DHCP and Auto-IP are activated simultaneously, DHCP is used first to try and obtain an address. If this does not function, Auto-IP is executed.
  • If only DHCP is switched on and an IP address assignment did not function, an attempt is made independent of bit 0 to connect using the entered static IP address.
A static IP address is also assigned to the communication partner. Settings using the Windows 7 operating system as an example:
  1. Press the Windows Start button and select Control Panel.
  2. Select Network and Sharing Center.
  3. Select Change adapter settings.
  4. A list of the available network adapters is displayed. Open the properties on the adapter with which the controller is connected (e.g., right-mouse click and select Properties).
  5. Select Internet Protocol version 4 (TCP/IPv4) and press the Properties button.
  6. Select the Use the following IP address: option and enter the desired IP address and network mask in the IP address field.
  7. Confirm acceptance of the entries with the OK button.

Establishing network connection

Establish a physical connection between controller and communication partner using a standard Ethernet cable. If static IP addresses were assigned to the controller and the communication partner, they can communicate directly.

If you have a DHCP server and want to find out the IP address, you can use the tool Tool ping. In order to do this, the NetBIOS service on the PC must be acivated and dthe MAC address known.

Example

  If you want to address the controller with the MAC address 44:AA:E8:00:02:9F, you start the tool by typing in a shell or command line:

ping MAC-44AAE800029F

REST web services

Introduction

The protocol used by the the web server is HTTP/1.0. The architecture here is realized according to REST (Representational State Transfer) which offers the possibility to access objects/resources. The values in the object dictionary are an example of this.

The operations supported here are:

  • GET: Request a resource
  • POST: Add a new resource

Resource names

The name of a resource is always specified in the URI (Uniform Resource Identifier) notation familiar from the Internet. Via this URI, the controller supports access to the object dictionary. The identifier for this is:

  • Od: Object dictionary

Example

 

Accessing a value in the object dictionary:

http://192.168.2.100/od/6040/00

This string is used to access entry 6040h subindex 0 in the object dictionary.

The reply is made as a JSON string and reflects the content of this object.

Example

 

Accessing a value in the object dictionary:

GET /od/6040/00 HTTP/1.0

This string is used to access entry 6040h subindex 0 in the object dictionary.

The reply is made as a JSON string and reflects the content of this object.

HTTP/1.0 200 OK

Server: uip/1.0

Cache-Control: no-cache, no-store, private

Content-type: application/json

"0006"

 

Writing a value in the object dictionary:

POST /od/6040/00 HTTP/1.0

Content-Type: application/x-www-form-urlencoded

Form item: ""000F"" = ""(Key: "000F", Value:)

This string is used to access entry 6040h subindex 0 in the object dictionary.

This string is used to write the value "15(0Fh)" in the object 6040h subindex 00h.

The controller receives a confirmation with the status code 200 OK:

HTTP/1.0 200 OK

Server: uip/1.0

Accessing the object dictionary

The following URIs enable access to the object dictionary:

<IP address>/od/xxxx/yy
Requests entry xxxx subindex yy from the object dictionary.
<IP address>/od/xxxx/Data
Requests entry xxxx with all subindices.

Example

 

Accessing a value in the object dictionary:

http://192.168.2.100/od/6040/00

This string is used to access entry 6040h subindex 0 in the object dictionary.

The reply is made as a JSON string and reflects the content of this object.

▶   next

Contents