Introduce and explain InTouch Historical trends
InTouch Historical trends YouTube Tutorial
Explain Historical trends configuration options
Historical trends provide snapshots of data from a time and date in the past. They are not dynamic. Unlike real-time trends, historical trends are only updated when they are instructed to do so, either through the execution of a QuickScript or an action by the operator (e.g., clicking a button). Up to eight tags (pens) can be trended at one time with no limit to the number of trends displayed. You have complete flexibility in designing the interface to your trend. Scooters can be created that the operator slides over the trend to access a variety of data based on the scooter’s current location.
For example, when the operator positions the scooter over an area on the trend that has visible data, the time and values at that location for all data points being trended is returned.
You can also create buttons to zoom in and out between the scooters or to data, such as the maximum to minimum value. Average and standard deviation can be displayed for the complete chart or for the area between the scooters.
Historical trends can also be scrolled by any amount of time. Custom scales can be created and linked to the .MinEU and .MaxEU tagname .fields to display the minimum and maximum Engineering Units. The distributed history system extends the retrieval capabilities of historical trends to include remote log databases. This system allows information from multiple historical log databases to be displayed in a single trend.
Note: You must select the Log Data option for each tag in the Tagname Dictionary in order for it to be trended.
In addition to its trending capabilities, InTouch includes the HistData Utility, designed to work with InTouch historical log files. The HistData utility converts encrypted historical log files (.LGH) to comma separated variable files (.CSV) for use in spreadsheet or text editing environments such as Microsoft Excel.
Logging Tagnames to the Historical Log File
In WindowViewer, the values of logged tags are written to the historical log file each time they change more than the specified Log Deadband setting, and by default, once an hour regardless of change. For a tag’s value to be written to the historical log file, it must be configured to be logged in the Tagname Dictionary.
For integer and real (floating point) tag types, you can set the Log Deadband in their respective details dialog boxes. The Log Deadband controls how many Engineering Units a tag’s value must change before it is logged to disk.
Logging a Tag
To log tags, Historical logging must be enabled. If a tag is changed from logged to not logged, the data already logged for the tag will not be accessible. However, if logging for a tag is re-enabled, the data is available but will display a gap in a trend trace.
Any changes made in WindowMaker to logging while WindowViewer is running are ignored until WindowViewer is restarted.
Click Special / Tagname Dictionary. The Tagname Dictionary dialog box appears.
Open the desired tag’s definition and select the Log Data option.
Click Close. Note: The Min/Max Engineering Units are very important for displaying historical trend data. The historical trend displays from 0-100% of EU scale.
Configuring Historical Logging
In order for tags configured with the Log Data option to be written to the historical log file, the global logging functionmust be enabled.
Click Special / Configure / Historical Logging.
The Historical Logging Properties dialog box appears:
Select the Enable Historical Logging option to enable global tag logging.
In the Keep Log Files for box, enter the number of days (prior to today) of log files to keep saved to disk.
Note: InTouch will create and save two historical log files per day (24 hours). Therefore, disk
space must be considered when this value is set. If your hard disk does not have enough free
space to save a historical log file, logging will stop. You must free some disk space and then restart
logging. Historical logging can be started and stopped in Runtime by linking the
$HistoricalLogging internal tag to a button or QuickScript or by using the Restart Historical
Logging Command in WindowViewer.
For example, if you enter 10 and today is the 12th day of the month, the log files for the 2nd through the 12th (10 days plus today) will be saved to disk. The file for the 1st will automatically be deleted. If you enter a zero, the log files will be kept indefinitely.
Store Log Files in Application Directory: Saves the historical log file in an application directory.
Store Log Files in specific Directory: Saves files to another directory. Enter the complete path to the directory you want to use.
This entry must be either a DOS or UNC path such as C:histlog.
By default, historical log files are named as follows:
YYMMDD00.LGH and YYMMDD00.IDX
where: YY equals the year the file was created
equals the month the file was created (01-12) DD equals the day the file was created (01-31)
00 represents hours; always displays zeros (regardless of when the log files were created).
For example, if the files were created on December 28, 2005, they would be named as follows:
05122800.LGH and 05122800.IDX
Note: This version of InTouch supports the log files with extensions of .LGH and .IDX. Earlier versions of InTouch used the extension .LOG for log files.
Name of Logging Node: Enter the network node name for the node that will be logging to the history log file.
Default % of page to print on: Enter the percentage ratio for the page size to trend.
Example: If you use 50 for the percentage, when you print a historical trend, it will fill half of the page (vertically and horizontally). A printout this size will take roughly one quarter of the time to prepare as a full page printout.
Max consecutive time to spend printing: Enter the number of milliseconds (processor time slice) the historical trend print module will spend consecutively printing.
Time to wait between printing: Enter the number of milliseconds the historical trend print module will wait between printouts.
Always use colors when printing: When using a color printer or plotter.
Select Printer Font: Accesses the Windows Font dialog box.
Using Historical Trend Wizards
The InTouch trend Wizard selector provides a quick and easy way to create a historical trend. Trend Wizards allow you to configure a full-featured historical trend with features such as scooters and zooming with just a few mouse clicks.
A trend object is like any other object drawn in WindowMaker. It can be moved by grabbing it with the mouse or it can be resized by grabbing one of the object handles. You can place multiple trends in a window.
Note: Configuration of the Hist Trend w/Scooters and Scale Wizard is similar to the object on the Draw Objects toolbar.
Click the Wizard toolbar icon .
The Wizard Selection dialog box appears:
Select Trends.
Note: The 16-Pen Trend and 16-Pen Trend Scooter wizards will not appear if not installed during the original InTouch installation.
Place the Hist Trend with Scooters and Scale wizard in your InTouch window.
Double-click on the trend wizard
The Historical Trend Chart Wizard dialog box appears:
Suggest: The wizard will automatically enter the configuration settings. The settings configured for a historical trend wizard are the same as those configured when the historical trend object is drawn using WindowMaker’s trend tool in the
Drawing Toolbar.
e. Click Suggest.
The trend wizard creates and fills in two tags:
Values…: This option allows customization of the vertical axis divisions, format, and range.
Click the Values… button in the Historical Trend Chart Wizard.
The Value Format (Vertical Axis) dialog box appears:
Click OK to save your changes. Times…: This option allows customization of the horizontal axis divisions, time span, and time format. Click the Times… button in the Historical Trend Chart Wizard. The Time Format (Horizontal Axis) dialog box appears:
Click OK to save your changes.
Pens…: This option allows the user to select which values and colors each pen will plot.
Click the Pens… button in the Historical Trend Chart
Wizard. The Trend Pens dialog box appears:
Double-click on the tags to trend field.
A Select Tag dialog box appears, showing only the tags that have Log Data
enabled in the Tagname Dictionary:
Configure the first pen to plot the value of the IntTag tagname.
Configure the second pen to plot the value of the RealTag tagname.
Allow Runtime Changes: Selection of this option sets the historical trend to be touch-sensitive in WindowViewer and the operator will be able to change features such as the pen assignments or the start date and time.
Ensure that Allow Runtime Changes is checked in the
Historical Trend Chart Wizard, and click OK.
Switch to Runtime.
Click the trend object in WindowViewer. The Historical Trend Setup dialog box appears:
Chart Start: Enter the starting date and time for the chart.
Display Mode: Select one of three modes as described in the following examples. Min/Max Historical Trend: This mode displays the trends or changes in the percentage of Engineering Units scale as a vertical line over the time span, with emphasis on time flow and rate-of-change and not on the amount of change.
Average/Scatter Historical Trend: This mode displays the average value of the point during the time intervals.
Average/Bar Chart Historical Trend: This mode displays the average value of the point during the time intervals in bar form.
Note: The display mode of the trend affects performance. Foremost, is the length of the lines being drawn to generate the trend: the longer the lines, the longer it takes to generate. Line width is also a performance factor. Wider lines take significantly longer to draw. Min/Max or Average/Scatter trends are generally much faster to generate than Average/Bar Chart.
Chart Length: Enter the horizontal (x-axis) length of time to be displayed on the trend and then select the time increment for the length. If you enter a 1 and select Hrs, the trend will be 1 hour long.
Chart Range: Enter the percentage of Engineering Units scale that the trend is to zoom in/out (vertical y-axis) range to be displayed on the trend. The units for the range are a percentage of Engineering Units scale. These values should be from 0 to 100.
Pen#: Click within the blank field to select the tag. The Tag Browser appears in the filtered selection mode:
Only the tags that are defined with the Log Data option selected will be displayed for the selected tag source.
Double-click the tagname that the selected pen will plot on the trend or select the tagname and click OK.
The Historical Trend Setup dialog box reappears displaying the selected tagname next to the Pen# button you originally clicked.
You can open the Filter drop- down list to view the filters that can be used to populate the Tag Browser. The first entry of this list is <none>, which means that no filter is being used. Only the tags that are defined with the Log Data option selected will be displayed for the selected tag source.
Additional Historical Trend Wizards
Add zoom and movement functions or pen controls to your historical trend with a Trend Zoom /Pan Panel or Trend Pen Legend wizard. For these components to work together, the same Hist Trend tagname must be used by all wizards.
Trend Zoom / Pan Panel: Place and configure the Trend Zoom / Pan Panel using the same stepsoutlined in the Hist Trend with Scooters and Scale section.
Place a Trend Zoom / Pan Panel wizard in your InTouch window and configure it using the Suggest button.
Note: The above diagram depicts the Zoom Bar and Scroll Bar button functionality when the Historical Trend wizard is not configured to update automatically. Use the scooters at the bottom of the Hist Trend with Scooters and Scale wizard to pinpoint a specific area. Then click the Zoom In button to zoom into that specified
area.
Trend Pen Legend: Displays tagname and values at Scooters for one pen. By default, the value of the pen at the left-most point on the Historical Trend is displayed on the left, while the value of the pen at the right-most point is displayed on the right side of the Trend Pen Legend. However, you can use the scooters at the bottom of the Historical Trend wizard to display a pen’s value at a specific time. Place two Trend Pen Legends in your InTouch window. Configure the first for the IntTag Pen Number (and Trend Pen color), and the second for the RealTag Pen Number (and color).
HistData Wizard: Saves Historical data to a CSV file. Place a HistData wizard in your InTouch window, and configure using the Suggest button.
Historical Trend Dot Fields
For any given historical trend tag there are many .fields that only apply to historical trending tags.
.Field | Description | ||
.ChartLength | Read/write integer tagname .field used to control the length of time displayed in | ||
a Historical trend graph. .ChartLength displays the length of the chart in | |||
seconds. | |||
.ChartStart | Read/write integer tagname .field used to control the starting time and/or to | ||
scroll the corresponding historical trend. .ChartStart displays the number of | |||
elapsed seconds since 12:00 a.m., 1/1/70. | |||
.DisplayMode | Read/write analog tagname .field used to determine the method to be used in | ||
displaying values on the trend. | |||
.MaxRange, | Read/write real tagname .fields used to represent the percentage of the | ||
.MinRange | tagname’s Engineering Unit range that should be displayed for each tagname | ||
being trended. The limits for .MaxRange and .MinRange are from 0 to 100 and | |||
.MinRange should always be less than .MaxRange. If a value less than 0 or | |||
greater than 100 is assigned to either of these fields, the value will be clamped | |||
at 0 or 100. If .MinRange is greater than or equal to .MaxRange, the trend will | |||
not display any data. | |||
.Pen1 – .Pen8 | Read/write TagID type tagname .fields used to control the tagname being | ||
historically trended by each pen. A TagID type tagname can only be equated to | |||
another TagID tagname. It cannot be mixed with any other | |||
tagname type | |||
unless the .TagID extension | |||
is added to the other tagname. .TagID cannot be | |||
used for remote history provider tagnames. | |||
.ScooterLockLeft | Read/write discrete field. When the value of this field is TRUE, the RIGHT | ||
scooter cannot move to the left of the left scooter’s position. (0=FALSE, | |||
1=TRUE). | |||
.ScooterLockRight | Read/write discrete field. When the value of this field is TRUE, the LEFT | ||
scooter cannot move to the right of the right scooter’s position. (0=FALSE, | |||
1=TRUE). | |||
.ScooterPosLeft | Read/write real field which represents the position of the left scooter (range 0.0 | ||
to 1.0). | |||
.ScooterPosRight | Read/write real field which represents the position of the right scooter (range | ||
0.0 to 1.0). | |||
.TagID | Read/write TagID tagname .field used in conjunction with the Historical Trend | ||
.Pen1 – .Pen8. TagID tagnames monitor and/or control the tagname being | |||
trended by a pen. | |||
.UpdateCount | Read-only integer .field that is incremented when a retrieval is complete for the | ||
trend. | |||
.UpdateInProgress | Read-only discrete .field that shows historical data retrieval status (0=no | ||
retrieval in progress, 1=retrieval in progress). | |||
.UpdateTrend | Read/write discrete tagname .field that can be set to 1 to cause a Historical | ||
trend to update using all current values. |
HistData Utility
The HistData utility program provides access to the historical data files created by InTouch. It is used to move selected historical data into a requesting program such as Microsoft Excel. HistData provides you with the ability to immediately view historical data or create a file for later access. Access to the historical data may be accomplished via macro functions in a requesting program or from within InTouch. The HistData program should be started and then reduced to an icon prior to starting any program that will be using it. Note: The HistData utility cannot be used with remote tagname references, for example, DBS:TAG (AccessName:Item).
HistData Database
The HistData program contains its own I/O. The items are used to specify start period, duration and sampling interval, and so on., for the historical data to be accessed. The following lists the items defined in the HistData program.
.Field | Description | Description |
DATADIR | Message | Pathname of the directory containing the historical data files |
(e.g., C:InTouchApp). | ||
DBDIR | Message | Pathname of the directory containing the InTouch Tagname |
Dictionary (e.g., C:InTouchApp). | ||
STARTDATE | Message | Data sample start date in the format MM/DD/YY. |
STARTTIME | Message | Data sample start time in the format HH:MM:SS using the 24- |
hour clock | ||
DURATION | Message | The length of time for which data is to be returned. DURATION |
can be expressed in weeks, days, hours, minutes and seconds. | ||
The following are the valid characters: w (week), d (day), h | ||
(hour), m (minute), s (second). Fractional values are also | ||
permitted (e.g., .5s for 500 milliseconds). To request a single | ||
sample, set DURATION to 0 (zero). | ||
INTERVAL | Message | The length of time between samples. INTERVAL can be |
expressed in weeks, days, hours, minutes and seconds (e.g., 1w | ||
represents 1 week). Fractional values are also allowed (e.g., .25d | ||
represents 6 hours). (The valid characters are the same as those | ||
for DURATION.) |
Note: The maximum length of time allowed for | ||||
DURATION and INTERVAL is 6 weeks. This applies to all | ||||
request types, days, seconds, and so on. For example, if | ||||
using days, 42 is the maximum (7 days x 6 weeks = 42). | ||||
FILENAME | Message | Complete pathname of file to write the requested data (e.g., | ||
C:INTOUCHHDFILE.CSV). | ||||
WRITEFILE | Integer | When set to 1, HistData will write the requested data to the file | ||
specified by the FILENAME item name. When the file update is | ||||
complete, WRITEFILE is automatically reset to 0 (zero). | ||||
ERROR | Message | A string containing a description of the last error. It will be “None” | ||
when STATUS is 1 and will contain an error message string when | ||||
STATUS is 0 (zero). |
.Field | Description | Description |
TAGS1, TAGS2,… | Message | The TAGS string can be 131characters in WindowViewer and |
255 characters in Excel. The string can be appended for longer | ||
requests by adding tagname items named “Tags1,” “Tags2”, and | ||
so on. If a tagname needs additional tagname text appended to it, | ||
a plus (+) is | ||
entered at the end of the string. | ||
For example: | ||
TAGS=”$Date,ProdLevel,ProdTemp,+” | ||
TAGS1=“ReactLevel,Temp,GasLevel,+” | ||
TAGS2=”MotorStatus” |
Note: Duplicate tagnames are not allowed and the | ||||
maximum length of each tag’s string is 512 bytes. | ||||
PRINTTAGNAMES | Discrete | This item defaults to 1 and causes HistData to print the tagnames | ||
on the first line of the output file above the associated column of | ||||
values. If the tagnames are not to be printed, this item’s value | ||||
must be changed to 0 (zero). | ||||
DATA | Message | This item is used to hold the requested data in the HistData | ||
program in comma separated variable format. It is used by other | ||||
applications to ADVISE or REQUEST data via DDE. | ||||
STATUS | Discrete | Displays the status of the last operation. 1 indicates success and | ||
0 (zero) indicates that an error occurred. | ||||
Historical Trending and Daylight Savings | ||||
The InTouch history system automatically accounts for time | ||||
zones. For information on Daylight Savings considerations | ||||
please refer to the InTouch Support area of the Wonderware | ||||
website. | ||||
SENDDATA | Integer | When set to 1, HistData will update the DATA item with the | ||
requested data. When the update is complete, SENDDATA is | ||||
automatically reset to 0 (zero). | ||||
Note: If you receive an error message saying you have | ||||
requested too much data when using SENDDATA, shorten | ||||
the DURATION or reduce the number of tagnames you are | ||||
requesting.Duplicate tagnames are not allowed and the | ||||
maximum length of each tag’s string is 512 bytes. | ||||
Also Read:-
thank you sir