Wednesday, August 3, 2011

In Search Of... Missing Time & Date Tags in Wonderware ArchestrA Symbols

Some of the InTouch system tags that do not exist in ArchestrA symbols relate to time and dates. Here's a quick tip on where to find them.


Step 1: Launch your Quick Script Editor.
Step 2: Click F(x) to list functions.



Step 3: Expand the 'Types' category and you'll be able to explore Microsoft's .NET System Namespace.
You'll find a number of familiar properties.




Here is a list of InTouch system tags and their equivalent .NET property:

$Month
System.DateTime.Now.Month
$Day
System.DateTime.Now.Day
$Year
System.DateTime.Now.Year
$Hour
System.DateTime.Now.Hour
$Minute
System.DateTime.Now.Minute
$Second
System.DateTime.Now.Second
$TimeString
System.DateTime.Now.ToString("hh:mm:ss")
$DateString
System.DateTime.Now.ToString("mm/dd/yyyy")

In addition to replacements for the classic InTouch time/date tags, you'll also find new properties and methods such as:

DayOfWeek
returns the day of the week (integer)
Add
adds incremental time to an existing time value (also AddDays, AddHours, etc)
DaysInMonth(month)
returns how many days are in the specified month
Compare
compares two datetimes and returns =, <, >
ToString
converts datetime value into a string equivalent (see table above)

To see more information about the .NET System Namespace, check out:

No comments:

Post a Comment