|
<< Click to Display Table of Contents >>
Data Blocks Acquired at Constant Intervals |
Users must use this mode when the time interval among data on the table is fixed. Thus, users can save memory space in a PLC, only storing the initial moment of collecting. This mode can only be used when there is several data for a single variable. To do so, users must perform the next steps.
In a PLC, there must be a program that stores acquired data on a decimal table. This table's format must has the next structure.
Data 1 - HHMMSS
Data 2 - DDMMYY
Data 3 - time interval between acquisitions, in milliseconds
Data 4 - value 1
(...)
Data N - value N - 3
For example, on a table with 255 positions, users want to store several acquisitions of the same analog variable with constant intervals. Therefore, this table after completed contains the following configuration, assuming that the current date is February 18th, 1998, 09:00:00, with acquisitions at every second.
Example of data with constant timestamp intervals
Table Position |
Value |
Table Position |
Value |
Table Position |
Value |
|---|---|---|---|---|---|
0 |
090000 |
7 |
Data |
14 |
Data |
1 |
180298 |
8 |
Data |
15 |
Data |
2 |
1000 |
9 |
Data |
16 |
Data |
3 |
Data |
10 |
Data |
17 |
Data |
4 |
Data |
11 |
Data |
18 |
Data |
5 |
Data |
12 |
Data |
19 |
Data |
6 |
Data |
13 |
Data |
20 |
Data |
And so on, until the table is completely filled. To control access to this table, there are 4 (four) bits of an auxiliary memory in a PLC. This auxiliary operand is then provided during a Tag reading.
•BIT 0 (ask_reading_permission): Performs a request to access the table to a PLC
•BIT 1 (reading_allowed): Checks if the request was granted
•BIT 2 (clear): This Driver writes 1 (one) to this bit and the PLC is then responsible for zeroing the table and turning this bit back to 0 (zero)
•BIT 3 (table_zeroed): This bit indicates whether that table is zeroed
Reading data can only be performed by using a PLC Tag with the N2 parameter equal to 13, where the N3 parameter indicates the address of a decimal table, and the N4 parameter indicates the address of an auxiliary operand that contains the control bits. Please check tables Supported Data Types for PLC Tags and Supported Data Types for Block Tags for more information. In case the data value read is different from 0 (zero), this Driver returns a list of event values to an Elipse Software application, each one with a timestamp equal to the table timestamp + (N - 3) × time interval, in which N is the position of the variable inside a table.
1.Checks bit 3 (three, table zeroed). If it is set to 1 (one), exits or proceeds otherwise.
2.Writes 1 (one) to bit 0 (zero, ask permission).
3.Checks bit 1 (one) and, if it is set to 1 (one), continues. Otherwise, checks it once again. If the authorization is not yet granted, exits. In this case, the PLC must handle the pending request, changing bit 0 (zero, ask permission) to 0 (zero).
4.Reads the first 3 (three) variables with timestamp and interval.
5.In case the first 3 (three) values contain a valid date, stores them.
6.Reads the next table positions, in blocks of 12 units, storing the value together with the added timestamp of each interval, and so on. In case the first value of each reading is equal to 0 (zero), returns the last values read and zeroes the table, that is, only transfers values from a block with 12 variables if the first value is different from 0 (zero).
7.Zeroes the table, in case at least one structure was read, writing 1 (one) to bit 2 (two, clear).
8.This Driver returns the values to an Elipse Software application.