This document describes the procedures and utilities for building real time Web based graphic screens under Visual Basic 6.0. These screens may be animated using real time data from a control system. Screens may be displayed on any workstation using a browser such as Microsoft Internet Explorer 5.5.
This document describes the basic procedures for building and publishing a screen. An overview of the process is as follows:
Use Microsoft Visual Basic 6.0 to build the basic screen
Animate the screen using the provided real-time objects
Publish the screen to the proper control system, making it accessible via the web from any network connected Internet browser
Install and configure the proper utilities on the control system to provide access to process variables
Display the page on a workstation using Microsoft’s Internet Explorer
...
Naming Conventions
Expand | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||
The names above should be used as both the Project and Control names as referred to in Visual Basic, as well as the name of the file that is stored on the hard drive (the one in parentheses next to the Project or Control name in VB).
|
Building a Basic Screen
Expand | ||
---|---|---|
| ||
The following procedure defines the steps involved to build a basic screen using Visual Basic 6.0. The tpriNtRt administrator program is used to begin a new Visual Basic screen. All the user has to do is add controls and design the layout of the page. Below is a screenshot of the Visual Basic design interface and descriptions of the layout: |
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
A Label object will always be used for the non-changeable background text on a screen.
For adding additional objects to the screen such as TelePro controls, refer to Section 6.5of this document |
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
After you are done testing the screen, you must hit the stop button ◼ in order to edit the code or view the page again. |
...
Expand | ||
---|---|---|
| ||
Pages can be quickly rebuilt and/or published using a program called tpriPublisher. D:\locNtRt\apps\tpriPublisher\tpriPublisher.exe, this program allows the user to select multiple screens and can rebuild, publish, or both with a single mouse click. |
Expand | ||
---|---|---|
| ||
|
...
Adding TelePro’s Standard Controls to a Visual Basic Web Screen
Expand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A tpriTextBox will always be used for data display and to input text.
|
Expand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A tpriActiveShape will always be used to data display shapes.
Tips on using a tpriActiveShapeThe following condition should be true:
Thus all numbers would be divided into 1-16 intervals. For any new value, the code running behind the control will sequentially verify the following conditions:
If any of the above becomes true, then the verification would be stopped, and ActiveShape control will have Color, Text, and blinking flags that are associated with this txxBoundValue. If none of them is true, then:
If any txxBoundValue is not set (empty), then the rest of the sequence would be ignored by the control. Example: if t05BoundValue is empty and the value is greater then t04BoundValue, the "default" settings would be used even if the following were true:
|
Expand | ||
---|---|---|
| ||
To add a tpriCmdButton object to an ActiveX screen, follow these steps.
Command buttons do not work when running the page from Visual Basic, so you will need to open Internet Explorer and type in the address where your .asp page is stored. For example: http://web.server/sys/MyScreen.asp |
Expand | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||
To add a tpriToggleButton object to an ActiveX screen, follow these steps:
Below is a list of all the properties that are specifically used for the tpriToggleButton:
|
Expand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
To add a tpriBarGraph object to an ActiveX screen, follow these steps:
Below is a list of all the properties that are used to design the graph:
Tips on using the tpriBarGraph
The demoBarGraph screen has the following Bar Graphs defined:
|
Expand | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||
A tpriCoverageBar control is a horizontal bar illustrating the location of a closed section within a wider region. Typically a tpriCoverageBar is tacked on below a bar graph to depict which bars are to be considered ‘valid’.
Below is a list of all the properties that are used to design the graph:
|
Expand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A trend graph requires three objects:
Follow these steps to setup a trend graph on an ActiveX screen:
You may copy the Pegoa graph object once it is on the screen to setup as many graph objects as needed. When copying, click ‘Yes’ to create a control array. The tpriTrendCom control is automatically placed in the corner of your screen.
The following table shows the proper default settings for the tpriTrendCom object.
The following list of Property setting is for the tpriTrendCtrl control.
Tips on using the Trend GraphYou only need one tpriTrendCom object on the page; it can handle multiple trend graphs. For each ProEssentials Pegoa graph on the screen there needs to be an associated tpriTrendCtrl control. If you are using the Pegoa graph for display only, you should set the TabStop property to False. This will take the object out of the tab sequence. The tpriTrendCom object will generate X Axis timestamp labels and send them to the Pegoa graph. The user has the option to display or not display Xaxis timestamp labels. If Xaxis timestamp labels are to be used the ShowXAxis property controls this. Set ShowXAxis to PESA_ALL (0) = Grid, Grid Numbers and Axis Labels if you want to display the timestamp information. If the graph has a user-definable Y-axis min and max, a trpiTextBox (use this one if the scaling values are to be stored in control program variables) or standard VB text box may be added to your screen to collect this information. The tYAxisMax and tYAxisMin properties allow this option. The tpriTrendGraph will check the values in your text box prior to each graph refresh cycle and if changed update the Y Axis scaling |
Expand | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||
A tpriLogMsg control is used to display messages posted to a specified LogMsg queue.
Below is a list of all the properties that are used to customize the LogMsg box:
|
Error Handling
Expand | ||||
---|---|---|---|---|
| ||||
The following is an overview of the VB error handling logic for ActiveX screen code. Including the following in your screen code will provide an orderly handling of VB errors if they should occur. In the case of an unplanned VB error the program will present a Windows message box reporting the error condition. Then the program will shut down and close the browser. Several standard lines of code are required for each screen. The IobjSafe.bas module is automatically included in your project. The ErrRpt Subroutine called by the error handler is included in this code. The following is automatically included at the start of your code.
Turn off the error handler for this sub. This is important. If you omit this line it is possible that an error generated in some other section of the code will branch here and report the wrong failing program location.
Exit (Note: If you have written a Function then change to Exit Function)
The following is the general error handler. Based on the error number, the program will proceed. If your code may generate an error that is expected under normal operating conditions, then handle it here. If the error is not included in the list of Select statement Case numbers, then the code will call a general purpose reporting procedure.
For example if error number 9 (Subscript out of range) is generated by a bad user data entry, then you may catch it here and respond.
Update this text to indicate the Sub or Function name. The string will be included in the error message reporting. You may also add any additional debug information.
If mbError is true then the ActiveX code will call back to the browser via the ErrorTerminate event.
If you handled the error and would like to have the program continue, then set mbError to False.
|
Expand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Following are the run-time errors defined by Visual Basic:
|
Adding Property Pages to the ActiveX Control
Expand | ||
---|---|---|
| ||
The following sequence is used to add property pages to an ActiveX Control. This sequence was used to add property pages to the TelePro supplied controls. It is included here for documentation purposes only.
|
Appendix
Expand | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||
|
Expand | |||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||
Use the following prefixes to indicate a variable's data type.
|
Expand | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Expand | |||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||
Some Examples:
|
Expand | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
|