Date and Time in Alarm Expression in 800xA
Can we Compare the 800xA or Local System Date and Time in the Alarm Expression with third Party OPC Server Time.If time is not equal for 5 sec then generate Alarm
If anybody try then please share your syntx.
Voted best answer
Normally, an OPC server derives its time from its Microsoft Windows host computer, not controller/PLC network.
So to get correct time in a 3rd party OPC server you only have to configure it as an W32Time slave to some NTP source, e.g. an 800xA node where you have started up W32Time in *server* mode (normally, some registry changes are required to disable *client* mode, enable *server* mode and force a reliable time quality) or else the node risk to be both W32 and Afw time client which can cause time jitter - the Network Configuration User's Guide, 3BSE034463-510 contains all info you need on making a PC slave to another PC using W32Time. Do not configure a node to slave to more than one clock!).
The available syntax for Alarm Expressions are limited, e.g. functions like ABS() does not exist so to check difference between two clocks two expressions are required (time is measured in whole seconds in the below example);
1) Check if remote clock is more than 60 seconds behind:
$'SomeLocalClockObject:Time' > $'SomeRemoteClockObject:Time' + 60
2) Check if remote clock is more than 60 seconds ahead:
$'SomeLocalClockObject:Time' < $'SomeRemoteClockObject:Time' - 60
The SomeLocalClockObject:Time can easily be created in an AC800 application and exposed as OPC properties to be used by the Alarm Expression.
Or, rather I'd Property Transfer the remote time into my AC800 application and make the time comparison there where features like ABS() is available.
One method to monitor if an OPC property is moving or not would be to use a calculation.
A calculation can be made to trigger on a property change; then the calculation can increase some counter value, e.g. a general property* or soft point.
A second cyclically triggered calculation can then monitor the previous general property or softpoint and set a boolean value (to trigger an alarm expression) if the general property or softpoint has not "increased enough" since last scheduling.
And who knows, maybe the calculation can read the property's timestamp directly through some sub-property? At least the .DataQuality sub property can be read this way from a calculation and set a boolean value if ".TimeStamp" (or whatever this sub property is called) is "too old" - however, I do not know if there exists a sub property containing the last received update timestamp or not.
This all requires a Calculation service provider and corresponding license though.
*) Don't write to too many general properties on cyclic basis as each write on a general property results in an aspect directory transaction which will slow down the overall performance of the system.