Acquisition Procedure in an Application

<< Click to Display Table of Contents >>

 

Acquisition Procedure in an Application

This topic contains a detailed explanation on the configuration of an application to acquire events accumulated in a PLC or programmable slave device.

Reading events in an application is performed using Tags that reference the special reading function Gen SOE. Tag's data type defines the structure of events stored in the device's event table. If a native data type of this Driver is defined, or built-in type, each event contains only one element of this data type, without a PLC-provided timestamp, because the timestamp represents the instant events were collected. On the other hand, if user-defined data types are used, then users can define structures for events, including timestamps, as explained later on this topic.

Next, there is a description of the configuration of Tags using the new methodology of configuring by Strings, the Device and Item fields, as well as the old numerical configuration used by Elipse SCADA, the N and B parameters.

 

String Configuration

Device: "<Slave Id>:"

Item: "elsoe<N>.<start add.>[.<type>[<type size>]][.<byte order>][/bit]"

 

Where:

N: "<Slave Id>:"

start add.: Address of the first control register, using the value defined on the example table of topic Event Table

type: Native or user-defined data type used for each event. For more information, please check topic String Configuration

type size: Used only for variable-size data types. For more information, please check topic String Configuration

byte order: Byte ordering. It can be omitted for devices fully compliant with protocol's standard. For more information, please check the Byte Order item on topic String Configuration. When structures are used, it only affects their individual elements. For more information, please check topic User-Defined Data Types

bit: Bit masking. Usually can be omitted, it would hardly be used here. For more information, please check the Bit field on topic String Configuration

 

Example:

Device: "1:"

Item: "elsoe150.&h101.TYPE3"

 

The TYPE3 data type is defined as follows in this Driver's default example file. For more information, please check topic User-Defined Data Types.

// This type has an UTC32-type timestamp
// and a few named elements
struct TYPE3
{
  DefaultAddress = 0x101;
  timestamp = UTC32;
  float Va;
  float Vb;
  float Vc;
  float Ia;
  float Ib;
  float Ic;
}

 

This is a Structure data type containing 6 (six) data fields and a timestamp. Therefore, this Tag must be a Block with 6 (six) Elements to represent that structure.

Notice that, as already explained, the value of a timestamp, although it occupies registers in the PLC, does not need Block Tag Elements, because its value is returned in the Tag's Timestamp property.

 

NOTE

The N parameter informs the size of a table as the maximum number of events, not as Modbus records. Together with the Start Address parameter, it indirectly informs the final address or upper limit of that table. The size of a table's data area, therefore, in number of Modbus registers, is the product of N by the size of each event in number of Modbus registers, that is, in 16-bit Words.

 

Numerical Configuration (N and B Parameters)

To configure Tags for reading Elipse SOE using a numerical configuration, users must configure an operation on the Operations tab using the special function GenSOE.

The next figure shows an example of a new operation added using special function GenSOE with a Word data type.

Special function GenSOE

Special function GenSOE

Notice that function 16 (Write Multiple Registers) was selected as its writing function, which is the most commonly used function. However, users are encouraged to use function 06 (Write Single Register) whenever supported by a device.

The next figure shows the same operation with a user-defined data type TYPE3 , which is a data type defined in the example configuration file, available with this Driver and used as an example on this topic. For more information, please check topic User-Defined Data Types.

Configuration using the GenSOE function and a user-defined data type

Configuration using the GenSOE function and a user-defined data type

Data type TYPE3 is defined in this Driver's example file as follows:

// This type has an UTC32-type timestamp
// and a few named elements
struct TYPE3
{
  DefaultAddress = 0x101;
  timestamp = UTC32;
  float Va;
  float Vb;
  float Vc;
  float Ia;
  float Ib;
  float Ic;
}

 

This is, therefore, a Structure data type with 6 (six) data fields and a timestamp, and the default address, the Tag's B4 parameter, equal to "101H", or 257 in decimal. To read it, users must define a Block Tag with 6 (six) Elements and the following configuration:

B1: Slave device's address (PLC) on the network (Slave Id)

B2: 8 (a previously defined operation with special function Gen SOE)

B3: N (size of a device's table, as the maximum number of events that table can contain)

B4: 100 (address of the first control register, using a value defined on the example table of topic Event Table)

Size: 6 (six)

 

NOTE

The B3 parameter informs the size of a table as the maximum number of events, not as Modbus records. Together with the B4 parameter, it indirectly informs the final address or upper limit of that table. The size of a table's data area, therefore, in number of Modbus records, is the product of B3 by the size of each event in number of Modbus records, that is, in 16-bit Words.

 

Notice that, if E3's or Elipse Power's Tag Browser is used to insert a Tag in an application, as explained on topic User-Defined Data Types, Tag Elements are already named according to the name given to structure elements when they were declared. Tag Browser can be opened by clicking Tag Browser on this Driver's Design tab.

 

Usage

Once defined an appropriate Tag, or Tags, enable its scan and let this Driver collect events from their respective table, whenever new events are detected.

Tags linked to the GenSOE function, or elsoe when configuring by Strings, are always event-reported. This means, as already explained on topic User-Defined Data Types, that this Driver can return several events on a single reading operation, that is, on a single interval of a Tag's scan.

This means that this Driver returns a set of events, or for the previous example sets of blocks with 6 (six) data fields and a timestamp, at once, which produces a sequence of OnRead events on a Tag, one for each event, or a block with 6 (six) data fields and a timestamp, returned by this Driver.

For detailed instructions on the right way to handle event-reported Tags, please check topic Tags Reported by Events on E3 User's Manual. Elipse SCADA User's Manual also contains an analogous topic.

In short, the usual way of handling event-reported Tags is by adding a call to the WriteRecord method of a previously linked Historic object on Tag's OnRead event, ensuring that all events reaching this Historic are registered. In this case, this Historic must be configured without a dead band, that is, the DeadBand property set to 0 (zero), and disabling historic by scan, that is, in E3 or Elipse Power the ScanTime property set to 0 (zero). Tag's EnableDeadBand property must also be configured to False.

 

IMPORTANT

When reading mass memory events in E3's or Elipse Power's event-reported Tags, disable Tag's dead band, that is, the EnableDeadBand property configured as False, and also in the linked Historic object, that is, the DeadBand property configured as 0 (zero), to avoid losing events with close values. It is also important to disable historic by scan, that is, in E3 or Elipse Power the ScanTime property configured as 0 (zero). This ensures that new events are only stored using the WriteRecord method, executed on Tag's OnRead event, avoiding duplicated events.

 

Optimization and Compatibility

Some devices, such as PLCs by ATOS, do not support block readings using data types with different structures. In practice, this prevents this Driver to read data from control and event registers as a single block. To collect PLC events with these restrictions, users must disable the Enable Control and Data Registers Grouping option on the Gen SOE tab.

Was this page useful?