Adding a Device on the Modbus Serial IOScanner

Introduction

This section describes how to add a device on the Modbus IOScanner.

Adding a Device on the Modbus IOScanner

To add a device on the Modbus IOScanner, select the Generic Modbus Slave in the Hardware Catalog, drag it to the Devices tree, and drop it on the Modbus_IOScanner node of the Devices tree.

For more information on adding a device to your project, refer to:

• Using the Drag-and-drop Method

• Using the Contextual Menu or Plus Button

NOTE: The variable for the exchange is automatically created in the %IWx and %QWx of the Modbus Serial Master I/O Mapping tab.

Configuring a Device Added on the Modbus IOScanner

To configure the device added on the Modbus IOScanner, proceed as follows:

Step

Action

1

In the Devices tree, double-click Generic Modbus Slave.

Result: The configuration window is displayed.

G-SE-0069248.1.gif-high.gif

 

 

2

Enter a Slave Address value for your device (choose a value from 1 to 247).

3

Choose a value for the Response Timeout (in ms).

To configure the Modbus Channels, proceed as follows:

Step

Action

1

Click the Modbus Slave Channel tab:

G-SE-0069250.1.gif-high.gif

 

 

2

Click the Add Channel button:

G-SE-0069252.1.gif-high.gif

 

 

3

Configure an exchange:

In the field Channel, you can add the following values:

oChannel: Enter a name for your channel.

oAccess Type: Choose the exchange type: Read or Write or Read/Write requests.

oTrigger: Choose the trigger of the exchange. It can be CYCLIC with the period defined in Cycle Time (ms) field, started by a RISING EDGE on a boolean variable (this boolean variable is then created in the Modbus Master I/O Mapping tab), or by the Application.

oComment: Add a comment about this channel.

In the field READ Register (if your channel is Read or Read/Write one), you can configure the %MW to be read on the Modbus slave. Those are mapped on %IW (see Modbus Master I/O Mapping tab):

oOffset: Offset of the %MW to read. 0 means that the first object that is read is %MW0.

oLength: Number of %MW to be read. For example, if 'Offset' = 2 and 'Length' = 3, the channel reads %MW2, %MW3 and %MW4.

oError Handling: choose the behavior of the related %IW in case of loss of communication.

In the field WRITE Register (if your channel is Write or Read/Write one), you can configure the %MW to be written to the Modbus slave. Those are mapped on %QW (see Modbus Master I/O Mapping tab):

oOffset: Offset of the %MW to write. 0 means that the first object that is written is %MW0.

oLength: Number of %MW to be written. For example, if 'Offset' = 2 and 'Length' = 3, the channel writes %MW2, %MW3 and %MW4.

4

Click OK to validate the configuration of this channel.

NOTE: You can also:

oClick the Delete button to remove a channel.

oClick the Edit button to change the parameters of a channel.

To configure your Modbus Initialization Value, proceed as follows:

Step

Action

1

Click the Modbus Slave Init tab:

G-SE-0069253.1.gif-high.gif

 

 

2

Click New to create a new initialization value:

G-SE-0069254.1.gif-high.gif

 

 

The Initialization Value window contains the following parameters:

oAccess Type: Enter the exchange type: Write requests.

oRegister Offset: Register number of register to be initialized.

oLength: Number of %MW to be read. For example, if 'Offset' = 2 and 'Length' = 3, the channel reads %MW2, %MW3 and %MW4.

oInitialization Value: Value the registers are initialized with.

oComment: Add a comment about this channel.

3

Click OK to create a new Initialization Value.

NOTE: You can also:

oClick Move up or Move down to change the position of a value in the list.

oClick Delete to remove a value in the list.

oClick Edit to change the parameters of a value.

To configure your Modbus Master I/O Mapping, proceed as follows:

Step

Action

1

Click the Modbus Master I/O Mapping tab:

G-SE-0069256.1.gif-high.gif

 

 

2

Double-click in a cell of the Variable column to open a text field.

Enter the name of a variable or click the browse button [...] and chose a variable with the Input Assistant.

3

For more information on I/O mapping, refer to EcoStruxure Machine Expert Programming Guide.

Access Types

This table describes the different access types available:

Function

Function Code

Availability

Read Coils

1

ModbusChannel

Read Discrete Inputs

2

ModbusChannel

Read Holding Registers (default setting for the channel configuration)

3

ModbusChannel

Read Input Registers

4

ModbusChannel

Write Single Coil

5

ModbusChannel

Initialization Value

Write Single Register

6

ModbusChannel

Initialization Value

Write Multiple Coils

15

ModbusChannel

Initialization Value

Write Multiple Registers (default setting for the slave initialization)

16

ModbusChannel

Initialization Value

Read/Write Multiple Registers

23

ModbusChannel