Integration Objects': OPC DA Access For Modbus Devices
Integration Objects': OPC DA Access For Modbus Devices
Integration Objects’
OPC DA Access for Modbus Devices
USER GUIDE
OPC Compatibility
OPC Data Access 3.00
OPC Data Access 2.05a
[email protected] 1
Integration Objects’ OPC Server for Modbus
All rights reserved. No part of this document may be reproduced, stored in a retrieval system,
translated, or transmitted, in any form or by any means, electronic, mechanical,
photocopying, recording, or otherwise, without the prior written permission of Integration
Objects.
Windows®, Windows NT® and .NET are registered trademarks of Microsoft Corporation.
[email protected] 2
Integration Objects’ OPC Server for Modbus
Table of Contents
PREFACE .................................................................................................................................................. 8
About this User Guide ............................................................................................................................. 8
Target Audience ...................................................................................................................................... 8
Document Conventions ........................................................................................................................... 8
Customer Support Services ..................................................................................................................... 8
INTRODUCTION ....................................................................................................................................... 9
1. Overview....................................................................................................................................... 9
2. System Architecture ..................................................................................................................... 9
3. Features ...................................................................................................................................... 10
4. OPC Compatibility....................................................................................................................... 11
5. Operating Systems Compatibility ............................................................................................... 11
6. System Requirements ................................................................................................................ 11
GETTING STARTED ................................................................................................................................. 12
1. Pre-Installation Considerations .................................................................................................. 12
2. Installing OPC Server .................................................................................................................. 12
3. Starting-up .................................................................................................................................. 20
4. Server Registration ..................................................................................................................... 21
5. Removing the OPC Server .......................................................................................................... 21
USING OPC SERVER FOR MODBUS ........................................................................................................ 23
1. User Interface Overview............................................................................................................. 23
2. File Menu .................................................................................................................................... 24
3. OPC Server Menu ....................................................................................................................... 24
4. Settings Menu ............................................................................................................................ 24
5. Server Configuration .................................................................................................................. 26
5.1. Add Device........................................................................................................................... 27
5.2. Edit Device ........................................................................................................................... 40
5.3. Delete Device ...................................................................................................................... 42
5.4. Add Group ........................................................................................................................... 43
5.5. Edit & Remove Group .......................................................................................................... 44
[email protected] 3
Integration Objects’ OPC Server for Modbus
[email protected] 4
Integration Objects’ OPC Server for Modbus
Table of Figures
Figure 1: System Architecture ................................................................................................................. 9
Figure 2: Installation Welcome Dialog Box............................................................................................ 13
Figure 3: License Agreement Dialog Box ............................................................................................... 14
Figure 4: Customer Information Dialog Box .......................................................................................... 15
Figure 5: Setup Type Dialog ................................................................................................................... 16
Figure 6: Features Dialog ....................................................................................................................... 17
Figure 7: Choose Destination Folder Dialog Box ................................................................................... 18
Figure 8: Installation Dialog Box ............................................................................................................ 19
Figure 9: Installation Completed Dialog Box ......................................................................................... 20
Figure 10: Launch the OPC Server for Modbus User Interface ............................................................. 20
Figure 11: Start Menu – Uninstaller Shortcut ....................................................................................... 21
Figure 12: Windows 10 Startup Menu - Uninstall Shortcut .................................................................. 22
Figure 13: OPC Server for Modbus – Main Interface ............................................................................ 23
Figure 14: File Menu .............................................................................................................................. 24
Figure 15: OPC Server Menu ................................................................................................................. 24
Figure 16: Settings Menu ...................................................................................................................... 25
Figure 17: Settings Configuration Windows .......................................................................................... 25
Figure 18: OPC Server for Modbus Address Space Tree View .............................................................. 27
Figure 19: Add a New Device................................................................................................................. 27
Figure 20: Add New Device Wizard ....................................................................................................... 28
Figure 21: Select Device Connection Configuration .............................................................................. 29
Figure 22: Select the TCP/IP Listening Modbus Port ............................................................................. 30
Figure 23: Select the Serial COM Modbus Port ..................................................................................... 31
Figure 24: Select the COM Port Settings ............................................................................................... 31
Figure 25: Select the TCP/IP Device Connection Parameters ............................................................... 32
Figure 26: Select the Serial Device Connection Parameters ................................................................. 34
Figure 27: Test Connection with Modbus Device.................................................................................. 35
Figure 28: Select Device Data Access & Swapping Mode Parameters .................................................. 36
Figure 29: Select Communication Failure Handling Parameters ........................................................... 39
Figure 30: Edit Device ............................................................................................................................ 41
Figure 31: Edit Serial Device Dialog Box ................................................................................................ 41
Figure 32: Edit TCP/IP Device Dialog Box .............................................................................................. 42
Figure 33: Delete Device ....................................................................................................................... 42
Figure 34: Delete Multiple Devices ....................................................................................................... 43
Figure 35: Delete All Devices ................................................................................................................. 43
Figure 36: New Group ........................................................................................................................... 43
Figure 37: New Group Dialog Box ......................................................................................................... 44
Figure 38: Edit Group ............................................................................................................................ 44
Figure 39: Edit Group Dialog Box........................................................................................................... 44
Figure 40: Delete Group ........................................................................................................................ 45
[email protected] 5
Integration Objects’ OPC Server for Modbus
[email protected] 6
Integration Objects’ OPC Server for Modbus
TABLE OF TABLES
[email protected] 7
Integration Objects’ OPC Server for Modbus
PREFACE
Target Audience
This document is intended for users that are looking for applications providing standard OPC
DA (Data Access) connectivity to Modbus devices. Knowledge of the basics of OPC DA
specification is assumed. It is also expected that you have some prior knowledge of the
Modbus protocol.
Document Conventions
Convention Description
Information to be noted
Americas: Support:
+1 713 609 9208 [email protected]
Sales:
Europe-Africa-Middle East
+216 71 195 360 [email protected]
Online:
www.integrationobjects.com
[email protected] 8
Integration Objects’ OPC Server for Modbus
INTRODUCTION
1. Overview
Integration Objects’ OPC Server for Modbus is an OPC Server software designed to provide
an OPC DA standard interface to Modbus compliant devices such as PLC, RTU and DCS. It
establishes connection with one or more Modbus devices via TCP/IP or Serial protocol in
order to collect data in real-time.
2. System Architecture
This OPC Server reads and updates data from/to devices such as RTU, PLC, and DCS. It
can be accessed locally or remotely via DCOM by any OPC DA compliant client.
The following figure illustrates the client/server architecture and demonstrates the interaction
between the OPC DA clients, the OPC Server for Modbus and the various Modbus-
communicating devices.
This OPC server can collect data from Modbus devices via the Modbus TCP or Serial
protocol and expose those data to OPC DA Clients.
[email protected] 9
Integration Objects’ OPC Server for Modbus
3. Features
This section details the features offered by this OPC server including OPC DA server
configuration.
Intuitive user interface for Modbus tags configuration
The OPC Server for Modbus offers an intuitive graphical user interface to configure
the tags. This configuration will be saved in a CSV file and will be loaded at the next
OPC server startup. After startup, the server loads the configuration file to create tags
and build its address space. The server will then map the Modbus addresses with the
OPC tags.
Tags configuration per blocks
Support of multiple OPC DA client connections
Support of multiple Modbus TCP devices connections
Support of multiple Modbus Serial devices connections
Automatic reconnection to the configured Modbus TCP devices after network glitches
Windows service capability allowing automatic restart after the restart of the host
machine
Traceability of events using log files and viewer
Comprehensive OPC data access capabilities: This OPC server allows OPC DA
Clients to retrieve in real-time the preconfigured Modbus slave devices addresses
values.
The following are the current supported OPC DA interfaces:
Object Interface Supported
IUnknown Yes
IOPCCommon Yes
IOPCServer Yes
OPC DA Server
IConnectionPointContainer Yes
IOPCBrowseServerAddressSpace Yes
(Optional)
IOPCItemProperties Yes
IUnknown Yes
IOPCItemMgt Yes
IOPCSyncIO Yes
IOPCAsyncIO Yes
[email protected] 10
Integration Objects’ OPC Server for Modbus
4. OPC Compatibility
Integration Objects’ OPC Server for Modbus implements OPC Data Access specification
version 2.05 and 3.0.
6. System Requirements
The following are the minimum requirements to run the OPC Server for Modbus:
[email protected] 11
Integration Objects’ OPC Server for Modbus
GETTING STARTED
1. Pre-Installation Considerations
In order to properly run the OPC Server for Modbus, the following software components need
to be installed on the target system:
The OPC core components 3.00 which consists of all shared OPC modules
including the DCOM proxy/stub libraries, the OPC Server Enumerator, .NET
wrappers, etc.
.NET framework version 4.5 or higher.
1. Double-click on the Integration Objects’ OPC Server for Modbus installation package.
[email protected] 12
Integration Objects’ OPC Server for Modbus
[email protected] 13
Integration Objects’ OPC Server for Modbus
3. After reading the license agreement, select the first option and click the Next button. By
proceeding, you are accepting all of the license agreement terms. Otherwise, you can
cancel the installation. The customer information dialog box will then appear.
[email protected] 14
Integration Objects’ OPC Server for Modbus
4. Enter the user name and the company name and then click the Next button. The dialog
box for selecting the destination folder will be displayed.
[email protected] 15
Integration Objects’ OPC Server for Modbus
[email protected] 16
Integration Objects’ OPC Server for Modbus
[email protected] 17
Integration Objects’ OPC Server for Modbus
7. Click the Next button to continue the installation, or the Browse button to choose a
different destination folder. The installation dialog box will then appear.
[email protected] 18
Integration Objects’ OPC Server for Modbus
[email protected] 19
Integration Objects’ OPC Server for Modbus
3. Starting-up
The OPC Server for Modbus service is started automatically with the host machine restart. It
can be started and stopped manually from the Windows services manager or from the OPC
Server for Modbus user interface. This user interface can be launched from the start menu
shortcut.
To do so, click on Start Programs Integration Objects OPC Server for Modbus
OPC Server for Modbus
Figure 10: Launch the OPC Server for Modbus User Interface
The server can also be activated dynamically when an OPC DA client is connecting to it.
[email protected] 20
Integration Objects’ OPC Server for Modbus
If the server is not currently running, COM will automatically launch it at the first OPC client
connection.
4. Server Registration
In compliance with the OPC and COM specifications, the OPC Server for Modbus creates
the following registry entries under HKEY_CLASSES_ROOT when installed on the target
system. These entries will be removed when the server is uninstalled.
IntegrationObjects.OPC.Modbus.1\C {CLSID} =
LSID
{ 66A0F806-7490-46CB-A3D5-40EC8C9F80DF }
CLSID\{CLSID}\AppID {CLSID}
CLSID\{CLSID}\ProgID IntegrationObjects.OPC.Modbus.1
If you are using Windows 10, Windows Server 2012 or Windows Server 2016 operating
systems, the uninstaller needs to be run from the start menu as illustrated below.
[email protected] 21
Integration Objects’ OPC Server for Modbus
[email protected] 22
Integration Objects’ OPC Server for Modbus
In this section, you will find an overview of the OPC Server for Modbus user interface as well
as the steps required to configure and use the application.
Menu bar (1): contains the file menu, the server menu, the settings menu and the
help menu.
Server address space tree view (2): allows to configure the OPC Server address
space.
Tag & Device properties display (3): The Tag Tab displays the tags’ properties
selected from the server address space tree view and the device tab displays the
selected device properties.
Server status summary (4): displays server status (running or suspended), the
number of connected clients, the number of created groups, the number of created
items and the last updated time.
[email protected] 23
Integration Objects’ OPC Server for Modbus
Log messages (5): displays the log messages including the Modbus requests and
responses exception messages.
2. File Menu
In the same OPC Server menu, you can start and stop the OPC Server for Modbus service
by using the right buttons.
4. Settings Menu
Using the Settings menu, you can:
Define the default configuration that will be loaded automatically when you restart
the server.
Remove the default configuration,
[email protected] 24
Integration Objects’ OPC Server for Modbus
Set up the configuration parameters through the displayed window when you click on
the "Configuration" button.
Select the style of the graphical user interface, which is set by default to
“Office2007Blue”.
Configure the server setting when clicking the Configure button
When the user clicks the Configure button, the window below will be prompted:
[email protected] 25
Integration Objects’ OPC Server for Modbus
5. Server Configuration
The Server address space can be configured from the tree view at the left side from the main
interface.
[email protected] 26
Integration Objects’ OPC Server for Modbus
Figure 18: OPC Server for Modbus Address Space Tree View
The sections below describe how to add, edit and delete Modbus devices and tags.
[email protected] 27
Integration Objects’ OPC Server for Modbus
[email protected] 28
Integration Objects’ OPC Server for Modbus
[email protected] 29
Integration Objects’ OPC Server for Modbus
[email protected] 30
Integration Objects’ OPC Server for Modbus
[email protected] 31
Integration Objects’ OPC Server for Modbus
The table below summarizes the parameters to configure the serial COM port:
Parameter Description
Baud Rate The baud rate to be used to configure the com port
Flow Control Defines how the RTS and DTR control lines are used
[email protected] 32
Integration Objects’ OPC Server for Modbus
Parameter Description
[email protected] 33
Integration Objects’ OPC Server for Modbus
Parameter Description
[email protected] 34
Integration Objects’ OPC Server for Modbus
[email protected] 35
Integration Objects’ OPC Server for Modbus
Figure 28: Select Device Data Access & Swapping Mode Parameters
The data access parameters are described in the below table:
Parameter Description
[email protected] 36
Integration Objects’ OPC Server for Modbus
zero
Parameter Description
[email protected] 37
Integration Objects’ OPC Server for Modbus
After configuring the device data access and swapping mode, click the Next button and the
following window will be displayed.
[email protected] 38
Integration Objects’ OPC Server for Modbus
Parameter Description
Enable auto device When checked, This option allows to demote a device
demotion on for a specific period of time when communication
communication failures reaches an already configured limited number.
failures
Discard write requests When checked, no write request will be sent to the
during the demotion device during the demotion period
period
[email protected] 39
Integration Objects’ OPC Server for Modbus
Parameter Description
After updating the block size properties, you need to restart the service so the changes take
effects.
Parameter Description
Step 4: Click the Finish button and the device will be then added to tree view.
[email protected] 40
Integration Objects’ OPC Server for Modbus
Then, the Edit Device dialog box will be displayed as illustrated below:
[email protected] 41
Integration Objects’ OPC Server for Modbus
[email protected] 42
Integration Objects’ OPC Server for Modbus
You can also delete multiple devices simultaneously by selecting the devices to be deleted or
clicking the Delete All Devices option to remove all the devices. To select multiple devices
in the address space tree, use the Shift or Ctrl keys.
[email protected] 43
Integration Objects’ OPC Server for Modbus
Then, the New Group dialog box will be displayed as illustrated below. You can have to
specify the group name.
You can also remove the selected group by right clicking on its node and then selecting on
the Delete option from the displayed menu. The Group node and all its tags and subgroups
will be removed from the address space.
[email protected] 44
Integration Objects’ OPC Server for Modbus
[email protected] 45
Integration Objects’ OPC Server for Modbus
Once the New Tag option is selected, a dialog box will be displayed allowing the user to
configure the tag parameters.
Parameter Description
[email protected] 46
Integration Objects’ OPC Server for Modbus
[email protected] 47
Integration Objects’ OPC Server for Modbus
Parameter Description
Base Tag Name The pattern used to generate the name of the tags
[email protected] 48
Integration Objects’ OPC Server for Modbus
[email protected] 49
Integration Objects’ OPC Server for Modbus
You can delete more than one tag simultaneously by selecting the tags to be removed using
the Shift or Ctrl keys and then selecting the Delete option in the right click menu.
[email protected] 50
Integration Objects’ OPC Server for Modbus
[email protected] 51
Integration Objects’ OPC Server for Modbus
The configuration will be then saved in CSV file format. The configuration is divided into three
sections;
COM port
Devices
Tags
The table below describes the fields of the COM port configuration section.
Field Description
2 Baud Rate The baud rate to be used to configure the com port
6 Flow Control Defines how the RTS and DTR control lines are used
[email protected] 52
Integration Objects’ OPC Server for Modbus
The table below describes the fields of the devices configuration section.
Field Description
6 Port The listening TCP port reserved for the Modbus device
communications. The default value is 502.
The waiting period for an unresponsive server
7 Connection
Timeout
8 Timeouts Nbr The allowed timeouts number when the server does not respond
The amount of seconds that the OPC Server will wait when
9 Request Timeout
using the diagnostics function to check the Modbus Device
availability.
10 In Coils Blck Size Specifies the number of input coils in the Modbus frame
requests
11 Out Coils Blck Specifies the number of output coils in the Modbus frame
Size requests
12 In Reg Blck Size Specifies the number of input registers in the Modbus frame
requests
13 H Reg Blck Size Specifies the number of output registers in the Modbus frame
requests
[email protected] 53
Integration Objects’ OPC Server for Modbus
19 Reg Base This option is used with bits within registers referenced as
Address Boolean
False (unchecked): The first bit within register begins at one
True (checked): The first bit within register begins at zero
20 H Reg Bit Mask This option is used to write in a bit within register using the
Boolean data type with holding registers.
False (unchecked): The OPC Server will use a read /Write
operation to update the bit of interest.
True (checked): The OPC Server will use function 22 to
update the bit of interest.
21 Only Single Reg This option is related to 32 bits and 64 bits OPC tags.
Write
False (unchecked): The OPC Server will use the function 16
to write to multiple registers.
True (checked): The OPC Server will use function 06 to write
into multiple registers.
22 Only Single Coil False (unchecked): The OPC Server will use the function 15
Write to write to multiple coils.
True (checked): The OPC Server will use function 05 to write
into multiple registers.
23 Double Register This check box determines how floating points and long integer
values are handled:
[email protected] 54
Integration Objects’ OPC Server for Modbus
24 Auto Demotion When checked, This option allows to demote a device for a
specific period of time when communication failures reaches an
already configured limited number.
25 Failures Nbr The number of successive failures before demoting the device
26 Demotion Period During this period ,no read request will be sent to the device
27 Discard Write When checked, no write request will be sent to the device during
the demotion period
32 Request Timeout The allowed request timeouts number before starting the
Nbr reconnection procedure to the device
The table below describes the fields of the tags configuration section.
Field Description
[email protected] 55
Integration Objects’ OPC Server for Modbus
5 Access Right The access right, which can be read only or read/write
VarType The type of data, which can be:
6
VT_I2
VT_I4
VT_R4
VT_UI2
VT_UI4
VT_BSTR
VT_BOOL
7 Address The address of the configured tag. The value should be
between 1 and 65534.
[email protected] 56
Integration Objects’ OPC Server for Modbus
After saving your configuration, you need to set the default configuration, which will be
loaded automatically at the OPC Server for Modbus Service start-up. To define a default
configuration, click the Define button available in the Settings Menu.
6. Errors Management
The OPC Server for Modbus handles both OPC and Modbus protocols related errors. All
errors are tracked in the service log file and in the log messages view in the graphical user
interface, as illustrated below:
[email protected] 57
Integration Objects’ OPC Server for Modbus
When sending the Modbus request to slave devices via the OPC Server for Modbus
exception responses may happen and error codes will be sent in the response message and
will be recorded in the software log file. These errors are described in the table below.
Code
Dec/Hex Name Meaning
01/0x01 Illegal Function The function code received in the query is not an allowable
action for the server (or slave). This may be because the
function code is only applicable to newer devices, and was
not implemented in the unit selected. It could also indicate
that the server (or slave) is in the wrong state to process a
request of this type, for example because it is not configured
and is being asked to return register values.
02/0x02 Illegal Data The data address received in the query is not an allowable
Address address for the server (or slave). More specifically, the
combination of reference number and transfer length is
invalid. For a controller with 100 registers a request of offset
96 and a length of 5 will generate exception 02.
03/0x03 Illegal Data The value contained in the query data field is not an allowable
Value value for the server (or slave). This indicates a fault in the
structure of the remainder of a complex request, such as that
the implied length being incorrect. It specifically does NOT
[email protected] 58
Integration Objects’ OPC Server for Modbus
04/0x04 Failure In An unrecoverable error occurred while the server (or slave)
Associated was attempting to perform the requested action.
Device
[email protected] 59
Integration Objects’ OPC Server for Modbus
Figure 55: OPC DA Client Connected to the OPC Server for Modbus
In case the local connection to the OPC Server for Modbus failed due to an access deny you
need to follow the steps below:
[email protected] 60
Integration Objects’ OPC Server for Modbus
[email protected] 61
Integration Objects’ OPC Server for Modbus
TROUBLESHOOTING
If you are using an evaluation license, you should first check the license validity by launching
the License Authorization tool. You can start it directly from the startup menu:
[email protected] 62
Integration Objects’ OPC Server for Modbus
4. Copy and send the User ID to the sales team {[email protected]} so they
can generate the dedicated activation code.
5. Enter the given Activation Code
In case the local connection to the OPC Server for Modbus failed due to an access deny you
need to follow the steps below:
1. Open the windows service manager
2. Select the Integration Objects’ OPC Server for Modbus Service.
3. Right click and select the Log On tab.
4. Check the “This account” radio button.
5. Enter your administrator account credentials as shown in the following figure:
[email protected] 63
Integration Objects’ OPC Server for Modbus
Case 3: The OPC Server ProgID cannot be displayed by the OPC Client.
In case the OPC Client is not able to display the server ProgID then you need to check the
following items:
Make sure that the OPC Core Components are installed in your machine
Make sure that a user with local administrative rights installs the OPC server so that it
is able to create the necessary entries in the registry.
Ensure that the OPCEnum is registered as a service, DCOM permissions are
configured properly, and the OPCEnum service is running.
Make sure that the client is running as a user that has read access to the registry
Case 4: Why does the connection to the TCP IP Modbus device fail?
In case the connection to the TCP\IP Modbus device fails, you need to check the following
items:
The port is not locked by another Modbus master
The IP address and the ID of the Modbus slave are correct
Case 5: Why does the connection to the serial Modbus device fail?
[email protected] 64
Integration Objects’ OPC Server for Modbus
In case the connection to the serial Modbus device fails, you need to check that The COM
port is not locked by another Modbus master.
Case 6: Why do the read/write from/to the serial Modbus device timeout?
In case the reads and writes time out, you need to check your configuration and make sure it
matches the configuration of your Modbus device for the following parameters:
Device ID
Device Transmission Mode
COM Port Baud Rate
COM Port Data Bit
COM Port Parity
COM Port Stop Bits
COM Port Flow Control
In case the reads and writes values are wrong, you need to check your configuration and
make sure that the data access settings and the swapping mode match the configuration of
your Modbus device.
[email protected] 65
Integration Objects’ OPC Server for Modbus
For additional information on this guide, questions or problems to report, please contact:
Offices
- Americas: +1 713 609 9208
- Europe-Africa-Middle East: +216 71 195 360
Email
- Support Services: [email protected]
- Sales: [email protected]
To find out how you can benefit from other Integration Objects products and custom-
designed solutions, please visit our website: www.integrationobjects.com