I have not used the ActiveView module, but for ProcessBook with VBA you can get the local machine clock with:
Code:MsgBox DateTime.Time
Or to get the PI Server time:
Code:Sub clock()
'Replace ServerName with your own server name in quotes
mySRV = PISDK.Servers("ServerName")
If Not PISDK.Servers("ServerName").Connected Then PISDK.Servers("ServerName").Open
MsgBox PISDK.Servers("ServerName").ServerTime.LocalDate 'formatted date
MsgBox PISDK.Servers("ServerName").ServerTime.UTCSeconds 'number of seconds
End Sub
Private Sub Display_DataUpdate()
Call clock()
EndSub
The clock() routine will give two messages - one with the date and time in a readable format, the second as a number of seconds. Either of these can be put into a Value object in PB.
The second routine is the built-in function that runs each time the display calls for new values (default is 4 seconds I believe). To get the time to refresh each second (along with the actual values) change the refresh rate to 1 second.
One final note - to use the PISDK commands, add a reference to pisdk.dll (in the VBA window, go to Tools -> References and check PISDK 1.3 Type Library).
Disclaimer: Any code presented by myself might be unconventional because of the lack of formal training. Any corrections are welcome. =)