Add a Menu Item to Open a Web Diagram
Use this procedure to access a WebDiagram by invoking Cicode from your project menu. Alternately, the following procedure describes how to add a WebDiagram view in your genie equipment popup:
Add Web Diagrams to Equipment Popups
To add a page to the project that will display a given WebDiagram:
- Create a new menu configuration item that calls the PLS_WebReachDsp Cicode explained below.
- Enter the call to the PLS_WebReachDsp function (found in the PLS_Applications.ci file), with the slideshow (if desired), and the page title.
About the PLS_WebReachDsp Cicode
In the following step, you will call the WebReachDsp function from a button. This function is part of the Cicode in the PLS_Include.ci file, which is packaged with this document. The code is shown here for reference:
FUNCTION PLS_WebReachDsp(STRING sDeviceName, STRING sTitle = "") STRING sPage = PLS_GetWebReachURL(sDeviceName);
IF ("" = sPage) THEN RETURN; END
IF ("" = sTitle) THEN sTitle = sDeviceName; END
PLS_WebDsp(sPage, sTitle);
END
There are some important things to note about this code:
sDeviceName
is the name of the device, determined in the step previous.sTitle
is the title of the page
If the diagram does not display, try the following troubleshooting steps:
Enter the URL of the diagram directly into a browser window; verify that it opens. The URL is: http://[servername]/ION/default.aspx?dgm=OPEN_TEMPLATE_DIAGRAM&node=[device name]
If this does not work, verify that the WebReachServer is correct in your Citect.ini, and the diagram appears correctly in WebReach.
The steps previous should resolve most issues. One last option is to test by putting the web browser in a window on the calling page.