

|
|
||||||
|
|
||||||
|
NOTE: This article and all content are provided on an "as is" basis without any warranties of any kind, whether express or implied, including, but not limited to the implied warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall Q-mation be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortuous action, arising out of or in connection with the use or performance of information contained in this article. TIP: Subtracting Dates in InTouch Date manipulation in the InTouch environment is pretty straight-forward... if you know what functions to leverage. Add-in Script Functions combined with Quick Functions can allow you to build reusable scripts to address all of your date manipulation needs.
Wonderware has traditionally used the “number of seconds since 1-1-1970” as the starting point for dates and times in the runtime environment. The ITXtras Script Function Library, available to Comprehensive Support subscribers on the Wonderware website, includes several useful functions including some that are used to convert and create dates in this format.
One example if this ability is shown below – creating a simple function to subtract two datetime values. This type of function is useful when you need to set the length of a Historical Trend Chart based on a completed batch run. This example uses the following function from the ITXtras library:
ITXCreateDateTimeUTC Usage : IntegerDateTimeValue = ITXCreateDateTimeUTC(year,month,day,hour,minute,second); Example : TrendTag.ChartStart = ITXCreateDateTimeUTC(1994,5,10,12,30,0);
This function returns an integer containing the number of seconds since January 1, 1970 on base of the system (UTC) time. It is in the correct format for assignment to the .ChartStart dot field of a historical trend.
NOTE: This integer date/time format refers to the date/time representation used by historical trend objects, NOT the date/time format used by the $DateTime system variable.
Please feel free to email support@qmation.com with questions.
|
||||||
|
©2003 Q-mation, Inc. All rights reserved. All trademarks are the property of their respective owners. |