Industrial Automation
Industrial Automation | Europe

myKnowledge

Main > Product Type > Automation Systems > Networks
Minimize Text   Default    Enlarge Text
 

Print
E-mail

Using the EJ1N-HFU-ETN with Modbus/TCP


Using the EJ1N-HFU-ETN wit Modbus/TCP

The EJ1N-HFU-ETN is an Ethernet gateway to Modbus/RTU on RS485. On the Ethernet side it supports both PROFINET IO and Modbus/TCP communication.

Introduction

Using PROFINET IO to communicate to the EJ1N-HFU-ETN and the Modbus serial devices connected to the RS485 network of the unit is described in the instruction sheet. However, the EJ1N-HFU-ETN also supports Modbus/TCP communication.
 
For PROFINET IO, communication from an IO Controller to the gateway needs to be setup with a configuration tool and the GSDML file of the EJ1N-HFU-ETN. At startup, the IO Controller will download parameters to the EJ1N-HFU-ETN to set up the Modbus communication. After setup, communication of data will commence automatically.
 
When using Modbus/TCP, the settings of the RS485 communication must be made first, and then each node on the RS485 network can be accessed through Modbus/TCP.
 
Content
 
Modbus/TCP is, as its name implies, nothing more than a TCP-connection between a client and a server that exchange Modbus messages. For more information on Modbus communication see www.modbus.org. The Modbus specifications are directly available from there.
 
For Modbus/TCP an extra field is added to the Modbus message. It is the so called Unit Identifier. Its description can be found in the Modbus/TCP specification.
It is used to address individual units within a Modbus/TCP device. In case of a modular device like slice IO, each slice could be addressed like this. The EJ1N-HFU-ETN uses the Unit Identifier as the Modbus address on the RS485 network.
 
The Unit Identifier is the first byte of the Modbus message sent over Modbus/TCP.
The Unit Identifier ranges from 00h to FFh. The address FFh is reserved for the EJ1N-HFU-ETN itself.
 
The EJ1N-HFU-ETN contains Modbus registers to indicate its status, and to configure baudrate and parity of the RS485 network. The registers for the baudrate and parity are 200h and 201h respectively.
 
FF03 0200 0001 will read the baudrate setting.
FF06 0200 0001 will write the value 1 to the baudrate register and will set the speed to 19k2.
 
To set the parity, write the desired value in register 201h. Be aware that Even and Odd parity will result in only 1 stop bit as None will have 2 stop bits.
 
When baudrate and parity are properly set, the devices on the modbus network can be accessed.
For example 0503 0001 0003 will read 3 registers, starting from register 1, from the modbus device with address 5.
If there is an error, the gateway will return the related error code. For a description of the error codes refer to the device manual or to the Modbus specification.
 
For a list of registers supported by the EJ1N-HFU-ETN, please refer to the attached file EJ1N-HFU-ETN Modbus address.docx
It is not recommended to access the gateway's internal modbus registers more than once per 100 ms. Access to this information has lower priority than servicing the connected devices, and it may happen that the EJ1N-HFU-ETN cannot service the request.
 
Summary
 
Besides PROFINET IO, the EJ1N-HFU-ETN gateway also supports Modbus/TCP. To use only Modbus/TCP the baudrate and parity must be set for the Modbus/RTU network. Each device on the Modbus network can be reached using the Unit Identifier, with the gateway itself having address FFh.
To set the IP-address of the EJ1N-HFU-ETN refer to this knowledge article:
 

 



Attachments



Comments (View All Comments / Add Comment)

Related Articles
No related articles found.
Created 2011-12-09
Modified 2012-05-23
Views 10016

 

You are not logged in.