Archestra trends and datetimepicker

abishur

Member
Join Date
May 2012
Location
Texas
Posts
47
I'm trying to use the arhcestrA provided "trendclient" object. I've successfully got it to read data from my historian and can modify the display time frame using the
Code:
TrendClient.TimeSelector.TimeDuration = (integer value)

function. But for some crazy reason archestrA never considered that we'd want to be able to scroll through the historized values. Go figure.

To fix this I've added a datetimepicker object to my trend page. Users select the start date (in the datetime Picker animation options I've set format to "Custom" and then used the following format MM/dd/yyyy hh:mm:ss tt).

After selecting the date/time they hit a submit button which sets a boolean, DateSubmit, to true.

I then have a function that executes OnTrue for DateSubmit with the following code.

Code:
im SDate as time;
dim EDate as time;
dim durType as integer;


TrendClient1.TimeSelector.GetStartAndEndTimes(SDate, EDate);
durType = TrendClient1.TimeSelector.TimeDuration;

    TrendClient1.TimeSelector.SetStartAndEndTimes(DateTimePicker1.Value,"",durType);

DateSubmit = false;

Everything works except for the SetStartAndEndTimes, it errors out with the message

Code:
Error setting start and end Times: System.ArgumentOutOfRangeException: Value of '12/31/1600 06:00:00 PM' is not valid for 'Value'. 'Value' should be between 'MinDate' and 'MaxDate'.
Parameter name: Value
   at System.Windows.Forms.DateTimePicker.set_Value(DateTime value)
   at ArchestrA.HistClient.UI.aaTimeRangePicker.SetStartAndEndTimes(DateTime startTime, DateTime endTime, aaTimeRangeEnumeration duration)
   at ArchestrA.HistClient.UI.aaTimeRangePicker.SetStartAndEndTimes(DateTime startTime, DateTime endTime, Int32 duration)

has anyone successfully done this before and can tell me why it's not accepting the date from the datetimePicker?
 
I have found when using dates and times you will have to ensure each element in the date and/or time.
Example:

Dim StartTime, EndTime
StartTime = Timer

if len(month(now))=1 then
strmonth = "0" & month(now)
else
strmonth = month(now)
end if
if len(day(now))=1 then
strday = "0" & day(now)
else
strday = day(now)
end if
stryear = right(year(now),2)
strdate = strmonth & "/" & strday & "/" & stryear

You can do the same thing for time.

Just a thought,
Garry
http://www.accautomation.ca
 
Thanks Garry, I just did some more testing and found the issue appears to be that I'm not providing an End time. Which is weird because their documentation explicitly states that as long as I provide a start time and a duration then I can omit the end time with "".
 
I opened a bug report with Wondeware(west), but for the time being an end time has to be provided. There's another version of the historian trend that uses a dll you have to import (C:\Program Files (x86)\Common Files\ArchestrA\aaHistTrendControl.dll") that has all the built in functionality you would expect for a trend. The only draw back is to use that dll you have to have the historian client installed locally on the machine.
 

Similar Topics

So I made some changes to our plants WindowMaker application and I'm having trouble deploying the update to the live runtime. From the deployment...
Replies
3
Views
124
Dear All, We are designing a solution with 1756-L74 and Archestra. We need to use SOE to show on HMI. Please mention any solution if someone did...
Replies
0
Views
134
So I'm trying to enable history for a tag that is being used to display PPH on InTouch. I was able to locate the tagPath by finding the display...
Replies
2
Views
676
Got myself into a bit of a jam this AM. Somehow the graphic editor hiccupped and when I went back into my graphic, everything was gone. I...
Replies
1
Views
1,059
It's a while since I had used this that I forget where the setting to enable/disable object security is. There are some devices (pumps/valves)...
Replies
1
Views
855
Back
Top Bottom