v5 Lufkin Modbus Manual
v5 Lufkin Modbus Manual
Table of Contents
Table of Contents 2
Lufkin Modbus Driver Help 4
Overview 4
Channel Setup 5
Device Setup 6
Cable Diagram 7
Modem Setup 7
Block Sizes 8
Data Encoding Settings 9
Framing 10
Error Handling 12
Card Settings 13
Tag Import 15
Data Types Description 16
Address Descriptions 17
Statistics Items 19
Error Descriptions 21
Address Validation 21
Address <address> is out of range for the specified device or register. 21
Array size is out of range for address <address>. 21
Array support is not available for the specified address: <address>. 21
Data Type <type> is not valid for device address <address>. 21
Device address <address> contains a syntax error. 22
Device address <address> is not supported by model <model name>. 22
Device address <address> is read only. 22
Missing address 22
Serial Communications 22
COMn does not exist. 23
COMn is in use by another application. 23
Error opening COMn [OS Error == <OS Error ID>]. 23
Serial communications error on channel <channel name> [<error mask>]. 23
Unable to set comm parameters on COMn [OS Error == <OS Error ID>]. 24
Device Status Messages 24
Device <device name> is not responding. 24
Unable to write to <address> on device <device name>. 24
Unable to write to address <address> on device <device>: Device responded with exception code
<code>. 25
Write failed for <tag name> on device <device name>. Maximum path length of <number> exceeded. 25
Lufkin Modbus Specific Messages 25
Bad address in block [<start address> to <end address>] on device <device name>. 25
www. kepware.com
Lufkin Modbus Driver Help 3
www. kepware.com
4 Lufkin Modbus Driver Help
CONTENTS
Overview
What is the Lufkin Modbus Driver?
Channel Setup
How do I configure channels for use with this driver?
Device Setup
How do I configure a device for use with this driver?
Address Descriptions
How do I address a data location on a Lufkin Modbus device?
Error Descriptions
What error messages are produced by the Lufkin Modbus driver?
Overview
The Lufkin Modbus Driver provides an easy and reliable way to connect Lufkin Modbus devices to OPC Client
applications, including HMI, SCADA, Historian, MES, ERP and countless custom applications. It intended for use
with serial devices that support the Extended Lufkin Automation Modbus (ELAM) protocol and the Standard
MODBUS protocol.
www. kepware.com
Lufkin Modbus Driver Help 5
Channel Setup
This driver supports multiple channel settings. For more information, refer to "What is a Channel?" in the server
help file.
Communication Serialization
The Lufkin Modbus Driver supports Communication Serialization, which specifies whether data transmissions
should be limited to one channel at a time. For more information, refer to "Channel Properties - Advanced" in the
server help file.
www. kepware.com
6 Lufkin Modbus Driver Help
Device Setup
Supported Devices
Injection Well Controller (IWC)
Progressive Cavity Pump (PCP)
Rod Pump Controller (RPC)
Variable Speed Drive (VSD)
Communication Protocol
Extended Lufkin Automation Modbus (ELAM)
Standard MODBUS
Note: Not all of the listed configurations may be supported in every device.
Ethernet Encapsulation
This driver supports Ethernet Encapsulation, which allows the driver to communicate with serial devices
attached to an Ethernet network using a terminal server. It may be enabled for the channel through the
Communications dialog in Channel Properties. For more information, refer to the OPC server's help file.
Flow Control
When using an RS232/RS485 converter, the type of flow control that is required depends on the converter's
needs. Some do not require any flow control whereas others require RTS flow. Consult the converter's
documentation to determine its flow requirements. An RS485 converter that provides automatic flow control is
recommended.
Note: When using the manufacturer's supplied communications cable, it is sometimes necessary to choose a
flow control setting of RTS or RTS Always in Channel Properties.
www. kepware.com
Lufkin Modbus Driver Help 7
Cable Diagram
For recommended wiring and cable diagrams, refer to the Modbus device manufacturer's documentation. The
Modicon 984 Modbus Controller cable diagram is shown below.
Modem Setup
This driver supports modem functionality. For more information, please refer to the topic "Modem Support" in the
OPC Server Help documentation.
www. kepware.com
8 Lufkin Modbus Driver Help
Block Sizes
l Coils (8-2000 in multiples of 8): This parameter specifies the output and input coils. Coils can be
read from 8 to 2000 points (bits) at a time. A higher block size means more points will be 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.
Important: Certain Firmware versions for Lufkin devices may not support requests for blocks of coils
greater than 1992. It is recommended that users with projects requiring the coil block size to be set
above this value contact the vendor
l Registers (1-2500): This parameter specifies the internal and holding registers. The minimum block
size is 1. The maximum block size depends on the Device ID. If the Device ID is 0 to 247, the configurable
block size range is 1 to 125. If the Device ID is 248 to 2295, the configurable block size range is 1 to
2500. A higher block size means more register values will be 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.
Note: Array data is read from a device in pieces no greater than the block size that was configured for the
associated function code. For example, with a configured holding register block size of 100, the tag
"40001[250]" would be read from a device in three transactions of 100, 100, and 50 respectively.
l Perform block read on strings: When checked, this option will block read string tags (which are
normally read individually). String tags will also be grouped together depending on the selected block
size. Block reads can only be performed for Modbus model string tags. The default setting is unchecked.
www. kepware.com
Lufkin Modbus Driver Help 9
l First word low in 32-bit data types: When checked, the driver will use first word low in 32-bit data
types and data type arrays (such as Float, DWord, Long, and LBCD). The default setting is checked.
Note: This setting does not apply to the Word, Short, BCD, or Double data types.
Data Encoding
To determine the correct Data Encoding setting, refer to both the table below and the device's documentation. For
most devices, the default setting is acceptable.
www. kepware.com
10 Lufkin Modbus Driver Help
Framing
Some terminal server devices add additional data to Modbus frames; as such, the Framing parameters can be
used to configure the driver to ignore the additional bytes in response messages.
l Use Modbus TCP Framing: When checked, this parameter is used to communicate with native Modbus
TCP devices using Ethernet Encapsulation. This option will be disabled when the device's ID is in the
extended range (ID > 247).
l Leading bytes: This parameter is used to specify the number of bytes to be attached to the beginning of
Modbus responses. Values may range from 0 to 8.
l Trailing bytes: This parameter is used to specify the number of bytes to be attached to the end of
Modbus responses. Values may range from 0 to 8.
2. In the Communications tab, select Use Ethernet Encapsulation. This will enable Ethernet
Encapsulation for the channel.
3. Next, open the device's Device Properties. Descriptions of the parameters are as follows:
l IP Address: This parameter specifies the device's IP address. The default setting is
255.255.255.255.
l Port Number: This parameter specifies the port number. The default setting is 2101.
l Protocol: This parameter specifies the protocol. The default setting is TCP/IP.
www. kepware.com
Lufkin Modbus Driver Help 11
www. kepware.com
12 Lufkin Modbus Driver Help
Error Handling
The Error Handling parameters determine how to deal with errors from the device.
l Deactivate Tags on Illegal Address Exception: When checked, the driver will stop 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. To read addresses that are accessible dynamically in the
device, uncheck this option. The default setting is checked.
l Reject Repeated Messages: When checked, the driver will expect repeated messages. When
unchecked, the driver will interpret a repeated message as an invalid response and will retry the request.
The default setting is unchecked.
Note: Some message-relay equipment will echo Modbus requests back to the driver.
www. kepware.com
Lufkin Modbus Driver Help 13
Card Settings
Card items are tags that facilitate the reading of dynagraph card data from a Lufkin device. When a client reads a
card item tag, the server writes to an address on the device that initiates the loading of dynagraph card data into
a memory buffer located on that same device. The server then reads the data from the device’s buffer, which
completes the card item read.
The Card Settings dialog specifies the address that the server will write to, as well as the buffer address and
length that the server will read for a particular card item.
Note: The Card Settings parameters are only available for the RPC and VSD device models.
l Coil Address Configuration: This group contains the coil addresses to which the server will write to
initiate a buffer load on a device. The addresses' default settings are device-specific, and will be
configured when the device is first created.
l Buffer Configuration: This group contains the memory buffers. Each memory buffer has a starting
address and length parameter that the server will use when reading the dynagraph card data. The
memory buffers' default starting addresses and lengths are device-specific, and will be configured when
the device is first created.
www. kepware.com
14 Lufkin Modbus Driver Help
www. kepware.com
Lufkin Modbus Driver Help 15
Tag Import
The Tag Import dialog is used to import tags from the Lufkin Modbus device.
Note: Tag Import is only available for the RPC and VSD device models.
l Import Tags: When clicked, this button will import card item tags from the Lufkin Modbus device. If the
server configuration utility does not have a connection to the Runtime (or if the device does not support
Card Items), this button will be disabled.
www. kepware.com
16 Lufkin Modbus Driver Help
Value range is 0-9999. Behavior is undefined for values beyond this range.
LBCD Four byte packed BCD
Value range is 0-99999999. Behavior is undefined for values beyond this range.
String Null terminated ASCII string
The driver interprets two consecutive registers as a single precision value by making the
last register the high word and the first register the low word.
Float Example If register 40001 is specified as a float, bit 0 of register 40001 would be bit 0 of the 32-bit
data type and bit 15 of register 40002 would be bit 31 of the 32-bit data type.
www. kepware.com
Lufkin Modbus Driver Help 17
Address Descriptions
The default data types for dynamically defined tags are shown in bold where appropriate.
*All Read/Write addresses may be set as Write Only by prefixing a "W" to the address such as "W40001." This
will prevent the driver from reading the register at the specified address. Any attempts by the client to read a
Write Only tag will result in obtaining the last successful write value to the specified address. If no successful
writes have occurred, the client will receive 0/NULL for numeric/string values for an initial value.
Caution: Setting the Client Access privileges of Write Only tags to Read Only will cause writes to these tags to fail
and the client to always receive 0/NULL for numeric/string values.
www. kepware.com
18 Lufkin Modbus Driver Help
String Support
The Lufkin Modbus Driver supports reading and writing holding register memory as an ASCII string. When using
holding registers for string data, each register will contain 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.
Note: Write requests to String Tags are limited to a maximum of 60 registers. Requests that surpass 60 will be
truncated.
1. The 255'th output coil would be addressed as '0255' using decimal addressing or 'H0FF' using
hexadecimal addressing.
2. Some documentation refers to Modbus addresses by function code and location. For instance, function
code 3, location 2000 would be addressed as '42000' or 'H47D0'. The leading '4' represents holding
registers or function code 3.
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 output
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. Examples are given using holding register locations.
www. kepware.com
Lufkin Modbus Driver Help 19
For arrays, rows multiplied by cols cannot exceed the maximum request size allowed by the protocol. For devices
in standard Modbus mode, rows multiplied by cols multiplied by the data type length in registers cannot exceed
125. For devices in ELAM mode (ID > 247), rows multiplied by cols multiplied by the data type length in registers
cannot exceed 2500.
Note: Write requests to Array Tags are limited to a maximum of 60 registers. Requests that surpass 60 will
result in only the first 60 registers of the array being written to the device.
where xxxx 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 will be such that the start address will be the least significant bit (LSB) of analog value.
Statistics Items
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. Alternatively, double-
click on the channel and select Enable Diagnostics.
Note: Statistics at the channel level are the sum of those same items at the device level.
www. kepware.com
20 Lufkin Modbus Driver Help
www. kepware.com
Lufkin Modbus Driver Help 21
Error Descriptions
The following categories of error/warning messages may be generated. Click on the link for list of messages.
Address Validation
Device Status Messages
Lufkin Modbus Specific Messages
Serial Communications
See Also:
Modbus Exception Codes
Address Validation
The following error/warning messages may be generated. Click on the link for a description of the message.
Address Validation
Address <address> is out of range for the specified device or register.
Array size is out of range for address <address>.
Array support is not available for the specified address: <address>.
Data Type <type> is not valid for device address <address>.
Device address <address> contains a syntax error.
Device address <address> is not supported by model <model name>.
Device address <address> is read only.
Missing address.
Possible Cause:
A tag address that has been specified statically references a location that is beyond the range of supported
locations for the device.
Solution:
Verify that the address is correct; if it is not, re-enter it in the client application.
Possible Cause:
A tag address that has been specified statically is requesting an array size that is too large for the driver's
address type or block size.
Solution:
Re-enter the address in the client application to specify a smaller value for the array or a different starting point.
Possible Cause:
A tag address that has been specified statically contains an array reference for an address type that doesn't
support arrays.
Solution:
Re-enter the address in the client application to remove the array reference or correct the address type.
www. kepware.com
22 Lufkin Modbus Driver Help
Warning
Possible Cause:
A tag address that has been specified statically has been assigned an invalid data type.
Solution:
Modify the requested data type in the client application.
Possible Cause:
A tag address that has been specified statically contains one or more invalid characters.
Solution:
Re-enter the address in the client application.
Possible Cause:
A tag address that has been specified statically references a location that is valid for the communications protocol
but not supported by the target device.
Solution:
Verify that the address is correct; if it is not, re-enter it in the client application. Also verify that the selected
model name for the device is correct.
Possible Cause:
A tag address that has been specified statically has a requested access mode that is not compatible with what the
device supports for that address.
Solution:
Change the access mode in the client application.
Missing address
Error Type:
Warning
Possible Cause:
A tag address that has been specified statically has no length.
Solution:
Re-enter the address in the client application.
Serial Communications
The following error/warning messages may be generated. Click on the link for a description of the message.
Serial Communications
COMn does not exist.
COMn is in use by another application.
Error opening COMn [OS Error == <OS Error ID>].
Serial communications error on channel <channel name> [<error mask>].
Unable to set comm parameters on COMn [OS Error == <OS Error ID>].
www. kepware.com
Lufkin Modbus Driver Help 23
Possible Cause:
The specified COM port is not present on the target computer.
Solution:
Verify that the proper COM port has been selected.
Possible Cause:
The serial port assigned to a device is being used by another application.
Solution:
1. Verify that the correct port has been assigned to the channel.
Possible Cause:
The specified COM port could not be opened due to an internal hardware or software problem on the target
computer.
Solution:
Verify that the COM port is functional and may be accessed by other Windows applications.
Possible Cause:
1. The serial connection between the device and the Host PC is bad.
Solution:
2. Verify that the specified communications parameters match those of the device.
www. kepware.com
24 Lufkin Modbus Driver Help
Possible Cause:
The serial parameters for the specified COM port are not valid.
Solution:
Verify the serial parameters and make any necessary changes.
Possible Cause:
1. The serial connection between the device and the Host PC is broken.
3. The named device may have been assigned an incorrect Network ID.
4. The response from the device took longer to receive than the amount of time specified in the "Request
Timeout" device setting.
Solution:
2. Verify that the specified communications parameters match those of the device.
3. Verify that the Network ID given to the named device matches that of the actual device.
4. Increase the Request Timeout setting so that the entire response can be handled.
Possible Cause:
1. The serial connection between the device and the host PC is broken.
3. The named device may have been assigned an incorrect network ID.
Solution:
2. Verify that the specified communications parameters match those of the device.
www. kepware.com
Lufkin Modbus Driver Help 25
3. Verify that the Network ID given to the named device matches that of the actual device.
Possible Cause:
See Modbus Exception Codes for a description of the exception code.
Solution:
See Modbus Exception Codes.
Write failed for <tag name> on device <device name>. Maximum path length
of <number> exceeded.
Error Type:
Warning
Possible Cause:
Path length is limited to the indicated number of characters.
Solution:
Devise a shorter path.
Possible Cause:
1. An attempt has been made to reference a nonexistent location in the specified device.
2. An attempt has been made to read more registers than allowed by the protocol.
Solution:
1. Verify the tags assigned to addresses in the specified range on the device and eliminate ones that
reference invalid locations.
See Also:
Error Handling
Block Sizes
Possible Cause:
www. kepware.com
26 Lufkin Modbus Driver Help
1. An attempt has been made to reference a nonexistent location in the specified device.
2. An attempt has been made to read more registers than allowed by the protocol.
Solution:
1. Verify that all the register addresses requested in the array exist in the device and reduce the array size
such that only valid addresses (that exist in the device) are requested by the array.
See Also:
Error Handling
Block Sizes
www. kepware.com
Lufkin Modbus Driver Help 27
Note: For this driver, the terms Slave and Unsolicited are used interchangeably.
www. kepware.com
28 Lufkin Modbus Driver Help
Index
Bad address in block [<start address> to <end address>] on device <device name>. 25
Bad array spanning [<address> to <address>] on device <device>. 25
BCD 16
Block Size 6
Block Sizes 8
Boolean 16
Cable Diagram 7
Card Settings 13
Channel Setup 5
Channels, maximum 6
COMn does not exist. 23
COMn is in use by another application. 23
Error Descriptions 21
Error Handling 12
Error opening COMn [OS Error == <OS Error ID>]. 23
www. kepware.com
Lufkin Modbus Driver Help 29
Framing 10 , 23
LBCD 16
Long 16
Lufkin Modbus Specific Messages 25
Missing address 22
Modbus Exception Codes 27
Modem Setup 7
Network 6
Overrun 23
Overview 4
Parity 23
Serial Communications 22
Serial communications error on channel <channel name> [<error mask>]. 23
Short 16
Statistics Items 19
Tag Import 15
Unable to set comm parameters on COMn [OS Error == <OS Error ID>]. 24
Unable to write to <address> on device <device name>. 24
www. kepware.com
30 Lufkin Modbus Driver Help
Unable to write to address <address> on device <device>: Device responded with exception code
<code>. 25
Word 16
Write failed for <tag name> on device <device name>. Maximum path length of <number> exceeded. 25
www. kepware.com