Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

The trend system described here operates under the TSENTRY real time control system.  It is a data collection system that supports the following functions:

  • Acquisition of process data from global common areas and from messages received from remote systems

  • Acquisition of data at precise user-defined intervals

  • Maintenance and storage of process data for some user-defined length of time

  • Buffering of trended process data to memory areas and disk files

  • Serving data requests from trend clients

  • Support of both static trends (variables trended continuously during system operation) and dynamic trends (variables trended on demand at the request of remote clients)

  • Display of trend data on web based screens

  • Monitor trend data for events and record data to individual disk-based data files for later review

  • Play back previously recorded trend data from historical trend files.


 Real-time vs. Historical Trending

The trend system simultaneously supports data collection in two separate modes.  The first mode is real-time trending; in this mode the trend system records the latest trend data into a combination of memory-based and disk-based circular buffers.  As a new point is recorded the oldest point is removed from the circular buffer, so that at any given time only the last n hours, minutes and seconds-worth of data is stored on the system (n is a configurable parameter).

In addition, the trend system can record historical trend data sets and store them as files on disk for later review. The historical trend system is driven by triggers, which are definitions of events and the data that should be recorded when the event is detected.  The historical trend system and triggers are defined in more detail on the Historical Trend Triggers section of this manual.

 Processes

The following host processes comprise the Trend System:

  • TrendMgr – the trend manager process

  • TrendGsm – the data acquisition process acquiring data from global shared memory regions

  • TrendSvr – the server process that services client requests for trend data

  • TrendTrig – the server process that manages historical trend data acquisition

 Screens

The following screens are available as part of the Trend System:

Historical Trend Triggers

 ...

A historical trend trigger is the definition of an event along with a list of data to be recorded when that event is triggered.  An event is triggered when a set of variables meet some prescribed conditions.  In an aluminum smelting plant, for instance, a trigger could be defined to capture data during an anode effect.  The trigger could watch for when the pot resistance gets too high, and when it does record a set of data including the pot resistance, volts, and line amps.  Once this trigger is configured in the historical trend system, all anode effect events would be captured to individual historical trend files on disk for later review.  

Once a trigger has been activated, the historical trend trigger system monitors each of the trigger conditions and continuously evaluates each of them to determine when they have all been met. During this time the trigger is Waiting for trigger event detection.  If this occurs, and all trigger conditions are met, then data collection begins and the trend system begins to write data to the file.  This will continue until the trigger conditions are no longer all met.  At this point the data file is closed and left on the disk for later review.

Several options are available to enhance data collection:

  • A pre-trigger time period may be configured so that when a trigger event is detected the trend system will actually go backwards in time to retrieve the data leading up to the event and save this in the historical trend file before the data for the event itself.  In many cases this information is crucial for determining the cause of a given event.

  • A post-trigger time period may be configured so that once the trigger conditions are no longer satisfied the trend system will continue to record data for a period of time and append it to the historical trend file after the data for the event itself.  In many cases this information is useful for determining how the control system reacts after a given event.

  • A maximum trend time period may be specified to keep file sizes small and manageable.  This value limits the maximum amount of time of historical data that can be stored in a single file; if the event lasts longer than this amount of time then the data recorded for that event will span multiple files.  This option is useful for continuously recording data (i.e. the event is defined as always triggered) and generating files of finite size.

 

Triggers can be created, modified, activated, and deactivated using the TriggerMgr screen.

 Trigger File Format

Historical trigger files are stored on the host as ASCII text files.  Following is an example file:

[Trigger]
Name=TrackTime
Description=Record the drift constants for the time tracking algorithms.
TagVar=PidCom.rtDrift.filtDrift
PreTriggerTrendTime=30
PostTriggerTrendTime=45
MaxTrendTime=1440
SaveDate=127592326792807993
 
NumTriggerVars=2
TriggerVar0=/TrendGsm/PidCom.rtDrift.bTrack != 0
TriggerVar1=/TrendGsm/PidCom.pcDrift.bTrack != 0
 
NumTrendVars=4
TrendVar0=/TrendGsm/PidCom.rtDrift.filtDrift   PidCom.rtDrift.filtDrift
TrendVar1=/TrendGsm/PidCom.rtDrift.instDrift   PidCom.rtDrift.instDrift
TrendVar2=/TrendGsm/PidCom.pcDrift.filtDrift   PidCom.pcDrift.filtDrift
TrendVar3=/TrendGsm/PidCom.pcDrift.instDrift   PidCom.pcDrift.instDrift

NumScalarVars=2
ScalarVar0=PidCom.rtDrift.filtDrift   PidCom.rtDrift.filtDrift
ScalarVar1=PidCom.rtDrift.instDrift   PidCom.rtDrift.instDrift

Tasks

TrendMgr - Trend Manager Process

 Overview

The trend manager process is responsible for initializing the trending subsystem, creating the trend global shared memory, configuring the various trend sources, and processing requests for dynamic trend variables.  In addition, TrendMgr monitors the active trends, periodically writing trend data from the memory buffer to the disk for long-term storage and disabling dynamic variables after a specified period of inactivity.  The trending subsystem is configured via an ini file, which is read by the TrendMgr process on initialization.  This file defines each of the various trend sources such as the global common trending process TrendGsm.  

 Trend Manager Initialization File

The trend manager process is initialized by a text file passed to it as a command line parameter.  This file is used to configure the internals of the trending subsystem itself.  It consists of several sections described below:

[General]
This section specifies the general parameters for the trending subsystem.

 

  • MaxTrendSrc=2
    Specifies the maximum number of trend sources in the system. The minimum value is 2, which will support both the internal test trend source and the TrendGsm global shared memory data collection trend source. This is sufficient for most systems.

 

  • MaxTrendVar=512
    Specifies the maximum number of trended variables in the system. This number must be larger than the total of the number of static trends, dynamic trends required by historical triggers, dynamic trends required to support various TrendX clients, and additional trending slots required as 'maneuvering room' for adding and deleting various dynamic trends during operation.  Since most of these values aren't known up front, it is recommended that this number be chosen to sufficiently cover the worst case scenario.

 

  • TrendComSizeMB=30
    Specifies the maximum size of the trend global common in megabytes. The trending system requires that the entire trending global common be locked in memory, so this number specifies the amount of available physical RAM that will be allotted to the trending subsystem.  If this number is too small given the maximum number of trended variables specified above, the TrendMgr process will not start but will provide suggestions (via the console LogMsg) for settings that provide adequate space.

 

  • TempDir=\locNtRt\sys\Temp\
    Specifies a temporary directory for the trending system. This directory is used to contain trended data that has been paged to disk, as well as the trending common image for persisting trend data between system shutdown and restart.

 

  • TriggerDefDir==\locNtRt\sys\Trigger\Def\
    Specifies the storage directory for trigger definitions. This is not required if the historical trend subsystem is not installed.

 

  • TriggerTrendDir==\locNtRt\sys\Trigger\Trend\
    Specifies the storage directory for historical trend files. This is not required if the historical trend subsystem is not installed.

 

  • PersistTrends=No
    Specifies whether or not to persist trended data between system shutdown and restart.

 

[TrendSrcList]

This section specifies the various trend sources configured for a given system.  Each trend source is specified on a single line in this section; this line contains a white space-delimited list of parameters defining the trend source.  Most systems will only have a single entry for the global common trending system, TrendGsm.

The parameters in order are:

 

  • SourceName
    Specifies the name of the trend source.  This name is used to fully qualify a trended variable.

 

  • AllowTemp
    Specifies whether or not the trend source allows temporary (dynamic) variables to be added at runtime.

 

An example configuration entry for the TrendGsm source is provided below:

#SourceName       #AllowTemp

TrendGsm          1

TrendGsm - Trend Global Shared Memory Process

 Overview

This hard real-time process samples variables from global common at frequencies up to 50 Hz (20 ms per sample) and buffers their values into memory. Static trend variables are defined through an ini file, which specifies each global variable’s fully qualified name, sampling period, and the number of samples to be stored both in memory and to disk.  Alternatively, dynamic trend variables may be requested at any time during system operation and the TrendGsm will begin buffering the appropriate data. 

 TrendGsm Initialization File

The TrendGsm process is initialized by a text file passed to it as a command line parameter. Typically, this file is the same as that used to initialize the trend manager process and containing additional sections for the TrendGsm process. The initialization file parameters are described below:

[TrendGsmVars]

This section specifies the list of statically trended variables for the TrendGsm process. Each variable listed in this section will be trended at all times as long as the TrendGsm process is active. Each statically trended variable is specified on a single line in this section; this line contains a white space-delimited list of parameters defining the trended variable.

The parameters in order are:

 

  • VariableName
    Specifies the data dictionary name of the variable to be trended.

 

  • SamplePeriod(ms)
    Specifies the sampling period of the variable in milliseconds. This number cannot be smaller than the rep rate of the TrendGsm process as specified in the sysProcs.ini file.

 

  • MemPeriod(s)
    Specifies the size of the circular buffer (in seconds-worth of data) that will be stored in memory before the data is paged off to disk. This number must be greater than zero. If DiskPeriod is zero, this number dictates how far back into the past live data will be stored before it is destroyed.

 

  • DiskPeriod(s)
    Specifies the size of the circular buffer (in seconds-worth of data) that will be stored on disk. If this number is zero, no data will be stored on disk. Otherwise this number must be greater than the MemPeriod and dictates how far back into the past live data will be stored before it is destroyed. 

TrendSrv - Trend Server Process

 Overview

The trend server process accepts TCP/IP connections from remote clients and handles their requests for trended data.  Trended data is requested by source and variable name at a given sampling rate and between a starting and ending time.  The TrendSrv process searches for the requested variable on the list of currently trended variables, returning the desired data if found.  If the variable is not currently being trended, TrendSrv passes a request for dynamic trend to the specified trend source and returns no data; subsequent client requests for this variable will thereafter return whatever data is available.

 Operation
  • Operates as a TCP/IP server process

  • Server services requests to port 2250

  • Runs at standard or real time 2000 priority

  • Does not run at a Hard Real-Time priority

  • Receives and processes connection request from client

  • Receives requests for set of trend data

  • Saves request information associated with a channel for use as defaults for following data requests

  • Responds to requests with requested trend data

  • Waits in loop for further data requests

TrendTrig - Trend Trigger Process

 Overview

The trend trigger process is responsible for monitoring the trending system for user-defined events and recording historical trends to disk for later reviewing.


Screens

TrendX

 Overview

The TrendX screen is used to graphically display and analyze recorded trend data.  It can be used either as a real-time display of live data as it is collected by the trending subsystem or to playback previously recorded data.  The graph itself is capable of simultaneously displaying any number of variables on up to sixteen separate, individually configured axes.  

 Operation

The trend graph consists of multiple vertical axes aligned with the same horizontal (time) axis. As data is played forwards in time it will move from the right to the left; the opposite is true when playing data backwards in time.  Though the vertical axes are stacked from top down, the line displayed for a given trend variable may appear within a different axis if the current value of that trend variable is outside the range configured for its associated axis (by default, trended data is not clipped to fit their owner axis).

“O-” as in 'O-Example' is an Operation sub doc

 O-Trend Configuration

The TrendCtrl window in the left half of the display shows the current configuration of the trend graph.  Variables are grouped according to their associated axes as shown below.

Between the grid and the graph is a splitter bar that can be dragged left and right to trade space between the graph and the grid.  This allows the user to increase the screen space allotted to the TrendCtrl to view all of the variable details at once or, on the other hand, to maximize the display of the graph within the screen.  A short cut for maximizing the textual display is also available. Click the top left corner of the grid on the left of screen to expand (>) or collapse (<) the textual display.

Most of the trend configuration can be performed in-place in the TrendCtrl grid.  Each row represents either a graph axis or a variable on an axis, and each column displays the properties for the corresponding axis or variable.  The first column is used to perform Drag and Drop of rows.  The rest of the columns are used to display trending information.  Some of the columns are display only while the others show properties that can be edited in-place. The columns are:

  • Drag-and-Drop column

  • Name (label)

  • Cursor1 (display only)

  • Cursor2 (display only)

  • Delta (display only)

  • Variable name

  • Variable data source

  • Variable display color

  • Variable graph line type

The first two rows of the grid describe the graph as a whole.  The entire width of the trend graph and the requested sampling period for the trended data can be set by clicking in the associated cell in the grid as shown below:

Additional axes can be added to the trend configuration by right-clicking in the grid and choosing Insert Axis.  Once an axis has been added to the configuration, the following properties can be set:

  • Axis Label
    Double click the Name column of an axis row to start editing the label of the axis.

 

  • Axis Scaling and Percentage
    Axis scaling and percentage are displayed on the selected axis row in Variable column. Click the cell to display axis scaling and percentage editor. Double click each cell to start editing. Click anywhere outside the editor to exit the editor. At this point the Trending Set is modified and trending will be restarted. The new values will be saved to a trend file if the Trend Set is saved.

Edit axis percentage will automatically recalculate the percentage of each enabled axis. The minimum percentage value is 5%. When the percentage value of an axis is increased the percentage of one or more axes may be reduced starting from the last axis. When the percentage value of an axis is decreased the additional percentage will be evenly distributed to all axes starting from the first axis.

Variables can be inserted into an axis by right-clicking in the grid and choosing Insert Variable.  A variable will be inserted into the trend configuration above the selected row.  Once a variable has been added to the configuration, the following properties can be set:

  • Variable Label
    Double click the Name column of a variable row to start editing the label of the variable. Click anywhere outside the cell to end editing. At this point the Trending Set is modified and trending will be restarted. The new values will be saved to a trend file if the Trend Set is saved.

 

  • Variable Name
    Double click the Variable column of a variable row to start editing the name of the variable. Click anywhere outside the cell to end editing. At this point the Trending Set is modified and trending will be restarted. The new values will be saved to a trend file if the Trend Set is saved.

Click the button in the variable name cell to use data dictionary to select one or more variable names. Double click an empty variable name cell will automatically load the data dictionary. If one or more variable names are accepted the Trending Set is modified and trending will be restarted. The new variables will be saved to a trend file if the Trend Set is saved.

  • Variable Data Source
    Double click the Source column of a variable row to start editing the variable data source. Click anywhere outside the cell to end editing. At this point the Trending Set is modified and trending will be restarted. The new values will be saved to a trend file if the Trend Set is saved.

Click the button in the variable source cell to use Select Trend Source to select a source. Double click an empty variable source cell will automatically load Select Trend Source. If a data source is accepted the Trending Set is modified and trending will be restarted. The new variable data source will be saved to a trend file if the Trend Set is saved.

  • Variable Display Color
    Double click the Color column of a variable row to start editing the variable display color using a color picker. Pick a color for the variable from list.  At this point the Trending Set is modified and trending will be restarted. The new values will be saved to a trend file if the Trend Set is saved.

If instead of picking a color you click anywhere outside of the color picker or click the color cell again the color picker will be closed and the Trend Set will not be modified.

  • Graph Line Type
    Double click the Line Type column of a variable row to start editing the graph line type using a line type list. select a line type for the variable from list.  At this point the Trending Set is modified and trending will be restarted. The new values will be saved to a trend file if the Trend Set is saved.

If instead of selecting a line type you click anywhere outside of the list or click the line type cell again the list will be closed and the Trend Set will not be modified.

All columns in the display can be resized simply by dragging the column headers.  Clicking on the 1, 2 or * column headers will expand or collapse all axes in the tree display.

 

Individual axes or variables can be moved within the trend configuration using a drag-and-drop operation on the first (blank) column of the grid.

 O-Data Cursors

The two vertical bars, one magenta and the other cyan, represent cursors overlaid on the graph. The cursors are used to select the data points for display in the textual trend variable data presented to the left of the graph. The grid on the left half of the screen displays the values of each of the trend variables lying directly underneath each of the two trend cursors.  In addition, the difference between the two cursor values is calculated for each of the trend variables and displayed in the Delta column in the grid.

Normally, the cursor bars default to the left and right edges of the graph display.  However, they can be moved by placing the mouse over the cursor and left-clicking-and-dragging to the desired position.  There is a Reset Cursors button on the bottom right corner of the screen (also in the graph option menu) to reset the cursors to the left- and right-most positions of the graph, which is especially useful for regaining access to the cursors when zoomed in on the trend graph as described below.

 O-Zooming Options

It is possible to zoom into a section of the graph simply by left clicking anywhere on the graph and dragging a box to the left or right, as shown below:

When the left mouse button is released the graph will zoom into the selected region.  Once zoomed, the original full display can be restored by right clicking to bring up the menu and choosing Undo Zoom.

 O-Change axis percentage

Mouse over an axis (horizontal bar in the graph) and wait for the resize cursor. Drag the axis and release it should change the percentage of the axis. Verify the percentage change using axis editor. At this point the Trending Set is modified. The new axis percentage values will be saved to a trend file if the Trend Set is saved.

 O-Exporting Data

The graph option menu provides numerous interactive options.  Click the right mouse button to display the graph option menu.

Also available from the popup menu is the ability to export data from the graph control through the Export Dialog… menu option.  This option will export all data currently displayed in the graph to a variety of destinations.

For instance, to output data to a text file set the set the Export type as Text/Data Only, select Export Destination as File, enter the desired local file name, and click the Export… button as shown below:

The following dialog then customizes which data should be exported to the text file.

Set the desired options and click on the Export button to create the file.  Default options to export all data are:

  • Select “All Data” as the Subsets and Points to export

  • Select Data and Labels

  • Select Y Axis Value

  • Set Export Style as Table

  • Set Row vs. Column as Points/Subsets

  • Set Numeric Precision as Maximum Precision

 O-Additional TrendCtrl Popup Menu Options

Right-clicking on the trend configuration grid displays a popup menu of available options.

The following options are available from this popup menu:

  • Identify Trace
    When this option is selected the graphical presentation of the variable will be resized to allow it to be located on the display.  Notice the variable graphed in Red on the third axis.

 This option is also available by clicking the left mouse button while pointing at the variable line. 

  • Original Configured Scale
    Set the axis max and min values to the values specified in the TrendSet.

 

  • Rescale This Axis
    Calculate a new set of axis max and min values based on the data currently displayed in the graph window.  The graph will be update to use these new values.  After this option has been selected the Cursor1 column display will show “(rescaled)” to inform the user that the originally configured scale has been modified. 

 

This option is also available by clicking the left mouse in the Cursor1, Cursor2, or Delta columns for an axis. 

The results of the Rescale are show below -- note the changes to the variable in red plotted on the second axis.

  • Set Current Scaling as Original Scaling
    Update Trend Set to set the selected axis scaling as the current scaling. The new scaling will be saved to a trend file if the Trend Set is saved.

  • Clip All Display Values
    All of the variables currently graphed for this axis will be ”clipped” to keep them within the window area defined for the axis.  The Clip Off and Clip On results are shown here.  Notice the variable graphed in Red on the second axis.  In the Clip Off mode the graph is visible in both first and third axis areas.  With Clip On the variable graphed in Red is only show for the values that fall within the range of the second axis.

  • Insert Axis
    Insert a new axis above the selected axis. Insert Axis without selecting an axis to add a new axis at the end.

 

  • Copy Axis
    Select one or more axis without any variable selected to copy the selected axes. Select one or more axis and all the variables under the selected axes to copy the selected axes.

 

  • Cut Axis
    Select one or more axis without any variable selected to cut the selected axes. Select one or more axis and all the variables under the selected axes to cut the selected axes.

 

  • Paste Axis
    Select an axis to paste the copied axes above the selected axis. Paste Axis without selecting an axis to paste the copied axes at the end.

 

  • Delete Axis
    Select one or more axis without any variable selected to delete the selected axes. Select one or more axis and all the variables under the selected axes to delete the selected axes. Select multiple axes and click Delete Axis to delete all the selected axes.

 

  • Insert Variable
    Select a variable to insert a new variable above the selected variable.

Select an axis and click Insert Variable to add a new variable at the end of the variable list of the axis above. This action is not available to the first axis on the list. Insert Variable without selecting an axis or a variable to add a new variable at the end.

 

  • Copy Variable
    Select one or more variable to copy all the selected variables.

 

  • Cut Variable
    Select one or more variable to cut all the selected variables.

 

  • Paste Variable
    Select a variable to paste the copied variables above the selected variable. Select an axis and click Paste Variable to paste the copied variables at the end of the variable list of the axis above. This action is not available to the first axis on the list. Paste Variable without selecting an axis or a variable to paste the copied variables at the end.

 

  • Delete Variable
    Select one or more variable to delete all the selected variables.

 

  • Find and Replace
    Click Find and Replace to show Find and Replace dialog box. Enter Find text and Replace with text. Click Replace All to find and replace for all axes and variables. Click Replace Selected to find and replace the selected axes and variables. The function will search axis labels, variable labels and names and replace any Find text with Replace text.

 

  • Change Source
    Click Change Source to show data source editor. Select a source and click Accept button to change data sources for all variables.

 

  • Display Historical Trend Metadata
    Click Display Historical Trend Metadata to display historical trend metadata associated with the historical data source (if the first variable data source is a historical trend source).

  • Automatically Select
    Colors Click Automatically Select Colors to change colors of the selected variables with a predefined color list.

 O-Buttons and Controls
Menu

In the bottom left of the display is a button labeled Menu.

Clicking this button will navigate back to the most recent menu screen.


TriggerMgr

In the bottom left of the display is a button labeled TriggerMgr.

Clicking this button will display the TriggerMgr screen pre-loaded with a trigger definition created from the current TrendX screen configuration.  That is, all trended variables shown on the TrendX screen will be added in the trigger Trend list.


TrendSet Loader Control

To the right of the TriggerMgr button are a set of buttons used to create, load, save, and delete TrendSets.

A TrendSet is a configuration file stored on the host system that contains all of the configuration parameters for the current trend display.  This allows the user to configure a trend graph, including all of the display variables and axis parameters, and store it on the host for later use. This control panel is described in detail in the TrendSetLoader [LINK] section of this manual.


Trend Playback Controls

To the right of the TrendSet loader control is the TrendPlayback control used to control the playback speed and direction of the trended data.

This control panel is described in detail in the TrendPlayback [LINK] section.


Reset Cursors

To the right of the trend playback controls is a button labeled Reset Cursors.

Clicking this button will move the two data cursors to the far right and far left edges of the current trend view.  This is helpful for regaining access to the cursors while zoomed in to a small section of the trended data.

TriggerMgr

 Overview

The TriggerMgr screen is used to configure and monitor historical trend triggers on a TSENTRY system.

Operation

“O-” as in 'O-Example' is an Operation sub doc

 O-Trigger Editor

The top half of this screen allows the user to create, load, save, and delete trigger configuration files from the host system; effectively, this portion of the screen is a file editor for trigger configuration files.  

The following parameters can be configured for a given trigger:

 

Trigger Name

String by which the trigger will be known.  This name must be unique among all triggers defined on the host.

File tag variable

Name of variable used to name the historical trend file.  By default, historical trend files are named as [TriggerName].[YYYYMMDD].[HHMMSS], where [TriggerName] is the name of the trigger and [YYYYMMDD].[HHMMSS] is the date/time that the event occurred.  If a variable is specified for the File Tag, then a snapshot of the value of the corresponding variable will be taken when the event first occurs, and the resulting historical trend file will be named as [TriggerName].[TagValue].[YYYYMMDD].[HHMMSS].  For instance, in coil rolling this option can be used to tag the file according to the coil ID number.

Pre-trigger time

When a trigger is triggered, the historical trend system has the capability to go backwards in time and record data for the time leading up to the trigger event.  This value specifies the number of seconds prior to the trigger event hat data should be saved to the historical trend files.

Post-trigger time

After the trigger conditions are no longer satisfied, the historical trend system will continue to record data for some period of time for two reasons: first, it is often useful to have some data after the event to analyze how the system reacted afterwards, and second, if the trigger conditions are again met during this period the trigger will re-arm and continue to record more data.  This value specifies the number of seconds after the trigger event has finished before trigger data acquisition is stopped.

Max trend time

Specifies the maximum amount of data (in seconds) that should be recorded in a single historical trend file.  If an event is continuously triggered for more than this time then the historical trend system will close the disk file and create a new one to contain the remaining data.

Description

Specifies the trigger description.  This field is used for documentation purposes only and has nothing to do with data collection.

The Trigger Conditions define the set of conditions that all must be met in order for the event to be triggered and data collection to take place.  That is, the trigger is satisfied when the boolean AND of all of the trigger conditions is TRUE.  Conditions can be added, deleted, and modified on the grid by double click a cell or right-clicking on the list and selecting options from the popup menu.

Each trigger condition must specify the fully qualified trend variable name (including trend source and variable name within the source), a Boolean operator, a threshold against which the value of the trend variable is to be compared to determine when the condition is satisfied, and a requested sampling period for testing the value.

 

The Trend Variables define the set of data that should be recorded when the trigger event has been detected.  Each of the variables listed in this section will be recorded to the historical trend disk file.  Variables can be added, deleted, and modified on the grid by double click a cell or right-clicking on the list and selecting options from the popup menu.

Each trend variable must specify the fully qualified trend variable name to be recorded and the requested sampling period for the recorded data.

 

The Scalar Variables define the set of data that should be recorded as a single snapshot when the trigger event has been detected.  Each of the variables listed in this section will be recorded to the historical trend disk file. Variables can be added, deleted, and modified on the grid by double click a cell or right-clicking on the list and selecting options from the popup menu.

Each scalar variable must specify the fully qualified scalar variable name to be recorded.

 O-Activating a Trigger

Once a trigger has been fully specified and saved to the host, the Activate button in the top right hand corner of the screen will activate the trigger for detection and data collection.  Within a few moments the newly activated trigger will appear in the Trigger Status box in the bottom half of the screen.  Note: re-activating a trigger that is already active will replace the existing trigger with the new version.  Note: the TSENTRY system must be running to process activate requests.

 O-Active Trigger Status

The bottom half of the screen displays the status of all of the active triggers loaded into the system.  The following parameters are shown for each of the triggers:

Trigger

Name of the trigger

Save Date

Date and time at which the trigger definition was saved to the host system.  This is useful for checking if the active trigger is the latest version available.

State

Current state of the trigger.  Possible states include Error (the trigger could not initialize because of an error), Uninit (the trigger is waiting for initialization, possibly because there is no data available yet for one of the trend variables), Waiting (the trigger is armed but the trigger conditions are not satisfied), and Recording (the trigger has been detected and the system is recording data to the file).

Message

Displays any applicable message for the user, especially any error messages for triggers that are in the Error state.

 O-Deactivating a Trigger

In order to deactivate an active trigger, click on the Deactivate button, which will display a list of active triggers to deactivate.  Alternatively, a trigger can be deactivated by highlighting its entry in the trigger status box and right-clicking to display a popup menu.  Selecting Deactivate Trigger from this menu will deactivate all highlighted triggers.  In either case, once deactivated the trigger status box will update within a few moments once the host processes the request.  Note: the TSENTRY system must be running to process deactivate requests.

 O-Buttons
Menu Button

In the bottom left of the display is a button labeled Menu.

Clicking this button will navigate back to the most recent menu screen.


TrendX Button

In the bottom left of the display is a button labeled TrendX.

Clicking this button will display the TrendX screen pre-loaded with a TrendSet definition created from the current trigger definition screen configuration.  This trend set will contain two axes, the first containing all trigger condition variables and the second containing all trigger trend variables.

TrendFileMgr

 Overview

The TrendFileMgr screen is used to manage historical trend data files that have been generated by triggers on a TSENTRY system.  This screen allows the user to convert binary historical trend data files to text and to copy, move, or delete historical data files from the host.

 Operation

The left half of the screen allows the user to review and select trend data files from either the host system or from some local folder (including locally mapped folders to remote network shares).  The complete list of historical trend files stored at the specified location will be displayed in the Historical Trend Data Files list box.  This list can be refreshed by pressing the Refresh button below the list box.  

A single selected file in the Historical Trend Data Files list box can be converted to a comma-delimited text file using the Convert Single File To Text options available at the top of the right half of the screen.  The output file generated by this function can be imported into Excel or some other text processing program for detailed analysis.

Alternatively, a group of files can be converted to comma-delimited text files using the Convert Multiple Files to Text options.  This feature converts each of the highlighted historical trend data files to a text file with the same file name but located in the specified Output Folder and with the specified Output File Extension.

The Move/Copy/Delete Files option allows the user to move or copy files from the host system to some local or locally accessible folder, as well as simply delete unneeded files from the host.

Client Operation

 Overview

The client includes the set of functionality that requests data from the Trend Server process, normally for display on a web screen.  A specific client may be a process, a web page, a Visual Basic form, or another ActiveX component.

  • Two building block components are supplied: a Trend Graph display object and a Trend Communications object, both for incorporation into VB Web based screens. 

  • The web based screen TrendX is also supplied for display of trend data.  TrendX will simultaneously display trends of up to several hundred variables.  This screen can be set up to look like a single graph with up to six (6) y-axes plotted against a single time interval on the x-axis.

 Trend Communications Control Operation
  • Locates TrendGraph objects located in the same container

  • Automatically starts the communications with the Trend Server host for any data streams requested by the TrendGraph object

  • Makes a TCP/IP connection to server process, Port 2250

  • Sends an ASCII string requesting a set of data

  • Receives a set of binary data representing the requested data

  • Sends another request when additional data is required and processes response

  • Closes connection when data is no longer required

 Notes
  • A data request may be for one or more ‘channels’ of data.

  • Each channel is assigned an integer (channel) number.

  • Each channel of data will have an associated data variable name.

  • Multiple trend channels (variables) may be requested on single connection.

  • The request for data will be for trend data over a specific time period.

  • Associated process TrendGsm will acquire real time data at required high speed.

Trend Data Client - Server Protocol

 Overview

After opening a TCP/IP connection with the Trend Server, the client will send an ASCII-encoded Trend Data Request to the Trend Server process.  This request will contain trend channel configuration information and a time interval for which data is requested.  The Server will respond with the available data requested.  The TCP/IP connection will remain open for use by the client as additional data may be requested.  The client will continue to make data requests as it is prepared to process the returned data.  When data is no longer required by the client, the client will close the connection.

 Trend Data Request Format

To request trend data of the server, the client will send an ASCII-encoded Trend Data Request to the TrendSrv.  This request will specify a channel number, the associated variable name, time period, acquisition frequency, and other data acquisition related information for each variable requested.

Parameters in the data request are sent as a continuous sequence of ASCII characters where individual parameters are separated by an ampersand (&) character. 

Supported parameters in the data request include:

  • channel=[0:varname]
    Define sequential channels and their associated variable names
    The first available channel is 0.
    varname is a variable name as recognized by the server system
    Each channel command defines a single variable
    Multiple channel commands are acceptable (and needed to define multiple variables)
    A channel command with no variable name removes that channel from the request list
    Example:  channels=0:varnamea&channel=1:varnameb

 

  • startTime=[secs.fraction]
    Define the earliest time for data in seconds and fractions
    If Time is not followed by an ‘R’, the time is in absolute UTC time
    If Time is followed by an ‘R’, the time is relative to the current time

 

  • endTime=[secs.fraction]
    Define the latest time for data in seconds
    Time in absolute UTC time

 

  • numSamples=[int]
    Define the maximum number of samples to be returned
    If more samples are available for the interval, those with earlier times will be returned

 

  • freq=[float]
    frequency, in samples/ second, at which data is sampled
    This represents the data acquisition frequency, not rate at which data is sent to the client.
    Specifying both the freq and samplePeriod (below) is redundant.

 

  • samplePeriod=[float]
    define the period (in seconds) between data samples
    This represents the sampling period of data acquisition, not that at which data is sent to the client.
    Specifying both the samplePeriod and freq (above) is redundant.

 

  • binary=[0,1]
    flag that defines the return data format
    0 = ASCII format (not currently supported)
    1 = binary format

Examples of satisfactory request strings include the following.  (Note: no blank space appears in a command).

 

Single channel request:  get data from 1 variable (speed), time of 1st data value is 1000 seconds ago, latest time of data is 4 billion seconds after Jan 1, 1970 (UTC), data frequency is 50 points per second (20 ms intervals)

channels=0:speed&startTime=-1000.0R&endTime=4000000000.0 &numSamples=1000&freq=50&binary=1

Three channel request:  get data from 3 variables (speed, volts, and amps), time of 1st data value is 1000 seconds ago, latest time of data is 4 billion seconds after Jan 1, 1970 (UTC), data frequency is 5 points per second (20 ms intervals)

channels=0:speed&startTime=-1000.0R&endTime=4000000000.0&numSamples=1000&freq=5&binary=1&

channels=1:volts&startTime=-1000.0R&endTime=4000000000.0&numSamples=1000&freq=5&binary=1&

channels=0:amps&startTime=-1000.0R&endTime=4000000000.0&numSamples=1000&freq=5&binary=1


Notes
  1. If multiple parameters define the same information, the last occurrence of the parameter will define the value.

  2. Parameters ‘samplePeriod’ and ‘freq’ define the same data acquisition information.

  3. The parameter ‘numSamples’ is not required; default would return data points starting at startTime through endTime.  If this parameter is supplied, the returned data will be limited to the lesser of the number of points available or the numSamples.  If the returned data points are limited by numSamples, the first available data points in the interval will be returned.

  4. Times are always specified in Universal Coordinated Time. This time is represented as the number of seconds from 00:00 Jan 1, 1970.  The fractional part is number of nanoseconds.  Times specified within parameter strings are specified as a floating point value.  Times returned in the binary representation of data are as an integer number of seconds and an integer number of nanoseconds after the second mark.

  5. The default for the ‘endTime’ parameter is the current time.  Returned data will include all data from the startTime through the latest point available.

  6. Requests for data from startTime through EndTime are inclusive of endpoint times.

  7. On succeeding requests for data, specify the startTime of a request as the endTime of the last returned data point + the minimum time interval on the Trend Server system (normally 1 millisecond (.001 seconds).  This will result in requests for continuous data (if available).

 Data Response Format

Binary data is returned in the XDR (RFC1832) format.  The format of this type of response is as follows:

typedef struct 
{
unsigned int seconds; 
int nanoseconds; 
} timestamp

struct trendvalue
{
int channel;
float value;
timestamp time;
};

The returned data message is the assembly of bytes that make up the following data structures:

trendvalue[(noValues returned for channel 1) + 1]
trendvalue[(noValues returned for channel 2) + 1] 
…
trendvalue[(noValues returned for channel n) + 1]

The last data value returned for each set of data associated with a channel will not contain a valid data value.  This ‘marker’ data point will indicate to the client that all of the data available for that channel from the previous request has been returned.  The ‘marker’ value will contain:

channel = -1

value = 0.0

timestamp = server time at the time the response is built

A marker point is always returned for any data request.  If data for that channel is available it will be returned prior to the marker point; if no data is available, just the marker point will be returned.

 

The server will leave the connection open after responding with the data values.  The client may then delay for a period of time, send another request for further data, or break the connection to the server.

 

If data from multiple channels are requested, the available data from the first channel requested will be returned 1st (including the trailing ‘marker’ data value), the available data from the second channel will be returned 2nd (including the trailing ‘marker’ data value), etc. until all available data for all channels has been returned.  If no data for a channel is available (perhaps because of the StartTime and EndTime specification, or because of an incorrect channel variable name), the ‘marker’ data point associated with that channel (with a channel number equal to -1) will still be returned.

Until a response containing all available data (and the required trailing ‘marker’ data values) for all channels included in the request is returned, the client will not make another data request.

Trend Class Definitions

 ...

The following classes provide the underlying support for the trend process and utilities.

  • tpriTrend

  • tpriTrendSrv

  • tpriTrendMgr

  • tpriTrendSrc

  • tpriTrendGsm

  • tpriTrendTrig

  • tpriTrigFile

  • No labels