I am trying to decide the quickest/easiest way to display the system time in a PB display...
all ideas welcome...
PE configured as datetime, 1 second scanclass, formula would be '*'
Nice idea I had not thought about a tag ..I had concentrated on using VBA...
How about a calculated DataSet with the Equation Asle suggested?
Hmm on that server we don't seem to have a 1 sec scan class.... where is the best place to add one - this is normally done in the interface???
Yes, open the ICU, locate the PE Scheduler and add the scan class.
Gregors suggestion saves you a tag, if that's important. But the downside is that you'll have to create the PI Calculation in every display you need this for, if you want it present in multiple displays.
Both suggestions limit the updates to the time period specified for ProcessBook updates (default 5 seconds), so you should probably configure the tag to not display the seconds - to avoid making the display look like it's lagging for 5 seconds all the time.
My suggestion writes a lot of events to the archive (1 each second, 86 400 per day) but you could disable archiving for that tag if you're only going to use it as a clock on a display. And maybe you're just as good off with a 5 second scanclass as well, since PB by default won't update quicker than that.
hmm managed to add the scan class and it worked once then the tag goes to "Scan off"??? Will try Gregor's idea too
Right I can get it to work as a tag every 30s - if I choose a SC lower than that it goes to "Scan Off" 30s should be ok though..thanks all
A calculated tag at 5 seconds scan frequency with archiving tag attribute set to 0 as suggested by Asle appears to be the best solution to me. Did you restart PI Performance Equation Scheduler service after adding the scan class? If not, the active instance will not pick it up before you restart the service.
tried it again - restarted the service and set it to 1 sec - goes straight to "scan off"
tried again with 5 secs and it works ok ????
I suspect a small configuration issue and suggest you sort this out with the help of OSIsoft TechSupport. Probably the best option would be looking at your configuration in a remote session. If this isn't possible, please consider opening a ticket via email with pipeschd.bat, the configuration of your tag and the PI Server log for the past 2 hours attached.
Please perform the following steps to dump messages from your PI Server's log into a text file:
- Open a command prompt on your PI Server
- Navigate to the adm subfolder of the PI Server's HOME (i.e. cd /d %PISERVER%\adm)
- Execute: pigetmsg -st *-2h -et * > piserverlog.txt
Private Sub Display_DataUpdate()
Dim sTime As String
sTime = Format(Time, "hh:mm:ss")
ThisDisplay.lblBioClock.Caption = sTime
Retrieving data ...