ALiEn2 Modbus Communications User's Guide
ALiEn2 Modbus Communications User's Guide
ALiEn2 Expert
Modbus Communications User Guide
v2.1.x 02/10/2017
Revision History
Rev Date (d/m/y) Author Changes
1.1.x 8/2/2011 Ahmad Haydar Add support for grayed register. And added
Cycle restart state and duration, and close CP
type
1.1.x 12/4/2011 Ahmad Haydar Add danger velocity and clean up the time
remaining description.
1.1.1 25/4/2011 Ahmad Haydar Add Valve Auto Catch Status to Modbus
Add more details to cycle log and daily
production.
1.3.x 29/2/2012 Mark Scantlebury Add in the new registers for Afterflow and Close
time that is the combination of the Min and
Extended times.
Renamed Max Open to Max Afterflow.
1.4.x 27/04/2012 Mark Scantlebury Add in the ability to get/set units.
Add in more optimization modes
Additional plunger arrival sensor settings and
statuses.
1.6.x 19/09/2013 Mark Scantlebury Add in vent time tracking, total stats and
plunger stats.
Add in Valve B Purge
1.7.x 28/01/2014 Mark Scantlebury Add in tubing pressure
Add in Device Logs
Dynamically Change Units (Metric vs. Imperial)
Add manual valve operations
Allow full log access (Cycle and Daily)
2.0.x 10/02/2016 Mark Blackburn Target Surface Velocity
Danger/Fast Trip Source
Casing Pressure Rate Trip Delay
Average/Surface Velocity Log entries
Correct modbus error address in modbus error
register description
H:M:S Date/Time Register Not Consistent with
User Guide
Rev Date (d/m/y) Author Changes
2.0.x 28/04/2016 Mark Blackburn Add Average/Surface Velocity Log entries to full
log access (3:5000/3:6000 address ranges)
Add velocity sensor option to Arrival Sensor
Configuration register
2.1.x 08/12/2016 Mark Blackburn Added Auto Catcher Config, Auto Catcher Hold
time, and Purge Time.
Move the virtual sensor entries to 4:370.
Confidence code 6,7 added to in Plunger Cycle
Log – Full Implementation
2.1.x 17/01/2017 Mark Blackburn Documented remaining virtual sensors in
4:0371 – 4:0375 block
2.1.x 02/10/2017 Mark Blackburn Added virtual sensors to device configuration
holding registers (4:0241, 4:0261, 4:0311,
4:0331).
Added notes that virtual sensors and velocity
logs are not available in all software builds.
Added Current Cycle Log coil
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
Table of Contents
1 Introduction ............................................................................................................................. 1
3 Layer 1 Operation..................................................................................................................... 2
4 Layer 2 Operation..................................................................................................................... 3
5 Layer 3 Operation..................................................................................................................... 5
i
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
9 Acronyms................................................................................................................................ 73
10 Index ................................................................................................................................... 74
ii
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
Index of Tables
Table 1 - Supported Communication Rates and Formats ............................................................... 3
Table of Figures
Figure 1 - High Level Connection Overview..................................................................................... 1
iii
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
1 Introduction
The Remote Access Interface allows access to functions which are normally accessed using the
integral front panel interface.
This document describes how to use Modbus commands to operate the Remote Access
Application. The Modbus registers and functionality described in this document are for the
monitoring and modification of typical controller parameters.
1.1 References
[1] ALiEn2/ALiEn2Expert Installation and Operations Manual; v 1.6.x Sept 19, 2013; Extreme
Telematics Corp.
[2] Modicon Modbus Protocol Reference Guide; PI-MBUS-300 Rev. J; June 1996; MODICON Inc.
1
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
2 Controller Setup
Access to the settings used for Modbus Communications are only available through the
controller menus. The following sections give a brief overview of the initial setup required.
More detailed descriptions are available in the ALiEn2 Installation and Operations Manual.
2.1.2 Protocol
The protocol can be set to either RTU(binary) or ASCII (text). RTU is definitely more common as
it takes less bits to transmit the same amount of information. This must match the same setting
that is used by your SCADA Host. The default is RTU.
2.1.5 Parity
This parameter will set the parity of the character. It can be set to even, odd, or none. The
default is none.
3 Layer 1 Operation
The ALiEn2 has a 2-wire RS-485 port (COM 1) that operates as a Modbus Slave. The feature set
associated with COM 2 on the ALiEn2Expert is still under development. See [1], for wiring
details.
2
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
Supported bit rates: 1200, 2400, 4800, 9600, and 19,200 bps.
Supported character formats:
Table 1 - Supported Communication Rates and Formats
The bit rate and character format are configured using the front panel only. Technically, all
character formats for RTU protocol support must be 11-bits in length with 8-bits of data. This
allows for 1 start bit, 8 bits of data, and two bits for parity and stop. In actual practice, this is
rarely followed, so all combinations are allowed.
4 Layer 2 Operation
The ALiEn2/ALiEn2Expert supports both the Modbus ASCII and RTU protocols (see [2]). Protocol
selection is configured from the front panel only, and defaults to RTU mode.
The ALiEn2/ALiEn2Expert Modbus station address is configured using the front panel only
(range: 1 – 247), but has a default value of 1. The ALiEn2/ALiEn2Expert will act on, but not
respond to, commands using the broadcast address (i.e. zero).
The maximum byte-length of Modbus commands and responses is limited to 256 characters
(see [3], §4.1).
3
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
When operating in ASCII mode, the ALiEn2/ALiEn2Expert performs the following required layer 2
checks on incoming commands:
- Parity
- LRC
ASCII commands can be accepted upon silence detection without a terminating CR/LF.
When operating in RTU mode, the ALiEn2/ALiEn2Expert performs the following required layer 2
checks on incoming commands:
- Parity
- CRC
4
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
5 Layer 3 Operation
The following Modbus commands are supported:
Table 2 - Supported Modbus Commands
Modbus allows for exception responses to be returned under certain failure conditions. Once
again, this is not typically desired in the process control industry. As such, the controller does
not normally return any exception responses. This can however be enabled through the user
interface if desired. The following Modbus Exception Responses are supported:
Table 3 - Supported Modbus Exception Responses
Code Response
01 Illegal Function
5
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
If an Address field, either explicit or implicit, is outside the known range, an Illegal Data Address
exception is returned. The User Application may read Input Registers 3:1001 and 3:1002 to
determine the first bank and address in the command which caused the exception. No part of
the command is executed.
A Slave Device Failure exception is used to indicate Application Layer errors. The User
Application may read Input Registers 3:1001 and 3:1002 to determine the bank and address in
the command which caused the exception. Execution of the command terminates at this
address.
1
In the Modbus ASCII protocol, a single byte is sent as 2 HEX-ASCII characters.
6
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
For example, accessing register 4:4000 is done via the following operations:
ReadMultipleRegisters, WriteSingleRegister, and WriteMultipleRegisters. All of these operations
use the address value 4000. Accessing register 0:4000 is done with the following operations:
ReadCoils and WriteCoils. These two operations also use the address value 4000, but access a
different register.
7
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
The information within the ALiEn2/ALiEn2Expert is grouped into a number of data-sets. Before
accessing any data within a data-set, it must be retrieved by the Remote Access Application.
This is done so that:
- The User Application can read a consistent data-set: That is, one in which the data is not
changing while it is being read. This means that, in general, the data-set will be out-of-date.
The User Application should have the Remote Access Application retrieve a fresh copy of a
data-set before each read “session”.
- Changes made to a data-set will not be lost: If parameters are changed using the front
panel and User Application at the same time, there is a potential for changes to be lost. For
this reason, a lock-out mechanism is provided. The User Application can retrieve a data-set
“for writing”. This will lock-out changes to the data-set by the front panel.
The controller however does not write data to the history until a predetermined even happens.
For the plunger cycle logs, the history is written each time that a cycle starts (controller moves
from Close to Rise). Daily production logs are modified at the specified Day Start Time. Reading
the history at the exact time that the history is being updated could lead to inconsistent data.
Therefore, it is best to avoid reading the history at these times.
For read operations, the User Application should query the starting register address and read
the entire length of the register set. Register sets must be written from low to high order with
8
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
no intervening write operations. The register set is validated, by the Remote Access Application,
as an aggregate when the high order register is written.
Log Updated
It is possible, therefore, that the history us being updated while it is being read by the User
Application. For example, at the end of the gas day, the Log 1 data becomes Log 2 and Log 7
data is removed. It is the responsibility of the User Application to manage this sliding window of
log data at the gas day or plunger cycle boundary.
9
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
10
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
11
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
7 Register Formats
The following sections outline the available register formats that are used throughout the
register map.
Start Seconds since January 1, 2000 Years since 2000 (e.g. value of 16
(MSW) means year 2016)
12
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
Number Description
Start MSW
Start + 1 LSW
13
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
8 Register Map
The following sections outline each of the sections of registers as defined by the Modbus
protocol. These groups are as follows:
Note: Any registers that are grayed out have not been implemented. Writes to these
registers will be ignored. Reads from these registers will return unpredictable results.
Note: Modbus uses a register number, which starts at 1 to describe the location of data. The
actual address that is passed in the protocol layer is 0. This means that depending on the tool
you are using, you may need to subtract 1 from the register number to access the appropriate
data.
8.1 Coils
Table 10 - Available Coils
Basic Control
14
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
1 - Metric
15
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
Controller Information
Output Status
1 - Present
16
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
17
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
18
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
Controller Information
1 = Afterflow Delay
2 = Close
3 = Non-Arrival Close
4 = Extended Afterflow
5 = Rise
6 = Stopped
7 = Extra Close
19
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
20
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
(Multiplied by 10 to show
decimal resolution. i.e. 100 =
10.0 psi)
(Multiplied by 10 to show
decimal resolution. i.e. 100 =
10.0 “ WC)
(Multiplied by 10 to show
decimal resolution. i.e. 100 =
10.0 e3m3/d)
(Multiplied by 10 to show
decimal resolution. i.e. 100 =
10.0 psi)
21
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
22
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
23
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
24
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
25
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
26
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
3:0294 - 3:0317 Daily Production Log - Vent Time – 8 Entries Elapsed Time format
27
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
3:0907 - 3:0909 Total Production Log - Open Time Elapsed Time format
3:0910 - 3:0912 Total Production Log - Close Time Elapsed Time format
28
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
3:0913 - 3:0914 Total Production Log - Prod Volume 0 – 4294967296 e3m3 (mcf)
(Multiplied by 10 to show
decimal resolution. i.e. 100 =
10.0 e3m3)
3:0925 - 3:0927 Total Production Log - Vent Time Elapsed Time format
29
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
Plunger Statistics
30
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
31
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
32
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
33
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
34
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
35
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
Device Log 1
36
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
Device Log 2
37
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
38
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
39
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
40
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
41
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
42
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
43
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
44
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
45
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
46
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
47
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
48
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
49
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
50
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
51
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
52
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
53
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
54
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
55
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
56
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
The amount of time to wait after the last Writing zero (which is the
written value before saving all changes to the default) will save all changes
controller. as they are made.
1 = Enabled
4:0013 – 4:0014 Day Start Time – Start of the gas day. Elapsed Time format: 0 –
86340 (00:00: – 23:59)
57
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
Well Information
1 = Surface Velocity
1 = Free Cycle
2 = Continuous
Timer Settings
58
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
59
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
4:0143 – 4:0145 Close Time (Sum of Min Close Time and Elapsed Time format: 1 –
Extended Close Time) 1,800,000 (000:00:00 –
500:00:00)
4:0146 – 4:0148 Afterflow Time (Sum of Min Afterflow Time and Elapsed Time format: 1 –
Extended Afterflow Time) 1,800,000 (000:00:00 –
500:00:00)
4:0149 – 4:0151 Casing Pressure Rate Trip Delay Elapsed Time format: 1 –
1,800,000 (000:00:00 –
500:00:00)
60
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
Exception Handling
1 – Fail Open
1 – Fail Open
1 – Fail Open
1 = Surface Velocity
Is used to scale the adjustments that are made 0 will disable all adjustments
to the Afterflow Time.
61
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
Is used to scale the adjustments that are made 0 will disable all adjustments
to the Close Time.
4 = Flow Control
If the Valve B configuration is modified the
following parameters may be auto-updated: 5 = Purge
62
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
63
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
64
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
65
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
4:0266 – 4:0268 Open Casing Pressure Stable Time Elapsed Time format: 0 –
7199s (00:00:00 – 01:59:00)
• current dead-band, to
66
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
1 = Flow DP Switch
2 = Flow DP Sensor
67
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
68
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
69
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
70
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
4:0336 – 4:0338 Open Tubing Pressure Stable Time Elapsed Time format: 0 –
7199s (00:00:00 – 01:59:00)
Virtual Sensors
(50000 = 5000.0)
71
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
(50000 = 5000.0)
72
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
9 Acronyms
AI Analog Input
DI Digital Input
DO Digital Output
R Read Permission
V Volts
VI Virtual Input
73
ALiEn2/ALiEn2Expert Modbus Communications User Guide v2.1.x 02/10/2017
10 Index
A H
Address Coding ............................................ 6 Holding Registers ...................................... 61
B I
Baud Rate .................................................... 2 Input Discretes .......................................... 16
D P
Data Bits ...................................................... 2 Parity ....................................................2, 3, 4
74