If just need to have the maximum value of each day, my suggestion is to use Summary method instead of Summaries2. Please see the following code as the reference:
If you still need to use Summaries2 to do the calculation, please try change cbTimeWeighted to cbEventWeighted, as cbTimeWeighted might return interpolate value, but cbEventWeighted will not.
OK I found it. This is for reference in case some people looking after the same thing.
There is a valueattribute called TimeOfMaxVal for a PIValue object. So get the PIValue object from the NamedValues collection for the "Maximum" summary type.
Then retrieve the TimeOfMaxVal attribute.
From my code above, it seems then that Summaries2 returns the "EarliestTime" by default instead of "TimeOfMaxVal".
I checked the Summary method and it returns the "TimeOfMaxVal".
Thank you for posting your findings.