The Tsentry HMI libraries are composed of a set of objects to facilitate the creation and usage of real-time HMI screens on the Tsentry Windows NT/2000/XP platform.
...
Expand | ||
---|---|---|
| ||
The TPRI.ToggleButton is an on/off switch that connects to a Boolean variable in global common. [PICTURE] |
Expand | ||
---|---|---|
| ||
The active display of the TPRI.ToggleButton object consists of two main states: on (true, non-zero) and off (false, zero). The display of each of these states is configured by setting the various object properties. When the button is pressed, the current value of the associated global common variable is changed to the opposite state. For example, if the variable is currently true, its value is changed to false and vice-versa. The button is then disabled until the new variable value is updated back to the screen. This prevents accidental double clicks of the button from changing the variable back to its original value. |
...
Expand | ||
---|---|---|
| ||
The TPRI.BarGraph is used as a live graphical display of up to two parallel array variables in global common. The arrays are displayed as a set of bars growing up or down from a centerline. For instance, this object is commonly used to display a feedback stress array for flatness control in metal rolling. [PICTURE] [PICTURE] |
Expand | ||
---|---|---|
| ||
In general, the bar graph is configured according to the following. Number of bars The horizontal extent of the display is divided into N bar slots, where N is equal to the tNumBars property. Each of the bar slots is divided into a left and right bar; when active, the heights of each of the left bars correspond to the values in the first (right) array, while the heights of each of the right bars correspond to the values in the second (left) array. Alternatively, the tNumBars property can be set to the name of a variable in global common. In this case, the bar graph will retrieve the value of this variable and use it to configure the number of bars displayed. Horizontal display configuration Both sets of bars can be configured to take up some fraction of each bar slot. The property tLeftBarPercent specifies the percentage of each bar slot that the left bar should consume; the left bar is always assumed to start at the leftmost edge of the bar slot. The property tRightBarPercent specifies the percentage of the bar slot that the right bar should consume; however, the starting point of the right bar is specified with the tRightBarOffset property. If the sum of tRightBarOffset and tRightBarPercent exceeds 100, the right bar will be truncated as the rightmost edge of the bar slot. Vertical display configuration The displayed heights of each bar are specified relative to three TPRI.BarGraph properties. The tEngUnitCenterLine property specifies the engineering units of the horizontal centerline of the graph. This is line from which each of the bars will grow up or down. If the array element value associated with a given bar is less than tEngUnitCenterLine, the bar will be drawn down from the centerline, and conversely, if the value associated with a bar is higher than tEngUnitCenterLine, the bar will be drawn up from the centerline. This allows the bar graph to be configured to display deviations from a nominal non-zero value. The top and bottom vertical limits of the graph are specified by the tEngUnitTop and tEndUnitBottom properties; array element values outside this range will display bars extending to the limits of the display. If forcing any of these three properties to a fixed value is not appropriate for the display, there are two alternatives. First, the property can be set to the name of a variable in global common whose value will be retrieved at runtime and used as the associate engineering value. This allows the display to be programmatically controlled by values in global common. Second, the property can be set to a special string consisting of an ampersand '@' followed by the name of a text box on the screen; in this case the value entered into the text box will be used as the associate engineering value. This allows the HMI user to configure the display at runtime as he pleases. Scale display configuration The property YTickSpacing is defined as the spacing (in engineering units) between the y-axis ticks annotating the graph. A tick is a short horizontal line drawn to the left of the graph together with a label indicating the corresponding y-axis position. A property YTickSpacing value less than or equal to zero indicates that no ticks should be drawn. A positive value indicates that ticks and labels should be drawn at integer multiples of the spacing value between the lower and upper limits of the graph. The default value is zero. |
...
Expand | ||
---|---|---|
| ||
A TPRI.CoverageBar control is a horizontal bar illustrating the location of a closed section within a wider region. Typically a TPRI.CoverageBar is tacked on below a bar graph to depict which bars are to be considered ‘valid’. For example, the CoverageBar may be used on a rolling mill to indicate which zones of a flatness bar display are covered by the strip itself. [PICTURE] |
Expand | ||
---|---|---|
| ||
At run-time, the TPRI.Coverage bar is a display-only object representing a contiguous range of values on the real number line. The left and right edges of the horizontal bar represent the lower (or most negative) and the upper (or most positive) limits of this range. Within this displayed range there is assumed to be a single range of values that are to be considered valid; these values are drawn in a different color to visually indicate the span of values that is valid. In the image above, this valid range is drawn in blue, while the total displayed range is drawn in gray. At design time, each of the four limits of the two ranges (left and right limits of displayed range, left and right limits of valid range) is set as a property of the object and can be specified in one of three ways. First, the property can be hard-coded to the actual numeric value. Second, the property can be set to the name of a variable on the host system that contains this value; at run-time this value will be actively retrieved and updated from the server. Third, the property can be set to the name of a TPRI.TextBox [LINK] object elsewhere on the screen prepended with an ampersand ('@') character that contains the specified value; this allows the HMI user to configure the display himself at run-time. |
...
Expand | ||
---|---|---|
| ||
The TPRI.LogMsg object actively displays all messages that are logged to a TSENTRY log message queue. For instance, the bottom half of the NtRtMgr screen uses this object to display messages from the default ‘LogMsg’ queue. [PICTURE] |
Expand | ||
---|---|---|
| ||
Active operation of the TPRI.LogMsg object is fully automated by the screen framework provided that the user screen is derived from the TPRI.BaseScreen class and that it contains a TPRI.OpcMgr object. Configuration of a TPRI.LogMsg control consists mainly of setting the desired LogMsg queue name in the LogMsgName property. This string must match one of the LogMsg queues defined in the system logs initialization file [LINK]. Once configured, the TPRI.LogMsg object will display all messages logged to the specified queue. |
...
Expand | ||
---|---|---|
| ||
The TPRI.ComboBox is used as a live display and input of global common variables that are defined only to have a finite set of allowable values. [PICTURE] |
Expand | ||
---|---|---|
| ||
The TPRI.ComboBox is similar to the TPRI.TextBox [LINK] in that it displays the current value of a variable in global common and operates in two possible modes, read-only mode and input mode. However, whereas the TextBox is a text-entry box that allows the user to enter any new value, the ComboBox is a drop down list that allows the user only to select a new value from the presented list of choices. Moreover, since many times the HMI user does not think of the list of choices in terms of numerical values but instead in conceptual possibilities, the ComboBox allows the designer to associate a text string with each of the possible variable values; these strings can be displayed at run-time instead of the actual values themselves. For example, suppose there is a variable in global common representing the current mode of a controller: automatic, manual, or off. The variable itself is an integer, and is defined such that automatic = 2, manual = 1, and off = 0. The TPRI.ComboBox object therefore limits the user choices in the drop down box to ‘Auto’, ‘Manual’, or ‘Off’, though it internally manages updating the variable value on the host to a 2, 1, or 0, respectively. When the TPRI.ComboBox object is initially connected to the host, it displays the descriptive string associated with the current value of the variable in global common. If this value is changed by some other process, the display will be updated accordingly to display the new descriptive string. If the user makes a new selection from the drop down list, however, the background color of the display changes color and the active update of the value is put on hold while the user finalizes his selection. The new value is not sent back to the server until a call is made to the TPRI.OpcMgr object's WriteModified() method. This is method is typically called in the click-handler of a button on the screen. Once the data has been sent back to the server the background color of the control is changed back to the original color and a special string (property tResetStr, default “@@@”) is displayed until the new value is updated to the screen. This provides verification that the variable in memory has been updated. In the case where the current value of the variable on the host is not in the list of available values defined in the TPRI.ComboBox object, the object will display “{XXX}” where XXX is the current value of the variable. If the flag AutoSubmit is set to true the control automatically submit changes to the host when a new item is selected from the list. Finally, if communications with the server is inactive for some reason and the object is not being actively updated with the current value, a special string (property tDisconnectedStr, default “###”) is displayed to indicate that the display is not live. |
...
Expand | ||
---|---|---|
| ||
The TPRI.OpcMgr object is responsible for automating all active variables on a screen. On initialization it searches for any objects on the screen that are derived from TPRI.BaseControl and requests from each of them a list of variables that should be retrieved from the host system. Then as these variables are updated from the server to the client, the OpcMgr object passes these updates back to each of the associated BaseControl objects. [PICTURE] |
Expand | ||
---|---|---|
| ||
In most cases, all operation of the TPRI.OpcMgr object is fully automated by the TPRI.BaseScreen framework. While connected to the data host, the OpcMgr object will display green and indicate the date/time of the most recent variable update from the host. Before the initial connection and any time the OpcMgr object disconnects from the host, the display will turn orange and will indicate the date/time of the most recent connection attempt; the OpcMgr object should attempt to reconnect every 3-5 seconds. Finally, there are two cases in which the OpcMgr object will turn red: If the OpcMgr object is unable to find any variables configured on the screen for retrieval from the server, the object will turn red and display a message indicating that there are no OPC items configured. If the OpcMgr object encounters an unrecoverable error the object will turn red and display an error indication. Details of the error can be viewed by holding down the control key and left clicking on the object.
There are some situations where a screen may want to receive variable updates for data that it wishes to use for its own purposes rather than for display in one of the existing active objects. To accomplish this, the screen should do the following: Add an event handler for OnRestart(..). Inside this handler make appropriate calls to the AutoAddItem() method to add all variables that the screen would like to receive directly. Add an event handler for OnDataUpdate(..). Inside this handler process individual variable updates. Optionally add an event handler for OnDisconnect(..). Place any code to reset the visual display of the screen to indicate that the screen is not connected to the data host. |
...
Expand | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
The following events are exposed by the TPRI.OpcMgr object
Description: Indicates that a data variable has been updated from the host. Parameters: Sender The source of the event. tag Tag of updated variable. Value Value of updated variable. timestamp Date and time associated with this variable update. quality Data quality flags as passed from host.
Description: Passes a message to the client. Parameters: Sender The source of the event. err Error number. msg Error description.
Description: Indicates that communications with the host have restarted. Parameters: Sender The source of the event.
Description: Indicates that the connection to the host has been disconnected. Parameters: Sender The source of the event. |
STOPPED HERE
TPRI.OpcCom
Expand | ||
---|---|---|
| ||
The TPRI.OpcCom object is an OPC communications client for accessing variables in global common on the host. |
Expand | ||
---|---|---|
| ||
The TPRI.OpcCom class is intended solely for internal use by the other TSENTRY objects. For access to variables in global common exposed by the OPC server on the host, see the TPRI.OpcMgr [LINK] class. |
Expand | ||
---|---|---|
| ||
There are no properties exposed by the TPRI.OpcCom class for public use. |
...
Expand | ||
---|---|---|
| ||
The TPRI.DataSetInfo is used to create, load, update and delete data set configuration files. [PICTURE] |
Expand | ||
---|---|---|
| ||
Expand | ||
---|---|---|
| ||
[TABLE] |
...
Expand | ||
---|---|---|
| ||
The TPRI.DDVarSelect object is used to select a variable from the data dictionary and display its name to the user. [PICTURE] |
Expand | ||
---|---|---|
| ||
Expand | ||
---|---|---|
| ||
[TABLE] |
...
Expand | ||
---|---|---|
| ||
The TPRI.DataDict object is used to access the data dictionary on the controller. [PICTURE] |
Expand | ||
---|---|---|
| ||
Expand | ||
---|---|---|
| ||
[TABLE] |
...
Expand | ||
---|---|---|
| ||
The TPRI.HMI.Controls.TrendCtrl object is used to select variables for trending as well as to monitor the values of each of these variables during trending. The main display of the TrendCtrl object is a grid of information displaying information about the entire set of trended variables. [PICTURE] |
Expand | ||
---|---|---|
| ||
[TABLE] |
...
Expand | ||
---|---|---|
| ||
The TPRI.TrendCom object is responsible for automating communications for all trends on a screen. On initialization it searches for any TrendCtrl objects on the screen and begins to request data on their behalf from the host system. As responses are received, the TrendCom object feeds the data back to the appropriate TPRI.TrendCtrl [LINK] objects. |
Expand | ||
---|---|---|
| ||
In most cases, all operation of the TPRI.TrendCom object is fully automated by theTPRI.BaseScreen [LINK] framework. While connected to the data host, the TrendCom object will display green and indicate the date/time of the most recent trend data response from the host. Before the initial connection and any time the TrendCom object disconnects from the host, the display will turn orange and will indicate the date/time of the most recent connection attempt; the TrendCom object should attempt to reconnect every 3-5 seconds. Finally, there are three cases in which the TrendCom object will turn red: If the TrendCom object has not been supplied a hostName to which it should connect, the object will turn red and display a message indicating that there is no host specified. If the TrendCom object is unable to find any TrendCtrl objects on the screen or none of the TrendCtrl object specify any variables to be trended, the object will turn red and display a message indicating that there are no trend items configured. If the TrendCom object encounters an unrecoverable error the object will turn red and display an error indication. |
...
Expand | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
The TPRI.TriggerEd object acts purely as a run-time user interface for interacting with the historical trend system. The buttons along the top row of the screen allow the user to create a New trigger definition, Load an existing trigger, Save the current trigger, Activate the current trigger, or Deactivate the current trigger. Below the row of buttons are a set of fields to configure general information about the trigger.
Below the general information fields are two columns of variables. The left column of Trigger Variables allows for specification of all variables that define the trigger. Each line in this list defines a Boolean operation; the trigger is considered active when every one of these operations is satisfied. Each operation is defined by a variable name, a comparison operator and comparison value selected; hence the operation is considered true when the associated variable on the host system meets the specified criterion. In order to facilitate variable selection, each of the variable name entry fields are TPRI.DDVarSelect [LINK] objects; clicking on the '*' in the upper right hand corner of the text box will load the data dictionary browser form. The right column of variables, the Trend Variables, specifies each of the variables that should be recorded while the trigger is considered active. Like the Trigger Variable names, the data dictionary browser can be loaded by pressing the '*' in the upper right hand corner of any of the Trend Variable entry text boxes. |
...
Expand | ||
---|---|---|
| ||
Parameter values can be modified by single-left-clicking on the parameter value, which will bring up an edit box that allows for text entry. Pressing the enter key while editing or clicking outside of the edit box will validate the user entry; if it is valid the rule parameter will be changed, while if there is a problem the user will be prompted and asked to correct the value. Editing a criteria or action value brings up a special text edit box that provides access to the Data Dictionary [LINK] by right clicking in the edit box. Once any rule parameter has been modified from its original value, the rule name displayed as the label on the root node is appended with an asterisk to indicate that it has been modified. For more in-depth information about the data dictionary, refer to Data Dictionary [LINK]. |
Expand | ||
---|---|---|
| ||
A rule can be saved to a file on disk and stored for later reference by choosing either of the first two save options from the popup menu. The Save Rule option simply saves the rule to its current file, while the Save Rule As... option saves the rule under a different name or into a different folder. Before the rule can be saved to disk, though, it must be validated to ensure that each of its parameters is formatted correctly and contains valid data. If validation is not successful the user will be prompted with a list of problems and the rule display will be populated with a red Local Errors node that contains a duplicate of this list. For instance, an improperly formatted VariableCondition statement containing unmatched parentheses causes a fatal validation error because the condition cannot be properly parsed. On the other hand, a properly formatted VariableCondition statement that contains a variable name that cannot be located in the data dictionary only causes a non-fatal validation warning, as this rule can still be properly parsed by the rules manager process. If only validation warnings are encountered, and there are no fatal validation errors, the user has the option of continuing with the save process or canceling the save to fix the problems; however, if any fatal errors are encountered the save cannot continue. If a rule is currently active on the host, it can only be saved to the host share under its current name by re-activating it at the same time (see below). The user may however choose to save the rule to a different folder under the same name. |
...