NOC ModbusTcp Slave
NOC ModbusTcp Slave
Overview
This section extends the sample Unity Pro application, by describing how to:
add an STB NIP 2212 Modbus TCP network interface module to your Unity Pro application
configure the STB NIP 2212 module
configure a Modbus TCP connection linking the BMX NOC 0401 communication module and
the STB NIP 2212 network interface module
NOTE: The instructions in this chapter describe a single, specific device configuration example.
Refer to the Unity Pro help files for additional information about alternative configuration choices.
Overview
This sample network includes the following hardware and software:
a controller rack with:
BMX CPS 2000, 100/240 VAC power supply
BMX P34 20302 controller
BMX NOC 0401.2 Ethernet communication module
a remote STB Advantys island with:
STB NIP 2212 Modbus TCP network interface module
STB PDT 3100 power distribution module
STB DDI 3230 2 pt digital input module
STB DDO 3200 2 pt digital output module
STB DDI 3420 4 pt digital input module
STB DDO 3410 4 pt digital output module
STB DDI 3610 6 pt digital input module
STB DDO 3600 6 pt digital output module
STB AVI 1270 2 pt analog input module
STB AVO 1250 2 pt analog output module
a PC running both Unity Pro (version 5.0 or higher) and Advantys configuration software
(version 5.0 or higher)
an Ethernet managed switch that is connected to the both the controller and island by means of
twisted pair Ethernet cable and RJ45 connectors.
file://C:\Users\SESA273832\AppData\Local\Temp\~hhCFB0.htm 11/28/2014
Adding a Modbus TCP Device to the Network Page 2 of 17
Network Topology
The Ethernet network devices used in this configuration include the following:
Overview
Use the generic Modbus DTM selection, in the Add dialog, to select and insert an STB NIP 2212
module to your project.
Step Action
file://C:\Users\SESA273832\AppData\Local\Temp\~hhCFB0.htm 11/28/2014
Adding a Modbus TCP Device to the Network Page 3 of 17
When you edit the Alias name, Unity Pro applies it as the base
name for both structure and variable names.
NOTE: No additional editing needs to be performed in the pages
of this window. Except for the Alias name field, parameters are
read-only.
The next step is to configure the device you have just added to the project.
Overview
file://C:\Users\SESA273832\AppData\Local\Temp\~hhCFB0.htm 11/28/2014
Adding a Modbus TCP Device to the Network Page 4 of 17
Use the pages of the Device Editor to view and edit settings for a remote device. To edit the device
settings, disconnect the DTM from the remote device.
To display the DTM settings for a remote device, select the device name, which is found under the
Device List node in the left pane of the Device Editor.
For the purposes of this example, which configures an STB NIP 2212 network interface module,
select the node named NIP2212_01. The Device Editor displays the following pages:
Properties
Address Setting
Request Setting
NOTE: Refer to the topic Configuring Properties in the Device Editor for instructions on how to edit
properties.
The following settings are used in this sample configuration. Use settings that are appropriate for
your actual application:
Step Action
Active Configuration
Enabled: adds this device to the Unity Pro project
configuration
file://C:\Users\SESA273832\AppData\Local\Temp\~hhCFB0.htm 11/28/2014
Adding a Modbus TCP Device to the Network Page 5 of 17
Input area:
Output area:
Default Name button Restores the default variable and structure names. For
this example, custom names are used.
Import mode
Automatic: I/O items are taken from the device
DTM and updated if the items list in the device
DTM changes. Items cannot be edited in the
Device Editor.
Manual: I/O items are manually added in the
Device Editor. The I/O items list is not affected by
changes to the device DTM.
In this example, select Manual.
Reimport Items Imports the I/O items list from the device DTM,
overwriting any manual I/O item edits. Enabled only
when Import mode is set to Manual.
4 Click Apply to save your edits, and leave the window open for further edits.
file://C:\Users\SESA273832\AppData\Local\Temp\~hhCFB0.htm 11/28/2014
Adding a Modbus TCP Device to the Network Page 6 of 17
The following settings are used in this sample configuration. Use settings that are appropriate for
your actual application:
Step Action
IP Address By default:
the first three octet values equal the first three
octet values of the Ethernet communication
module, and
the fourth octet value equals this device Number
setting—in this case, 004.
In this example, the IP address is 192.169.1.7.
file://C:\Users\SESA273832\AppData\Local\Temp\~hhCFB0.htm 11/28/2014
Adding a Modbus TCP Device to the Network Page 7 of 17
2 Click Apply to save your edits, and leave the window open for further edits.
The next step is to configure the connection between the communication module and the remote
device.
The Add Request function is enabled only when Import Mode is set to Manual.
The following settings are used in this sample configuration. Use settings that are appropriate for
your actual application:
Step Action
Connection (Read-only) The offset for both the health bit and the control bit for this
Bit connection. Offset values are auto-generated by the Unity Pro Ethernet
Configuration Tool—starting at 0—based on the connection type, in the
following order:
1. Modbus TCP connections
2. Local Slave connections
3. EtherNet/IP connections
NOTE: When this Modbus TCP connection is created, the offset values for
the previously created local slave and EtherNet/IP connections are
incremented by 1: the local slave connection bit is set to 1, and the
EtherNet/IP connection bit value is set to 2.
Unit ID The number of the device, or module, that is the target of the connection. A
value of:
255 (the default) used to access the Ethernet communication module
itself
254 causes no Modbus message to be sent; the module reports an
event
0...253 identifies the device number of the target device, behind a
Modbus TCP to Modbus gateway
file://C:\Users\SESA273832\AppData\Local\Temp\~hhCFB0.htm 11/28/2014
Adding a Modbus TCP Device to the Network Page 8 of 17
Repetitive The data scan rate, from 0...60000 ms, in intervals of 5 ms. The default = 60
Rate ms. Accept the default value of 60.
RD Address in the remote device of the input data image. The input data image
Address begins at word 45391. Because there is an offset of 40000 in the M340
platform, type in a value of 5391.
RD Length The number of words in the remote device, from 0...125, that the
communication module will read. Because the Modbus device will be
configured for 18 words of input items, type in a value of 18.
Last Value The behavior of inputs in the application in the event communication is lost:
Hold Value (the default)
Set To Zero
Accept the default.
WR Address in the remote device of the output data image. The output data
Address image begins at word 40000. Because there is an offset of 40000 in the
M340 platform, type in a value of 0.
WR Length The number of words in the remote device, from 0 to 120, to which the
communication module will write. Because the Modbus device will be
configured for 5 words of output items, type in a value of 5.
The next step is to connect the Unity Pro project to the Advantys Island.
Overview
In this example, you will use the Advantys configuration software running on your PC to:
connect the Advantys configuration software to the STB NIP 2212 and the 8 I/O modules that
comprise the Advantys STB island
upload Advantys STB island configuration to the Advantys configuration software in your PC
display a fieldbus image for the Advantys STB island showing the relative location of:
input data
output data
Using the data presented in the fieldbus image, you can use Unity Pro to create input and output
file://C:\Users\SESA273832\AppData\Local\Temp\~hhCFB0.htm 11/28/2014
Adding a Modbus TCP Device to the Network Page 9 of 17
items that map to specific input, output, and output echo data.
NOTE: Before proceeding with the following instructions, confirm that you have auto-configured the
Advantys STB island by pressing the RST button on the front of the STB NIP 2212 module.
Step Action
1 Startup the Advantys configuration software on your PC. A dialog opens displaying
available project types.
2 Select STB.
3 Select File → New Workspace. The New Workspace window opens (below).
5 Click OK. The Advantys configuration software displays an empty DIN rail in the center of
the screen.
8 In the Remote IP Address field, type in the IP address for the STB NIP 2212, in this
example: 192.168.1.7.
9 Click OK to close the TCP/IP Parameters dialog, and click OK again to close the
Connection Settings dialog.
file://C:\Users\SESA273832\AppData\Local\Temp\~hhCFB0.htm 11/28/2014
Adding a Modbus TCP Device to the Network Page 10 of 17
11 Select Upload in the Data Transfer dialog. The island workspace is populated with island
data and shows the STB NIP 2212 and the island modules (below):
Note: A box appears beneath each module containing one or two integers—for example
. These integers serve the following purpose:
The left-side integer (3 in this example) identifies the module’s physical position—
left to right—among the modules in the rack.
The right-side integer (1 in this example) identifies the module’s relative position—
left to right—among only data producing/receiving modules. If the module is not a
data producing/receiving module (e.g. a power supply, or end of segment module)
no right-side integer appears.
12 Select Island → I/O Image Overview. The I/O Image window opens to the Fieldbus Image
page:
file://C:\Users\SESA273832\AppData\Local\Temp\~hhCFB0.htm 11/28/2014
Adding a Modbus TCP Device to the Network Page 11 of 17
Each table cell contains an integer that identifies the relative rack position of a data
producing/receiving module with input or output data in that cell. For example:
the STB DDI 3230 input module is the first data producing or receiving module in the
rack; its data and status information is indicated by the integer 1 in bits 0...1 of
registers 45392 and 45393 in the Input Data table
the STB DDO 3600 output module is the sixth data producing module in the rack; its
output echo and status data is designated by the integer 6 in bits 0 - 5 of register
45402 and in bits 0 - 5 of register 45403 in the Input Data table; its output data is
designated by the integer 6 in bits 0 - 5 of register 40003 in the Output Data table
NOTE:
Select a cell in either the Input Data or Output Data tables to display—in the middle
of the page—a description of the cell data and its source module.
Convert the size of the Input Data table and the Output Data table from words to
bytes (i.e. divide by 2), then use that information when setting the RD Length
(inputs) and WR Length (outputs) parameters in the Request Setting page for the
remote Modbus TCP device.
Overview
The next task in this example is to add I/O items to the configuration of the STB NIP 2212 and its 8
I/O modules. To accomplish this:
use the Modbus Image page of the Advantys configuration software to identify the relative
position of each I/O module’s inputs and outputs
use the Unity Pro Device Editor to create input and output items, defining each item’s:
name
data type
NOTE: You can manually configure I/O items only when Input Mode is set to Manual.
Step Action
file://C:\Users\SESA273832\AppData\Local\Temp\~hhCFB0.htm 11/28/2014
Adding a Modbus TCP Device to the Network Page 12 of 17
1 In the Advantys configuration software, select Island → I/O Image Overview. The I/O
Image window opens to the Modbus Image page.
2 Select the cell 0 of the first word (45392) in the Input Data table to display—in the middle
of the page—a description of the cell data and its source module.
3 Make a note of the register number and item information for that word.
1 not used
3 not used
5 not used
7 not used
9 not used
11 not used
13 not used
15 not used
17 not used
19 not used
file://C:\Users\SESA273832\AppData\Local\Temp\~hhCFB0.htm 11/28/2014
Adding a Modbus TCP Device to the Network Page 13 of 17
21 not used
23 not used
25 0-7
27 not used
29 0-7
31 not used
33 not used
35 not used
1 not used
3 not used
5 not used
7 0-7
9 0-7
This example shows you how to create 18 words of inputs and 5 words of outputs. This example
creates items in the following sequence:
input word items
output word items
file://C:\Users\SESA273832\AppData\Local\Temp\~hhCFB0.htm 11/28/2014
Adding a Modbus TCP Device to the Network Page 14 of 17
Step Action
3 In the left pane of the Device Editor, navigate to and select the Items node for the
STB NIP 2212 network interface module:
NOTE: In this example, each row represents a byte. Because the items you create will be
a 16-bit word, each item consists of 2 rows.
6 Starting at the beginning of the table, select the first two rows: 0 and 1:
file://C:\Users\SESA273832\AppData\Local\Temp\~hhCFB0.htm 11/28/2014
Adding a Modbus TCP Device to the Network Page 15 of 17
7 Click the Define Item(s) button. The Item Name Definition dialog opens:
NOTE: The Define Item(s) button is enabled only when Input Mode is set to Manual.
8 Select WORD as the New Item(s) Data Type, then click OK. A new item is created:
9 Click Apply to save the new items, and leave the page open.
10 Repeat steps 2 - 6 for each new word item you need to create. In this example, that
includes the following items:
Rows 2-3, Default Items Name Root: DDI3230_in_st
Rows 4-5: Default Items Name Root: DDO3200_out_echo
Rows 6-7: Default Items Name Root: DDO3200_out_st
Rows 8-9: Default Items Name Root: DDI3420_in_data
Rows 10-11: Default Items Name Root: DDI3420_in_st
Rows 12-13: Default Items Name Root: DDO3410_out_echo
file://C:\Users\SESA273832\AppData\Local\Temp\~hhCFB0.htm 11/28/2014
Adding a Modbus TCP Device to the Network Page 16 of 17
Step Action
NOTE: In this example, each row represents a byte. Because the items you create will
be a 16-bit word, each item consists of 2 rows.
3 Starting at the beginning of the table, select the first 2 rows, 0 and 1:
file://C:\Users\SESA273832\AppData\Local\Temp\~hhCFB0.htm 11/28/2014
Adding a Modbus TCP Device to the Network Page 17 of 17
4 Click the Define Item(s) button. The Item Name Definition dialog opens:
NOTE: The Define Item(s) button is enabled only when Input Mode is set to Manual.
5 Select WORD as the New Item(s) Data Type, then click OK. A new item is created:
6 Click Apply to save the new item and leave the page open.
7 Repeat steps 2 - 6 for each new word item you need to create. In this example, that
includes the following items:
Rows 2-3, Default Items Name Root: DDO3410_out_data
Rows 4-5: Default Items Name Root: DDO3600_out_data
Rows 6-7: Default Items Name Root: AVO1250_CH1_out_data
Rows 8-9: Default Items Name Root: AVO1250_CH2_out_data
file://C:\Users\SESA273832\AppData\Local\Temp\~hhCFB0.htm 11/28/2014