Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

Min,Max, Avg values are same always

Data retrieved via SQL from Citadel is listed in the attachement. There are four groups; of data: List, Average, Maximum, Minimum; all have been retrieved at 1 hour intervals.

It appears as though the first record returned for the Average, Maximum, and Minimum is ALWAYS the first data sample. Back in March, we posed this same question and the response from National Instruments was:

The reason for this behavior is that the traces table uses interpolation to create intermediate data points. The average transform only uses the logged data points. I noticed that in your numbers, the average transform returns a value equal to the first number. This means there was not another logged data point during the 10 seconds when the
average was taken.

The data listed in attachment is changing constantly and we are retrieving data at 1 hour intervals.
0 Kudos
Message 1 of 3
(3,074 Views)
Dan,

I could understand your concern, but I guess that's how the average function is implemented in the ODBC 4 driver of Citadel 4.

I did not see in your document how you specifiy the SQL command, especially the WHERE clause for the time range. Perferable you should use localtime > '3/12/03 12:00:00' AND localtime <= '3/12/03 21:00:00' AND interval = '1:00:00' for AVG{}, thus the first value is not listed but the average is taken TIME WIGHTED from this first start time value.

A really nice document can be found under (you might know already):
Using Citadel's AVG Transform

And it looks like in your case the first value cannot be TIME WEIGHTED, and w
ill be displayed as "raw" interpolated value.

Hope this helps
Roland
0 Kudos
Message 2 of 3
(3,074 Views)
I comment my answer as well.

I've tried to see if the new ODBC driver of Citadel 5 (released with LabVIEW 7 Express and the LabVIEW 7 Datalogginig and Supervisory Control Module) behaves the same.

And I realized that this behavior was improved! - If you make a query with localtime >= it will perform all the interpolated, max, min and other math calculation based on the whole interval before localtime. If you specify localtime > it will give you the first, calculated values on localtime+interval.

I hope NI will upgrade Lookout to use Citadel 5 as well.

Roland
0 Kudos
Message 3 of 3
(3,074 Views)