Event Table

Driver Modicon Modbus

Event Table

Top  Previous  Next

As already mentioned on topic Elipse Software's Generic SOE Reading Algorithm, each event table keeps events in a circular buffer. The circular buffer of each table is defined by its initial address, or base address, contiguous to control registers, and by its maximum number of registers, which defines its final limit. The following table shows a layout of events inside a table's circular buffer.

Layout of events in a circular buffer

Event

Timestamp

Element1

Element2

Element3

...

ElementN

1

 

 

 

 

 

 

2

 

 

 

 

 

 

3

 

 

 

 

 

 

4

 

 

 

 

 

 

5

 

 

 

 

 

 

...

 

 

 

 

 

 

N

 

 

 

 

 

 

 

Each row on the previous table represents a stored event, usually represented by a structure, or by User-Defined Data Types.

Notice that, in the example of the previous table, the first element of that event structure is a timestamp. This field, whose presence is not mandatory and that does not need to appear in the first position, defines Tag's Timestamp property and it is not returned in its Elements (for more information, please check topic User-Defined Data Types).

It is also possible to define events with Driver's native data types, and in this case there is only one data Element in each event, without timestamp.

Events must be inserted in this circular buffer in ascending order, returning to the base address after reaching the upper limit of this circular buffer. The following control registers must be defined for each table:

·Table status: Must be kept by the PLC, indicating the number of events available for reading in the circular buffer. It must be updated by the device whenever new events are added to the circular buffer, or after finishing the collecting of events by an application, which can be detected via Acquisition status

·Recording pointer: This value indicates an index, starting at 0 (zero), of the position where a device must insert the next event. It must be incremented by the device after each new event insertion in the circular buffer, moving back to the base address after reaching buffer's upper limit. Notice that this value must not be provided in units of Modbus registers, but in event positions, and it must be incremented by one unit at every new event inserted, regardless of the number of Modbus registers occupied for each event in the circular buffer. With this, the maximum allowed value for this pointer is given by the formula MaxWritePtr = (Size of the circular buffer / Size of event structure) - 1

·Acquisition status: Indicates the number of registers already read by a Driver at each individual event reading. After each reading, this Driver writes in this register the number of registers it successfully read. Slave's resident application (ladder) must immediately subtract the value written by this Driver from Table status and then zeroes Acquisition status

·Reserved: This register is currently not used. It may be used on future versions of this Driver, and it can be kept in 0 (zero) in its current version

 

As already mentioned, the base address of this circular buffer, that is, the address in which an event table starts, must be contiguous to control registers.

Control registers, on the other hand, must be also set on contiguous addresses, on the same order presented previously, allowing their reading on a single operation, that is, assuming that the base address of control registers for a certain table is 100, these are the addresses for the other registers:

Register addresses

Register

Address

Table Status

100

Recording Pointer

101

Acquisition Status

102

Reserved

103

Circular Buffer's Base Address

104

 

On topic Acquisition Procedure in a PLC there is a description of a step-by-step acquisition procedure or algorithm based on a slave device (PLC). On the next topic, Acquisition Procedure in an Application, there is a discussion on how to configure an application for acquiring table events.

 
Has this section of the documentation helped you configure this Driver?
Yes No
Comments (optional):