AnsweredAssumed Answered

How to Close a specific PI ProcessBook Display Page using VBA Command?

Question asked by Muthulingam-EnQuest on Mar 29, 2018
Latest reply on Apr 12, 2018 by Muthulingam-EnQuest

Hi guys,

 

- What is the VBA Command to Close a Specific PI ProcessBook Page?

 

I need to Open and Close a Specific PI ProcessBook Page cyclically in order to refresh the Data Set Calculations in that page.

I am currently using the following command to run the Slideshow in a Loop. The slideshow is working fine, but the Data-Set Calculations doesn't seem to be refreshing as it should.

Refer to the "Hours Open" Data Sets below.

 

Page Open always: The "Hours Open" Data-sets are Not showing similar Values (Not OK)

 

After Closing and Opening: The "Hours Open" Data-sets are showing similar values (OK)

 

It was meant to show how many hours the Wellheads are "Open" from 6.00 am to 6.00 pm (24 hrs) everyday. It only refreshes accurately if I close the Page and Re-Open it.

If not refreshed, they show a different value for each Open Wellhead, this should not be the case as most of the Wellheads are running at a similar time frame.

Some Wellheads are genuinely Turned On or Off, but most are running concurrently.

 

All the Data-sets are programmed exactly identical with similar Refresh Rates and Calculation Intervals.

 

10  Set x = Application.Displays.Open("\\klpi01\Graphics\PM8E-PVDS.pdi", True)

    'Starts the First loop

    PauseTime = 10    ' Set duration.

    Start = Timer    ' Set start time.

    Do While Timer < Start + PauseTime

        DoEvents    ' Yield to other processes.

    Loop

    Finish = Timer    ' Set end time.

         

    Set x = Application.Displays.Open("\\klpi01\Graphics\SEDWellheadMonitoring.pdi", True)

    'Starts the Second loop

    PauseTime = 5    ' Set duration.

    Start = Timer    ' Set start time.

    Do While Timer < Start + PauseTime

        DoEvents    ' Yield to other processes.

    Loop

    Finish = Timer    ' Set end time.

   

    GoTo 10

 

I've tried multiple VBA Code like:

 

  • Application.Displays.Close("\\klpi01\Graphics\PM8E-PVDS.pdi", True)
  • ThisDisplay.Close
  • ThisDisplay.Close (False)

 

but the Data sets are still not refreshed as it should have been.

Please help guys.

 

Best Regards,

 

Muthulingam Ramiah

 

Ganesh Supromaniam

Muthulingam Ramiah

Outcomes