Creating custom toolbar buttons

in Process Analyst


Technical Paper
September 2005

Presented by:

Warwick Black



Abstract

This paper outlines how to create custom toolbar buttons in Process Analyst.

About Citect

Citect is a leading, global provider of industrial automation, real-time intelligence, building automation, next generation manufacturing execution systems (MES) and on-demand benchmarking applications. Leveraging open technologies, CitectHMI/SCADA, Ampla, Nexa and Meta connect to multiple plant and business systems. Its products are complemented by Professional Services, Global Customer Support and Educational Services. Citect solutions are installed in over 80 countries and implemented in numerous industries: mining, metals, food and beverage, manufacturing, facilities, water, gas pipelines, power distribution and pharmaceuticals. Headquartered in Sydney Australia, Citect has representation in Oceania, Southeast Asia, China and Japan, North and South America, Europe, Africa and the Middle East.

www.citect.com/support

Contacts

customerservice@citect.com


Create a new Popup page, and place a Process Analyst ActiveX object that takes up the entire viewable area of the popup page.

Double click the Process Analyst object

Click On “New” in the Appearance / Toolbars Tab

Fill out the details on the New Button as shown – or create your own values.

Remove all the “Current Toolbar Buttons” that you may not want for this example, and Add our newly created toolbar to the list.


SAVE THE POP-UP PAGE – This will affect the next step.

After saving, check the “Event Class” of the Process Analyst object. This is found on the Access / Identification Tab as shown below. In this Example the page has been saved as PA_Pop. We can now see the Event Class, which we need to use in our code, is ‘PA_Pop_AN22’

PERSIST ACTIVEX DATA BETWEEN PAGE TRANSITIONS MUST BE TICKED!

Create a new page, and add a button that will open the pop-up page in whatever manner you wish.In this example I am using the command ‘PagePopUp(“PA_Pop”)’


Now the code must be written to capture the event and perform a task according to the CommandID.

This can be done in Cicode or CiVBA, by defining a function:

‘PA_Pop_AN22_CommandExecuted()’

The arguments passed to each function differ between the Cicode and CiVBA versions.

CiCode:

FUNCTION PA_Pop_AN22_CommandExecuted(OBJECT processAnalyst, STRING commandId)

IF commandId = "Command_MyCustom" THEN

/*INSERT YOUR CUSTOM CODE FOR THIS BUTTON HERE!!!!*/

WinFree() //IN THIS CASE OUR CODE WILL CLOSE THE POPUP

/*END YOUR CUSTOM CODE FOR THIS CommandID HERE!!!!*/

END

END

OR

CiVBA:

Sub PA_Pop_AN22_CommandExecuted(commandId As String)

If commandId = "Command_MyCustom" Then

/*INSERT YOUR CUSTOM CODE FOR THIS BUTTON HERE!!!!*/

CicodeCallOpen("WinFree")

/*END YOUR CUSTOM CODE FOR THIS CommandID HERE!!!!*/

End If

End Sub

Conclusion:

Now, whenever any button is pressed, the “PA_Pop_AN22_CommandExecuted” function is executed, and is passed the “CommandID”.

By filtering which “CommandID” is passed, we can use an if statement to filter out which code to execute.

Note: If “PERSIST ACTIVEX DATA BETWEEN PAGE TRANSITIONS” is not ticked, then the popup page will close the first time, but not any other time. This may be because it has created the new instance of the popup with a different event class.

Disclaimer

Disclaimer of All Warranties 
SCHNEIDER ELECTRIC (AUSTRALIA) PTY LTD DISCLAIMS ANY AND ALL WARRANTIES WITH RESPECT TO SCHNEIDER ELECTRIC (AUSTRALIA) PTY LTD PRODUCTS AND THE RELATED DOCUMENTATION, WHETHER EXPRESS OR IMPLIED, INCLUDING SPECIFICALLY THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A GENERAL OR PARTICULAR PURPOSE. CITECTSCADA AND THE RELATED DOCUMENTATION ARE PROVIDED "AS IS," AND YOUR COMPANY UNDERSTANDS THAT IT ASSUMES ALL RISKS OF THEIR USE, QUALITY, AND PERFORMANCE.

Disclaimer of Liability 
YOUR COMPANY AGREES AND ACKNOWLEDGES THAT SCHNEIDER ELECTRIC (AUSTRALIA) PTY LTD SHALL HAVE NO LIABILITY WHATSOEVER TO YOUR COMPANY FOR ANY PROBLEMS IN OR CAUSED BY SCHNEIDER ELECTRIC (AUSTRALIA) PTY LTD PRODUCTS OR THE RELATED DOCUMENTATION, WHETHER DIRECT, INDIRECT, INCIDENTAL, SPECIAL, OR CONSEQUENTIAL (INCLUDING LOSS OF PROFITS).

Attachments