ECAN-240. (Modbus TCP to 2-port CAN Bus Gateway User manual) ECAN-240 Modbus TCP to 2-port CAN Bus Gateway User Manual, Version 1.0.

Similar documents
I-7550E PROFIBUS/Ethernet Converter. User's Manual

tsh-700 Series User Manual

GW-7238D J1939 to Modbus TCP Server / RTU Slave Gateway

NCOM SERIAL DEVICE SERVER 4XX SERIES USER S MANUAL

Motortronics VirtualSCADA VS2-MT Communication Gateway VS2-MT User Manual Revision

The I-7530A-MR Modbus RTU to CAN Converter

NCOM SERIAL DEVICE SERVER 1XX SERIES USER S MANUAL

i-7550 PROFIBUS to RS-232/422/485 Converter User's Manual High Quality, Industrial Data Acquisition, and Control Products

The I-7530A RS-232/485/422 to CAN Converter

DL-10. User Manual. RS-485 Remote Temperature and Humidity. English Ver. 1.0, Jul. 2017

GW-7228 J1939/Modbus RTU Slave Gateway

Industrial Serial Device Server

I-7570 Serial To HART Converter

GW-7472 / GW EtherNet/IP to Modbus RTU/TCP Gateway User Manual

Serial to Ethernet Converter

tgw-700 Series User Manual

GW-7553-CPM PROFIBUS/CANopen GATEWAY. User's Manual

WLAN Products 2.1 Overview P WLAN Remote Maintenance Device P WLAN Converter P Applications P2-4-1

3-7 Tiny Serial-to-Ethernet Device Server & Modbus Gateway

Winsonic MODBUS Remote IO user manual Rev. 1.0

FR-2057iT. 16-channel Sink Type Isolated Output Module With Isolated Communication line. User Manual

tgw-700 Series User Manual

ZigBee Converter User s Manual

Warranty. Warning. Copyright. Contact Us

SERIAL TO ETHERNET CONVERTER E-P User Manual

HART 710. User s Manual Version HART-710 User Manual (Version 1.00, July/2010) PAGE: 1

EGW1-IA3-MB User s Manual

tds-700 Series User Manual

IPM-01 / IPM-01H MODBUS TCP/RTU Bridge User Guide

MODEL: GR8-EM. Communication Adaptor GR8 Series

The UART to CAN Bus Converter

ET-2200 Series Ethernet I/O Modules User Manual

Embedded Modbus TCP Module GS11-MT. User Manual REV 1.1. SST Automation.

BACnet/IP to BACnet MS/TP Router

Document Name: User Manual for SC10MK, Modbus RTU to Modbus TCP Converter

Infosystem. User Manual. Version 1.0. Serial to Ethernet Converter with 3 sockets. Infosystem Technology Corporation, Ltd.

INDEX. Document Name : User Manual for SC10EJ Serial to Ethernet Converter

SK CU4-EIP-C Part number:

GW-7662 User Manual. Version 1.00, Jan Written by Ryan Lin

HRT-710. User s Manual Version HRT-710 User Manual (Version 1.23, Dec/2012) PAGE: 1

tm-752n Series User Manual

NET101. RS232 / RS422 / RS485 to Ethernet Converter. User s Manual. Version 1.2

J1939/Modbus Slave Gateway FAQ

USR-TCP User Manual

MSD-SRF2XM Multi-port RS-232 to Ethernet Data Gateway User Manual

BAS Router BACnet Multi-Network Router

Hardened Web-Smart High Power PoE Ethernet Switch

NetBiter Serial Server User Manual

8520/8520R. User Manual

WM-120. Serial to Ethernet Module. Serial to Ethernet Module. User Manual. Version 1.0. Infosystem Technology Corporation, Ltd.

WIZ220IO / WIZ220IO-EVB User s Manual (Ver. 1.0)

SST-2450 Wireless Modem User s Manual

HRM-0800 Instruction Manual

tds-700/ tds-700 RevB Series

Communication adapter RS485/422 over the Ethernet ELO E222. User manual

RS232/RS485/RS422 to TCP/IP Converter ITEM NO.: RS007

Operation Manual EX-9133C-2-MTCP

User Manual A08. User Manual

WiFi 16 Relay Board TCP ModBus Controlled - User Manual 21 Aug WiFi 16 Relay Board TCP ModBus Controlled

DCON Utility Pro User s Manual Version 1.1, May 2015

Serial to Ethernet Converter HL-SE02P-V1. User s Manual V3.606

Ethernet I/O Module by ICP DAS Co., Ltd. All Rights Reserved. Comparison Item tpet PETL-7000 PET-7000 CPU 32-bit ARM Ethernet

SST Automation

User Manual Edition: v a

UA-5000 Series User Manual

SSE232-LE Serial Server- User s Manual

Operation Manual of EX-9132C-2. Serial to TCP/IP Converter

e-net TCP/IP Converters

Modbus TCP/RTU Gateway

Industrial 2-port RS422/485 Modbus Gateway

I-7560U/7561U/7563U. User Manual WARRANTY WARNING COPYRIGHT TRADEMARKS CONTACT US

TRP-C34H. Ethernet to 4 RS232/422/485 Converter. User s Manual. Printed Sep Rev 1.1

isma-b-mg-ip User Manual Global Control 5 Sp. z o.o. Poland, Warsaw

MDA-8000 DIO User Manual

RS-232/422/485 Over IP Adapter

MGate 5118 Quick Installation Guide

Industrial Device Server IDS-3010 Fiber Series

TRP-C37 User s Manual

HOME AUTOMATION, INC. Model 93A00-1. Serial Server. User s Manual

TCP/IP Converter. EX-9132 Operation Manual for 8051 Series

tds-700 Series User Manual

TRP-C37. Ethernet to RS232/422/485 Converter. User s Manual. Printed Apr.2014 Rev 1.3

SK CU4-PNT-C Part number:

tgw-700 Series User Manual Warranty Warning Copyright Trademark

USR-TCP User Manual

VPGate Manual PROFINET to Serial

Industrial 1-port RS422/485 Modbus Gateway

GEM-10 GPRS/Modbus Gateway User Manual. Rev /2012

Document Name: User Manual for SC10EK4 Serial to Ethernet Converter with 4 TCP Sockets. Index

1 port RS-232 Device Server

3-7 Tiny Serial-to-Ethernet Device Server & Modbus Gateway

LM300 Bluetooth Ethernet Access Point/Server 3 Simultaneous Bluetooth SPP Connections

MGate MB3000 Modbus Gateway User Manual

Wireless LAN Access Point

MGate 5111 Quick Installation Guide

User Manual Electronic Systems Protection, Inc. / Technical Support: / espei.com

MGate MB3000 Modbus Gateway User s Manual

TCD channel H.264 Video Encoder Hardware User s Manual (DC 12V) Ver. 2010/10/29

User Manual SUPPORT. Ethernet I/O Modules Ver. 1.8, Jan. 2014

1 Port RS232 Serial over IP Ethernet Device Server

Transcription:

ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway User manual) ECAN-240 Modbus TCP to 2-port CAN Bus Gateway User Manual, Version 1.0.0 Page: 1

Table of Contents Table of Contents -----------------------------------------------------------------------------2 Important Information -----------------------------------------------------------------------4 1. Introduction ---------------------------------------------------------------------------------5 1.1. Features ---------------------------------------------------------------------------------------------- 7 1.2. Specification ----------------------------------------------------------------------------------------- 8 2. Getting Started -----------------------------------------------------------------------------9 2.1. LED Indicator -------------------------------------------------------------------------------------- 10 2.2. Rotary Switch -------------------------------------------------------------------------------------- 11 2.3. Terminator Resistor ------------------------------------------------------------------------------ 12 3. Web Configuration ---------------------------------------------------------------------- 13 3.1. Overview ------------------------------------------------------------------------------------------- 14 3.2. Basic Settings -------------------------------------------------------------------------------------- 15 3.3. CAN Bus Settings --------------------------------------------------------------------------------- 18 3.3.1. Basic CAN Settings --------------------------------------------------------------------------------------------- 18 3.3.2. CAN Filter Settings -------------------------------------------------------------------------------------------- 19 3.4. Modbus TCP Server ------------------------------------------------------------------------------ 21 3.4.1. Specific CAN ID Settings -------------------------------------------------------------------------------------- 21 3.5. Modbus TCP Client ------------------------------------------------------------------------------- 22 3.5.1. Modbus Read Command Settings ------------------------------------------------------------------------- 22 3.5.2. Modbus Read Command Mapping ------------------------------------------------------------------------ 24 3.5.3. Modbus Write Command Settings------------------------------------------------------------------------- 25 3.6. Pair Connection Settings -------------------------------------------------------------------------27 3.7. Other Functions ---------------------------------------------------------------------------------- 28 ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 2

4. Modbus TCP Server Applications ---------------------------------------------------- 29 4.1. Modbus Address Mapping --------------------------------------------------------------------- 31 4.1.1. Input Register -------------------------------------------------------------------------------------------------- 31 4.1.2. Output Register ------------------------------------------------------------------------------------------------ 35 4.2. Structure of CAN message in Modbus commands --------------------------------------- 38 4.3. Modbus Command Examples ----------------------------------------------------------------- 39 4.3.1. Reading a CAN message via a Modbus command ----------------------------------------------------- 39 4.3.2. Reading a CAN message containing a specific CAN ID via a Modbus command ---------------- 41 4.3.3. Reading a CAN message that has been sent via a Modbus command ---------------------------- 42 4.3.4. Reading the status of a module via a Modbus command -------------------------------------------- 43 4.3.5. Writing a CAN message via a Modbus command ------------------------------------------------------ 44 4.4. Modbus Exception Codes ---------------------------------------------------------------------- 47 5. Modbus TCP Client Applications ----------------------------------------------------- 48 5.1. Supported Modbus Function Codes --------------------------------------------------------- 49 5.2. I/O Memory Size ---------------------------------------------------------------------------------- 50 5.3. Error Response ------------------------------------------------------------------------------------ 51 6. Pair Connection Applications --------------------------------------------------------- 53 7. Listen Only Application ----------------------------------------------------------------- 55 8. Bridge Mode Applications ------------------------------------------------------------- 56 Appendix A Firmware Update --------------------------------------------------------- 57 ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 3

Important Information Warranty All products manufactured by ICP DAS are under warranty regarding defective materials for a period of one year, beginning from the date of delivery to the original purchaser. Warning ICP DAS assumes no liability for any damage resulting from the use of this product.icp DAS reserves the right to change this manual at any time without notice. The information furnished by ICP DAS is believed to be accurate and reliable. However, no responsibility is assumed by ICP DAS for its use, not for any infringements of patents or other rights of third parties resulting from its use. Copyright Copyright @ 2016 by ICP DAS Co., Ltd. All rights are reserved. Trademark Names are used for identification purpose only and may be registered trademarks of their respective companies. Contact us If you encounter any problems while operating this device, feel free to contact us via mail at: service@icpdas.com. We guarantee to respond within 2 working days. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 4

1. Introduction The IoT (Internet of Things) has been a much discussed topic in recent years. Using the IoT concept, it is easy to integrate the environment of heterogeneous network and let all of the things into be digitized making life more convenient. In order to provide additional access to IoT applications related to industry based on the CAN bus, ICPDAS has developed a new Ethernet product, the ECAN-240. The ECAN-240 module is a Modbus TCP to 2-port CAN Bus Gateway. As its functionality, that provides communications via the Ethernet based on the Modbus TCP industrial protocol, meaning that the module can be easily integrated with an industrial network. The ECAN-240 module includes two CAN bus interfaces, meaning that more various CAN applications can be supported, such as a CAN bridge or a CAN message router. The CAN message router function means that the ECAN-240 module can be used to connect to four different CAN networks, ensuring they can communicate with each other. More details related to applications that can be implemented using the ECAN-240 module will be illustrated in sections 4-8. The ECAN-240 module has a fine abilities including anti-jamming and a wide operating temperature meaning that it can be used in harsh environments. The ECAN-240 module provides two rotary switches that are used to select Baud Rate for the CAN bus, which supports 10 kbps to 1 Mbps. The ECAN-240 module contains seven LED indicators, one is used to indicate the status of the power and the others are used to indicate the status of the CAN bus. The ECAN-240 module uses the RJ-45 standard communication interface to perform Ethernet transmission. The status of the Ethernet connection can be determined from the built-in indicators on the RJ-45 port. The ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 5

ECAN-240 module also supports an auto-negotiation function that enables different transmission speeds via the Ethernet. The ECAN-240 module is constructed with a metal-housing that provides a fully ventilated design, meaning that there are no problems with heat radiation. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 6

1.1. Features Hardware Supports input voltage 10~30VDC. Fully compatible with the ISO 11898-2 standard. Includes built-in DIP-switch the can be used to enable/disable the terminator resistor. Includes an RJ-45 Ethernet interface with auto-negotiation function. Includes two CAN bus interfaces with 9 pin D-sub connector. Includes two rotary switches for selection of CAN bus Baud Rate. Contains seven LED indicators, one as a power indicator and the others for monitoring CAN bus activity. Contains LED indicator on RJ-45 for Ethernet status. RoHS Design. Software Provides support for the CAN bus ID filter function. Provides support for the CAN bus bridge mode via configuration. Provides support for the CAN bus listen only mode via configuration. Provides support for a range of CAN bus Baud Rate from 10k bps to 1M bps adjustable via the rotary switch. Provides support for the Modbus TCP Client/Server function via configuration. Provides support for TCP/UDP pair connection function via configuration. Provides support for bootloader mode to enable firmware updates. Provides support for web configuration functions. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 7

1.2. Specification Module ECAN-240 CAN Bus Interface Channels 2 Connector 9-pin D-sub male Baud Rate 10k bps to 1M bps Terminator Resistor Built-in 120 ohm terminator resistor, enabled/disabled via DIP-Switch Isolation 3 kv VDC for DC to DC, 2500 Vrms for photo couple CAN Bus Specification ISO 11898-2 CAN 2.0A and CAN 2.0B Ethernet Controller 10/100Base-TX Ethernet Controller (Auto-negotiating, Auto_MDIX) Connector RJ-45 with Ethernet indictor Protocol Modbus TCP Client/Server, TCP, UDP, HTTP Socket connections 8 for TCP, 1 for UDP LED Indicator LED (Round) Power (1), CAN Bus Status (2), CAN Bus Tx (2), CAN Bus Rx (2) Ethernet LED Ethernet Status (RJ-45) (2) Power Power Supply Unregulated +10 ~ +30 VDC Protection Reverse polarity protection, Over-voltage brown-out protection Power Consumption (0.08) @24VDC, 2W Mechanical Installation DIN-Rail Dimension (W x L x H) 106.8mm x 146.8mm x 25.9mm Environment Operating -25 to +75 C Temperature Storage Temperature -40 to +80 C Relative Humidity 10 to 90% RH, Non-condensing ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 8

2. Getting Started Appearance 1 No. Description 2 3 4 5 1 LED indicators (7) 2 Ethernet Port with RJ-45 connector 3 CAN1 with 9-pin D-sub male connector 4 Terminator Resistor DIP-switches 5 CAN2 with 9-pin D-sub male connector 6 Power Connector(PWR, GND, F.G.) 7 CAN Bus Baud Rate Rotary Switch 7 6 Wire connections and pin assignments Pin Description 1 N/A 2 CAN Low 3 CAN Ground 4 N/A 5 N/A 6 CAN Ground 7 CAN High 8 N/A 9 N/A Pin Power GND F.G. Power F.G. GND Description Power, +10~+30VDC Power Ground Frame Ground ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 9

2.1. LED Indicator The ECAN-240 module provides seven LED indicators, including indicators for power status and CAN Bus status. The Following is an overview of the purpose and function of each LED indicator together with a description. LED Name LED Status LED Description Power (Red) ON The power of the module is ON ST1 (Red) ON CAN1 Bus is OFF (*Note) Flashing An error has occurred on CAN 1(*Note) ST2 (Red) ON CAN2 Bus is OFF (*Note) Flashing An error has occurred on CAN 2(*Note) TX1 (Green) Flashing A CAN message was successfully transmitted on CAN1 TX2 (Green) Flashing A CAN message was successfully transmitted on CAN2 RX1 (Green) Flashing A CAN message was successfully received on CAN1 RX2 (Green) Flashing A CAN message was successfully received on CAN2 *Note: The CAN Bus will be set to OFF if there are too many faults or if communication is interrupted. In this situation, the ECAN-240 module will automatically restore the Bus and the LED will be turned off. *Note: When CAN bus has some errors or CAN software buffer is overflow, the STx indicator will be flashing. The Ethernet status indicator on ECAN-240 is part of the built-in RJ-45 connector, such as shown in the figure below. LED Name LED Status LED Description ON 100 Mbps 10/100M OFF 10 Mbps or Ethernet disconnected. Link/Act Flashing Communicating ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 10

2.2. Rotary Switch The ECAN-240 module provides two rotary switches that are used to change CAN Bus Baud Rate for using the built-in configuration functions. The following is an overview of the purpose and function of each rotary switch position together with a description. CAN2_SW CAN1_SW CAN1_SW CAN2_SW Value Description 0 0 CAN Bus Baud Rate = 10 kbps. 1 1 CAN Bus Baud Rate = 20 kbps. 2 2 CAN Bus Baud Rate = 50 kbps. 3 3 CAN Bus Baud Rate = 80 kbps. 4 4 CAN Bus Baud Rate = 100 kbps. 5 5 CAN Bus Baud Rate = 125 kbps. 6 6 CAN Bus Baud Rate = 250 kbps. 7 7 CAN Bus Baud Rate = 500 kbps. 8 8 CAN Bus Baud Rate = 800 kbps. 9 9 CAN Bus Baud Rate = 1 Mbps. A A User-defined CAN Bus baud rate. B - E Reserved. B Load factory default IP, Mask, Gateway values and not save into EEPROM. C Module self-testing function. Tests the two F CAN Buses and the UDP broadcasting function. D Load all factory default values and saves them to the EEPROM. E Reserved. F Bootloader mode. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 11

2.3. Terminator Resistor In order to minimize the effects of reflection on the CAN Bus, the bus must be terminated using a terminator resistor at each end. According to the specifications given in ISO 11898-2, each terminator resistor should be 120Ω(or between 108Ω and 132Ω). The bus topology and the positions of these terminator resistors are shown below. The ECAN-240 module includes two CAN ports and terminator resistors are provided for each CAN port. The terminator resistor can be enabled or disabled via the terminator DIP-switches as illustrated in following figure. As indicated in the figure, when the DIP-switch is in the OFF position, the terminator resistor function is disabled. Similarly, when the DIP-switch is in the ON position, the terminator resistor function is enabled. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 12

3. Web Configuration The configuration for the module parameters or communication commands (in Modbus Client mode only) on the ECAN-240 module can be performed via a standard web browser using the embedded web configuration function. The web configuration functions are divided into several categories and includes basic configuration, CAN Bus configuration, Modbus configuration and pair connection configuration. The following is an overview of the process used to configure the ECAN-240 module via the web. The figure below is an illustration of the main screen for web configuration. On the left are the function buttons, including Overview, Basic Settings, CAN Basic Settings, CAN Filter Settings, Specific CAN ID Settings (Modbus TCP Server), Read Command Settings (Modbus TCP Client), Read Command Mapping(Modbus TCP Client), Write Command Settings (Modbus TCP Client), Pair Connection, Reboot, and Logout. Note: The browsers are supported, including IE 8, Chrome, Opera, Firefox(recommended). The influence of Temporary Internet File on IE 8 will lead to work abnormally during using web configuration function. Thus, please change the setting to every visit to the page The IE 11 and Microsoft Edge are not supported. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 13

3.1. Overview The Overview page shows details of the firmware version currently in use on the ECAN-240 module, as illustrated in the figure below. The Overview page also provides a description of each configuration function. The configuration web page can be accessed using either the function button or the link on Overwrite page. As illustrated below, each button is mapped to a link, meaning that there are two ways to access the configuration page. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 14

3.2. Basic Settings The Basic Configuration section provides the ability to set or adjust basic settings for the ECAN-240 module, including the network, communication, and timeout configuration parameters, etc, as illustrated in the figure below. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 15

The following is an overview of the parameters that can be found on the Basic Configuration page together with a description of each. Parameter Description Module Alias Used to specify recognizable name for the module. MAC Address Used to specify the Ethernet MAC address for the module. Note: the address is set by the manufacturer by default and cannot be modified. IP Address Used to specify the IP address for the module using the IPv4 protocol, and supports class A to E setting. Note: The IPv6 protocol is not supported on the ECAN-240 module. The default IP address is 192.168.255.1. Mask Address Used to specify the standard subnet mask for the module. Note: The default Mask address is 255.255.0.0. Gateway Address Used to specify the Gateway address for the module. Note: The default Gateway address is 192.168.255.2. Authentication Used to specify whether the authentication function is enabled or disabled. If the function is enabled, users attempting to access the web configuration portal will be redirected to the authentication page. Check the checkbox to enable the function. Note: If authentication fails, the web configuration function cannot be used. Login ID Used to specify the authentication login ID. Password Used to specify the authentication password. Enable DHCP Used to enable or disable the DHCP function. Check the checkbox to enable the function. Note : when using this function, the IP, Mask, Gateway settings will be inactive. Client Connection Used to specify the Client Connection Timeout value. When the Timeout ECAN-240 module is set to act as a Server, the value will be used to calculate the timeout value if the Client either malfunctions or if its operation is terminated abnormally. If timeout, the ECAN-240 will be terminated the connection Server Used to specify the Server Reconnection Timeout value. When the Reconnection ECAN-240 module is set to act as a Client, this value will be used to Timeout calculate the timeout value and reconnect the server automatically if the Server either malfunctions or if its operation is terminated abnormally. Communication Used to specify the communication mode to be used. Seven Mode communication modes are provided on the ECAN-240 module. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 16

Details related to the application of each communication mode can be found in Sections 4 to 8. Remote Connection IP Address Modbus Node ID Response Timeout Send CAN Interval Error Response CAN ID Enable Error Response Passively Send CAN Message Save Basic Configuration Used to specify the IP address of a remote device which the ECAN-240 module need to connect. This parameter is used when the ECAN-240 module is acting as a Client. Used to specify the Modbus Node ID when the ECAN-240 module is acting as a Modbus TCP Server. Used to specify a timeout value for Modbus TCP commands. This parameter is used when the ECAN-240 module is operating in Modbus TCP Client mode. Used to specify the CAN message transmission interval. This parameter is used when the ECAN-240 module is operating in Modbus TCP Client mode. Used to specify the CAN ID to be included in a CAN message that is transmitted when the ECAN-240 module receives an error from the Modbus TCP. This function is used when the ECAN-240 module is operating in Modbus TCP Client mode. Used to enable or disable the Error Response function. This function is used in combination with the Error Response CAN ID function and is only used when the ECAN-240 module is operating in Modbus TCP Client mode. Check the checkbox to enable the function. Used to enable or disable the Passively Send CAN Message function. By default, CAN messages are sent actively based on the Send CAN Interval value. This function is only used when the ECAN-240 module is operating in Modbus TCP Client mode. Check the checkbox to enable the function. Used to save the basic configuration to the EEPROM. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 17

3.3. CAN Bus Settings 3.3.1. Basic CAN Settings The Basic CAN Settings page is used to configure the user-defined CAN Bus parameters, including CAN Baud Rate, as well as enabling or disabling Listen Only mode. The following is an overview of the parameters that can be found on the Basic CAN Settings page, together with a description of each. Parameter Description Bit Timing Value Used to specify the bit timing value. It is an optimum value. The ECAN-240 module will use this value to calculate a approximate (actual) bit timing. Sample Point (%) Used in the calculation of the CAN Baud Rate. The sample point is located at the specified percentage of the CAN waveform, and defines the error tolerance for the CAN message. Four selection ranges are provided: Actual Bit Timing Value Enable Listen Only Mode Generate Save CAN Configuration Used to specify the real bit timing value after calculating the bit timing parameters. The ECAN-240 module will use this value to communicate with other CAN devices. Used to enable or disable Listen Only mode. Check the checkbox to enable the function. Used to generate a actual bit timing value. Used to save the CAN configuration to the EEPROM. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 18

3.3.2. CAN Filter Settings The CAN ID filter function on the ECAN-240 module allows messages form specific CAN IDs to be received from the CAN network. Five fields can be configured on the CAN Filter Settings page, including the CAN Port, the CAN Specifications, Single/Group selection, and the CAN ID range. The following is an overview of the parameters that can be found on the CAN Filter Settings page, together with a description of each. Parameter Description Add New Rule Used to add a new rule to the CAN Filter table CAN Port Used to specify a CAN port where the CAN ID is to be filtered. CAN Specification Used to specify whether the ID filter is based on either the CAN 2.0A or the CAN 2.0B specification. Single/Group Used to specify whether the filter is based on either a Single or a Group ID. CAN ID Range 1 Used to specify the range of CAN ID values to be filtered. Two fields CAN ID Range 2 are used to set the CAN ID value range. When the Single/Group parameter is set as Single Mode, the values specified in the two range fields will be the same, meaning that a single CAN ID will be filtered. For example, if the CAN ID Range is set as 0x000 to 0x000, it means that only messages from CAN ID 0x000 will be received from the CAN network, and all other messages will be blocked by the module. When the Single/Group parameter is set as Group Mode, the values specified in the two range fields will be the first and last values of a sequential range of CAN IDs. For example, if the CAN ID Range is set as 0x001 to 0x003, it means that only messages from CAN IDs in the range of 0x001 to 0x003 will be received from the CAN network, and all other messages will be blocked by the ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 19

Delete Save CAN Configuration module. Used to delete a rule from the CAN Filter table. Used to save the CAN filter configuration to the EEPROM. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 20

3.4. Modbus TCP Server 3.4.1. Specific CAN ID Settings The Specific CAN ID Settings function is only used when the ECAN-240 module is operating in Modbus TCP Server mode. In general, the ECAN-240 module will store the I/O data in a ring buffer when a CAN message is received, and then the Modbus address is used to retrieve the I/O data. If a specific CAN ID table is configured, the ECAN-240 module will identify the CAN ID from the specific CAN ID table and then store the IO data in the relevant buffer after finding the same CAN ID from specific CAN ID table. The CAN message in this specific buffer will be overwritten when received the same CAN ID message. Note: About the Modbus address table, please refer to the next section. The following is an overview of the parameters that can be found on the Specific CAN ID Settings page, together with a description of each. Parameter Add New ID CAN Port CAN Specification CAN ID Delete Save CAN Configuration Description Used to add a new CAN ID to the CAN ID table. Used to specify the CAN port that owns this specific CAN ID. Used to specify whether the ID settings are based on the CAN 2.0A or the CAN 2.0B specification. Used to specify the CAN ID value. Used to delete a specific CAN ID from the CAN ID table. Used to save a specific CAN ID configuration to the EEPROM. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 21

3.5. Modbus TCP Client Three kinds of settings for the Modbus TCP Client function are available, including the Read Command Settings, Read Command Mapping, and Write Command Settings, which will be discussed in more detail in section 3.4.1 to 3.4.3 below. 3.5.1. Modbus Read Command Settings The Modbus Read Command function is only used when the ECAN-240 module is operation in Modbus TCP Client mode. These commands support Modbus Function codes 0x01 to 0x04. When using Modbus Read Command, the ECAN-240 module will store the returned data in specific memory blocks(the Read Memory Space), and then respond using CAN messages, as illustrated in the following figure. The following is an overview of the parameters that can be found on the Modbus Read Command Settings page, together with a description of each. Parameter Add New Rule CAN Port Slave Node ID Description Used to add a new Modbus Read Command rule to the Modbus Read Command list. Used to specify the CAN port that will be used to send the response with the return value. Used to specify the node ID for the Modbus TCP device. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 22

Function Code Start Address (High) Start Address (Low) Bit/Word Count (High) Bit/Word Count (Low) Delete Save Modbus TCP Client Configuration Used to specify the Modbus Function Code. The ECAN-240 module supports function codes 0x01 to 0x04. Used to specify the high byte of the Modbus start address. Used to specify the low byte of the Modbus start address. Used to specify the high byte of the Bit/Word count. Note: The exact settings for the Bit/Word Count depends on the function code. If the function code is 0x01 or 0x02, this parameter will be set to Bit Count. If the function code is 0x03 or 0x04, it will be set to Word Count. Used to specify the low byte of the Bit/Word count. Note: The exact settings for the Bit/Word Count depends on the function code. If the function code is 0x01 or 0x02, this parameter will be set to Bit Count. If the function code is 0x03 or 0x04, it will be set to Word Count. Used to delete a specific rule from the Modbus Read Command list. Used to save a specific Modbus Read Command to the Flash memory. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 23

3.5.2. Modbus Read Command Mapping The Modbus Read Command Mapping function is only used when the ECAN-240 module is operating in Modbus TCP Client mode. Its major purpose of the function is to map the relationship between the I/O data and the CAN messages. When using the Modbus Read Command Mapping function, the ECAN-240 module will load the I/O data to the CAN data field from the read memory space and then send a CAN message. The following is an overview of the parameters that can be found on the Modbus Read Command Mapping page, together with a description of each. Parameter Add New Rule CAN Port CAN Specification CAN ID Byte Count (High) Memory Start Address Delete Save Modbus TCP Client Configuration Description Used to add a new Read Command Mapping configuration rule to the list. Used to specify the CAN port that will be used to send the response with the return value. Used to specify whether the ID settings are based on the CAN 2.0A or the CAN 2.0B specification. Used to specify the CAN ID value that will be used to send the response. Used to specify the length of the I/O data. Note: this value cannot be greater than 8 bytes, because the maximum data length for a CAN message is 8 bytes. Used to specify the start address of the read memory space, and is used for I/O data and CAN message mapping. Used to delete a specific rule from the Modbus Read Command Mapping configuration list. Save Modbus Read Command Mapping into Flash. Used to save a specific Read Command Mapping configuration to the flash memory ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 24

3.5.3. Modbus Write Command Settings The Modbus Write Command Settings function is only used when the ECAN-240 modules in operating in Modbus TCP Client mode. These commands support Modbus Function codes 0x05, 0x06, 0x0F, and 0x10. The Modbus Write Command Settings interface includes a CAN ID field that is used to a map the relationship between specific memory blocks(write memory space) and the CAN messages, as illustrated in the following figure. By using the CAN ID, the ECAN-240 module is able to send a Modbus Write Command containing a variety of data after it receives a CAN message. The following is an overview of the parameters that can be found on the Write Command Settings configuration page, together with a description of each. Parameter Add New Rule CAN Port CAN Specification CAN ID Slave Node ID Function Code Start Address (High) Start Address (Low) Bit/Word Count Description Used to add a new Modbus Write Command rule into to the Modbus Write Command list. Used to specify the CAN port that will be used to receive the CAN data. Used to specify whether the ID settings are based on the CAN 2.0A or the CAN 2.0B specification. Used to specify the CAN message ID that will be used to map the relationship. Used to specify the node ID for the Modbus TCP device. Used to specify the Modbus function code. The ECAN-240 module supports function codes 0x05, 0x06, 0x0F, and 0x10. Used to specify the high byte of the Modbus start address. Used to specify the low byte of the Modbus start address. Used to specify the high byte of the Bit/Word count. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 25

(High) Bit/Word Count (Low) Delete Save Modbus TCP Client Configuration Note: The exact settings for the Bit/Word Count depends on the function code. If the function code is 0x01 or 0x02, this parameter will be set to Bit Count. If the function code is 0x03 or 0x04, it will be set to Word Count. Used to specify the low byte of the Bit/Word count. Note: The exact settings for the Bit/Word Count depends on the function code. If the function code is 0x01 or 0x02, this parameter will be set to Bit Count. If the function code is 0x03 or 0x04, it will be set to Word Count. Used to delete a specific rule from the Modbus Write Command list. Used to save a specific Modbus Write Command to the Flash memory. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 26

3.6. Pair Connection Settings The Pair Connection Settings function is used to configure the router path. As the ECAN-240 module contains two CAN ports, a router table is used to connect two ECAN-240 modules located at different ends of a CAN network. A more detailed illustration of the function will be described in Section 6. The following is an overview of the parameters that can be found on the Pair Connection Settings page, together with a description of each. Parameter Description CAN Port1 to Remote Used to specify the remote CAN port that will be connected to CAN port1 on the ECAN-240 module. CAN Port2 to Remote Used to specify the remote CAN port that will be connected to CAN port2 on the ECAN-240 module. Note: The ECAN-240 module supports two connection methods, one-to-one and one-to-all. For example: Pair Connection Transmission Interval Save Pair Connection Configuration This means that the local CAN port 1 can be connected to either CAN port 1 on the remote device or all CAN ports. Used to specify the transmission interval. Note: While the ECAN-240 module received messages from CAN side until 1400 bytes, and then sent via Ethernet. If not enough 1400 bytes, the ECAN-240 will wait for the transmission interval timeout and then send. Used to save the Pair Connection configuration to the EEPROM. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 27

3.7. Other Functions Reboot Click the Reboot button to reboot the module. After clicking the button, close the browser or the browser tab containing the web configuration page. Logout If the Authentication function is enabled, clicking this button will log the user out from the web configuration page. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 28

4. Modbus TCP Server Applications The Modbus TCP Server function is used to implement communications between a CAN device and a Modbus TCP Client. When the ECAN-240 module is acting as a Modbus TCP Server, the Modbus TCP Client needs to use Modbus commands based on the CAN format in order to access the ECAN-240 module. The ECAN-240 module will then translate these commands into CAN format messages and send them to the CAN networks. Similarly, when a CAN format message is received from the CAN network, the ECAN-240 translates the message into Modbus format, which can then be accessed using a Modbus command. As illustrated below, the data pool can be considered as a ring buffer that can store up to 200 records. If this maximum is exceeded, the ECAN-240 module will overwrite the oldest record. The ECAN-240 module also provides an additional buffer that can be used to store messages based on specific CAN ID. The maximum is 100 records can be stored. The functionality of this buffer is slightly different in that. The message in this buffer will be overwritten based on the specific CAN ID. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 29

The ECAN-240 module supports Modbus function codes 0x03, 0x04, 0x06, and 0x10, as indicated in the table below. Function Code Function Name Description 3 (03 Hex) Read Output Register Used to read multiple output registers when sending a CAN message. 4 (04 Hex) Read Input Register Used to read multiple input registers when receiving a CAN message 6 (06 Hex) Write Output Register Used to write single output registers for sending a CAN message 16 (10 Hex) Write Multiple Registers Used to write multiple registers for sending a CAN message ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 30

4.1. Modbus Address Mapping The memory on the ECAN-240 module is divided into two parts, depending on the purpose, and includes the Input Register and the Output Register to match the needs of Modbus TCP Server applications. 4.1.1. Input Register The major purpose of the Input Register is used for reading CAN messages. Since the ECAN-240 contains two CAN ports, the Input Register is divided to two sections, one for each CAN port. The ECAN-240 module also provides the ability to read the status of the module using Modbus commands. The following figures provide an overview of the address allocation for the Input Register. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 31

CAN1/CAN2 Rx memory addresses Protocol Addresses (Base 0) PLC Addresses (Base 1) Word Count Description Decimal rule (CAN1) 00000 ~ 00008 30001 ~ 30009 9 CAN1 Rx Message #001 00009 ~ 00017 30010 ~ 30018 9 CAN1 Rx Message #002 01782 ~ 01790 31783 ~ 31791 9 CAN1 Rx Message #199 01791 ~ 01799 31792 ~ 31800 9 CAN1 Rx Message #200 Decimal rule (CAN2) 04096 ~ 04104 34094 ~ 34104 9 CAN2 Rx Message #001 04105 ~ 04113 34105 ~ 34113 9 CAN2 Rx Message #002 05878 ~ 05886 35878 ~ 35886 9 CAN2 Rx Message #199 05887 ~ 05895 35887 ~ 35895 9 CAN2 Rx Message #200 Addresses for specific CAN1/CAN2 Rx messages Protocol Addresses (Base 0) PLC Addresses (Base 1) Word Count Description Decimal rule (CAN1) 01900 ~ 01908 31901 ~ 31909 9 CAN1 specific Rx Message #001 01909 ~ 01917 31910 ~ 31918 9 CAN1 specific Rx Message #002 02781 ~ 02790 32782 ~ 32791 9 CAN1 specific Rx Message #99 02791 ~ 02799 32792 ~ 32800 9 CAN1 specific Rx Message #100 Decimal rule (CAN2) 05996 ~ 06004 35997 ~ 36005 9 CAN2 specific Rx Message #001 06005 ~ 06013 36006 ~ 36014 9 CAN2 specific Rx Message #002 06877 ~ 06886 36878 ~ 36887 9 CAN2 specific Rx Message #99 06887 ~ 06895 36888 ~ 36896 9 CAN2 specific Rx Message #100 ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 32

Module status addresses Protocol Addresses (Base 0) PLC Addresses (Base 1) Word Count Description Decimal rule (CAN1) 02900 32901 1 CAN1 Rx message count 02901 32902 1 CAN1 Baud Rate configuration 02902 ~ 02903 32902 ~ 32903 2 User-defined Baud Rate configuration for CAN1 02904 32905 1 CAN1 status register 02905 32906 1 CAN1 error count 02906 32907 1 CAN1 overflow 02907 32908 1 CAN2 Rx message count 02908 32909 1 CAN2 Baud Rate configuration 02909 ~ 02910 32910 ~ 32911 2 User-defined Baud Rate configuration for CAN2 02911 32912 1 CAN2 status register 02912 32913 1 CAN2 error count 02913 32914 1 CAN2 overflow 02914 32915 1 Ethernet status 02915 32916 1 Firmware version 02916 ~ 02919 32917 ~ 32920 4 Module Name 02920 ~ 02922 32927 ~ 32923 3 Manufacturer CAN status register Bit Number Description 7 Bus Status (0: Bus-On, 1: Bus-Off). 6 Error Status (0: no error, 1: error). 5 Transmit Status (0: idle, 1: transmit). 4 Receive Status (0: idle, 1: receive). 3 Transmit Complete Status (0: incomplete, 1: complete). 2 Transmit Buffer Status (0: locked, 1: released). 1 Data Overrun Status (0: absent, 1: overrun). 0 Receive Buffer Status (0: empty, 1: full). ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 33

Ethernet status Bit Number Description 15 100M Full Duplex (0: non-used, 1: used). 14 100M Half Duplex (0: non-used, 1: used). 13 10M Full Duplex (0: non-used, 1: used). 12 10M Half Duplex (0: non-used, 1: used). 6-11 Reserved 5 Auto-negotiation Complete (0: incomplete, 1: complete) 3 4 Reserved 2 Link Status (0: Link-Off, 1: Link-On) 0-1 Reserved ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 34

4.1.2. Output Register The major purpose of the output register is for writing CAN messages. Since the ECAN-240 module contains two CAN ports, the Output Register is divided to two sections, one for each CAN port. ECAN-240 also provides the ability to control the module using Modbus commands. The following figures provide an overview of the address allocation for the Output Register. CAN1/CAN2 Tx message addresses Protocol Addresses PLC Addresses (Base 0) (Base 1) Decimal rule (CAN1) Word Description Count 00000 ~ 00006 40001 ~ 40007 7 CAN1 Tx Message Decimal rule (CAN2) 00016 ~ 00022 40017 ~ 40023 7 CAN2 Tx Message Addresses for specific settings commands Protocol Addresses (Base 0) PLC Addresses (Base 1) Word Count Description Decimal rule (CAN1) 00256 ~ 0257 40257 ~ 40258 2 Modbus Command (Configuration) The Modbus Command (Configuration) includes the Reboot Module and Reset CAN bus functions. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 35

Reboot Module This function is used to reboot the ECAN-240 module using Modbus command. After sending the request command, the module will respond with a message indicating that the request was successful. Request command: Field Name Size Valid Value Range Example Hexadecimal rule Node ID 1 byte 0x01 to 0xF7 0x01 Function Code 1 byte 0x10 0x10 Start Address 2 bytes 0x0100 0x0100 Word Count 2 bytes 0x0002 0x0002 Byte Count 1 byte 0x04 0x04 Data-1 2 bytes 0x0001 0x0001 Data-2 2 bytes 0x0001 0x0001 Response: Field Name Size Valid Value Range Example Hexadecimal rule Node ID 1 byte 0x01 to 0xF7 0x01 Function Code 1 byte 0x10 0x10 Start Address 2 bytes 0x0100 0x0100 Word Count 2 bytes 0x0002 0x0002 Reset CAN bus This function is used to reset the CAN bus via a Modbus command. After sending the request command, the module will respond with a message indicating that the request was successful. Request command: Field Name Size Valid Value Range Example Hexadecimal rule Node ID 1 byte 0x01~0xF7 0x01 Function Code 1 byte 0x10 0x10 Start Address 2 bytes 0x0100 0x0100 Word Count 2 bytes 0x0002 0x0002 Byte Count 1 byte 0x04 0x04 Data-1 2 bytes 0x0001 0x0001 Data-2 2 bytes 0x0002 0x0001 ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 36

Response: Field Name Size Valid Value Range Example Hexadecimal rule Node ID 1 byte 0x01 to 0xF7 0x01 Function Code 1 byte 0x10 0x10 Start Address 2 bytes 0x0100 0x0100 Word Count 2 bytes 0x0002 0x0002 Note: This command will clear CAN error status and software buffer overflow status. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 37

4.2. Structure of CAN message in Modbus commands In order to enable data exchange between the CAN bus and Modbus, the ECAN-240 module provides CAN data format in a standard Modbus command. The CAN data format in Modbus commands is divided to two parts, Read CAN message format and Write CAN message format. Read Command Format: Word Number Description 1 Bit 15: 0 = valid data, 1 = invalid data Bit 6~14: Reserved Bit 5: CAN Specification, 0 = 2.0A, 1 = 2.0B Bit 4: RTR, 0 = No, 1 = Yes Bit s 0-3: Data length, value = 0-8 2 Most significant two bytes of the CAN identifier. (Big-endian) 3 Least significant two bytes of the CAN identifier. (Big-endian) 4 The Data 1 and Data 2 elements from the CAN data field. 5 The Data 3 and Data 4 elements from the CAN data field. 6 The Data 5 and Data 6 elements from the CAN data field. 7 The Data 7 and Data 8 elements from the CAN data field. 8 Most significant two bytes of the RX timestamp message. (Big-endian) 9 Least significant two bytes of the RX timestamp message. (Big-endian) Write Command Format: Word Number Description 1 Bit 6-15: Reserved Bit 5: CAN Specification, 0 = CAN 2.0A, 1 = CAN 2.0B Bit 4: RTR, 0 = No, 1 = Yes Bit 0-3: Data length, value = 0-8 2 Most significant two bytes of the CAN Identifier. (Big-endian) 3 Least significant two bytes of the CAN Identifier. (Big-endian) 4 The Data 1 and Data 2 elements from the CAN data field. 5 The Data 3 and Data 4 elements from the CAN data field. 6 The Data 5 and Data 6 elements from the CAN data field. 7 The Data 7 and Data 8 elements from the CAN data field. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 38

4.3. Modbus Command Examples The following is an illustration of how to use Modbus commands to read or write CAN messages and configure the ECAN-240 module. 4.3.1. Reading a CAN message via a Modbus command Refer to the figure for details of how to use function code 0x04 to read a single CAN message. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 39

Refer to the figure for details of how to use function code 0x04 to read two CAN messages. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 40

4.3.2. Reading a CAN message containing a specific CAN ID via a Modbus command Refer to the figure for details of how to use function code 0x04 to read a single CAN message that contains a specific CAN ID. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 41

4.3.3. Reading a CAN message that has been sent via a Modbus command Refer to the figure for details of how to use function code 0x03 to read a CAN message that has been sent via a Modbus command. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 42

4.3.4. Reading the status of a module via a Modbus command Refer to the figure for details of how to use function code 0x04 to read the status of a module. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 43

4.3.5. Writing a CAN message via a Modbus command There are two ways to write a CAN message, including using function codes 0x06 and 0x10. Using function code 0x06: The following is a step-by-step illustration of how to send a CAN message via function code 0x06. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 44

ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 45

Using function code 0x10: Refer to figure for details of how to use function code 0x10 to write a CAN message. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 46

4.4. Modbus Exception Codes The following is an overview of the Modbus Exception codes that are supported by the ECAN-240 module. Code Description Possible causes & solutions 1 Illegal function The function code is not supported by the ECAN-240 module. 2 Illegal Data Address The data address does not exist on the ECAN-240 module. 3 Illegal Data Value The number of registers or the byte count value is not valid, or no CAN message details are stored in the Normal CAN Message field on the ECAN-240 module. 6 Slave Device Busy A transmission buffer overrun has occurred. The message should be retransmitted at a later time once the status of the module has returned to normal. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 47

5. Modbus TCP Client Applications The Modbus TCP Client function is used to implement communications between a CAN Bus and a Modbus TCP Server. When the ECAN-240 module is acting as a Modbus TCP Client, it can access the Modbus TCP Server via the command configuration. When the ECAN-240 module receives I/O data, it will forward it to the remote CAN devices for analysis, control, or other operations. Once configured, the ECAN-240 module is also able to access the Modbus TCP Server via a CAN message. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 48

5.1. Supported Modbus Function Codes The Modbus TCP Client function supports Modbus function codes 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x0F, and 0x10, as indicated in the table below. Modbus Command Modbus Read Command Modbus Write Command Function Code Function Name Description 1 (01 Hex) Read Coil Status Used to read the status of a coil from a Modbus TCP Server device. 2 (02 Hex) Read Input Status Used to read the status of the input from a Modbus TCP Server device. 3 (03 Hex) Read Holding Registers Used to read Holding Registers from a Modbus TCP Server device. 4 (04 Hex) Read Input Registers Used to read the registers of the input from a Modbus TCP Server device. 5 (05 Hex) Write Single Coil Used to write to a single coil on a Modbus TCP Server device. 6 (06 Hex) Write Signal Register Used to write to a single register on a Modbus TCP Server device. 15 (0F Hex) Write Multiple Coil Used to write to multiple coils on a Modbus TCP Server device. 16 (10 Hex) Write Multiple Registers Used to write to multiple registers on a Modbus TCP Server device. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 49

5.2. I/O Memory Size The ECAN-240 module provides a memory block that can be used for data exchange via Modbus TCP Client function. Each CAN port provides a total of 2048 bytes of memory space for transmission and reception, where the available space is 1024 bytes for each. For more information related to the operation of the transmission and reception memory blocks, refer to Sections 3.5. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 50

5.3. Error Response The ECAN-240 Module allows error response messages over CAN Bus via error response settings. The Error Response CAN ID is used to specify the CAN ID of the error response messages. Once the error response function is enabled, a CAN message will be returned whenn the ECAN-240 encounters a Modbus error. The following describes the format and definition of the CAN error response message. CAN Error Response Message Format CAN ID Length Byte 0 Bytes 1-3 Bytes 4-6 Byte7 Error Response 8 Identifier Code Reserved Modbus Reserved CAN ID Exception The Identifier Code in Data Byte0 is divided into four types Identifier Code 0x00 0x01 0x02 0x03 Description Reserved This code indicates that the current Modbus command has been completely transmitted, but the ECAN-240 module has received the wrong Node ID command. This code indicates that the current Modbus command has been completely transmitted, but the ECAN-240 module has not received any response command. This code indicates that the current Modbus command has been completely transmitted, but the ECAN-240 module has received a Modbus Exception command. Data Bytes 4 to 7 indicate the Modbus Exception message, which includes the Slave Node ID, the Exception Function Code, and the Exception Code. If the Identifier code is 0x03, this message will be shown in the CAN error response message. Otherwise, these data value will be 0x00. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 51

Modbus Exceptions Byte4 Byte5 Byte6 Byte7 Slave Node ID Exception Function Code Exception Code Reserved Relationship between the Function Code and Exception Function Code Function Code (Hex) 0x01 0x02 0x03 0x04 0x05 0x06 0x0F 0x10 Exception Function Code (Hex) 0x81 0x82 0x83 0x84 0x85 0x86 0x8F 0x90 Modbus Exception Code For more information related to Modbus Exception Code, refer to the Modbus protocol specifications. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 52

6. Pair Connection Applications The pair connection function is used to implement communication between two ends of CAN network. CAN Network #1 can communicate with CAN Network #3 or CAN Network #4 using pair connection configuration (for details of the router table, refer to Section 3.6). Similarly, CAN Network #2 can also communicate with CAN Network #3 or CAN Network #4 in the same manner. The pair connection function on the ECAN-240 module is implemented via either the TCP or the UDP protocol. When using the TCP protocol, the application architecture will be one-to-one, as illustrated in the application diagram below. When using the UDP protocol, the application architecture will be either one-to-one or one-to-many (UDP broadcast), as illustrated in the application diagram below. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 53

Note: When using UPD protocol, be aware that some routers will block the transmission of UPD packets to the Internet. The Transparent option is to see as a half-pair connections. The TCP/UDP packet is in CAN format and contains the CAN ID. TCP uses port 10003 and UDP uses port 57540. This is useful because it allows custom TCP/UDP programs to be developed that can directly access the ECAN-240 module for specific applications. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 54

7. Listen Only Application The Listen Only function is used for listening to CAN Bus communications between two CAN networks. After enabling the Listen Only function and rebooting the module, the CAN Bus on the ECAN-240 module will be set to Listen Only mode, meaning that the ECAN-240 module will not be able to send any messages to the CAN Bus. On the Ethernet side of the connection, the ECAN-240 module acts as a Modbus TCP Server and can be accessed using Modbus TCP commands. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 55

8. Bridge Mode Applications Bridge Mode is a special function that allows two CAN networks to communicate with each other via the ECAN-240 protocols. At this time, the ECAN-240 module acts as a Modbus TCP Server and CAN messages can be transmitted between two CAN modules using Modbus TCP commands. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 56

Appendix A Firmware Update The firmware on the ECAN-240 module can be updated via CAN devices produced by ICP DAS. The latest firmware file ( *.fw ) and the latest version of the Firmware Updata utility, FW_Update_CAN_vX.XX.exe (where X denotes the utility version), are available from the FTP link below. A notification will not be sent when a new version is released. ftp://ftp.icpdas.com/pub/cd/fieldbus_cd/can/gateway/ecan-240/firmware ftp://ftp.icpdas.com/pub/cd/fieldbus_cd/can/gateway/ecan-240/software/update_tool Follow the process described below to update the firmware for the ECAN-240 module using the ICP DAS Firmware Update utility. Step 1: Move the two rotary switches to the 0xF position (Bootloader mode) and reboot the module. Once the ECAN-240 module has rebooted, all the LEDs on the module will be flashing. Step 2: Run the Firmware Update utility, FW_Update_CAN_vX.XX.exe (where X denotes the utility version). [1] CAN devices: The firmware on the ECAN-240 module can be updated by using ICP DAS CAN products indicated below and Firmware Update utility. (1) RS232 to CAN : I-7530(A). (2) Ethernet to CAN: I-7540D. (3) USB to CAN: I-7565, I-7565-H1, and I-7565-H2. (4) CAN Card: PISO-CM100(U), PISO-/PCM-/PEX-CAN200 and CAN400. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 57

Before updating the firmware, the following parameters needs to be set on the utility. (1) Select the CAN hardware device. (2) Set the Dev_Port or Board_ID (for CAN cards only). (3) Set the CAN_Port number. (4) Connect to CAN Port 1 of the ECAN-240 module. [2] Download the Firmware: (1) Click the Browser button to select the location of the firmware file. The name of the firmware file will be ECAN-240_vXXX.fw (where X denotes the firmware version). (2) Click the Start Firmware Download button to being the firmware update process. While the firmware is being updated, a progress bar will be displayed in the utility to indicate the status of the update process. Once the firmware has been successfully updated, a notification will be displayed. ECAN-240 (Modbus TCP to 2-port CAN Bus Gateway) User Manual, Version 1.0.0 Page: 58