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 Hardware Catalog

• 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.

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 Slave Channels, proceed as follows:

Step

Action

1

Click the Modbus Channels tab:

2

Click the Add Channel button:

3

Configure an exchange:

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

  • Name: Enter a name for your channel.

  • Access Type: Choose the exchange type: Read or Write or Read/Write multiple requests. See Access Types.

  • Trigger: 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.

  • Comment: Add a comment about this channel.

In the area 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):

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

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

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

In the area 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):

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

  • Length: 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:
  • Click the Delete button to remove a channel.

  • Click the Edit button to change the parameters of a channel.

Result: The configured channels are displayed:

To configure your Modbus Initialization Value, proceed as follows:

Step

Action

1

Click the Modbus Slave Init tab:

2

Click New to create a new initialization value:

The Initialization Value window contains the following parameters:

  • Access Type: Enter the exchange type: Write requests.

  • Register Offset: Register number of register to be initialized.

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

  • Initialization Value: Value the registers are initialized with.

  • Comment: Add a comment about this channel.

3

Click OK to create a new Initialization Value.

NOTE: You can also:
  • Click Move up or Move down to change the position of a value in the list.

  • Click Delete to remove a value in the list.

  • Click 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:

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