|
<< Click to Display Table of Contents >>
Reading Digital Input Events |
This method for reading data with timestamp is generally used in substations by a device's manufacturer.
Using the Read Digital Input Events Tag, with the B2 parameter equal to 10, this Driver can read blocks of values from a stack implemented by a PLC's application. Every block of values in that stack represents an event and it is composed by 6 (six) bytes.
The value of the reading pointer indicates the starting address of the stack in a PLC's memory. The writing pointer, on the other hand, indicates the next free position in that stack, in which the next event block must be added. The writing pointer's value is equal to the reading pointer's value plus the number of existent blocks in the stack, and it is incremented by 6 (six) units at each event added.
When this Tag is read by an application, this Driver reads and interprets all available blocks in the PLC's stack, and then sets the writing pointer to the same value of the reading pointer, thus emptying the stack. The next table shows the format for storing every block in the PLC's stack.
Format for blocks of events in a PLC's stack
Byte |
Description |
|---|---|
1 |
Least significant byte of a 16-bit Word identifying the number of a digital input |
2 |
Most significant byte of a 16-bit Word identifying the number of a digital input |
3 |
Byte for miscellaneous parameters (status). |
4 |
Most significant byte of milliseconds of a timestamp |
5 |
Least significant byte of milliseconds of a timestamp |
6 |
Minutes of a timestamp. Ignore the most significant bit |