Enron Modbus Driver

Not counted towards your tag license limit.

Protocol Introduction

Enron Modbus is a variation on the standard Modbus protocol that allows for the transmission of stored historical data and alarm / event logs. The standard read / write Modbus function codes, 01, 03, 05, 06, are supported and used to read or write real-time values. The only major difference between accessing real-time values in regular Modbus versus Enron Modbus is the register addressing. See the addressing section for details.

Many devices that communicate via Enron Modbus also maintain an internal historical log with periodic, hourly or daily records. Additionally, they usually have a separate log, which contains alarm and event data specific to the flow calculations that the device is monitoring. The Enron driver allows both of these logs to be read and then transferred to the VTScada historian.

This driver supports multiple TCP/IP port connections between a single instance of the driver and the RTU.

As of release 12.1.31, this driver supports Omni Flow Computers. For details specific to that device, refer to the description of the Custom History Log Format within this document and relevant notes in the topic, Enron Modbus I/O Addressing.

Related application properties:

The following property settings hold additional configuration parameters for your Enron Modbus driver:

EnronBoolMaxBlockSize - Maximum number of standard Boolean values requested in a single read.

EnronShortMaxBlockSize - Maximum number of standard short integer values requested in a single read.

EnronLongMaxBlockSize - Maximum number of standard long integer/floating point values requested in a single read.

EnronMaxHistoryBlockSize - Maximum number of historical values requested in a single history log read.

EnronPropogateOnlyOnDataChange - If set, don't bother processing incoming data if it hasn't changed since the last read. Note that this setting does not apply to history reads or event log reads (which are always processed).

EnronSharedRPC - Set to use the same RPC service for all instances of the Enron Modbus driver. drivernameSharedRPC properties are stored in Settings.Startup, not Settings.Dynamic. Changes require a restart of the application in order to take effect.

EnronContinuousHistoryRead - When set, a single history poll cycle will continue reading from the device until all new history has been read.

EnronHistoryReadStartUpDelay - Seconds to wait for Enron history tags to initialize before timing out with a communications error.

Server List

Select (or create) a named server list. (Driver Server Lists) Servers for the list must be defined using the Application Configuration dialog, as described in Servers for Specific Services. Smaller sites that do not have multiple servers, or that use only the default server list, need not configure this field.

Enron Modbus Driver properties Options

Comm Channel

Choose the format of the outgoing messages. Serial RTU sends the messages as they are and includes a CRCClosed Cyclic Redundancy Check at the end. Open Modbus TCP prefaces the messages with a TCP header. Note that the comm channel setting can be changed independently of the port tag. For example, some devices use the Serial RTU protocol sent out over a TCP/IP port.

Enable Multi-Write Function

Although standard Modbus multi-write function codes are not defined as part of the Enron Modbus standard, some devices can make use of them. If this is true of your device, this box may be selected.

Squelch Noise Present

Applies when communicating over a radio modem. Select this box to enable squelching of background noise.

Squelch Time

The number of seconds to wait before clearing noise when the Squelch Noise Present option has been selected.

Store Last Output Values

When selected, the driver will maintain a record of the last value written to each output address. This may be useful in at least two situations:

  • For hardware that does not maintain its state during a power loss and must be restored to that state when re-started.
  • When failed hardware is replaced by a new device and you would like to start that device with the values last written to the old one.

If the last output values are stored, they may be re-written by either of two methods:

  • Automatically, when communication is restored to the device.
  • Manually by way of a button press. See, Rewrite Outputs Widget for details.

Changing this value from selected to deselected will cause all stored values to be erased immediately.

If this driver is being used in conjunction with a Driver Multiplexer, then configure the Driver Multiplexer to store the last values, not the drivers connected to the Multiplexer. In this case, only the Multiplexer should be configured to re-write automatically.

Enable Auto Rewrite

If selected, the Store Last Output Values option will also be activated. This option causes the driver to rewrite the last value written to each output, in the event that communications are lost and then restored.

Use this option only if you are certain that you want the last values to be rewritten automatically after an interruption in driver communications.

Device Clock Time Zone

The time zone of the clock in the Enron Modbus device. This is used to correct the time-stamped values read from the device by VTScada for storage in its historian using UTC format. Regardless of the time zone selected with this option, the driver assumes that the device does NOT adjust its clock for daylight savings time (DST).

  • Uses Server Time Zone (no DST) - assumes that the device is in the same time zone as the server.
  • Device Clock In UTC - the clock in the device is set to UTC
  • Actual Time Zone - select the time zone where the device is located.

Enron Modbus Driver Configuration - Communications

Port

The port tag through which this driver communicates to a device, usually either a serial port tag or a TCP/IP tag.

Time-Out Limit

The length of time, in seconds, that the driver should wait for a reply from the device.

Retries

The number of times to retry a message before declaring an error.

Use only if the driver is connected to a device that uses a serial port or a UDP/IP port that is configured to be polled. When connected directly to a device using TCP/IP, this value should normally be set to 0 since TCP/IP is a guaranteed message delivery protocol.
For unreliable communications, such as radio, set to 3 or 4.

Hold

Select this to have I/O tags attached to the driver hold their last value in the event of a communication failure. If not selected, tags will have their value set to invalid on a communication failure.

RTS Key Off Delay

Used for serial communications, this field represents the length of time in seconds that the device will wait before dropping RTS at the end of a data transmission.

Station Address Mode

Use to limit the range of allowed addresses. Select according to your hardware:

Standard Address ... 1 - 247 according to Modbus Protocol

Lufkin ELAM Address ... 1 - 2295

TeleBUS Extended Address ... 1 - 65534

Station Address

The Modbus address of the Enron Modbus device.

Retry Delay

The length of time, in seconds, that the driver will wait between retry attempts if there is no reply to the initial message.

Enron Modbus Driver Configuration - Protocol

Operator Change / Alarm Event Log...

Base Date

When operator-change or alarm-event-log, time-stamped data is returned from the device, the year is provided as a two-digit number. That number is then added to this base date to produce the actual date used for the timestamp. for example, if the number returned was "34" and the base date is "1980" then the year will be recorded as 2014. This information should be available in your device's documentation.

Date Returned Before Time

Usually operator-change or alarm-event-log time-stamps from the device are returned with the time being sent before the date. If the reverse is true for your device then this box should be selected.

History Log...

Base Date

When history log time stamped data is returned from the device, the year is provided as a two-digit number. That number is then added to this base date to produce the actual date used for the timestamp (e.g. if the number returned was "34" and the base date is "1980" then the year will be re-corded as 2014. This information should be available in your device's documentation.

Date Returned Before Time

Usually, history-log time-stamps from the device are returned with the time being sent before the date. If the reverse is true for your device then this box should be selected.

Enron Modbus Driver Configuration - History

The Enron Modbus protocol allows for the retrieval of historical data records stored in the device. Each record holds the value of several variables for a specific timestamp, ordered by an incrementing index value. The following table is a representation of a theoretical hourly history log.

Index Date Time Temperature Pressure Flow
1 08/08/2014 08:00:00 21.3 87.2 48.4
2 08/08/2014 09:00:00 22.4 86.9 49.4
3 08/08/2014 10:00:00 25.1 87.3 48.7
... ... ... ... ... ...
1024 27/06/2014 19:00:00 18.9 87.4 44.0

Every hour, a new record is created inside the device. After the final history register has been filled (in this case index 1024) the next record goes back to index 1 and overwrites the record stored there.

The History tab is used to define and to track the characteristics and status of the device's history log. The "table columns" that are to be logged should be defined here. Up to 30 log tables may be defined.

History Address Number

Select which of the 30 separate history addresses to configure.

Log Address

The register address in the device where the history log is stored. For the first flow run, this is usually either 701 (for hourly history) or 702 (for daily history).

Default values of 701 through 710 are provided for History Address Numbers 1 through 10.

History Log Index Address

Some devices track the position of the index of the next record to be written. The address where this index position is stored should be entered here. This field is only used if the Enron driver's Read History Index from a Separate Address box is selected.

Total Number of Log Indices

The total number of records stored in the history log. After the driver has read this many indices it will start back at the first index.

Log Indices Begin at 0

Select this box if the first index of your device is 0 instead of 1.

Read History Log Index from a Separate Address

Historical data is read from a table in the device, which is ordered by an index value. By default the Enron Modbus driver will read all indices sequentially until arriving at the end of the new data (according to the datum's timestamp), however some devices track the most recent index value internally in a separate register. If this is the case with your device then this box should be selected. Note that the actual index register is set as part of the Enron History tag.

Use a 6-Byte Time/Date Format

The Enron Modbus protocol it returns the time and date from history logs as a pair of 4-byte floats. Some RTUs will instead return those as six 1-byte integers (MM/DD/YY followed by HH/MM/SS).

6-Byte Format Returns Day First

Enabled only when the preceding option is selected. Returns a 6-byte date format as DD/MM/YY instead of MM/DD/YY.

Custom History Log Format

This is an optional JSON file that you can use to specify the format of data in the history log for the case when it is not a series of 32-bit floating point numbers.

Example:

{
  "721": {
    "NumItems": 16,
    "Length" : 99,
    "FormatInfo":[
      {"DataType" : "STRING8", "Offset"   : 6},
      {"DataType" : "STRING8", "Offset"   : 14},
      {"DataType" : "STRING8", "Offset"   : 22},
      {"DataType" : "STRING8", "Offset"   : 30},
      {"DataType" : "BYTE",    "Offset"   : 38},
      {"DataType" : "STRING8", "Offset"   : 39},
      {"DataType" : "UINT32",  "Offset"   : 47},
      {"DataType" : "UINT32",  "Offset"   : 51},
      {"DataType" : "UINT32",  "Offset"   : 55},
      {"DataType" : "FLOAT",   "Offset"   : 59},
      {"DataType" : "FLOAT",   "Offset"   : 67},
      {"DataType" : "FLOAT",   "Offset"   : 71},
      {"DataType" : "FLOAT",   "Offset"   : 75},
      {"DataType" : "FLOAT",   "Offset"   : 91},
      {"DataType" : "UINT16",  "Offset"   : 95},
      {"DataType" : "STRING8", "Offset"   : 97}
    ]
  }
}

NumItems is the number of log items to be read

Length is the number of bytes needed to read all the data in FormatInfo

FormatInfo is an array of items consisting of a DataType and Offset value. The Offset is how many bytes into the data the value starts, and the data type is the type of data to read.

Supported values of data type are: FLOAT, BYTE, SINT16, SINT32, UINT16, UINT32, and STRING##, where ## is the length of the string in bytes.

If an improperly formatted file is detected, an error is displayed. Note the Import button, for use when adding a JSON.