Would you mind sharing your code, please? I'd like to make sure that I understand what you are talking about. I tried reproducing this with a newer version of AF SDK but was unable to do so, so I'd like to make sure that I attempted the same thing that you are describing.
1 of 1 people found this helpful
I don't think the Formula DR supports the AFDataMethod.PlotValues option. Each DR will have an override of the AFDataReference base class SupportedDataMethods property. I suspect that the Formula DR either just returns the base class implementation, or it's override doesn't include the PlotValues AFDataMethod enumeration.
I'm not sure that this is entirely correct. If I find an AF attribute that is a Formula DR and then look that the SupportedDataMethods property, I can see that PlotValues is a supported data method. Also, looking at the help documentation for PI System Explorer under Retrieval of asset information > View time series data > Restrictions on viewing time series data, there is a chart for DR's that indicates that a calculation-based DR with time-series inputs supports the PlotValues data method. The PI Server documentation also contains this table that I am referencing.
Undoubtedly - it was just a guestimate, as I no longer have access to the source code for those projects
The reference table is interesting, as I haven't seen that before.
This now goes back to Luis Gustavo Ferrão's original question as to why the Plot Values data call using the Formula DR in AF 188.8.131.5266 doesn't seem to behave as expected. I believe then that it is most likely due to the configuration in the Time series Data dialog - what is the value of your Number of Intervals setting?
The default value on my PSE client was 640, which returned the same number of values as the Archive (Recorded Values) option. Decreasing the interval count will decrease the values returned for Plot Values. Remember that the documentation for the PlotValues method states that it "Retrieves values over the specified time range suitable for plotting over the number of intervals (typically represents pixels)".
So I believe that you are seeing the correct behaviour, you will just need to adjust the interval count for the time range in order to see a lower count of values than the RecordedValues count.
Hi Everybody !
We reviewed our code and found some mistakes. After this, the code is working as expected. The PlotValues works fine to our formula's attributes.
Thank you for your attention and help !