41 Modbus Gateway. Westermo RFI-219-F4G-T7G, Viper-212A-T5G-P8-HV, RFI-219-F4G-T7G-F8, RFI-211-F4G-T7G, L106-F2G, Viper-212A, L205-S1, Viper-112A-T5G, L110-F2G, Viper-112A-T3G


Add to my manuals
1088 Pages

advertisement

41 Modbus Gateway. Westermo RFI-219-F4G-T7G, Viper-212A-T5G-P8-HV, RFI-219-F4G-T7G-F8, RFI-211-F4G-T7G, L106-F2G, Viper-212A, L205-S1, Viper-112A-T5G, L110-F2G, Viper-112A-T3G | Manualzz

Westermo OS Management Guide

Version 4.22.0-0

Chapter 41

Modbus Gateway

This chapter describes the Modbus Gateway application available on WeOS products equipped with a serial port. The Modbus Gateway is used for interconnecting a Modbus/TCP network with a Modbus/RTU or a Modbus/ASCII network.

The Modbus Gateway has two operational modes, server and client:

ˆ Server: 1

Allowing one or many Modbus/TCP masters to connect to one or many serial Modbus slaves. In this mode the gateway acts as Modbus/TCP slave on the TCP/IP side and a Modbus Master on the serial side. All incoming

Modbus/TCP requests are converted into either Modbus/RTU or Modbus/ASCII requests on the serial side.

1

In server mode, the Modbus Gateway acts as a server on the TCP/IP side (TCP Server).

1014 © 2017 Westermo Teleindustri AB

Westermo OS Management Guide

Version 4.22.0-0

ˆ Client: 2

Allowing one serial Modbus Master to connect to one or many Modbus/TCP slaves. In this mode the Gateway acts as a Modbus Master on the

TCP/IP side and a Modbus Slave on the serial side. All Modbus/RTU requests

(or Modbus/ASCII requests) on the serial side are converted into Modbus/TCP requests on the TCP/IP side.

2

In client mode, the Modbus Gateway acts as a client on the TCP/IP side (TCP Client).

© 2017 Westermo Teleindustri AB 1015

Westermo OS Management Guide

Version 4.22.0-0

41.1

Managing Modbus Gateway via the web interface

The Web interface provides configuration of all Modbus Gateway Settings.

41.1.1

Modbus Gateway Overview

Menu path: Configuration Serial Modbus

If no Modbus Gateway is configured, click the New button to create a Modbus

Gateway and you will be presented to the edit page described in

section 41.1.2

.

Otherwise, the Modbus Gateway will be presented in a short overview.

1016 © 2017 Westermo Teleindustri AB

Westermo OS Management Guide

Version 4.22.0-0

41.1.2

Edit Modbus Gateway Settings

Menu path: Configuration Serial Modbus ⇒ New

Menu path: Configuration Serial Modbus

Configuration of Modbus Gateway in Server Mode

Modbus settings common to Client and Server Modes

Gateway Mode

Serial Port

Configures the Modbus Gateway mode: (TCP) Server or (TCP) Client

Selects the Serial Port

Serial Protocol

RTU Interval

Configures Serial protocol (RTU or ASCII)

Configures the RTU-interval if RTU is selected as serial protocol.

ASCII Timeout Configures the ASCII timeout if ASCII is selected as serial protocol.

Response Timeout Configures the Response timeout

Error Check Enables or disables CRC/LRC error check

Continued on next page

© 2017 Westermo Teleindustri AB 1017

Westermo OS Management Guide

Version 4.22.0-0

Exceptions

Continued from previous page

Configures Modbus Exceptions. With Modbus Exceptions enabled, the Modbus Gateway will react upon and respond to certain error conditions, e.g., if a Gateway in client mode receives a (serial) Modbus message addressed to Modbus unit not found in its Map table. If exception handling is desired, except for this particular situation, the gateway can be configured to ignore exceptions for unknown units.

Modbus Server specific settings

Listen interface

Poll Interval

Inactivity Timeout

Broadcast Delay

Redirect

Redirect Broadcast

Request Queue

Configures the listen Interface and port.

Configures the Poll Interval

Configures the Inactivity timer

Configures the Broadcast delay

Configures the Modbus Address redirection

Enables/Disables redirect of Modbus broadcasts

Enables/Disables the Request Queue

Configuration of Modbus Gateway in Client Mode

Modbus Client specific settings

Map table Configures the mapping of Modbus unit number to IP address and TCP port number of Modbus/TCP slaves.

1018 © 2017 Westermo Teleindustri AB

Westermo OS Management Guide

Version 4.22.0-0

41.1.3

Modbus Gateway Status Page

Menu path: Status Serial Modbus

Gateway Mode Current operation mode of the gateway,

Server or Client.

Serial Port

Serial Protocol

The serial port in use.

Serial protocol, RTU or ASCII.

Listen Interface Listen interface and port (only in server mode).

Active connections This list shows active and open sessions. The gateway can only handle 16 open TCP sessions; if a new connection is needed, the oldest session will be closed.

Auto Refresh Click on a value to make the page reload with updated statistics automatically every 5, 15,

30 or 60 seconds. Click Off to turn off auto refresh.

Refresh Click on this button to reload with updated statistics.

© 2017 Westermo Teleindustri AB 1019

Westermo OS Management Guide

Version 4.22.0-0

41.2

Managing Modbus Gateway via the CLI interface

The table below shows Modbus Gateway management features available via the

CLI.

Command Default Section

Configure Modbus Gateway settings

[no] modbus

[no] enable

[no] mode <server|client>

[no] port <SERIAL-PORT>

Section 41.2.1

Enabled

Section 41.2.2

server

Section 41.2.3

Disabled

Section 41.2.4

[no] serial-protocol <rtu|ascii> rtu

Section 41.2.5

[no] listen iface <IFNAME|any> [port <PORT>] Any:502

Section 41.2.6

[no] ascii-timeout <MILLISECONDS>

[no] rtu-interval <MILLISECONDS>

[no] poll-interval <MILLISECONDS>

[no] error-check

1000

50

50

Enabled

Section 41.2.7

Section 41.2.8

Section 41.2.9

Section 41.2.10

[no] inactivity-timeout <SECONDS>

[no] response-timeout <MILLISECONDS>

[no] broadcast-delay <MILLISECONDS>

[no] redirect <MODBUS-ADDR>

[no] redirect-broadcast

[no] request-queue

[no] exceptions [ignore-unknown]

[no] map unit <MODBUS-ADDR> address <IPADDRESS>[:<PORT>]

Disabled

500

100

Section 41.2.11

Section 41.2.12

Section 41.2.13

Disabled

Section 41.2.14

Disabled

Section 41.2.15

Enabled

Section 41.2.16

Enabled

Section 41.2.17

N/A

Section 41.2.18

Show Modbus Gateway Status show modbus

Section 41.2.19

41.2.1

Managing Modbus Gateway settings

Syntax [no] modbus

Context

Global Configuration

context

1020 © 2017 Westermo Teleindustri AB

Westermo OS Management Guide

Version 4.22.0-0

Usage Enter the

Modbus Gateway Configuration

context (this context). A gateway instance will be created, unless it already exists. As of WeOS v4.22.0 a single Modbus Gateway instance is supported.

Use ”no modbus” to remove your Gateway instance(s).

Use ”show modbus” (from

Global Configuration

context) to list summary information for configured Modbus Gateway instance(s). Use ”show” (within the

Modbus Gateway Configuration

context) to list detailed information on a specific Modbus Gateway instance.

Default values Not applicable.

41.2.2

Setting Enable

Syntax [no] enable

Context

Modbus Gateway Configuration

context

Usage Use ”enable” to enable and ”no enable” to disable a Modbus Gateway instance. (Other gateway settings are preserved.)

Use ”show enable” to show whether this gateway instance is enabled or disabled.

Default values Enabled

41.2.3

Setting Mode (Client or Server)

Syntax [no] mode <server|client>

Context

Modbus Gateway Configuration

context

Usage Use ”mode server” or ”mode client” to configure the Modbus Gateway in server and client mode respectively.

Use ”no mode” to reset the mode to default (server).

Use ”show mode” to show the Modbus Gateway mode setting.

Default values Server (”mode server”)

© 2017 Westermo Teleindustri AB 1021

Westermo OS Management Guide

Version 4.22.0-0

41.2.4

Setting Serial Port

Syntax [no] port <SERIAL-PORT>

Context

Modbus Gateway Configuration

context

Usage Set serial port, e.g., use ”port 1” to select serial port 1 on a single slot unit, or ”port 1/1” to select serial port 1 in slot 1 of a slotted WeOS unit.

You can use the ”show serial” command in Admin Exec (see

section 39.3.11

)

mode to list information about your serial ports, including the serial port numbers.

Use ”no port” to deselect the defined serial port.

Note

The Modbus Gateway will not be activated if no serial port is defined.

Use ”show port” to show the Modbus Gateway port setting.

Default values Disabled (”no port”)

41.2.5

Setting Serial Protocol

Syntax [no] serial-protocol <rtu|ascii>

Context

Modbus Gateway Configuration

context

Usage Use ”serial-protocol rtu” or ”serial-protocol ascii” to specify use of RTU or ASCII as serial protocol respectively.

Use ”no serial-protocol” to reset the serial protocol to default (RTU).

Use ”show serial-protocol” to show the serial protocol setting.

Default values RTU (”serial-protocol rtu”)

41.2.6

Setting listen interface and port

Syntax [no] listen iface <IFNAME|any> [port <PORT>]

Context

Modbus Gateway Configuration

context (server mode only)

1022 © 2017 Westermo Teleindustri AB

Westermo OS Management Guide

Version 4.22.0-0

Usage Setting local interface and TCP port to listen to.

Acceptable port range is in range <1-65335> (default port 502). Omitting the ”port” argument leaves the port number unchanged.

Use ”no listen” to reset the setting to default (listen on any interface, port

502)

Use ”show listen” to show the current listen setting.

The setting is only applicable when configuring the Modbus Gateway in

”server” mode (see

section 41.2.3

).

Default values Any interface, port 502 (”listen iface any port 502”)

41.2.7

Setting ASCII Timeout

Syntax [no] ascii-timeout <MILLISECONDS>

Context

Modbus Gateway Configuration

context

Usage Set ASCII Timeout, i.e., the maximum time between two frames in ASCII mode. Allowed range is <10-7050> (milliseconds).

Use ”no ascii-timeout” to reset the timeout to the default value (1000 milliseconds).

Use ”show ascii-timeout” to show the current timeout setting.

The ”ascii-timeout” command is only applicable when configuring the

Modbus Gateway to use ”ascii” as serial protocol (see

section 41.2.5

).

Default values 1000

41.2.8

Setting RTU Interval

Syntax [no] rtu-interval <MILLISECONDS>

Context

Modbus Gateway Configuration

context

Usage Set RTU Interval, i.e., the minimum time between two frames in RTU mode. Allowed range is <10-7050> (milliseconds).

Use ”no rtu-interval” to reset the interval to the default value (50 milliseconds).

© 2017 Westermo Teleindustri AB 1023

Westermo OS Management Guide

Version 4.22.0-0

Use ”show rtu-interval” to show the current interval setting.

The ”rtu-interval” command is only applicable when configuring the Modbus Gateway to use ”rtu” as serial protocol (see

section 41.2.5

).

Default values 50

41.2.9

Setting Poll Interval

Syntax [no] poll-interval <MILLISECONDS>

Context

Modbus Gateway Configuration

context (server mode only)

Usage Set Poll Interval. Allowed values are in range <10-65535> (milliseconds).

Use ”no poll-interval” to reset the interval to the default value (50 milliseconds).

Use ”show poll-interval” to show the current interval setting.

Only applicable when configuring the Modbus Gateway in ”server” mode

(see

section 41.2.3

).

Default values 50

41.2.10

Setting Serial Error Check

Syntax [no] error-check

Context

Modbus Gateway Configuration

context

Usage Use ”error-check” to enable and ”no error-check” to disable serial error check.

Use ”show error-check” to show the current error check setting.

Default values Enabled

41.2.11

Setting Inactivity Timeout

Syntax [no] inactivity-timeout <SECONDS>

Context

Modbus Gateway Configuration

context (server mode only)

1024 © 2017 Westermo Teleindustri AB

Westermo OS Management Guide

Version 4.22.0-0

Usage Set Inactivity Timeout, i.e., the time to keep an idle session open. Allowed values are in range <10-65535> (seconds).

Use ”no inactivity-timeout” to disable the inactivity timeout.

Use ”show inactivity-timeout” to show the current timeout setting.

Only applicable when configuring the Modbus Gateway in ”server” mode

(see

section 41.2.3

).

Default values Disabled

41.2.12

Setting Response Timeout

Syntax [no] response-timeout <MILLISECONDS>

Context

Modbus Gateway Configuration

context

Usage Set Response Timeout. Allowed values are in range <1-65535> (milliseconds).

Use ”no response-timeout” to reset the response timeout to default (500 milliseconds).

Use ”show response-timeout” to show the current timeout setting.

Default values 500

41.2.13

Setting Broadcast Delay

Syntax [no] broadcast-delay <MILLISECONDS>

Context

Modbus Gateway Configuration

context (server mode only)

Usage Set Broadcast Delay, i.e., time to wait after transmitting an broadcast.

Allowed values are in range <0-65535> (milliseconds).

Use ”no broadcast-delay” to reset the broadcast delay to default (100 milliseconds).

Use ”show broadcast-delay” to show the current delay setting.

Only applicable when configuring the Modbus Gateway in ”server” mode

(see

section 41.2.3

).

Default values 100

© 2017 Westermo Teleindustri AB 1025

Westermo OS Management Guide

Version 4.22.0-0

41.2.14

Setting Redirect

Syntax [no] redirect <MODBUS-ADDR>

Context

Modbus Gateway Configuration

context (server mode only)

Usage Set redirect, i.e., redirect all Modbus addresses to this address. Allowed values are in range <1-255> (seconds)

Use ”no redirect” to disable the redirect setting.

Use ”show redirect” to show the current redirect setting.

Only applicable when configuring the Modbus Gateway in ”server” mode

(see

section 41.2.3

).

Default values Disabled

41.2.15

Setting Redirect Broadcast

Syntax [no] redirect-broadcast (server mode only)

Context

Modbus Gateway Configuration

context

Usage Set redirect broadcast, i.e., redirect all Modbus broadcasts to Modbus address 1.

Use ”no redirect-broadcast” to disable the redirect broadcast setting.

Use ”show redirect-broadcast” to show the current redirect broadcast setting.

Only applicable when configuring the Modbus Gateway in ”server” mode

(see

section 41.2.3

).

Default values Disabled

41.2.16

Setting Request Queue

Syntax [no] request-queue

Context

Modbus Gateway Configuration

context (server mode only)

1026 © 2017 Westermo Teleindustri AB

Westermo OS Management Guide

Version 4.22.0-0

Usage Enabled/disables Request Queue.

Use ”request-queue” to enable and ”no request-queue” to disable the request queue.

Use ”show request-queue” to show the current setting.

Only applicable when configuring the Modbus Gateway in ”server” mode

(see

section 41.2.3

).

Default values Enabled

41.2.17

Setting Exceptions

Syntax [no] exceptions [ignore-unknown]

Context

Modbus Gateway Configuration

context

Usage Enable/disables handling of Modbus exceptions. With Modbus Exceptions enabled, the Modbus Gateway will react upon and respond to certain error conditions, e.g., if a Gateway in client mode receives a (serial) Modbus message addressed to Modbus unit not found in its Map table. If exception handling is desired, except for this particular situation, the gateway can be configured to ignore exceptions for unknown units (”exceptions

ignore-unknown”).

Use ”no exceptions” to disable exception handling.

Use ”show exceptions” to show the current exception setting.

Default values Enabled (all exceptions enabled)

41.2.18

Managing Mapping of Modbus units to IP hosts

Syntax [no] map unit <MODBUS-ADDR> address <ADDRESS>[:<PORT>]

Context

Modbus Gateway Configuration

context (client mode only)

Usage Setup Modbus IP map.

Use e.g., ”map unit 33 address 192.168.5.11” to map Modbus unit 33 to IP host 192.168.5.11 and (default) port 502.

Use ”no map” to remove all mappings, or ”no map unit <MODBUS-ADDR>” to remove an individual mapping.

© 2017 Westermo Teleindustri AB 1027

Westermo OS Management Guide

Version 4.22.0-0

Use ”show map” to show the current mappings.

Only applicable when configuring the Modbus Gateway in ”client” mode

(see

section 41.2.3

).

Default values N/A

41.2.19

Show Modbus Gateway status

Syntax show modbus

Context

Admin Exec

context.

Usage Show Modbus Gateway status information

Default values Not applicable.

Example

Example

example:/#> show modbus

Modbus Gateway Enabled

Mode

Serial port

Serial protocol

: Yes, running as PID 542

: client

: 1

: rtu

Remote IP addr Modbus Addr Exception

=====================================================

192.168.2.5 : 502 example:/#>

10

1028 © 2017 Westermo Teleindustri AB

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Related manuals

advertisement

Table of contents