I’m using Easychart in the historical mode. When I call it up, I always want it to start at 7am, stop at 7pm, todays date. (even though it may be 6 in the morning, noon, or whatever).
The operator can then change to different times/date/whatever.
QUESTION - How can I access the computers system clock (time date) and use it to set up the easy chart.
ALSO - How can I access the computers time to simply display the current time/date?
In this case you are going to have to set up the Easy Chart to run in “Manual” mode. This means you handle the date range yourself.
Now, as you described it, the chart’s X-axis is starts at 7AM-7PM. I assume that you also want the operator to be able change that range after the window starts up. Here is how you do that.
(1)Set the “Chart Mode” to “Manual”
(2)Add a Date Range component - put it below the Easy Chart.
(3)Set the Date Range’s “Startup Mode” property to “None”
(4)Bind the Date Range’s “Start Date” property to a polling off SQL Query that selects 7AM this morning. For MySQL, the query would be:
select CAST(CONCAT(CURRENT_DATE, ' 7:00:00') AS DATETIME)
(5)Bind the Date Range’s “End Date” property to a similar polling off SQL Query that selects 7PM today:
select CAST(CONCAT(CURRENT_DATE, ' 19:00:00') AS DATETIME)
Now that Date Range will start up from 7AM to 7PM every time you open the window. All thats left is…
(6)Bind your Manual Mode Easy Chart’s Start Date and End Date properties to the date range’s Start Date and End Date properties, respectively.
To display the current time/date: simply bind a label’s text to a query that returns the current time. Download Component Pack 1 from the FactoryPMI Goodies (inductiveautomation.com/prod … i/goodies/) for a nice pre-made clock dispaly.
Hope this helps,