A–18 PQM POWER QUALITY METER – INSTRUCTION MANUAL
DATA LOGGER IMPLEMENTATION APPENDIX A: APPLICATION NOTES
Data Logs. The Data Logs will place the user-selected parameters into their respective 
Record structures based upon their respective order in the PQM Memory Map. For 
example, if Positive kWh, Frequency and Current Unbalance were selected to be measured 
parameters, they would be placed into the Record structure in the following order:
Unbalance2 bytes(16 bit value)
Frequency2 bytes(16 bit value)
Positive kWh4 bytes(32 bit value)
The DATA LOG PARAMETERS table on the following page illustrates the order of parameters 
and their size.
Therefore, the Record size would be 8 bytes. To put a time value associated with each 
Record, you must read the Log Time and Date from the Header. This is the time of the last 
Record in the Log. To time stamp the first Record used, multiply the Log Time Interval by 
the Log Records Used and subtract this number from the time associated with the last 
Record. To determine the time associated with any Record, add the Log Time Interval times 
the Record to be read to the time associated with the first Record in the Log.
For example:
Log Time Interval:3600
Log Time - Hours/Minutes:02 30
Log Time - Seconds:30300
Log Date - Month:06 15
Log Date - Year:1997
Log Records Used:1600
The last Record entry time is interpreted as 2:30 AM, 30.300 seconds, June 15, 1997. The 
Log Time Interval is 3600 seconds, or 1 hour. Taking the Log Records Used (1600) and 
multiplying this by the Log Time Interval(3600) gives 5760000 seconds. This translates into 
66 days and 16 hours. Subtracting backwards on a calendar from the time for the last 
Record gives a time and date of 10:30:30.000AM, April 9, 1997. This is the time stamp for 
the first Record. Time stamping the remaining Records requires adding 3600 seconds for 
each Record starting from the time associated with the first Record. It is important to note 
that when in the Circulate mode, and the Data Log fills the available memory, the Log 
wraps around the first available Register of the memory structure and the Log Pointer to 
First Item of First Record will float along in time with each additional entry into the Log. For 
example, if the Data Log has wrapped around the available memory more than once, the 
Log Pointer to First Item of First Record will always be preceded in memory by the Log 
Pointer to First Item of Record After Last. As each new entry is written into the Log, these 
two pointers move down to the next record space in memory, overwriting the first entry 
into the log as of the Present Log Time and Date.
Courtesy of NationalSwitchgear.com