Modbus Serial Manual
Modbus Serial Manual
Table of Contents
M odbus RTU Serial Driver 1
Table of Contents 2
Overview 5
Setup 6
Channel Properties — General 6
Tag Counts 7
Channel Properties — Communication Serialization 7
Channel Properties — Write Optimizations 9
Channel Properties — Serial Communications 9
Channel Properties — Advanced 12
Device Properties — General 13
Operating Mode 13
Tag Counts 14
Device Properties — Scan Mode 14
Device Properties — Ethernet Encapsulation 15
Device Properties — Timing 16
Device Properties — Auto-Demotion 17
Device Properties — Tag Generation 17
Device Properties — Settings 20
Device Properties — Block Sizes 23
Device Properties — Variable Import Settings 24
Device Properties — Framing 24
Device Properties — Error Handling 25
Device Properties — Redundancy 25
Statistics Items 27
Address Descriptions 31
Modbus Addressing 31
www. ptc.com
3 M od b u s RTU Serial Driver
www. ptc.com
Modbus RTU Serial Driver 4
Index 65
www. ptc.com
5 M od b u s RTU Serial Driver
CONTENTS
Overview
What is the Modbus RTU Serial Driver?
Set up
How do I configure channels and devices for use with this driver?
Overview
The Modbus RTU Serial Driver provides a reliable way to connect Modbus serial devices to OPC client applic-
ations, including HMI, SCADA, Historian, MES, ERP, and countless custom applications. It is intended for use
with serial devices that support the Modbus RTU protocol. The Modbus RTU Serial Driver has been
developed to support a wide range of Modbus RTU compatible devices.
www. ptc.com
Modbus RTU Serial Driver 6
Set up
Communication Protocol
Modbus RTU Protocol
Supported Devices
l Modbus-compatible devices
l Elliott Flow Computer
l Magnetek GPD 515 Drive
l Omni Flow Computer
l Daniel S500 Flow Computer
l Dynamic Fluid Meter (DFM) SFC3
l TSXCUSBMBP USB Adapter
N ote: Not all of the listed configurations may be supported in every device.
Identification
N am e: Specify the user-defined identity of this channel. In each server project, each channel name must be
unique. Although names can be up to 256 characters, some client applications have a limited display window
www. ptc.com
7 M od b u s RTU Serial Driver
when browsing the OPC server's tag space. The channel name is part of the OPC browser information. The
property is required for creating a channel.
For information on reserved characters, refer to "How To... Properly Name a Channel, Device, Tag, and Tag
Group" in the server help.
Driver: Specify the protocol / driver for this channel. Specify the device driver that was selected during chan-
nel creation. It is a disabled setting in the channel properties. The property is required for creating a chan-
nel.
N ote: With the server's online full-time operation, these properties can be changed at any time. This
includes changing the channel name to prevent clients from registering data with the server. If a client has
already acquired an item from the server before the channel name is changed, the items are unaffected. If,
after the channel name has been changed, the client application releases the item and attempts to re-
acquire using the old channel name, the item is not accepted. Changes to the properties should not be made
once a large client application has been developed. Utilize proper user role and privilege management to
prevent operators from changing properties or accessing server features.
Diagnostics
Diagnostics Capture: When enabled, this option makes the channel's diagnostic information available to
OPC applications. Because the server's diagnostic features require a minimal amount of overhead pro-
cessing, it is recommended that they be utilized when needed and disabled when not. The default is dis-
abled.
N ote: This property is not available if the driver does not support diagnostics.
For more information, refer to "Communication Diagnostics" and "Statistics Tags" in the server help.
Tag Counts
Static Tags: Provides the total number of defined static tags at this level (device or channel). This inform-
ation can be helpful in troubleshooting and load balancing.
The term "virtual network" describes a collection of channels and associated devices that use the same
pipeline for communications. For example, the pipeline of an Ethernet radio is the client radio. All channels
using the same client radio associate with the same virtual network. Channels are allowed to communicate
each in turn, in a "round-robin" manner. By default, a channel can process one transaction before handing
communications off to another channel. A transaction can include one or more tags. If the controlling chan-
nel contains a device that is not responding to a request, the channel cannot release control until the trans-
action times out. This results in data update delays for the other channels in the virtual network.
www. ptc.com
Modbus RTU Serial Driver 8
Channel-Level Settings
Virtual N etwork: Specify the channel's mode of communication serialization. Options include None and Net-
work 1 - Network 500. The default is None. Descriptions of the options are as follows:
Transactions per Cycle: Specify the number of single blocked/non-blocked read/write transactions that can
occur on the channel. When a channel is given the opportunity to communicate, this is the number of trans-
actions attempted. The valid range is 1 to 99. The default is 1.
Global Settings
N etwork Mode: This property is used to control how channel communication is delegated. In Load Bal-
anced mode, each channel is given the opportunity to communicate in turn, one at a time. In Priority mode,
channels are given the opportunity to communicate according to the following rules (highest to lowest pri-
ority):
2. Channels with pending explicit reads (through internal plug-ins or external client interfaces) are pri-
oritized based on the read's priority.
The default is Load Balanced and affects all virtual networks and channels.
Devices that rely on unsolicited responses should not be placed in a virtual network. In situations where
communications must be serialized, it is recommended that Auto-Demotion be enabled.
Due to differences in the way that drivers read and write data (such as in single, blocked, or non-blocked
transactions); the application's Transactions per cycle property may need to be adjusted. When doing so,
consider the following factors:
www. ptc.com
9 M od b u s RTU Serial Driver
Write Optimizations
Optim ization Method: Controls how write data is passed to the underlying communications driver. The
options are:
l Write All Values for All Tags: This option forces the server to attempt to write every value to the
controller. In this mode, the server continues to gather write requests and add them to the server's
internal write queue. The server processes the write queue and attempts to empty it by writing data
to the device as quickly as possible. This mode ensures that everything written from the client applic-
ations is sent to the target device. This mode should be selected if the write operation order or the
write item's content must uniquely be seen at the target device.
l Write Only Latest Value for N on-Boolean Tags: Many consecutive writes to the same value can
accumulate in the write queue due to the time required to actually send the data to the device. If the
server updates a write value that has already been placed in the write queue, far fewer writes are
needed to reach the same final output value. In this way, no extra writes accumulate in the server's
queue. When the user stops moving the slide switch, the value in the device is at the correct value at
virtually the same time. As the mode states, any value that is not a Boolean value is updated in the
server's internal write queue and sent to the device at the next possible opportunity. This can greatly
improve the application performance.
N ote: This option does not attempt to optimize writes to Boolean values. It allows users to optimize
the operation of HMI data without causing problems with Boolean operations, such as a momentary
push button.
l Write Only Latest Value for All Tags: This option takes the theory behind the second optimization
mode and applies it to all tags. It is especially useful if the application only needs to send the latest
value to the device. This mode optimizes all writes by updating the tags currently in the write queue
before they are sent. This is the default mode.
Duty Cycle: is used to control the ratio of write to read operations. The ratio is always based on one read for
every one to ten writes. The duty cycle is set to ten by default, meaning that ten writes occur for each read
operation. Although the application is performing a large number of continuous writes, it must be ensured
that read data is still given time to process. A setting of one results in one read operation for every write
operation. If there are no write operations to perform, reads are processed continuously. This allows optim-
ization for applications with continuous writes versus a more balanced back and forth data flow.
N ote: It is recommended that the application be characterized for compatibility with the write optimization
enhancements before being used in a production environment.
www. ptc.com
Modbus RTU Serial Driver 10
N otes:
l With the server's online full-time operation, these properties can be changed at any time. Utilize
proper user role and privilege management to prevent operators from changing properties or
accessing server features.
l Users must define the specific communication parameters to be used. Depending on the driver, chan-
nels may or may not be able to share identical communication parameters. Only one shared serial
connection can be configured for a Virtual Network (see Channel Properties — Serial Com-
munications).
Connection Type
Physical Medium : Choose the type of hardware device for data communications. Options include Modem,
COM Port, and None. The default is COM Port.
1. N one: Select None to indicate there is no physical connection, which displays the Operation with no
Com m unications section.
2. COM Port: Select Com Port to display and configure the Serial Port Settings section.
3. Modem : Select Modem if phone lines are used for communications, which are configured in the
Modem Settings section.
4. Shared: Verify the connection is correctly identified as sharing the current configuration with another
channel. This is a read-only property.
COM ID: Specify the Communications ID to be used when communicating with devices assigned to the chan-
nel. The valid range is 1 to 9991 to 16. The default is 1.
Baud Rate: Specify the baud rate to be used to configure the selected communications port.
Data Bits: Specify the number of data bits per data word. Options include 5, 6, 7, or 8.
Parity: Specify the type of parity for the data. Options include Odd, Even, or None.
www. ptc.com
11 M od b u s RTU Serial Driver
Stop Bits: Specify the number of stop bits per data word. Options include 1 or 2.
Flow Control: Select how the RTS and DTR control lines are utilized. Flow control is required to communicate
with some serial devices. Options are:
Tip: When using two-wire RS-485, "echoes" may occur on the communication lines. Since this com-
munication does not support echo suppression, it is recommended that echoes be disabled or a RS-485 con-
verter be used.
Operational Behavior
l Report Com m unication Errors: Enable or disable reporting of low-level communications errors.
When enabled, low-level errors are posted to the Event Log as they occur. When disabled, these
same errors are not posted even though normal request failures are. The default is Enable.
l Close Idle Connection: Choose to close the connection when there are no longer any tags being ref-
erenced by a client on the channel. The default is Enable.
l Idle Tim e to Close: Specify the amount of time that the server waits once all tags have been
removed before closing the COM port. The default is 15 seconds.
M odem Settings
l Modem : Specify the installed modem to be used for communications.
l Connect Tim eout: Specify the amount of time to wait for connections to be established before failing
a read or write. The default is 60 seconds.
l Modem Properties: Configure the modem hardware. When clicked, it opens vendor-specific modem
properties.
l Auto-Dial: Enables the automatic dialing of entries in the Phonebook. The default is Disable. For more
information, refer to "Modem Auto-Dial" in the server help.
l Report Com m unication Errors: Enable or disable reporting of low-level communications errors.
When enabled, low-level errors are posted to the Event Log as they occur. When disabled, these
same errors are not posted even though normal request failures are. The default is Enable.
www. ptc.com
Modbus RTU Serial Driver 12
l Close Idle Connection: Choose to close the modem connection when there are no longer any tags
being referenced by a client on the channel. The default is Enable.
l Idle Tim e to Close: Specify the amount of time that the server waits once all tags have been
removed before closing the modem connection. The default is 15 seconds.
N on-N orm alized Float Handling: A non-normalized value is defined as Infinity, Not-a-Number (NaN), or as
a Denormalized Number. The default is Replace with Zero. Drivers that have native float handling may
default to Unmodified. Non-normalized float handling allows users to specify how a driver handles non-nor-
malized IEEE-754 floating point data. Descriptions of the options are as follows:
l Replace with Zero: This option allows a driver to replace non-normalized IEEE-754 floating point val-
ues with zero before being transferred to clients.
l Unm odified: This option allows a driver to transfer IEEE-754 denormalized, normalized, non-num-
ber, and infinity values to clients without any conversion or changes.
N ote: This property is disabled if the driver does not support floating-point values or if it only supports the
option that is displayed. According to the channel's float normalization setting, only real-time driver tags
(such as values and arrays) are subject to float normalization. For example, EFM data is not affected by this
setting.
For more information on the floating-point values, refer to "How To ... Work with Non-Normalized Floating-
Point Values" in the server help.
Inter-Device Delay: Specify the amount of time the communications channel waits to send new requests to
the next device after data is received from the current device on the same channel. Zero (0) disables the
delay.
N ote: This property is not available for all drivers, models, and dependent settings.
www. ptc.com
13 M od b u s RTU Serial Driver
Identification
N am e: Specify the name of the device. It is a logical user-defined name that can be up to 256 characters
long and may be used on multiple channels.
N ote: Although descriptive names are generally a good idea, some OPC client applications may have a
limited display window when browsing the OPC server's tag space. The device name and channel name
become part of the browse tree information as well. Within an OPC client, the combination of channel name
and device name would appear as "ChannelName.DeviceName".
For more information, refer to "How To... Properly Name a Channel, Device, Tag, and Tag Group" in server
help.
Channel Assignm ent: Specify the user-defined name of the channel to which this device currently belongs.
Model: Specify the type of device that is associated with this ID. The contents of the drop-down menu
depend on the type of communications driver being used. Models that are not supported by a driver are dis-
abled. If the communications driver supports multiple device models, the model selection can only be
changed when there are no client applications connected to the device.
N ote: If the communication driver supports multiple models, users should try to match the model selec-
tion to the physical device. If the device is not represented in the drop-down menu, select a model that con-
forms closest to the target device. Some drivers support a model selection called "Open," which allows users
to communicate without knowing the specific details of the target device. For more information, refer to the
driver help documentation.
ID: Specify the device's driver-specific station or node. The type of ID entered depends on the com-
munications driver being used. For many communication drivers, the ID is a numeric value. Drivers that sup-
port a Numeric ID provide users with the option to enter a numeric value whose format can be changed to
suit the needs of the application or the characteristics of the selected communications driver. The format is
set by the driver by default. Options include Decimal, Octal, and Hexadecimal.
Operating M ode
www. ptc.com
Modbus RTU Serial Driver 14
Data Collection: This property controls the device's active state. Although device communications are
enabled by default, this property can be used to disable a physical device. Communications are not attemp-
ted when a device is disabled. From a client standpoint, the data is marked as invalid and write operations
are not accepted. This property can be changed at any time through this property or the device system tags.
Sim ulated: Place the device into or out of Simulation Mode. In this mode, the driver does not attempt to
communicate with the physical device, but the server continues to return valid OPC data. Simulated stops
physical communications with the device, but allows OPC data to be returned to the OPC client as valid data.
While in Simulation Mode, the server treats all device data as reflective: whatever is written to the simulated
device is read back and each OPC item is treated individually. The data is not saved if the server removes
the item (such as when the server is reinitialized). The default is No.
N otes:
1. This System tag (_Simulated) is read only and cannot be written to for runtime protection. The Sys-
tem tag allows this property to be monitored from the client.
2. When a device is simulated, updates may not appear faster than one (1) second client.
Simulation Mode is for test and simulation purposes only. It should never be used in a production envir-
onment.
Tag Counts
Static Tags: Provides the total number of defined static tags at this level (device or channel). This inform-
ation can be helpful in troubleshooting and load balancing.
Scan Mode: Specify how tags in the device are scanned for updates sent to subscribing clients. Descriptions
of the options are:
www. ptc.com
15 M od b u s RTU Serial Driver
l Respect Client-Specified Scan Rate: This mode uses the scan rate requested by the client.
l Request Data N o Faster than Scan Rate: This mode specifies the value set as the maximum scan
rate. The valid range is 10 to 99999990 milliseconds. The default is 1000 milliseconds.
N ote: When the server has an active client and items for the device and the scan rate value is
increased, the changes take effect immediately. When the scan rate value is decreased, the changes
do not take effect until all client applications have been disconnected.
l Request All Data at Scan Rate: This mode forces tags to be scanned at the specified rate for sub-
scribed clients. The valid range is 10 to 99999990 milliseconds. The default is 1000 milliseconds.
l Do N ot Scan, Dem and Poll Only: This mode does not periodically poll tags that belong to the
device nor perform a read to get an item's initial value once it becomes active. It is the OPC client's
responsibility to poll for updates, either by writing to the _DemandPoll tag or by issuing explicit device
reads for individual items. For more information, refer to "Device Demand Poll" in server help.
l Respect Tag-Specified Scan Rate: This mode forces static tags to be scanned at the rate specified
in their static configuration tag properties. Dynamic tags are scanned at the client-specified scan
rate.
Initial Updates from Cache: When enabled, this option allows the server to provide the first updates for
newly activated tag references from stored (cached) data. Cache updates can only be provided when the
new item reference shares the same address, scan rate, data type, client access, and scaling properties. A
device read is used for the initial update for the first client reference only. The default is disabled; any time a
client activates a tag reference the server attempts to read the initial value from the device.
IP Address: Enter the four-field IP address of the terminal server to which the device is attached. IPs are
specified as YYY.YYY.YYY.YYY. The YYY designates the IP address: each YYY byte should be in the range of 0
to 255. Each serial device may have its own IP address; however, devices may have the same IP address if
there are multiple devices multi-dropped from a single terminal server.
Port: Configure the Ethernet port to be used when connecting to a remote terminal server.
Protocol: Set TCP/IP or UDP communications. The selection depends on the nature of the terminal server
being used. The default protocol selection is TCP/IP. For more information on available protocols, refer to the
terminal server's help documentation.
N otes
www. ptc.com
Modbus RTU Serial Driver 16
1. With the server's online full-time operation, these properties can be changed at any time. Utilize
proper user role and privilege management to prevent operators from changing properties or
accessing server features.
2. The valid IP Address range is greater than (>) 0.0.0.0 to less than (<) 255.255.255.255.
Communications Timeouts
Connect Tim eout: This property (which is used primarily by Ethernet based drivers) controls the amount of
time required to establish a socket connection to a remote device. The device's connection time often takes
longer than normal communications requests to that same device. The valid range is 1 to 30 seconds. The
default is typically 3 seconds, but can vary depending on the driver's specific nature. If this setting is not sup-
ported by the driver, it is disabled.
N ote: Due to the nature of UDP connections, the connection timeout setting is not applicable when com-
municating via UDP.
Connect Attem pts: This property (which is used primarily by some Ethernet Encapsulation based drivers)
limits the number of times a connection between the driver and the target device can be attempted. If the
limit is reached, the connection request has failed. The Connect Timeout property specifies the time interval
between connection attempts. The valid range is 1 to 10 attempts. The default is 3 attempts. If this setting is
not supported by the driver, it is disabled.
Request Tim eout: This property specifies an interval used by all drivers to determine how long the driver
waits for a response from the target device to complete. The valid range is 50 to 9,999,999 milliseconds
(167.6667 minutes). The default is usually 1000 milliseconds, but can vary depending on the driver. The
default timeout for most serial drivers is based on a baud rate of 9600 baud or better. When using a driver
at lower baud rates, increase the timeout to compensate for the increased time required to acquire data.
Attem pts Before Tim eout: This property specifies how many times the driver issues a communications
request before considering the request to have failed and the device to be in error. The valid range is 1 to
10. The default is typically 3, but can vary depending on the driver's specific nature. The number of attempts
configured for an application depends largely on the communications environment. This property applies to
both connection attempts and request attempts.
Timing
www. ptc.com
17 M od b u s RTU Serial Driver
Inter-Request Delay: This property specifies how long the driver waits before sending the next request to
the target device. It overrides the normal polling frequency of tags associated with the device, as well as
one-time reads and writes. This delay can be useful when dealing with devices with slow turnaround times
and in cases where network load is a concern. Configuring a delay for a device affects communications with
all other devices on the channel. It is recommended that users separate any device that requires an inter-
request delay to a separate channel if possible. Other communications properties (such as communication
serialization) can extend this delay. The valid range is 0 to 300,000 milliseconds; however, some drivers may
limit the maximum value due to a function of their particular design. The default is 0, which indicates no
delay between requests with the target device.
N ote: Not all drivers support Inter-Request Delay. This setting does not appear if it is not available.
Dem ote on Failure: When enabled, the device is automatically taken off-scan until it is responding again.
Tip: Determine when a device is off-scan by monitoring its demoted state using the _AutoDemoted sys-
tem tag.
Tim eouts to Dem ote: Specify how many successive cycles of request timeouts and retries occur before the
device is placed off-scan. The valid range is 1 to 30 successive failures. The default is 3.
Dem otion Period: Indicate how long the device should be placed off-scan when the timeouts value is
reached. During this period, no read requests are sent to the device and all data associated with the read
requests are set to bad quality. When this period expires, the driver places the device on-scan and allows for
another attempt at communications. The valid range is 100 to 3600000 milliseconds. The default is 10000
milliseconds.
Discard Requests when Dem oted: Select whether or not write requests should be attempted during the
off-scan period. Disable to always send write requests regardless of the demotion period. Enable to discard
writes; the server automatically fails any write request received from a client and does not post a message
to the Event Log.
www. ptc.com
Modbus RTU Serial Driver 18
Not all devices and drivers support full automatic tag database generation and not all support the same data
types. Consult the data types descriptions or the supported data type lists for each driver for specifics.
If the target device supports its own local tag database, the driver reads the device's tag information and
uses the data to generate tags within the server. If the device does not natively support named tags, the
driver creates a list of tags based on driver-specific information. An example of these two conditions is as fol-
lows:
1. If a data acquisition system supports its own local tag database, the communications driver uses the
tag names found in the device to build the server's tags.
2. If an Ethernet I/O system supports detection of its own available I/O module types, the com-
munications driver automatically generates tags in the server that are based on the types of I/O mod-
ules plugged into the Ethernet I/O rack.
N ote: Automatic tag database generation's mode of operation is completely configurable. For more inform-
ation, refer to the property descriptions below.
On Property Change: If the device supports automatic tag generation when certain properties change, the
On Property Change option is shown. It is set to Yes by default, but it can be set to N o to control over when
tag generation is performed. In this case, the Create tags action must be manually invoked to perform tag
generation.
On Device Startup: Specify when OPC tags are automatically generated. Descriptions of the options are as
follows:
l Do N ot Generate on Startup: This option prevents the driver from adding any OPC tags to the tag
space of the server. This is the default setting.
l Always Generate on Startup: This option causes the driver to evaluate the device for tag inform-
ation. It also adds tags to the tag space of the server every time the server is launched.
l Generate on First Startup: This option causes the driver to evaluate the target device for tag
information the first time the project is run. It also adds any OPC tags to the server tag space as
needed.
N ote: When the option to automatically generate OPC tags is selected, any tags that are added to the
server's tag space must be saved with the project. Users can configure the project to automatically save
from the Tools | Options menu.
On Duplicate Tag: When automatic tag database generation is enabled, the server needs to know what to
do with the tags that it may have previously added or with tags that have been added or modified after the
communications driver since their original creation. This setting controls how the server handles OPC tags
that were automatically generated and currently exist in the project. It also prevents automatically gen-
erated tags from accumulating in the server.
www. ptc.com
19 M od b u s RTU Serial Driver
For example, if a user changes the I/O modules in the rack with the server configured to Always Generate
on Startup, new tags would be added to the server every time the communications driver detected a new
I/O module. If the old tags were not removed, many unused tags could accumulate in the server's tag space.
The options are:
l Delete on Create: This option deletes any tags that were previously added to the tag space before
any new tags are added. This is the default setting.
l Overwrite as N ecessary: This option instructs the server to only remove the tags that the com-
munications driver is replacing with new tags. Any tags that are not being overwritten remain in the
server's tag space.
l Do not Overwrite: This option prevents the server from removing any tags that were previously gen-
erated or already existed in the server. The communications driver can only add tags that are com-
pletely new.
l Do not Overwrite, Log Error: This option has the same effect as the prior option, and also posts an
error message to the server's Event Log when a tag overwrite would have occurred.
N ote: Removing OPC tags affects tags that have been automatically generated by the com-
munications driver as well as any tags that have been added using names that match generated tags.
Users should avoid adding tags to the server using names that may match tags that are automatically
generated by the driver.
Parent Group: This property keeps automatically generated tags from mixing with tags that have been
entered manually by specifying a group to be used for automatically generated tags. The name of the group
can be up to 256 characters. This parent group provides a root branch to which all automatically generated
tags are added.
Allow Autom atically Generated Subgroups: This property controls whether the server automatically cre-
ates subgroups for the automatically generated tags. This is the default setting. If disabled, the server gen-
erates the device's tags in a flat list without any grouping. In the server project, the resulting tags are named
with the address value. For example, the tag names are not retained during the generation process.
N ote: If, as the server is generating tags, a tag is assigned the same name as an existing tag, the system
automatically increments to the next highest number so that the tag name is not duplicated. For example, if
the generation process creates a tag named "AI22" that already exists, it creates the tag as "AI23" instead.
Create: Initiates the creation of automatically generated OPC tags. If the device's configuration has been
modified, Create tags forces the driver to reevaluate the device for possible tag changes. Its ability to be
accessed from the System tags allows a client application to initiate tag database creation.
N ote: Create tags is disabled if the Configuration edits a project offline.
www. ptc.com
Modbus RTU Serial Driver 20
Data Access
Zero-Based Addressing: If the address-numbering convention for the device starts at one as opposed to
zero, the value can be specified when defining the device parameters. By default, user-entered addresses
have one subtracted when frames are constructed to communicate with a Modbus device. If the device does
not follow this convention, choose disable. The default behavior follows the convention of Modicon PLCs.
Zero-Based Bit Addressing: Within registers, memory types that allow bits within Words can be referenced
as Booleans. The addressing notation is <address>.<bit>, where <bit> represents the bit number within the
Word. This option provides two ways of addressing a bit within a given Word; zero- or one-based. Zero-based
means that the first bit begins at 0 (range=0-15); one-based means that the first bit begins at 1 (range=1-
16).
Holding Register Bit Mask: When writing to a bit location within a holding register, the driver should only
modify the bit of interest. Some devices support a special command to manipulate a single bit within a
register (function code hex 0x16 or decimal 22). If the device does not support this feature, the driver must
perform a Read / Modify / Write operation to ensure that only the single bit is changed. When enabled, the
driver uses function code 0x16, regardless of this setting for single register writes. When disabled, the driver
uses function code 0x06 or 0x10, depending on the selection for Modbus Function 06 for single register
writes. The default setting is disabled.
N ote: When Modbus byte order is disabled, the byte order of the masks sent in the command is Intel byte
order.
Modbus Function 06: This driver supports Modbus protocol functions to write holding register data to the
target device. In most cases, the driver switches between functions 06 and 16 based on the number of
registers being written. When writing a single 16-bit register, the driver generally uses Modbus function 06.
When writing a 32-bit value into two registers, the driver uses Modbus function 16. For the standard Modicon
PLC, the use of either of these functions is not a problem. There are, however, a large number of third-party
devices using the Modbus protocol and many support only Modbus function 16 to write to holding registers.
This selection is enabled by default, allowing the driver to switch between 06 and 16 as needed. If a device
requires all writes to use only Modbus function 16, disable this selection.
N ote: For bit within word writes, the Holding Register Bit Mask property takes precedence over this option.
If Holding Register Bit Mask is enabled, function code 0x16 is used regardless of this property. If not enabled,
either function code 0x06 or 0x10 is used for bit within word writes.
www. ptc.com
21 M od b u s RTU Serial Driver
Modbus Function 05: This driver supports Modbus protocol functions to write output coil data to the target
device. In most cases, the driver switches between these two functions based on the number of coils being
written. When writing a single coil, the driver uses Modbus function 05. When writing an array of coils, the
driver uses Modbus function 15. For the standard Modicon PLC, the use of these functions is not a problem.
There are, however, many third-party devices that use the Modbus protocol and many only support the use
of Modbus function 15 to write to output coils regardless of the number of coils. This selection is enabled by
default, allowing the driver to switch between 05 and 15 as needed. If a device requires all writes to use only
Modbus function 15, disable this selection.
Data Encoding
Modbus Byte Order: sets the data encoding of each register / 16-bit value. The byte order can be changed
from the default Modbus byte ordering to Intel byte ordering using this selection. The default is enabled,
which is the normal setting for Modbus-compatible devices. If the device uses Intel byte ordering, disable
this property to read Intel-formatted data.
N ote: This setting does not apply to the Omni model. It always uses Modbus byte order.
First Word Low: sets the data encoding of 32-bit values and the double word of 64-bit values. Two con-
secutive registers' addresses in a Modbus device are used for 32-bit data types. The driver can read the first
word as the low or the high word of the 32-bit value based on this option. The default is enabled, first word
low, to follow the convention of the Modicon Modsoft programming software.
N ote: This setting does not apply to the Omni model. It always uses Modbus byte order.
First DWord Low : sets the data encoding of 64-bit values. Four consecutive registers' addresses in a Mod-
bus device are used for 64-bit data types. The driver can read the first DWord as the low or the high DWord
of the 64-bit value. The default is enabled, first DWord low, to follow the default convention of 32-bit data
types.
N ote: This setting does not apply to the Omni model. It always uses Modbus byte order.
Modicon Bit Order: when enabled, the driver reverses the bit order on reads and writes to registers to fol-
low the convention of the Modicon Modsoft programming software. For example, a write to address
40001.0/1 affects bit 15/16 in the device when this option is enabled. This option is disabled (disabled) by
default.
For the following example, the 1st through 16th bit signifies either 0-15 bits or 1-16 bits, depending on the
driver using zero-based or one-based bit addressing within registers.
MSB = Most Significant Bit
LSB = Least Significant Bit
www. ptc.com
Modbus RTU Serial Driver 22
Treat Longs as Decim als: when enabled, the driver encodes and decodes double-precision unsigned Long
and DWord data types as values that range from 0 to 99999999. This format specifies that each word rep-
resents a value between 0 and 9999. Values read above the specified range are not clamped, but the beha-
vior is undefined. All read values are decoded using the formula [Read Value] = HighWord * 10000 +
LowWord. Written values greater than 99999999 are clamped to the maximum value. All written values are
encoded using the formula Raw Data = [Written Value]/10000 + [Written Value] % 10000.
Tips on Settings
Dat a Types M odbus Byt e Order First Word Low First DWord Low
Word, Short, BCD Applicable N/A N/A
Float, DWord, Long, LBCD Applicable Applicable N/A
Double Applicable Applicable Applicable
If needed, use the following information and the device's documentation to determine the correct settings of
the data encoding options.
The default settings are acceptable for the majority of Modbus devices.
Dat a Encoding
Dat a Encoding
Opt ion
Modbus Byte High Byte (15..8) Low Byte (7..0)
Order
Modbus Byte
Low Byte (7..0) High Byte (15..8)
Order
High Word (31..16) Low Word (15..0)
First Word Low High Word (63..48) of Double Word in Low Word (47..32) of Double Word in 64-
64-bit data types bit data types
Low Word (15..0) High Word (31..16)
First Word Low Low Word (47..32) of Double Word in 64- High Word (63..48) of Double Word in
bit data types 64-bit data types
First DWord Low High Double Word (63..32) Low Double Word (31..0)
First DWord Low Low Double Word (31..0) High Double Word (63..32)
www. ptc.com
23 M od b u s RTU Serial Driver
Coils
Output Coils: Specifies the output block size in bits. Coils can be read from 8 to 2000 points (bits) at a time.
A higher block size means more points are read from the device in a single request. The block size can be
reduced to read data from non-contiguous locations within the device. The default setting is 32.
Input Coils: Specifies the input block size in bits. Coils can be read from 8 to 2000 points (bits) at a time. A
higher block size means more points are read from the device in a single request. The block size can be
reduced to read data from non-contiguous locations within the device. The default setting is 32.
Registers
Internal Registers: Specifies the internal register block size in bits. From 1 to 125 standard 16-bit Modbus
registers can be read at a time. A higher block size means more register values are read from the device in
a single request. The block size can be reduced to read data from non-contiguous locations within the
device. The default setting is 32.
Holding Registers: Specifies the holding register block size in bits. From 1 to 125 standard 16-bit Modbus
registers can be read at a time. A higher block size means more register values are read from the device in
a single request. The block size can be reduced to read data from non-contiguous locations within the
device. The default setting is 32.
Caution: A bad address in block error can occur if the register block sizes are set above 120 and a 32- or
64-bit data type is used for any tag. To prevent this, decrease the block size value to 120.
Block Sizes
Block Read Strings: Enables group / block reads of string tags, which are normally read individually. String
tags are grouped together depending on the selected block size. Block reads can only be performed for Mod-
bus model string tags. The default setting is disabled.
www. ptc.com
Modbus RTU Serial Driver 24
For more information on CSV files for Modbus Drivers, refer to Creating CSV Files for Modbus Drivers.
Variable Im port File: This parameter is used to browse to the exact location of the variable import file to
use for Automatic Tag Database Generation.
Include Descriptions: When enabled, imported tag descriptions are used if present in the file.
For more information on configuring the Automatic Tag Database Generation feature (and how to create a
variable import file), refer to Automatic Tag Database Generation.
Framing
Modbus TCP Fram ing: Select Enable if the driver should use Modbus TCP frames with MBAP headers. The
default is disabled.
Tip: This setting should be enabled when communicating with native Modbus TCP devices.
Leading Bytes: Specify the number of bytes to be attached to the beginning of Modbus responses. Values
may range from 0 to 8.
www. ptc.com
25 M od b u s RTU Serial Driver
Trailing Bytes: Specify the number of bytes to be attached to the end of Modbus responses. Values may
range from 0 to 8.
Deactivate Tags on Illegal Address: When enabled, the driver stops polling for a block of data if the device
returns Modbus exception code 2 (illegal address) or 3 (illegal data, such as number of points) in response
to a read of that block. When disabled, the driver continues to poll that data block. The default setting is
enabled.
Reject Repeated Messages: When enabled, the driver interprets a repeated message as an invalid
response and retries the request. The default setting is enabled. When disabled, the driver expects repeated
messages.
N ote: Some message-relay equipment echoes Modbus requests back to the driver.
www. ptc.com
Modbus RTU Serial Driver 26
This driver requires additional settings in addition to the basic settings that are common to all drivers that
support automatic tag database generation. The specialized settings include the name and location of the
variable import file, which can be specified during the Variable Import Settings step of the Device Wizard or
later by selecting Device Properties| Variable Im port Settings.
For more information, refer to Variable Import Settings.
Server Configuration
Automatic tag database generation can be customized to fit an application's specific needs. The primary con-
trol options can be set during the Database Creation step of the Device Wizard or later by selecting Device
Properties | Tag Generation.
Operation
Depending on the configuration, tag generation may start automatically when the server project starts or be
initiated manually at some other time. The Event Log show when the tag generation process started, any
errors that occurred while processing the variable import file, and when the process completed.
www. ptc.com
27 M od b u s RTU Serial Driver
St at ist ics It em s
Statistical items use data collected through additional diagnostics information, which is not collected by
default. To use statistical items, Communication Diagnostics must be enabled. To enable Communication
Diagnostics, right-click on the channel in the Project View and click Properties | Enable Diagnostics. Altern-
atively, double-click on the channel and select Enable Diagnostics.
N ote: Statistics at the channel level are the sum of those same items at the device level.
www. ptc.com
Modbus RTU Serial Driver 28
www. ptc.com
29 M od b u s RTU Serial Driver
www. ptc.com
Modbus RTU Serial Driver 30
* The descriptions assume the default first DWord low data handling of 64-bit data types, and first word low
data handling of 32-bit data types.
www. ptc.com
31 M od b u s RTU Serial Driver
M odbus Addressing
M agnet ek GPD 515 Drive Addressing
Elliot t Flow Comput er Addressing
Daniels S500 Flow Comput er Addressing
Dynamic Fluid M et er Addressing
Omni Flow Comput er Addressing
St at ist ics
M odbus Addressing
The default data types for dynamically defined tags are shown in bold. The Function Codes are displayed in
decimal.
www. ptc.com
Modbus RTU Serial Driver 32
Funct ion
Address Range Dat a Type Access*
Code
Long, LBCD
Double
3xxxxx.0/1-
3xxxxx.15/16* * *
Boolean
300001.2H-365536.240H
Caution: Setting the Client Access privileges of Write Only tags to Read Only causes writes to these tags to
fail and the client to always receive 0/NULL for numeric/string values.
* * For more information, refer to String Support.
* * * For more information, refer to Zero-Based Bit Addressing in Settings.
www. ptc.com
33 M od b u s RTU Serial Driver
Funct ion
Address Range Dat a Type Access
Code
Double
H3xxxxx.0/1-H3xxxxx.F/10*
Boolean
Internal Registers H300001.2H-H3FFFF.240H.
As String with HiLo Bit is string length, range 2 to String* * Read Only 04
Byte Order 240 bytes.
Internal Registers H300001.2L-H3FFFF.240L.
As String with LoHi Bit is string length, range 2 to String* * Read Only 04
Byte Order 240 bytes.
Holding Registers H400001-H410000 H400001- Word, Short, BCD, Float, 03, 06, 16
H4FFFF H400001-H4FFFD DWord, Long, LBCD, Read/Write 03, 06, 16,
H4xxxxx.0/1-H4xxxxx.F/10* Double, Boolean 22
Holding Registers H400001.2H-H4FFFF.240H.
As String with HiLo Bit is string length, range 2 to String* * Read/Write 03, 16
Byte Order 240 bytes.
Holding Registers H400001.2L-H4FFFF.240L.
As String with LoHi Bit is string length, range 2 to String* * Read/Write 03, 16
Byte Order 240 bytes.
* For more information, refer to Zero-Based Bit Addressing in Settings.
* * For more information, refer to String Support.
String Support
The Modbus model supports reading and writing holding register memory as an ASCII string. When using
holding registers for string data, each register contains two bytes of ASCII data. The order of the ASCII data
within a given register can be selected when the string is defined. The length of the string can be from 2 to
240 bytes and is entered in place of a bit number. The length must be entered as an even number. The byte
order is specified by appending either a "H" or "L" to the address.
String Examples
1. To address a string starting at 40200 with a length of 100 bytes and HiLo byte order, enter
"40200.100H".
2. To address a string starting at 40500 with a length of 78 bytes and LoHi byte order, enter
"40500.78L".
N ote: The string's length may be limited by the maximum size of the write request that the device allows.
If, while utilizing a string tag, an error message of "Unable to write to address <address> on device
<device>: Device responded with exception code 3" is received in the server event window, this means that
the device did not like the string's length. If possible, shorten the string.
2. Some documentation refers to Modbus addresses by function code and location. For instance, func-
tion code 3; location 2000 would be addressed as '42000' or 'H47D0'. The leading '4' represents hold-
ing registers or function code 3.
www. ptc.com
Modbus RTU Serial Driver 34
3. Some documentation refers to Modbus addresses by function code and location. For instance, setting
function code 5 location 100 would be addressed as '0100' or 'H064'. The leading '0' represents out-
put coils or function code 5. Writing 1 or 0 to this address would set or reset the coil.
Array Support
Arrays are supported for internal and holding register locations for all data types except for Boolean and
Strings. Arrays are also supported for input and output coils (Boolean data types). There are two methods of
addressing an array. The following examples use holding register locations:
For arrays, rows multiplied by cols cannot exceed the block size that has been assigned to the device for the
register / coil type. For register arrays of 32-bit data types, rows multiplied by cols multiplied by 2 cannot
exceed the block size.
where xxxxx is the address of the first coil (decimal and hex values allowed), and nn is the number of coils to
be packed into an analog value (1-16, decimal only).
The bit order is such that the start address is the LSB (least significant bit) of analog value.
www. ptc.com
35 M od b u s RTU Serial Driver
Example
To access the driver's Operation Status, address 02BH, enter the following address: H4002B.
N ote: When adding a Magnetek Device to the OPC Server project, users must make sure that the setting
Zero-Based Addressing is disabled. If this parameter is not set correctly, the Modbus RTU driver offsets all of
the Magnetek addresses by 1.
Array Support
Arrays are supported for holding register locations for all data types except Boolean. There are two meth-
ods of addressing an array. The following examples use holding register locations:
Rows multiplied by cols cannot exceed the block size that has been assigned to the device for the register
type.
3xxxxx.0/1-3xxxxx.15/16* Boolean
400001-465536 Word, Short, BCD* *
400001-465535 Float, DWord, Long, LBCD
Holding Registers Read/Write
4xxxxx.0/1-4xxxxx.15/16* Boolean
For more information, refer to Zero-Based Bit Addressing in Settings.
* * Address ranges 405001 to 405315 and 407001 to 407315 are 32-bit registers. Addresses in the range of
405001 to 405315 use a default data type of Long.
Addresses in the range of 407001 to 407315 use a default data type of Float. Since these address registers
are 32-bit, only Float, DWord, Long, or LBCD data types are allowed. Arrays are not allowed.
Array Support
Arrays are supported for internal and holding register locations for all data types except Boolean. There are
two methods of addressing an array. The following examples use holding register locations:
www. ptc.com
Modbus RTU Serial Driver 36
Rows multiplied by cols cannot exceed the block size that has been assigned to the device for the register
type. For arrays of 32-bit data types, rows multiplied by cols multiplied by 2 cannot exceed the block size.
www. ptc.com
37 M od b u s RTU Serial Driver
N ote: This driver requires that all addresses begin with "4" for the Dynamic Fluid Meter model. This 4 may
not always be written explicitly in the Dynamic Fluid Meter documentation. For example, users may see a ref-
erence to "Unit ID at address 3001". This value must be addressed in the server as "403001".
String Support
The Dynamic Fluid Meter model supports reading and writing holding register memory as an ASCII string.
When using holding registers for string data, each register contains two bytes of ASCII data. The order of the
ASCII data within a given register can be selected when the string is defined. The length of the string can be
from 2 to 240 bytes and is entered in place of a bit number. The length must be entered as an even number.
The byte order is specified by appending either a "H" or "L" to the address.
String Examples
1. To address a string starting at 40200 with a length of 100 bytes and HiLo byte order, enter
"40200.100H".
2. To address a string starting at 40500 with a length of 78 bytes and LoHi byte order, enter
"40500.78L".
N ote: The string's length may be limited by the maximum size of the write request that the device allows.
If, while utilizing a string tag, an error message of "Unable to write to address <address> on device
<device>: Device responded with exception code 3" is received in the server event window, this means the
device did not like the string's length. If possible, try shortening the string.
www. ptc.com
Modbus RTU Serial Driver 38
www. ptc.com
39 M od b u s RTU Serial Driver
www. ptc.com
Modbus RTU Serial Driver 40
32-Bit IEEE Float ing Point Dat a Range Dat a Type Access
Float, Long,
Reserved Data 6001-7000 Read/Write
DWord, LBCD
Float, Long,
Digital to Analog Outputs 7001-7024 Read/Write
DWord, LBCD
Float, Long,
User Variables 7025-7088 Read/Write
DWord, LBCD
Float, Long,
Programmable Accumulator 7089-7099 Read/Write
DWord, LBCD
7n01 - 7n99 Float, Long,
Meter Run Data Read/Write
n=Number of Meter Run DWord, LBCD
Float, Long,
Scratch Pad Data 7501-7599 Read/Write
DWord, LBCD
Float, Long,
PID Control Data 7601-7623 Read/Write
DWord, LBCD
Float, Long,
Miscellaneous Meter Run Data 7624-7699 Read/Write
DWord, LBCD
Float, Long,
Miscellaneous Variables 7701-7799 Read/Write
DWord, LBCD
Float, Long,
Meter Station Data 7801-7899 Read/Write
DWord, LBCD
Float, Long,
Prover Data 7901-7918 Read/Write
DWord, LBCD
www. ptc.com
41 M od b u s RTU Serial Driver
32-Bit IEEE Float ing Point Dat a Range Dat a Type Access
Float, Long,
Configuration Data for Prover 7919-7958 Read/Write
DWord, LBCD
Float, Long,
Last Prove Data 7959-7966 Read/Write
DWord, LBCD
Float, Long,
Data Rejected During Prove 7967-7990 Read/Write
DWord, LBCD
Float, Long,
Prove Run Data 7991-8050 Read/Write
DWord, LBCD
Float, Long,
Prove Average Data 8051-8079 Read/Write
DWord, LBCD
Float, Long,
Prove Run-Client Meter Data 8080-8199 Read/Write
DWord, LBCD
Float, Long,
Proving Series Data 8200-8223 Read/Write
DWord, LBCD
Float, Long,
Data of Meter Being Proved 8224-8230 Read/Write
DWord, LBCD
Float, Long,
Mass Prove Data 8231-8500 Read/Write
DWord, LBCD
Float, Long,
Miscellaneous Meter Run # 1 8501-8599 Read/Write
DWord, LBCD
Float, Long,
Miscellaneous Meter Run # 2 8601-8699 Read/Write
DWord, LBCD
Float, Long,
Miscellaneous Meter Run # 3 8701-8799 Read/Write
DWord, LBCD
Float, Long,
Miscellaneous Meter Run # 4 8801-8899 Read/Write
DWord, LBCD
Float, Long,
Station Previous Batch Average Data 8901-8999 Read/Write
DWord, LBCD
16-Bit Int eger Configurat ion Dat a Range Dat a Type Access
Short, Word,
Meter Run # 1 13001-13013 Read/Write
BCD
Short, Word,
Meter Run # 2 13014-13026 Read/Write
BCD
Short, Word,
Meter Run # 3 13027-13039 Read/Write
BCD
Short, Word,
Meter Run # 4 13040-13052 Read/Write
BCD
Short, Word,
Prover Configuration 13053-13073 Read/Write
BCD
Short, Word,
General Flow Configuration 13074-13084 Read/Write
BCD
Short, Word,
Serial Port Configuration 13085-13128 Read/Write
BCD
www. ptc.com
Modbus RTU Serial Driver 42
16-Bit Int eger Configurat ion Dat a Range Dat a Type Access
Short, Word,
PID Configuration 13129-13160 Read/Write
BCD
Short, Word,
PLC Data 13161-13299 Read/Write
BCD
Short, Word,
Peer to Peer Setup 13300-13499 Read/Write
BCD
Short, Word,
Raw Data Archive 13500-13999 Read/Write
BCD
32-Bit IEEE Float ing Point Dat a Range Dat a Type Access
Float, Long,
Flow Computer Configuration 17001-18999 Read/Write
DWord, LBCD
Om ni Cust om Packet s
The Omni Flow Computer allows users to map various ranges of memory to a single data structure that can
be read with a single, highly efficient read command. These data structures are called Custom Packets.
Packet Configuration
Each custom packet may contain up to twenty groups of data points. Each group is defined by its starting
index and the number of data points. The total size of the custom packet must not exceed 250 bytes. The
addresses used to define the custom packets are listed below.
www. ptc.com
43 M od b u s RTU Serial Driver
to
3055 Group 20-Starting index
3056 Group 20-Number of points
N ote: Data is returned from the device as 16-bit registers. Digital I/O must be mapped in blocks of 16 bits.
N otes:
2. If a 16 character ASCII string data address is contained in group configuration, then data can be read
as two 8-character ASCII string data items.
Example
Define Custom Packet # 1 to map to the following:
N ote: This makes a total of 222 bytes. The custom packet configuration registers would have the following
values:
3001 = 1001
3002 = 16
3003 = 5101
3004 = 15
3005 = 7001
www. ptc.com
Modbus RTU Serial Driver 44
3006 = 12
3007 = 4101
3008 = 4
3009 = 4808
3010 = 6
3011 = 14001
3012 = 2
Tags to access the Digital I/O data would have the following addresses (all 16 values contained in word 0):
CP1_0.0 (Word 0 of Custom Packet 1, bit 0-mapped to 1009)
CP1_0.1 (Word 0 of Custom Packet 1, bit 1-mapped to 1010)
...
CP1_0.6 (Word 0 of Custom Packet 1, bit 6-mapped to 1015)
CP1_0.7 (Word 0 of Custom Packet 1, bit 7-mapped to 1016)
CP1_0.8 (Word 0 of Custom Packet 1, bit 8-mapped to 1001)
CP1_0.9 (Word 0 of Custom Packet 1, bit 9-mapped to 1002)
...
CP1_0.14 (Word 0 of Custom Packet 1, bit 14-mapped to 1007)
CP1_0.15 (Word 0 of Custom Packet 1, bit 15-mapped to 1008)
Tags to access the Meter Run 1 Batch data would have the following addresses (each 32-bit value uses 2
words):
CP1_1 (Word 1 of Custom Packet 1-mapped to 5101)
CP1_3 (Word 3 of Custom Packet 1-mapped to 5102)
...
CP1_29 (Word 29 of Custom Packet 1-mapped to 5115)
Tags to access the Analog Output data would have the following addresses (each 32-bit value uses 2 words):
CP1_31 (Word 31 of Custom Packet 1-mapped to 7001)
CP1_33 (Word 33 of Custom Packet 1-mapped to 7002)
...
CP1_53 (Word 53 of Custom Packet 1-mapped to 7012)
Tags to access the Meter Run 8 character ASCII String data would have the following addresses (each String
value uses 4 words):
CP1_55 (Word 55 of Custom Packet 1-mapped to 4101)
...
CP1_67 (Word 67 of Custom Packet 1-mapped to 4104)
Tags to access the Meter Station 8 character ASCII String data would have the following addresses (each
String value uses 4 words):
CP1_71 (Word 71 of Custom Packet 1-mapped to 4808)
...
CP1_91 (Word 91 of Custom Packet 1-mapped to 4813)
Tags to access the Flow Configuration 16 character ASCII String data would have the following addresses
(each String value uses 4 words):
CP1_95 (Word 95 of Custom Packet 1-mapped to 14001 characters 1-8)
CP1_99 (Word 99 of Custom Packet 1-mapped to 14001 characters 9-16)
CP1_103 (Word 103 of Custom Packet 1-mapped to 14002 characters 1-8)
CP1_107 (Word 107 of Custom Packet 1-mapped to 14002 characters 9-16)
www. ptc.com
45 M od b u s RTU Serial Driver
Each record may contain up to sixteen groups of data points. Each group is defined by its starting index and
the number of data points. The addresses used to define the archive records are listed below. The total size
of the record must not exceed 250 bytes. The device uses the first 6 bytes for date and time stamp data, leav-
ing 244 bytes for raw data. Each record has its own Boolean trigger. Data is stored when the trigger goes
from low to high.
Before a group starting index, number of points in group or trigger for a raw data archive can be changed,
archiving must halt. The Allow Archive Configuration Flag must be set in the device. Be aware that doing
this likely causes the data archive in the device to be reinitialized, including all Raw Data Archives and the
Text Archive.
This driver may be used to read a Raw Data Archive one record at a time. To read a record, first write the
desired record index to the "Requested record" register. Once this value is set, users may read the record
with an "RA" tag. Users should ensure that the specified record index does not exceed the maximum num-
ber of records allowed for that archive. If the "Last record updated" value is zero, there have been no
records saved in the archive since it was last initialized.
www. ptc.com
Modbus RTU Serial Driver 46
www. ptc.com
47 M od b u s RTU Serial Driver
www. ptc.com
Modbus RTU Serial Driver 48
N ote: Data is returned from the device as 16-bit registers. Digital I/O must be mapped in blocks of 16 bits.
N otes:
2. If a 16 character ASCII string data address is contained in group configuration, then data can be read
as two 8-character ASCII string data items.
Timestamp Format
The first 6 bytes of each record contains the time and date that the record was placed in the archive.
www. ptc.com
49 M od b u s RTU Serial Driver
Alarm Types
Type Descript ion
0 Log event, sound beeper and display in LCD any edge change in bit identified by field # 3.
1 Log event, sound beeper and display in LCD rising edge changes in bit identified by field # 3.
2 Event Log any edge change in bit identified by field # 3. No beeper or LCD display action.
3 Event Log rising edge changes in bit identified by field # 3. No beeper or LCD display action.
N ote: Fields 5 and 6 are set to 0.0 when the variable type changed is a string. Fields 7 and 8 contain null
characters when the variable type change is not a string. When fields 7 and 8 contain 8-character strings,
the remaining 8 characters are padded with nulls.
Om ni Text Report s
The Omni Flow computer can generate several different types of text reports. Each of these reports can be
read by this driver and sent to the OPC Client as a string value.
www. ptc.com
Modbus RTU Serial Driver 50
There are a number of report types that can be retrieved from the Omni Flow Computer. They may be read
using a "TR" tag. The report types are as follows.
Example
To read or write to the Snapshot Report Template (address 9001), create a tag with address "TR9001".
N ote: Because it can take several seconds to read a Text Report, the "TR" tags should be kept inactive in
the OPC client. Alternatively, triggered reads can be used instead. No other tags on the channel can be read
or written to while the driver is reading or writing a Text Report.
www. ptc.com
51 M od b u s RTU Serial Driver
As noted above, it is recommended that the Text Report tag be kept inactive, even though it is not always pos-
sible. A triggered read capability has been added as an alternative, allowing the Text Report tag to remain
active. It also controls when the actual device reads occur with an auxiliary trigger tag.
A triggered read may not begin immediately, depending on when in the Text Report tag's update cycle the
trigger is set. After the read attempt has been completed, the driver clears the trigger state. The Text Report
tag shows the value and data quality that resulted from the last triggered read attempt.
Example
To read the Last Batch Report (address 9101) on trigger, create two tags. The first is a Text Report tag with
address "TR9101 T", and the second is a Text Report Read Trigger tag with address "TRIG_TR9101".
N ote: The Text Report tag address looks like a normal Text Report address followed by a space and the let-
ter "T" for "triggered read". This "T" must be present in the address for triggered reads to work.
To trigger a read, set the trigger tag value to true (non-zero). After the read attempt has been completed,
the driver sets the trigger value to false (0). If the read was successful, the Text Report tag's data quality is
Good. If the read failed, the Text Report tag's data quality is Bad, and the value is the last value successfully
read.
The path buffers are initialized to empty strings on server start up. The driver does not write Text Report
data to file until a valid path is saved in the associated path buffer. Path data is not persistent. The path
strings must be rewritten each time the server is restarted. The path values can be changed at any time,
allowing users to save data to different files on each read if desired.
Example
To read the Last Batch Report (address 9101) and save the result to disk, create two tags. The first is a Text
Report tag with address "TR9101", and the second is a path tag with address "PATH_TR9101".
To save the report data in a file called "LastBatch.txt" (which is to be created in the folder "C:\Om-
niData\BatchReports") set up the client so that the first thing that it does is write "C:\Om-
www. ptc.com
Modbus RTU Serial Driver 52
niData\BatchReports\LastBatch.txt" to the path tag. Once this is done, read the Text Report tag. If the path is
not set before the first read of the Text Report, the driver is not able to save the data to disk.
N ote: To disable this feature, write an empty string to the path tag.
Om ni Text Archive
The Omni Flow Computer can also store reports in an archive. This driver can read a range of reports from
the archive and send them to the OPC client as a string value.
If a Text Archive read fails midway, users should reset the device's read buffer by writing 999 to the number
of days register (15127), and then repeat the normal Text Archive read procedure. Otherwise, the driver
may not get the first part of the requested archive range.
A triggered read may not begin immediately depending on when in the Text Archive tag's update cycle the
trigger is set. After the read attempt has been completed, the driver clears the trigger state. The Text
Archive tag shows the value and data quality that resulted from the last triggered read attempt.
Example
To read the Text Archive on trigger, create two tags. The first is a Text Archive tag with address "TA T", and
the second is a Text Archive Read Trigger tag with address "TRIG_TA". Users must create start date and num-
ber of days tags.
www. ptc.com
53 M od b u s RTU Serial Driver
N ote: The Text Archive tag address looks like a normal Text Archive address followed by a space and the
letter "T" for "triggered read". This "T" must be present in the address for triggered reads to work.
To trigger a read, set the trigger tag value to true (non-zero). After the read attempt has been completed,
the driver sets the trigger value to false (0). If the read was successful, the Text Archive tag's data quality is
Good. If the read failed, the Text Archive tag's data quality is Bad and the value is the last value successfully
read.
The path buffer is initialized to an empty string on server start up. The driver does not write Text Archive
data to file until a valid path is saved in the associated path buffer. Path data is not persistent. Users must to
rewrite the path string each time the server is restarted. The path value can be changed at any time, allow-
ing the data to be saved to different files on each read (if desired).
The path string may be up to 255 characters long. The directory cannot be the root drive (C:\\Tex-
tArchive.txt), within the Windows directory, or within the Program Files directory other than the server install-
ation location. The file extension must be either .txt or .log.
Example
To read the Text Archive and save the result to disk, create two tags. The first is a Text Archive tag with
address "TA", and the second is a path tag with address "PATH_TA". Users must create start date and num-
ber of days tags as described above.
To save the Text Archive data in a file called "TextArchive.txt" (which is to be created in the folder "C:\Om-
niData\ArchiveData") set up the client so that the first thing that it does is write "C:\Om-
niData\ArchiveData\TextArchive.txt" to the path tag. Once this is done, read the Text Archive tag. If the path
is not set before the first read of the Text Archive, the driver is not able to save the data to disk.
N ote: To disable this feature, write a empty string to the path tag.
www. ptc.com
Modbus RTU Serial Driver 54
www. ptc.com
55 M od b u s RTU Serial Driver
General Properties
N ote: Changing this property causes the API endpoint URL to change.
common.ALLTYPES_DESCRIPTION
servermain.CHANNEL_DIAGNOSTICS_CAPTURE
servermain.CHANNEL_ETHERNET_COMMUNICATIONS_NETWORK_ADAPTER_STRING
Advanced Properties
servermain.CHANNEL_NON_NORMALIZED_FLOATING_POINT_HANDLING
Write Optimizations
servermain.CHANNEL_WRITE_OPTIMIZATIONS_METHOD
servermain.CHANNEL_WRITE_OPTIMIZATIONS_DUTY_CYCLE
See Also: The server help system Configuration API Service section.
General Properties
common.ALLTYPES_DESCRIPTION
servermain.DEVICE_CHANNEL_ASSIGNMENT
servermain.DEVICE_DATA_COLLECTION
servermain.DEVICE_SIMULATED
www. ptc.com
Modbus RTU Serial Driver 56
Scan M ode
servermain.DEVICE_SCAN_MODE
servermain.DEVICE_SCAN_MODE_RATE_MS
servermain.DEVICE_SCAN_MODE_RATE_MS
servermain.DEVICE_SCAN_MODE_PROVIDE_INITIAL_UPDATES_FROM_CACHE
Auto Demotion
servermain.DEVICE_AUTO_DEMOTION_ENABLE_ON_COMMUNICATIONS_FAILURES
servermain.DEVICE_AUTO_DEMOTION_DEMOTE_AFTER_SUCCESSIVE_TIMEOUTS
servermain.DEVICE_AUTO_DEMOTION_PERIOD_MS
servermain.DEVICE_AUTO_DEMOTION_DISCARD_WRITES
Tag Generation
servermain.DEVICE_TAG_GENERATION_ON_STARTUP
servermain.DEVICE_TAG_GENERATION_DUPLICATE_HANDLING
servermain.DEVICE_TAG_GENERATION_GROUP
servermain.DEVICE_TAG_GENERATION_ALLOW_SUB_GROUPS
Tip: To Invoke Automatic Tag Generation, send a PUT with an empty body to the TagGeneration service
endpoint on the device.
See Also: For more information, see Services help.
Timing
servermain.DEVICE_CONNECTION_TIMEOUT_SECONDS
servermain.DEVICE_REQUEST_TIMEOUT_MILLISECONDS
servermain.DEVICE_RETRY_ATTEMPTS
servermain.DEVICE_INTER_REQUEST_DELAY_MILLISECONDS
See Also: The server help system Configuration API Service section.
www. ptc.com
57 M od b u s RTU Serial Driver
Bad address in block range. | Address range = <st art > t o <end>.
Error Type:
Error
Possible Cause:
1. An attempt was made to reference a nonexistent location in the specified device.
2. An attempt was made to read more registers than allowed by the protocol.
Possible Solution:
1. Verify the tags assigned to addresses in the specified range on the device and eliminate ones that ref-
erence invalid locations.
See Also:
1. Error Handling
2. Block Sizes
Possible Cause:
An array of addresses was defined that spans past the end of the address space.
Possible Solution:
1. Verify the size of the device's memory space and redefine the array length accordingly.
2. Verify the tags assigned to addresses in the specified range on the device and eliminate ones that ref-
erence invalid locations.
See Also:
www. ptc.com
Modbus RTU Serial Driver 58
1. Error Handling
2. Block Sizes
Block address responded wit h except ion code. | Address range = <st art >
t o <end>, Except ion code = <code>.
Error Type:
Warning
Possible Cause:
See Modbus Exception Codes for a description of the exception code.
Possible Solution:
See Modbus Exception Codes.
Possible Cause:
See Modbus Exception Codes for a description of the exception code.
Possible Solution:
See Modbus Exception Codes.
Unable t o read from address, device responded wit h except ion code. |
Address = '<address>', Except ion code = <code>.
Error Type:
Warning
Possible Cause:
See Modbus Exception Codes for a description of the exception code.
Possible Solution:
See Modbus Exception Codes.
Possible Cause:
The driver can not allocate memory required to process variable import file.
Possible Solution:
www. ptc.com
59 M od b u s RTU Serial Driver
Possible Cause:
The variable import file could not be read.
Possible Solution:
Regenerate the variable import file.
Error parsing record in im port file. | Record num ber = <num ber>, Field =
<nam e>.
Error Type:
Warning
Possible Cause:
The specified field in the variable import file could not be parsed because it is invalid or longer than expec-
ted.
Possible Solution:
Edit the variable import file to change the offending field.
Descript ion t runcat ed for record in im port file. | Record num ber = <num -
ber>.
Error Type:
Warning
Possible Cause:
The tag description given in specified record is too long.
Possible Solution:
The driver truncates descriptions as needed. To prevent this error, edit the variable import file to shorten
the description.
Im port ed t ag nam e is invalid and has been changed. | Tag nam e = '<t ag>',
Changed t ag nam e = '<t ag>'.
Error Type:
Warning
Possible Cause:
The tag name encountered in the variable import file contained invalid characters.
Possible Solution:
www. ptc.com
Modbus RTU Serial Driver 60
The driver constructs valid names based on the variable import file. To prevent this error and maintain
name consistency, change the name of the exported variable.
A t ag could not be im port ed because t he dat a t ype is not support ed. | Tag
nam e = '<t ag>', Unsupport ed dat a t ype = '<t ype>'.
Error Type:
Warning
Possible Cause:
The driver does not support the data type specified in the variable import file.
Possible Solution:
Change the data type specified in the variable import file to one that is supported. If the variable is for a
structure, manually edit the file to define each tag required for the structure or configure the required tags
manually in the server.
See Also:
Exporting Variables from Concept
Could not read Om ni t ext buffer due t o m em ory allocat ion problem .
Error Type:
Warning
Possible Cause:
The driver can not allocate memory required for an Omni Text Record or Text Archive read operation.
Possible Solution:
Shut down all unnecessary applications and retry.
Possible Cause:
No data is in the text archive for the date range specified by the Start Date register (15128) and the Number
of Days register (15127).
Possible Solution:
This is not necessarily an error. Verify there is no data available for specified range.
Writ e t o Om ni t ext report t runcat ed. | Report num ber = <num ber>.
Error Type:
Warning
Possible Cause:
An attempt was made to write more than 8192 bytes to a text report. This is a limit imposed by the protocol.
www. ptc.com
61 M od b u s RTU Serial Driver
Possible Solution:
Do not write strings greater than the 8192 byte limit. If the string is longer, only the first 8192 characters are
written to the device.
Could not read Om ni t ext report due t o packet num ber lim it . | Report
num ber = <num ber>.
Error Type:
Warning
Possible Cause:
Text reports are expected to be 8192 bytes or less. This is a limit imposed by the protocol. The driver read
8192 bytes before encountering the expected end of file character.
Possible Solution:
Verify that the report template used by the device generates reports of 8192 bytes or less.
Possible Cause:
Path length is limited to the indicated number of characters.
Possible Solution:
Use a shorter path.
Error writ ing Om ni t ext dat a t o file. | Tag address = '<address>', Reason =
'<reason>'.
Error Type:
Warning
Possible Cause:
The driver could not write the Omni text data to disk for the indicated reason.
Possible Solution:
Consult the operating system documentation for appropriate corrective measures for the reason indicated.
Om ni t ext out put file could not be opened. | Tag address = '<address>',
Reason = '<reason>'.
Error Type:
Warning
Possible Cause:
The file specified in an Omni Text Path tag could not be created or opened.
www. ptc.com
Modbus RTU Serial Driver 62
Possible Solution:
Consult the operating system documentation about the reason indicated for appropriate corrective meas-
ures. The most likely cause is an invalid path.
See Also:
1. Omni Text Reports
Om ni t ext out put file could not be changed. | Tag address = '<address>',
Reason = The pat h specified is not allowed.
Error Type:
Warning
Possible Cause:
The directory specified in an Omni Text Path tag is not allowed.
Possible Solution:
Consult the driver help content and supply a path to a secure location.
See Also:
1. Omni Text Reports
Om ni t ext out put file could not be changed. | Tag address = '<address>',
Reason = The file ext ension specified m ust be '.t xt ' or '.log'.
Error Type:
Warning
www. ptc.com
63 M od b u s RTU Serial Driver
Possible Cause:
The extension specified in an Omni Text Path tag is not allowed and must be .txt or .log.
Possible Solution:
Specify a valid extension.
See Also:
1. Omni Text Reports
Im port ing t ag dat abase from file. | File nam e = '<nam e>'.
Error Type:
Informational
www. ptc.com
Modbus RTU Serial Driver 64
www. ptc.com
65 M od b u s RTU Serial Driver
Index
A tag could not be imported because the data type is not supported. | Tag name = '<tag>', Unsupported
data type = '<type>'. 60
Address Descriptions 31
Allow Sub Groups 19
Attempts Before Timeout 16
Auto-Demotion 17
Auto-Dial 11
Automatic Tag Database Generation 26
Channel-Level Settings 8
Channel Assignment 13
Channel Properties — Advanced 12
Channel Properties — Communication Serialization 7
Channel Properties — General 6
Channel Properties — Serial Communications 9
Channel Properties — Write Optimizations 9
Close Idle Connection 11-12
Coils 31
COM ID 10
COM Port 10
www. ptc.com
Modbus RTU Serial Driver 66
Communication Protocol 6
Communications Timeouts 16
Connect Attempts 16
Connect Timeout 11, 16
Connection Type 10
Could not read Omni text buffer due to memory allocation problem. 60
Could not read Omni text report due to packet number limit. | Report number = <number>. 61
Create 19
www. ptc.com
67 M od b u s RTU Serial Driver
General 13
Generate 18
Global Settings 8
Hardware break 63
Holding Register Bit Mask 20
Holding Registers 23
I/O error 63
ID 13
Identification 6, 13
Idle Time to Close 11-12
www. ptc.com
Modbus RTU Serial Driver 68
Imported tag name is invalid and has been changed. | Tag name = '<tag>', Changed tag name =
'<tag>'. 59
Importing tag database from file. | File name = '<name>'. 63
Include Descriptions 24
Initial Updates from Cache 15
Input Coils 23
Inter-Device Delay 12
Inter-Request Delay 17
Internal Registers 23
IP Address 15
LBCD 30
Leading 24
Load Balanced 8
Long 30
Name 13
Network 1 - Network 500 8
Network Mode 8
No Omni text archive data available in specified date range. 60
Non-Normalized Float Handling 12
www. ptc.com
69 M od b u s RTU Serial Driver
None 10
Parent Group 19
Parity 6, 10, 63
Physical Medium 10
Poll Delay 11
Port 15
Priority 8
Protocol 15
Raise 11
www. ptc.com
Modbus RTU Serial Driver 70
Read Processing 12
Redundancy 25
Registers 31
Reject Repeated Messages 25
Replace with Zero 12
Report Communication Errors 11
Request Timeout 16
Respect Tag-Specified Scan Rate 15
RS-485 11
RTS 11
RX buffer overrun 63
Scan Mode 14
Serial Communications 9
Serial Port Settings 10
Settings 20
Setup 6
Shared 10
Short 30
Simulated 14
Statistics Items 27
Stop Bits 6, 11
String 30
Supported Devices 6
Tag Counts 7, 14
Tag Generation 17
Tag import failed due to low memory resources. 58
Timeouts to Demote 17
Trailing 25
Transactions per Cycle 8
Treat Longs as Decimals 22
TX buffer full 63
www. ptc.com
71 M od b u s RTU Serial Driver
Unable to read block address. Unexpected characters in response. | Address range = <start> to
<end>. 62
Unable to read from address, device responded with exception code. | Address = '<address>', Exception
code = <code>. 58
Unable to read from address. Unexpected characters in response. | Tag address = '<address>'. 62
Unable to write to address, device responded with exception code. | Address = '<address>', Exception
code = <code>. 58
Unable to write to address. Unexpected characters in response. | Tag address = '<address>'. 62
Unmodified 12
Word 30
Write All Values for All Tags 9
Write failed. Maximum path length exceeded. | Tag address = '<address>', Maximum length = <num-
ber>. 61
Write Only Latest Value for All Tags 9
Write Only Latest Value for Non-Boolean Tags 9
Write to Omni text report truncated. | Report number = <number>. 60
Zero-Based Addressing 20
Zero-Based Bit Addressing 20
www. ptc.com