trend link scripting language - isagraf enhanced 4.21 i table of contents trend link scripting...
TRANSCRIPT
Trend Link Scripting Language
Software release 4.21
February 2004
ISaGRAF Enhanced -Trend Link Scripting Language
Printing History 1st printing — February 28, 20012nd printing — June 29, 20013rd printing — August 31, 20014th printing — February 8, 20025th printing — February 16, 2004
© Copyright 1999-2004: ICS Triplex ISaGRAF Inc
All rights reserved. No portion of this work may be reproduced in any form or by any means, without the prior written permission of ICS Triplex ISaGRAF Inc.
Table of ContentsTrend Link Scripting Language ______________________ 1
Trend Link ............................................................................................................. 2Trend Link Properties ..................................................................................... 3
BorderStyle Property .................................................................................4BorderWidth Property................................................................................7FeatureSet Property....................................................................................8Font Property .............................................................................................9IsDirty Property .......................................................................................11IsWorking Property..................................................................................12LegendNumRows Property......................................................................13LegendPlacement Property ......................................................................14PrinterDeviceName Property ...................................................................15PrinterFormName Property......................................................................16PrinterPaperLength Property ...................................................................17PrinterPaperSize Property........................................................................18PrinterPaperWidth Property.....................................................................19PrintingBottomMargin Property ..............................................................20PrintingColor Property.............................................................................21PrintingLeftMargin Property ...................................................................22PrintingOrientation Property....................................................................23PrintingRightMargin Property .................................................................24PrintingTopMargin Property....................................................................25UserMode Property ..................................................................................26XScalePlacement Property.......................................................................27YScalePlacement Property.......................................................................28
Trend Link Methods ..................................................................................... 29CopyToClipboard Method .......................................................................30EnumForms Method ................................................................................31EnumPrinters Method ..............................................................................32LoadFromFileMethod ..............................................................................33PrintPreview Method ...............................................................................34PrinterPageSetupDlg Method ..................................................................35PrintWithoutPrintDlg Method .................................................................36PrintWithPrintDlg Method.......................................................................37
ISaGRAF Enhanced 4.21 i
SaveToFile Method .................................................................................38Trend Link Events ........................................................................................ 39
Trend Graph......................................................................................................... 41Trend Graph Properties ................................................................................ 42
AutoBandOnAdd Property ......................................................................44AutoCursor Property................................................................................45AutoScaleOnAdd Property ......................................................................46AutoScalePrecision Property ...................................................................47BackgroundColor Property......................................................................48BorderStyle Property ...............................................................................50DeltaModeEnabled Property ...................................................................53DynamicAutoScaleActive Property.........................................................54FeatureSet Property .................................................................................55FeaturesPage Property .............................................................................56GridLineColor Property...........................................................................57GridLineType Property............................................................................59GridScaleAxisType Property...................................................................60GridScaleAxisWidth Property .................................................................61GridTimeAxisNumLines Property ..........................................................62GridTimeAxisType Property ...................................................................63GridTimeAxisWidth Property .................................................................64GridTimeInterval Property ......................................................................65IsWorking Property .................................................................................66
Trend Graph Methods .................................................................................. 67AddTrend Method ...................................................................................68AddTrendDialog Method.........................................................................69AutoBand Method ...................................................................................70AutoScale Method ...................................................................................71EnumExportFileTypes Method ...............................................................72ExportDataDlg Method ...........................................................................73ExportDataToFile Method.......................................................................74PropertyDialog Method ...........................................................................76RemoveAllTrends Method ......................................................................77
Trend Graph Events...................................................................................... 78Time Display ....................................................................................................... 80
Time Display Properties ............................................................................... 81BorderStyle Property ...............................................................................82BorderWidth Property .............................................................................85
ii ISaGRAF Enhanced 4.21
DisplayString Property.............................................................................86FeatureSet Property..................................................................................87Font Property ...........................................................................................88
Time Display Methods ................................................................................. 90Time Display Events..................................................................................... 91
Scales ................................................................................................................... 92Scale Properties ............................................................................................ 93
BorderStyle Property ...............................................................................94BorderWidth Property..............................................................................97FeatureSet Property..................................................................................98Font Property ...........................................................................................99
Scale Methods............................................................................................. 101Scale Events................................................................................................ 102
Legend ............................................................................................................... 103Legend Properties ....................................................................................... 104
BorderStyle Property .............................................................................105BorderWidth Property............................................................................108FeatureSet Property................................................................................109Font Property .........................................................................................110
Legend Methods ......................................................................................... 112Legend Events ............................................................................................ 113
Trends ................................................................................................................ 114Trends Properties ........................................................................................ 115
AutoScalePrecision Property .................................................................117Count Property .......................................................................................118DynamicAutoScaleActive Property.......................................................119HighBand Property ................................................................................120HighScale Property ................................................................................121IsWorking Property................................................................................122Item Property .........................................................................................123LimitColor Property...............................................................................124LowBand Property .................................................................................126LowScale Property.................................................................................127TrendColor Property ..............................................................................128
Trends Methods .......................................................................................... 130AutoScale Method .................................................................................131GetAnnotations Method.........................................................................132GetBatches Method................................................................................134
ISaGRAF Enhanced 4.21 iii
Independent Export............................................................................................ 136EnumExportFileTypes Method .................................................................. 137ExportDataToFile Method ......................................................................... 138ExportProps ................................................................................................ 142
Copyright ........................................................................................................... 143
iv ISaGRAF Enhanced 4.21
Trend Link Scripting Language
You can use scripting language to define methods, events, or properties of the Trend LinkControl or its individual components.
! Trend Link
! Trend Graph
! Time Display
! Scales
! Legend
! Trends
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 1
Trend Link ! Properties
! Methods
! Events
Object
CLITrendDisplay[x] or TrendLink[x]
2 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Trend Link Properties= Read Only
BorderStyle HeaderFont PrinterPaperSize
BorderWidth HeaderHeight PrinterPaperWidth
ChartTitle HeaderLeftText PrintingBottomMargin
ChartTitleColor HeaderRightText PrintingColor
ChartTitleFont HistoricalTimeDisplay PrintingLeftMargin
ChartTitleHeight IntervalTimeDisplay PrintingOrientation
FeatureSet IsDirty PrintingRightMargin
Font IsWorking PrintingTopMargin
FooterCenterText Legend ScaleHistoricalEdge
FooterColor LegendNumRows ScaleLiveEdge
FooterFont LegendPlacement Trend Graph
FooterHeight LiveTimeDisplay UserMode
FooterLeftText PrinterDeviceName XScalePlacement
FooterRightText PrinterFormName YScalePlacement
HeaderColor PrinterPaperLength
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 3
BorderStyle Property
Applies To: Historical Time Display, Interval Time Display, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge, Trend Link, and Trend Graph.
Returns or sets the border style for an object.
Syntax
object.BorderStyle = [value]
Settings
For the HistoricalTimeDisplay, IntervalTimeDisplay, and LiveTimeDisplay objects, theBorderStyle property settings are:
Part Description
object An object expression that evaluates to an applicable object.
value A value or constant that determines the border style, as described in Settings.
Constant Setting Description
XSWBorderNone 0 There is no border around the window.
XSWWindowSunken 1 (Default) The window is sunken.
XSWWindowRaised 2 The window is raised.
XSWBorderRaised 3 The window is within a raised border.
XSWBorderSunken 4 The window is within a sunken border.
XSWBorderFlat 5 The window is within a flat border.
4 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
For the Legend object, the BorderStyle property settings are:
For the ScaleHistoricalEdge and ScaleLiveEdge object, the BorderStyle property settings are:
Constant Setting Description
LGBorderNone 0 (Default) There is no border around the window.
LGWindowSunken 1 The window is sunken.
LGWindowRaised 2 The window is raised.
LGBorderRaised 3 The window is within a raised border.
LGBorderSunken 4 The window is within a sunken border.
LGBorderFlat 5 The window is within a flat border.
Constant Setting Description
YSWBorderNone 0 (Default) There is no border around the window.
YSWWindowSunken 1 The window is sunken.
YSWWindowRaised 2 The window is raised.
YSWBorderRaised 3 The window is within a raised border.
YSWBorderSunken 4 The window is within a sunken border.
YSWBorderFlat 5 The window is within a flat border.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 5
For the Trend Link object, the BorderStyle property settings are:
For theTrend Graph object, the BorderStyle property settings are:
Constant Setting Description
TDBorderNone 0 There is no border around the window.
TDWindowSunken 1 The window is sunken.
TDWindowRaised 2 (Default) The window is raised.
TDBorderRaised 3 The window is within a raised border.
TDBorderSunken 4 The window is within a sunken border.
TDBorderFlat 5 The window is within a flat border.
Constant Setting Description
TGBorderNone 0 There is no border around the window.
TGWindowSunken 1 (Default) The window is sunken.
TGWindowRaised 2 The window is raised.
TGBorderRaised 3 The window is within a raised border.
TGBorderSunken 4 The window is within a sunken border.
TGBorderFlat 5 The window is within a flat border.
TGBorderMono 6 The window is within a mono border.
6 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
BorderWidth Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge, and Trend Link.
Returns or sets the width of a control's border.
Syntax
object.BorderWidth = [number]
The BorderWidth property syntax has these parts:
Remarks
The following table shows the effect of BorderStyle settings on the BorderWidth property:
Part Description
object An object expression that evaluates to an applicable object.
number A numeric expression from 1 to 8192, inclusive.
BorderStyle Effect on BorderWidth
0 BorderWidth setting is ignored.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 7
FeatureSet Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge, Trend Link, and Trend Graph.
Returns or sets the current level of licensing or any feature sets created by the designer.
Syntax
object.FeatureSet = [file As String]
Remarks
The FeatureSet property can be set on the applicable individual objects for a designerprogramming individual objects but it is recommended to set the FeatureSet on the Trend Linkobject which will pass the setting on to the other controls.
Part Description
object An object expression that evaluates to an applicable object.
file A filename of a license file or feature set (e.g. "Basic Feature Set") located in the application directory.
8 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Font Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge, and Trend Link.
Returns or sets font properties for an object.
Syntax
object.Font.[Property] = [value]
Settings
The possible Font property settings for Applies to objects are:
Part Description
object An object expression that evaluates to an applicable object.
Property The name of the Property to return or set as described in Set-tings.
value A value as described in Type to indicate or change what is in the Description
Property Type Description
Name BSTR The facename of the font, e.g. Arial.
Size short The point size of the font.
Bold BOOL Indicates whether the font is boldfaced.
Italic BOOL Indicates whether the font is italicized.
Underline BOOL Indicates whether the font is underlined.
Strikethrough BOOL Indicates whether the font is strikethrough.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 9
Weight short The boldness of the font.
Charset short The character set used in the font, such as ANSI_CHARSET, DEFAULT_CHARSET, or SYMBOL_CHARSET.
Property Type Description
10 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
IsDirty Property
Returns a Boolean value indicating whether or not the object was changed since the last timeit was saved.
Syntax
object.IsDirty
Settings
The possible boolean return values from the IsDirty property are:
Part Description
object An object expression that evaluates to the Trend Link object .
Setting Description
True Indicates the object has changed since it was saved.
False Indicates the object has not changed.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 11
IsWorking Property
Applies To: Trend Link, Trend Graph, and Trends
Returns a Boolean value indicating if historical data is currently being retrieved.
Syntax
object.IsWorking
Settings
The possible boolean return values from the IsWorking property are:
Part Description
object An object expression that evaluates to an applicable object.
Setting Description
True Indicates historical data is being retrieved.
False Indicates historical data is not being retrieved.
12 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
LegendNumRows Property
Returns or sets the maximum number of rows the legend will display.
Syntax
object.LegendNumRows = [value As Long]
Note: This property will persist when adding new trends to a chart.
Part Description
object An object expression that evaluates to the Trend Link object .
value A value or constant that detemines the maximum number of rows to display in the Legend.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 13
LegendPlacement Property
Returns or sets the placement of the Legend window.
Syntax
object.LegendPlacement = [value]
Settings
The LegendPlacement property settings are:
Part Description
object An object expression that evaluates to the Trend Link object .
value A value or constant that determines the placement, as described in Settings.
Constant Setting Description
LegendNone 0 Do not show any Legend.
LegendTop 1 Place the Legend at the top.
LegendBottom 2 (Default) Place the Legend at the bottom.
14 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
PrinterDeviceName Property
Returns or sets the current printer to use for printing operations.
Syntax
object.PrinterDeviceName = [printer As String]
Remarks
The names of available printers installed on a system can be returned using the EnumPrintersmethod.
Changes to the property are persistant till the control is closed or the chart is saved, then Printersetting are saved with the chart.
Part Description
object An object expression that evaluates to the Trend Link object .
printer A printer name installed on the system or network.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 15
PrinterFormName Property
Returns or sets the printer form name to use for printing operations.
Syntax
object.PrinterFormName = [form As String]
Remarks
Each form name is associated with a particular form size, length and width.
The names of available forms on the current printer device can be returned using theEnumForms method.
Changes to the property are persistant till the control is closed or the chart is saved, then Printersetting are saved with the chart.
Part Description
object An object expression that evaluates to the Trend Link object .
form A form name available on the current printer device.
16 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
PrinterPaperLength Property
Returns or sets the paper length for a form to use for printing operations.
Syntax
object.PrinterPaperLength = [formLength As Long]
Remarks
A form length is associated with a particular form name and size.
The dimensions of available form sizes on the current printer device can be returned using theEnumForms method.
Changes to the property are persistant till the control is closed or the chart is saved, then Printersetting are saved with the chart.
Part Description
object An object expression that evaluates to the Trend Link object .
formLength A long value in tenths of a millimeter representing the length of a paper form.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 17
PrinterPaperSize Property
Returns or sets the printer form size to use for printing operations.
Syntax
object.PrinterPaperSize = [formNumber As Integer]
Remarks
Each paper size is associated with a particular form name, length and width.
The names of available form sizes on the current printer device can be returned using theEnumForms method.
Changes to the property are persistant till the control is closed or the chart is saved, then Printersetting are saved with the chart.
Part Description
object An object expression that evaluates to the Trend Link object .
formNumber A paper size available on the current printer device.
18 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
PrinterPaperWidth Property
Returns or sets the paper width for a form to use for printing operations.
Syntax
object.PrinterPaperWidth = [formWidth As Long]
Remarks
A form width is associated with a particular form name and size.
The dimensions of available form sizes on the current printer device can be returned using theEnumForms method.
Changes to the property are persistant till the control is closed or the chart is saved, then Printersetting are saved with the chart.
Part Description
object An object expression that evaluates to the Trend Link object .
formWidth A long value in tenths of a millimeter representing the width of a paper form.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 19
PrintingBottomMargin Property
Returns or sets the bottom margin for a form to use for printing operations.
Syntax
object.PrinterBottomMargin = [value As integer]
Remarks
The default value is 1000, equal to 1 inch and can also be viewed or set in thePrinterPageSetupDlg.
Changes to the property are persistant till the control is closed or the chart is saved, then Printersetting are saved with the chart.
Part Description
object An object expression that evaluates to the Trend Link object .
value A value in thousandths of an inch representing the bottom margin on a paper form.
20 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
PrintingColor Property
Returns or sets color or monochrome printing.
Syntax
object.PrintingColor = [value]
Settings
The PrintingColor property settings are:
Note: Changes to the property are persistant till the control is closed or the chart is saved, thenPrinter setting are saved with the chart.
Part Description
object An object expression that evaluates to the Trend Link object .
value A value or constant that determines color or monochrome, as described in Settings.
Constant Setting Description
ForceColor 0 Color printing (gray scale on black & white printer).
ForceMono 1 Monochrome printing.
DeviceDependent 2 (Default)Dependent on printer.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 21
PrintingLeftMargin Property
Returns or sets the left margin for a form to use for printing operations.
Syntax
object.PrinterLeftMargin = [value As integer]
Remarks
The default value is 1000, equal to 1 inch and can also be viewed or set in thePrinterPageSetupDlg.
Changes to the property are persistant till the control is closed or the chart is saved, then Printersetting are saved with the chart.
Part Description
object An object expression that evaluates to the Trend Link object .
value A value in thousandths of an inch representing the left margin on a paper form.
22 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
PrintingOrientation Property
Returns or sets the orientation for a form to use for printing operations.
Syntax
object.PrintingOrientation = [value]
Settings
The PrintingOrientation property settings are:
Remarks
Can also be viewed or set in the PrinterPageSetupDlg.
Changes to the property are persistant till the control is closed or the chart is saved, then Printersetting are saved with the chart.
Part Description
object An object expression that evaluates to the Trend Link object .
value A value or constant that determines the orientation, as described in Settings.
Constant Setting Description
PortraitOrientation 0 (Default) Portrait orientation.
LandscapeOrientation 1 Landscape orientation.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 23
PrintingRightMargin Property
Returns or sets the right margin for a form to use for printing operations.
Syntax
object.PrinterRightMargin = [value As integer]
Remarks
The default value is 1000, equal to 1 inch and can also be viewed or set in thePrinterPageSetupDlg.
Changes to the property are persistant till the control is closed or the chart is saved, then Printersetting are saved with the chart.
Part Description
object An object expression that evaluates to the Trend Link object .
value A value in thousandths of an inch representing the right margin on a paper form.
24 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
PrintingTopMargin Property
Returns or sets the top margin for a form to use for printing operations.
Syntax
object.PrinterTopMargin = [value As integer]
Remarks
The default value is 1000, equal to 1 inch and can also be viewed or set in thePrinterPageSetupDlg.
Changes to the property are persistant till the control is closed or the chart is saved, then Printersetting are saved with the chart.
Part Description
object An object expression that evaluates to the Trend Link object .
value A value in thousandths of an inch representing the top margin on a paper form.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 25
UserMode Property
Returns a boolean value indicating whether the control is being used in design mode or run timemode.
Syntax
object.UserMode
Settings
The possible boolean return values from the UserMode property are:
Part Description
object An object expression that evaluates to the Trend Link object .
Setting Description
True The control is currently being used in run time. If the container does not implement this ambient property, this will be the default value. In Visual Basic, this is Run Mode.
False The control is currently being used in design mode (the developer). In Visual Basic, this is Design Mode.
26 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
XScalePlacement Property
Returns or sets the placement of the Time Display windows.
Syntax
object.XScalePlacement = [value]
Settings
The XScalePlacement property settings are:
Part Description
object An object expression that evaluates to the Trend Link object .
value A value or constant that determines the placement, as described in Settings.
Constant Setting Description
XScaleWindowsNone 0 Do not show any Time Display windows.
XScaleWindowsBottom 1 (Default) Place the Time Display windows at the bottom.
XScaleWindowsTop 2 Place the Time Display windows at the top.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 27
YScalePlacement Property
Returns or sets the placement of the Scale windows.
Syntax
object.YScalePlacement = [value]
Settings
The YScalePlacement property settings are:
Part Description
object An object expression that evaluates to the Trend Link object .
value A value or constant that determines the placement, as described in Settings.
Constant Setting Description
YScaleNone 0 Do not show any Scales.
YScaleHistoricalEdge 1 Place the Scale on the historical data edge.
YScaleCurrentEdge 2 Place the Scale on the current data edge.
YScaleBoth 3 (Default) Place the Scales on both edges.
28 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Trend Link Methods
CopyToClipboard EnumForms EnumPrinters
LoadFromFile PrinterPageSetupDlg PrintPreview
PrintWithoutPrintDlg PrintWithPrintDlg SaveToFile
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 29
CopyToClipboard Method
Copies a Windows Metafile and Bitmapped image into the clipboard.
Syntax
object.CopyToClipboard
Note: In most containers if Trend Link has the focus Ctrl + C will perform theCopyToClipboard.
Part Description
object An object expression that evaluates to the Trend Link object .
30 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
EnumForms Method
Returns four arrays of enumerated form information for forms available on the given printer.
Syntax
object. EnumForms(printerName As String, forms() As String, formNumbers() As Integer,formLengths() As Long, formWidths() As Long)
Note: The returned arrays are used to provide needed information for setting properties whenautomating print capabilities.
Part Description
object An object expression that evaluates to the TrendLink object .
printerName The name of an installed printer on the system or network.
forms A string array variable to hold the names of the paper sizes supported by the specified printer.
formNumbers An integer array variable to hold the enumerated values associated with each paper size.
formLengths A long array variable to hold the enumerated values of the lengths of each paper size.
formWidths A long array variable to hold the enumerated values of the widths of each paper size.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 31
EnumPrinters Method
Returns a string array of available printers installed on the system or network.
Syntax
object.EnumPrinters(printers() As String)
Note: The returned array is used to provide needed information for setting a property such asthe PrinterDeviceName property or a parameter of another method such as the EnumFormsmethod.
Part Description
object An object expression that evaluates to the TrendLink object .
printers A string array variable to hold the printer names returned.
32 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
LoadFromFileMethod
Loads the configuration from the given file.
Syntax
object.LoadFromFile [file As String]
Note: The properties read from the file must be of the correct file format.
Part Description
object An object expression that evaluates to the Trend Link object .
file A valid path, filename and extension (e.g. .cht) where to load the con-figuration settings from.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 33
PrintPreview Method
Opens a Print Preview window for viewing the printer settings before printing.
Syntax
object.PrintPreview
Remarks
Clicking the Print button will open the Print dialog.
Clicking the Close button will destroy the current image.
In most containers if Trend Link has the focus Shift + Ctrl + P will display the PrintPreview.
If a printer is not available the method will return an error.
Part Description
object An object expression that evaluates to the Trend Link object .
34 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
PrinterPageSetupDlg Method
Opens the Print Setup dialog box to select the printer, page orientation, paper size and margins.
Syntax
object.PrinterPageSetupDlg
Remarks
Changes made in the Print Setup dialog are persistant till the control is closed or the chart issaved, then Printer setting are saved with the chart.
If a printer is not available the method will return an error.
Part Description
object An object expression that evaluates to the Trend Link object .
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 35
PrintWithoutPrintDlg Method
Executes a printing operation with the default printer and page properties unless otherwise setin script or the Print Setup dialog.
Syntax
object.PrintWithoutPrintDlg
Remarks
PrintWithoutPrintDlg will use changes made in the Print Setup dialog or through scripting andare persistant till the control is closed or the chart is saved, then Printer setting are saved withthe chart.
If a printer is not available the method will return an error.
Part Description
object An object expression that evaluates to the Trend Link object .
36 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
PrintWithPrintDlg Method
Opens the Print dialog box to select the printer, printer properties, print range and copies.
Syntax
object.PrintWithPrintDlg
Remarks
Clicking the OK button will perform the print operation.
Clicking the Cancel button will destroy the current image.
In most containers if Trend Link has the focus Ctrl + P will display the PrintWithPrintDlg.
If a printer is not available the method will return an error.
Part Description
object An object expression that evaluates to the Trend Link object .
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 37
SaveToFile Method
Saves the configuration to the given file.
Syntax
object.SaveToFile [file As String]
Note: If the given file already exists the method will not fail but overwrite the file without anyprompt.
Part Description
object An object expression that evaluates to the Trend Link object .
file A valid path, filename and extension (e.g. .cht) where to save the cur-rent configuration settings.
38 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Trend Link Events
Trend Link Events
BorderStyleChange BorderWidthChange
FeatureSetChange IsWorkingChange
XScalePlacementChange YScalePlacementChange
LegendNumRowsChange LegendPlacementChange
TrendGraph Events
TrendGraphAddRemoveTrends TrendGraphAutoBandOnAddChange
TrendGraphAutoCursorChange TrendGraphAutoScaleOnAddChange
TrendGraphBackgroundColorChange TrendGraphBatchModeChange
TrendGraphBorderStyleChange TrendGraphDeltaModeEnabledChange
TrendGraphDisplayAnnotationsChange TrendGraphExportError
TrendGraphExportProgress TrendGraphGridLineColorChange
TrendGraphGridLineTypeChange TrendGraphGridScaleAxisTypeChange
TrendGraphGridScaleAxisWidthChange TrendGraphGridTimeAxisNumLine-sChange
TrendGraphGridTimeAxisTypeChange TrendGraphGridTimeAxisWidthChange
TrendGraphGridTimeIntervalChange TrendGraphLiveEdgeChange
TrendGraphLiveModeChange TrendGraphLiveScrollPercentChange
TrendGraphMagnificationChange TrendGraphMaxNumValueBoxesChange
TrendGraphMaxScrollPercentageChange TrendGraphMillisecondDefaultChange
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 39
TrendGraphScrollBarLinePercent-ageChange
TrendGraphScrollBarPagePercent-ageChange
TrendGraphScrollBarPlacementChange TrendGraphShowGridLinesChange
TrendGraphSubsecondDigitsChange TrendGraphTimeOrIntervalChange
TrendGraphTimeRedoAvailableLevels-Change
TrendGraphTimeUndoAvailableLevels-Change
TrendGraphTrendOrderChange TrendGraphValueCursorFormatChange
Trend Events
TrendAutoScalePrecisionChange TrendAvgVsRangeChange
TrendColorChange TrendConv1000SeparatorChange
TrendConvGeneralDigitsChange TrendConvNumberDigitsChange
TrendConvScientificDigitsChange TrendConvTypeChange
TrendDescriptionChange TrendDynamicAutoScaleActiveChange
TrendEngineeringUnitsChange TrendHighBandChange
TrendHighLimitEnableChange TrendHighScaleChange
TrendHighStaticLimitChange TrendLabelFormatChange
TrendLabelScaleAxisPercentChange TrendLabelTimeAxisPercentChange
TrendLabelVisibleChange TrendLimitColorChange
TrendLowBandChange TrendLowLimitEnableChange
TrendLowScaleChange TrendLowStaticLimitChange
TrendUseShortNameChange TrendVisibleChange
40 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Trend Graph! Properties
! Methods
! Events
Object
Parent.TrendGraph
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 41
Trend Graph Properties= Read Only
AddColorIndex IntervalTime
AutoBandOnAdd IsWorking
AutoCursor Legend
AutoScaleOnAdd LiveEdge
AutoScalePrecision LiveMode
BackgroundColor LiveScrollPercent
BatchMode LiveTime
BorderStyle Magnification
ChartTitle MaxNumValueBoxes
DeltaModeEnabled MaxScrollPercentage
DisplayAnnotations MillisecondDefault
DynamicAutoScaleActive ScrollBarLinePercentage
FeatureSet ScrollBarPagePercentage
FeaturesPage ScrollBarPlacement
GridLineColor ShowGridLines
GridLineType SubsecondDigits
GridScaleAxisType ThinGridLines
GridScaleAxisWidth Property TimeRedoAvailableLevels
GridTimeAxisNumLines TimeUndoAvailableLevels
42 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
GridTimeAxisType TimeUndoGroupEvents
GridTimeAxisWidth TimeUndoMaxLevels
GridTimeInterval Trends
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 43
AutoBandOnAdd Property
Returns or sets a boolean value indicating whether TrendGraph should AutoBand the Scaleswhen the next trend is added.
Syntax
object.AutoBandOnAdd = [bool]
Settings
The possible boolean values for the AutoBandOnAdd property are:
Remarks
The AutoBand function divides the trend graph window evenly into horizontal bands so thateach trend is displayed in its own band area.
Part Description
object An object expression that evaluates to the TrendGraph object .
Setting Description
True AutoBand enabled when adding a new trend.
False AutoBand disabled when adding a new trend.
44 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
AutoCursor Property
Returns or sets a boolean value indicating whether the AutoCursor is enabled.
Syntax
object.AutoCursor = [bool]
Settings
The possible boolean values for the AutoCursor property are:
Remarks
The AutoCursor displays when the cursor is steady over the Trend Graph window for morethan one half second. A line will appear across the Trend Graph window with value boxesdisplaying selected information about the Trend where the line and trend intersect. This willallow the user to view information about the trends at specific times.
Part Description
object An object expression that evaluates to the TrendGraph object .
Setting Description
True AutoCursor enabled.
False AutoCursor disabled.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 45
AutoScaleOnAdd Property
Returns or sets a boolean value indicating whether TrendGraph should AutoScale the Scaleswhen the next trend is added.
Syntax
object.AutoScaleOnAdd = [bool]
Settings
The possible boolean values for the AutoScaleOnAdd property are:
Remarks
The AutoScale function scans the values which are currently visible for all trends and changesthe high and low scale values so that the trends are scaled appropriately into the band area.
Part Description
object An object expression that evaluates to the TrendGraph object .
Setting Description
True AutoScale enabled when adding a new trend.
False AutoScale disabled when adding a new trend.
46 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
AutoScalePrecision Property
Applies To: Trend Graph and Trends
Returns or sets the precision for all trends under Trendgraph and per trend under Trends( ).
Syntax
object.AutoScalePrecision = [value As Integer]
Settings
The AutoScalePrecision property settings are:
Remarks
AutoScalePrecision determines how close the current view of the trend is scaled within theband area. A tight setting will scale the trend to the full extents of the band area. A loose settingwill allow the trend values to change more without going beyond the scale ranges.
Changes made to AutoScalePrecision under TrendGraph will override any changes made to thesetting under a trend and will also be applied to any new trends added.
Part Description
object An object expression that evaluates to an applicable object.
value A value that detemines the amount of precision described under set-ings.
Setting Description
from -3 (tight) This value will scale the trend to its maximum deflection within the band area.
to 3 (loose) This value will scale the trend to whole rounded numbers.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 47
BackgroundColor Property
Returns or sets the color of the TrendGraph background.
Syntax
object.BackgroundColor = [RGB function As Long]
Note: To calculate the RGB function as Long, you need to perform the following calculation:
RGB Long = (blue X 65536) + (green X 256) + (red)
RGB Function Syntax
RGB(red, green, blue)
The RGB function syntax has these named arguments:
Part Description
object An object expression that evaluates to the TrendGraph object .
RGB function Returns a Long whole number representing an RGB color value as described below.
Part Description
red Required; Variant (Integer). Number in the range 0–255, inclu-sive, that represents the red component of the color.
green Required; Variant (Integer). Number in the range 0–255, inclu-sive, that represents the green component of the color.
blue Required; Variant (Integer). Number in the range 0–255, inclu-sive, that represents the blue component of the color.
48 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Remarks
Application methods and properties that accept a color specification expect that specificationto be a number representing an RGB color value. An RGB color value specifies the relativeintensity of red, green, and blue to cause a specific color to be displayed.
The value for any argument to RGB that exceeds 255 is assumed to be 255.
The following table lists some standard colors and the red, green, and blue values they include:
Color Red Value Green Value Blue Value
Black 0 0 0
Blue 0 0 255
Green 0 255 0
Cyan 0 255 255
Red 255 0 0
Magenta 255 0 255
Yellow 255 255 0
White 255 255 255
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 49
BorderStyle Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge, Trend Link, and Trend Graph.
Returns or sets the border style for an object.
Syntax
object.BorderStyle = [value]
Settings
For the HistoricalTimeDisplay, IntervalTimeDisplay, and LiveTimeDisplay objects, theBorderStyle property settings are:
Part Description
object An object expression that evaluates to an applicable object.
value A value or constant that determines the border style, as described in Settings.
Constant Setting Description
XSWBorderNone 0 There is no border around the window.
XSWWindowSunken 1 (Default) The window is sunken.
XSWWindowRaised 2 The window is raised.
XSWBorderRaised 3 The window is within a raised border.
XSWBorderSunken 4 The window is within a sunken border.
XSWBorderFlat 5 The window is within a flat border.
50 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
For the Legend object, the BorderStyle property settings are:
For the ScaleHistoricalEdge and ScaleLiveEdge object, the BorderStyle property settings are:
Constant Setting Description
LGBorderNone 0 (Default) There is no border around the window.
LGWindowSunken 1 The window is sunken.
LGWindowRaised 2 The window is raised.
LGBorderRaised 3 The window is within a raised border.
LGBorderSunken 4 The window is within a sunken border.
LGBorderFlat 5 The window is within a flat border.
Constant Setting Description
YSWBorderNone 0 (Default) There is no border around the window.
YSWWindowSunken 1 The window is sunken.
YSWWindowRaised 2 The window is raised.
YSWBorderRaised 3 The window is within a raised border.
YSWBorderSunken 4 The window is within a sunken border.
YSWBorderFlat 5 The window is within a flat border.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 51
For the Trend Link object, the BorderStyle property settings are:
For the Trend Graph object, the BorderStyle property settings are:
Constant Setting Description
TDBorderNone 0 There is no border around the window.
TDWindowSunken 1 The window is sunken.
TDWindowRaised 2 (Default) The window is raised.
TDBorderRaised 3 The window is within a raised border.
TDBorderSunken 4 The window is within a sunken border.
TDBorderFlat 5 The window is within a flat border.
Constant Setting Description
TGBorderNone 0 There is no border around the window.
TGWindowSunken 1 (Default) The window is sunken.
TGWindowRaised 2 The window is raised.
TGBorderRaised 3 The window is within a raised border.
TGBorderSunken 4 The window is within a sunken border.
TGBorderFlat 5 The window is within a flat border.
TGBorderMono 6 The window is within a mono border.
52 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
DeltaModeEnabled Property
Returns or sets a boolean value indicating whether the DeltaMode is enabled.
Syntax
object.DeltaModeEnabled = [bool]
Settings
The possible boolean values for the DeltaModeEnabled property are:
Remarks
The DeltaMode works by pressing the shift key down while dragging the mouse with the leftbutton down over TrendGraph. In the Delta mode the value at the starting point will besubtracted from the second point. As you drag the mouse the values and time differences arecalculated and displayed in the value boxes on screen.
Part Description
object An object expression that evaluates to the TrendGraph object .
Setting Description
True DeltaMode enabled.
False DeltaMode disabled.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 53
DynamicAutoScaleActive Property
Applies To: Trend Graph and Trends
Returns or sets a boolean value indicating whether the DynamicAutoScale is enabled for alltrends under Trendgraph and per trend under Trends( ).
Syntax
object.DynamicAutoScaleActive = [bool]
Settings
The possible boolean values for the DynamicAutoScaleActive property are:
Remarks
When scrolling or the chart is in live mode the trend values will sometimes go beyond the highor low scale values. By enabling the DynamicAutoScale the scale values will automatically beadjusted and an Auto Scale performed on the trend to stay within the band area.
Part Description
object An object expression that evaluates to an applicable object.
Setting Description
True DynamicAutoScaleActive enabled.
False DynamicAutoScaleActive disabled.
54 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
FeatureSet Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge, Trend Link, and Trend Graph.
Returns or sets the current level of licensing or any feature sets created by the designer.
Syntax
object.FeatureSet = [file As String]
Remarks
The FeatureSet property can be set on the applicable individual objects for a designerprogramming individual objects but it is recommended to set the FeatureSet on the Trend Linkobject which will pass the setting on to the other controls.
Part Description
object An object expression that evaluates to an applicable object.
file A filename of a license file or feature set (e.g. "Basic Feature Set") located in the application directory.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 55
FeaturesPage Property
Returns or sets a boolean value indicating whether the FeaturesPage is enabled.
Syntax
object.FeaturesPage = [bool]
Settings
The possible boolean values for the FeaturesPage property are:
Note: The FeaturesPage is normally displayed during design time. This property can beenabled to show the FeaturesPage during run time.
Part Description
object An object expression that evaluates to the TrendGraph object .
Setting Description
True FeaturesPage enabled.
False FeaturesPage disabled.
56 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
GridLineColor Property
Returns or sets the color of the TrendGraph Grid Lines.
Syntax
object.GridLineColor = [RGB function As Long]
Note: To calculate the RGB function as Long, you need to perform the following calculation:
RGB Long = (blue X 65536) + (green X 256) + (red)
RGB Function Syntax
RGB(red, green, blue)
The RGB function syntax has these named arguments:
Part Description
object An object expression that evaluates to the TrendGraph object .
RGB function Returns a Long whole number representing an RGB color value as described below.
Part Description
red Required; Variant (Integer). Number in the range 0–255, inclu-sive, that represents the red component of the color.
green Required; Variant (Integer). Number in the range 0–255, inclu-sive, that represents the green component of the color.
blue Required; Variant (Integer). Number in the range 0–255, inclu-sive, that represents the blue component of the color.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 57
Remarks
Application methods and properties that accept a color specification expect that specificationto be a number representing an RGB color value. An RGB color value specifies the relativeintensity of red, green, and blue to cause a specific color to be displayed.
The value for any argument to RGB that exceeds 255 is assumed to be 255.
The following table lists some standard colors and the red, green, and blue values they include:
Color Red Value Green Value Blue Value
Black 0 0 0
Blue 0 0 255
Green 0 255 0
Cyan 0 255 255
Red 255 0 0
Magenta 255 0 255
Yellow 255 255 0
White 255 255 255
58 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
GridLineType Property
Returns or sets the type of TrendGraph Grid Line.
Syntax
object.GridLineType = [value]
Settings
The GridLineType property settings are:
Part Description
object An object expression that evaluates to the TrendGraph object .
value A value or constant that determines the line type, as described in Settings.
Constant Setting Description
TGGridSolid 0 (Default) Grid lines are displayed as solid lines.
TGGridDash 1 Grid lines are displayed as dashed lines.
TGGridDot 2 Grid lines are displayed as dotted lines.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 59
GridScaleAxisType Property
Returns or sets the type of method used to draw the Grid Lines along the Scales axis.
Syntax
object.GridScaleAxisType = [value]
Settings
The GridScaleAxisType property settings are:
Part Description
object An object expression that evaluates to the TrendGraph object .
value A value or constant that determines the drawing method, as described in Settings.
Constant Setting Description
TGUseTickmarks 0 (Default) Grid lines are drawn from each Scale graduation.
TGScalePixelWidth 1 Grid lines are drawn at the distance in pix-els specified in GridScaleAxisWidth.
TGScaleNone 2 No grid lines are drawn on the Scale axis.
60 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
GridScaleAxisWidth Property
Returns or sets the width in pixels between grid lines on the Scale axis whenTGScalePixelWidth is selected for the GridScaleAxisType.
Syntax
object.GridScaleAxisWidth = [value As integer]
Remarks
A pixel is the smallest element that can be displayed on a screen or printer. Pixels arescreen-dependent.
Part Description
object An object expression that evaluates to the TrendGraph object .
value A value or constant that determines the width in pixels between grid lines on the Scale axis.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 61
GridTimeAxisNumLines Property
Returns or sets the number of grid lines on the Time axis when TGCalcInterval is selected forthe GridTimeAxisType.
Syntax
object.GridTimeAxisNumLines = [value As integer]
Part Description
object An object expression that evaluates to the TrendGraph object .
value A value or constant that determines the number of grid lines on the Time axis.
62 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
GridTimeAxisType Property
Returns or sets the type of method used to draw the Grid Lines along the Time axis.
Syntax
object.GridTimeAxisType = [value]
Settings
The GridTimeAxisType property settings are:
Part Description
object An object expression that evaluates to the TrendGraph object .
value A value or constant that determines the drawing method, as described in Settings.
Constant Setting Description
TGCalcInterval 0 (Default) A set number of grid lines are drawn as specified in GridTimeAxisNum-Lines.
TGConstInterval 1 Grid lines are drawn at the distance equal to the time specified in GridTimeInterval.
TGTimePixelWidth 2 Grid lines are drawn at the distance in pix-els specified in GridTimeAxisWidth.
TGTimeNone 3 No grid lines are drawn on the Time axis.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 63
GridTimeAxisWidth Property
Returns or sets the width in pixels between grid lines on the Time axis whenTGTimePixelWidth is selected for the GridTimeAxisType.
Syntax
object.GridTimeAxisWidth = [value As integer]
Remarks
A pixel is the smallest element that can be displayed on a screen or printer. Pixels arescreen-dependent.
Part Description
object An object expression that evaluates to the TrendGraph object .
value A value or constant that determines the width in pixels between grid lines on the Time axis.
64 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
GridTimeInterval Property
Returns or sets the grid line time interval on the Time axis when TGConstInterval is selectedfor the GridTimeAxisType.
Syntax
object.GridTimeInterval = [value As Variant]
Settings
The GridTimeInterval value types are:
Part Description
object An object expression that evaluates to the TrendGraph object .
value A time value as described in Settings.
Type Syntax Description
Currency 20500 = 00:00:20.500 = 20.5 seconds Millisecond Interval value in currency form.
String "[x days] hh:mm:ss.[000]"
"1 d 00:10:20.000" = 1 day, 10 minutes, 20 seconds
"2:45" = 2 hours, 45 minutes
Time in string form.
Integer 305000000 = 00:00:30.500 = 30.5 seconds 100 Nanosecond Interval in File time.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 65
IsWorking Property
Applies To: Trend Link, Trend Graph, and Trends
Returns a Boolean value indicating if historical data is currently being retrieved.
Syntax
object.IsWorking
Settings
The possible boolean return values from the IsWorking property are:
Part Description
object An object expression that evaluates to an applicable object.
Setting Description
True Indicates historical data is being retrieved.
False Indicates historical data is not being retrieved.
66 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Trend Graph Methods
AbortExports NextValueCursorItem
AddTrend OrderTrends
AddTrendDialog PropertyDialog
AddTrends PutValueCursorItemOrder
AddYScaleWindow PutValueCursorItemVisible
AutoBand ReadLocale
AutoScale ReleaseYScaleWindow
EnumExportFileTypes RemoveAllTrends
ExportDataDlg RemoveTrend
ExportDataToFile ScrollScreen
GetValueCursorItemDescription TimeRedo
GetValueCursorItemOrder TimeUndo
GetValueCursorItemVisible
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 67
AddTrend Method
Adds a trend into TrendGraph.
Syntax
object.AddTrend(DataSourceString As String)
Settings
The AddTrend DataSourceString syntax are:
Remarks
Periods are used as delimiters in the DataSourceString. Any periods in the Server Name or ItemID should be preceded with the "\" escape character.
To access tags in an InSQL database requires a logon to be established with the server.
Part Description
object An object expression that evaluates to the TrendGraph object.
DataSourceString A string containing the database type,dataset or server and tag ID as described in Settings.
Type Syntax
TBase TBase.[Dataset]:[Tagname]
OPC OPC Data Access Servers.[Computer Name or Local].[Server Name].[Item ID]
InSQL Industrial SQL Servers.[Computer Name or InSQL].[Analog Tags or Discrete Tags].[Tagname]
OA Historical
OA Real Time
68 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
AddTrendDialog Method
Opens a dialog box to add trends to TrendGraph.
Syntax
object.AddTrendDialog
Remarks
This dialog will show data sources, trends and trend details available to be added to a chart.
There are also check boxes to enable/disable the AutoScaleOnAdd and AutoBandOnAddproperties.
Part Description
object An object expression that evaluates to the TrendGraph object .
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 69
AutoBand Method
The AutoBand method divides the trend graph window evenly into horizontal bands so thateach trend is displayed in its own band area.
Syntax
object.AutoBand
Part Description
object An object expression that evaluates to the TrendGraph object .
70 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
AutoScale Method
Applies To: TrendGraph, and Trends( )
The AutoScale method scans the values which are currently visible for the trends and changesthe high / low or both scale values so that the trends are scaled appropriately into the band area.
Syntax
object.AutoScale
object.Trends(x).AutoScale [scaleType]
Settings
The AutoScale scaleTypes are:
Note: Under the TrendGraph object AutoScale applies to all loaded trends and both upper andlower scales.
Part Description
object An object expression that evaluates to the TrendGraph object .
scaleType A value or constant that determines the scale, as described in Settings.
Constant Setting Description
TrendAutoScaleBoth 0 Scales both upper and lower values.
TrendAutoScaleHigh 1 Scales the upper value.
TrendAutoScaleLow 2 Scales the lower value
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 71
EnumExportFileTypes Method
Applies To: TrendGraph and Export Objects.
Returns two string arrays of available export file types and export file descriptions.
Syntax
object.EnumExportFileTypes(exportFileTypes() As String, exportFileDescriptions() AsString)
Remarks
The returned arrays are used to provide needed information for a dialog to allow the user toselect the Export Type before doing an ExportDataToFile.
Part Description
object An object expression that evaluates to an applicable object.
exportFileTypes() A string array variable to hold the export file types returned.
exportFileDescrip-tions()
A string array variable to hold the export file descriptions returned.
72 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
ExportDataDlg Method
Opens a dialog box to select and enter information to perform an export to a .CSV file.
Syntax
object.ExportDataDlg
Remarks
This dialog is preloaded with the available export types and allows the user to enter file name,description and sample rate. Clicking the Save button then passes the parameters on to theExportDataToFile method which executes the export.
Part Description
object An object expression that evaluates to the TrendGraph object .
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 73
ExportDataToFile Method
Exports the data displayed in TrendGraph to a .CSV file according to the parameters passed toit.
Syntax
object.ExportDataToFile filename As String, chartDescription As String, expType As String,sampleRate
Settings
The ExportDataToFile expType types are:
Part Description
object An object expression that evaluates to the TrendGraph object .
filename A string containing the full path where the file is to be created.
chartDescription A string describing the export and copied into the beginning of the file.
expType A string containing the export type as described in Settings.
sampleRate A time value as described in Settings.
Type Description
MATHCAD.EXP Mathcad Array Format(*.PRN)
SPSHEET.EXP Column Heading Format(*.CSV)
STD.EXP Std. Comma Separated Values(*.CSV)
STDBCH.EXP Std. Batch Comma Sep. Values(*.CSV)
STDUBE.EXP Std UBE Comma Sep. Values(*.CSV)
74 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
The ExportDataToFile sampleRate types are:
Remarks
If the given file already exists the method will not fail but overwrite the file without anyprompt.
If no trends are present in TrendGraph an error condition will occur.
Type Syntax Description
Currency 20500 = 00:00:20.500 = 20.5 seconds Millisecond Interval value in currency form.
String "[x days] hh:mm:ss.[000]"
"1 d 00:10:20.000" = 1 day, 10 minutes, 20 seconds
"2:45" = 2 hours, 45 minutes
Time in string form.
Integer 305000000 = 00:00:30.500 = 30.5 seconds 100 Nanosecond Interval in File time.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 75
PropertyDialog Method
Displays the Property Dialogs in TrendGraph.
Syntax
object.PropertyDialog
Part Description
object An object expression that evaluates to the TrendGraph object .
76 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
RemoveAllTrends Method
Removes all the trends in TrendGraph.
Syntax
object.RemoveAllTrends
Part Description
object An object expression that evaluates to the TrendGraph object .
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 77
Trend Graph Events
TrendGraph Events
AddRemoveTrends IsWorkingChange
AutoBandOnAddChange LiveEdgeChange
AutoCursorChange LiveModeChange
AutoScaleOnAddChange LiveScrollPercentChange
BackgroundColorChange MagnificationChange
BatchModeChange MaxNumValueBoxesChange
BorderStyleChange MaxScrollPercentageChange
DeltaModeEnabledChange MillisecondDefaultChange
ExportError ScrollBarLinePercentageChange
ExportProgress ScrollBarPagePercentageChange
FeatureSetChange ScrollBarPlacementChange
GridLineColorChange ShowGridLinesChange
GridLineTypeChange SubsecondDigitsChange
GridScaleAxisTypeChange TimeOrIntervalChange
GridScaleAxisWidthChange TimeRedoAvailableLevelsChange
GridTimeAxisNumLinesChange TimeUndoAvailableLevelsChange
GridTimeAxisTypeChange TrendOrderChange
GridTimeAxisWidthChange ValueCursorFormatChange
GridTimeIntervalChange
78 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Trend Events
TrendAutoScalePrecisionChange TrendHighScaleChange
TrendAvgVsRangeChange TrendHighStaticLimitChange
TrendColorChange TrendLabelFormatChange
TrendConv1000SeparatorChange TrendLabelScaleAxisPercentChange
TrendConvGeneralDigitsChange TrendLabelTimeAxisPercentChange
TrendConvNumberDigitsChange TrendLabelVisibleChange
TrendConvScientificDigitsChange TrendLimitColorChange
TrendConvTypeChange TrendLowBandChange
TrendDescriptionChange TrendLowLimitEnableChange
TrendDynamicAutoScaleActiveChange TrendLowScaleChange
TrendEngineeringUnitsChange TrendLowStaticLimitChange
TrendHighBandChange TrendUseShortNameChange
TrendHighLimitEnableChange TrendVisibleChange
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 79
Time Display ! Properties
! Methods
! Events
Object
Parent.HistoricalTimeDisplay
Parent.IntervalTimeDisplay
Parent.LiveTimeDisplay
80 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Time Display Properties= Read Only
BorderStyle LiveBackgroundColor PrecisionRightofDP
BorderWidth LiveForegroundColor PrecisionTotal
DefaultSubsecondDigits MaxFontSize SignificantDigits
DisplayString MillisecondDefault SubsecondDigits
FeatureSet MinFontSize ThousandsSeparator
Font NumberOfLines Tooltips
HistBackgroundColor PercentOfChart TrendGraphSource
HistForegroundColor PositionType ValueFormat
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 81
BorderStyle Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge, Trend Link, and Trend Graph.
Returns or sets the border style for an object.
Syntax
object.BorderStyle = [value]
Settings
For the HistoricalTimeDisplay, IntervalTimeDisplay, and LiveTimeDisplay objects, theBorderStyle property settings are:
Part Description
object An object expression that evaluates to an applicable object.
value A value or constant that determines the border style, as described in Settings.
Constant Setting Description
XSWBorderNone 0 There is no border around the window.
XSWWindowSunken 1 (Default) The window is sunken.
XSWWindowRaised 2 The window is raised.
XSWBorderRaised 3 The window is within a raised border.
XSWBorderSunken 4 The window is within a sunken border.
XSWBorderFlat 5 The window is within a flat border.
82 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
For the Legend object, the BorderStyle property settings are:
For the ScaleHistoricalEdge and ScaleLiveEdge objects, the BorderStyle property settingsare:
Constant Setting Description
LGBorderNone 0 (Default) There is no border around the window.
LGWindowSunken 1 The window is sunken.
LGWindowRaised 2 The window is raised.
LGBorderRaised 3 The window is within a raised border.
LGBorderSunken 4 The window is within a sunken border.
LGBorderFlat 5 The window is within a flat border.
Constant Setting Description
YSWBorderNone 0 (Default) There is no border around the window.
YSWWindowSunken 1 The window is sunken.
YSWWindowRaised 2 The window is raised.
YSWBorderRaised 3 The window is within a raised border.
YSWBorderSunken 4 The window is within a sunken border.
YSWBorderFlat 5 The window is within a flat border.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 83
For the Trend Link object, the BorderStyle property settings are:
For theTrend Graph object, the BorderStyle property settings are:
Constant Setting Description
TDBorderNone 0 There is no border around the window.
TDWindowSunken 1 The window is sunken.
TDWindowRaised 2 (Default) The window is raised.
TDBorderRaised 3 The window is within a raised border.
TDBorderSunken 4 The window is within a sunken border.
TDBorderFlat 5 The window is within a flat border.
Constant Setting Description
TGBorderNone 0 There is no border around the window.
TGWindowSunken 1 (Default) The window is sunken.
TGWindowRaised 2 The window is raised.
TGBorderRaised 3 The window is within a raised border.
TGBorderSunken 4 The window is within a sunken border.
TGBorderFlat 5 The window is within a flat border.
TGBorderMono 6 The window is within a mono border.
84 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
BorderWidth Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge, and Trend Link.
Returns or sets the width of a control's border.
Syntax
object.BorderWidth = [number]
The BorderWidth property syntax has these parts:
Remarks
The following table shows the effect of BorderStyle settings on the BorderWidth property:
Part Description
object An object expression that evaluates to an applicable object.
number A numeric expression from 1 to 8192, inclusive.
BorderStyle Effect on BorderWidth
0 BorderWidth setting is ignored.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 85
DisplayString Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, and LiveTimeDisplay.
Returns or sets the time DisplayString in the appropriate Time Display window.
Syntax
object.DisplayString = [string]
Settings
The DisplayString property settings are:
Remarks
The Time Display string will vary according to the Regional Settings of the computer. Anytime entered beyond the available time records in the data source will default to the oldest ornewest time accordingly.
Part Description
object An object expression that evaluates to an applicable object.
string A date/time string as described in Settings.
Object String Description
HistoricalTimeDisplay "mm/dd/yyyy hh:mm:ss.000 AM/PM" Date/time string.
IntervalTimeDisplay "[x days] hh:mm:ss.000"
(Decimal part optional)
"1 d 00:10:20.000" - 1 day, 10 minutes, 20 seconds
"2:45" - 2 hours, 45 minutes
Time interval.
LiveTimeDisplay "mm/dd/yyyy hh:mm:ss.000 AM/PM" Date/time string.
86 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
FeatureSet Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge, Trend Link, and Trend Graph.
Returns or sets the current level of licensing or any feature sets created by the designer.
Syntax
object.FeatureSet = [file As String]
Remarks
The FeatureSet property can be set on the applicable individual objects for a designerprogramming individual objects but it is recommended to set the FeatureSet on the Trend Linkobject which will pass the setting on to the other controls.
Part Description
object An object expression that evaluates to an applicable object.
file A filename of a license file or feature set (e.g. "Basic Feature Set") located in the application directory.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 87
Font Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge, and Trend Link.
Returns or sets font properties for an object.
Syntax
object.Font.[Property] = [value]
Settings
The possible Font property settings for the applicable objects are:
Part Description
object An object expression that evaluates to an applicable object.
Property The name of the Property to return or set as described in Set-tings.
value A value as described in Type to indicate or change what is in the Description
Property Type Description
Name BSTR The facename of the font, e.g. Arial.
Size short The point size of the font.
Bold BOOL Indicates whether the font is boldfaced.
Italic BOOL Indicates whether the font is italicized.
Underline BOOL Indicates whether the font is underlined.
Strikethrough BOOL Indicates whether the font is strikethrough.
Weight short The boldness of the font.
88 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Charset short The character set used in the font, such as ANSI_CHARSET, DEFAULT_CHARSET, or SYMBOL_CHARSET.
Property Type Description
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 89
Time Display Methods
GetHeight SetDisplayFontSizeOverride
GetLargestFontSize ReadLocale
GetPixelSize
90 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Time Display Events
BorderStyleChange PercentOfChartChange
BorderWidthChange PositionTypeChange
FontChange PrecisionRightofDPChange
HistBackgroundColorChange PrecisionTotalChange
HistForegroundColorChange SignificantDigitsChange
LiveBackgroundColorChange SubsecondDigitsChange
LiveForegroundColorChange ThousandsSeparatorChange
MaxFontSizeChange TooltipsChange
MillisecondDefaultChange TrendGraphSourceChange
MinFontSizeChange ValueFormatChange
NumberOfLinesChange WidthChange
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 91
Scales! Properties
! Methods
! Events
Object
Parent.ScaleHistoricalEdge
Parent.ScaleLiveEdge
92 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Scale Properties= Read Only
BackColor FeatureSet MinFontSize
BorderStyle Font ScaleHandles
BorderWidth Magnification
DockedEdge MaxFontSize
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 93
BorderStyle Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge, Trend Link, and Trend Graph.
Returns or sets the border style for an object.
Syntax
object.BorderStyle = [value]
Settings
For the HistoricalTimeDisplay, IntervalTimeDisplay, and LiveTimeDisplay objects, theBorderStyle property settings are:
Part Description
object An object expression that evaluates to an applicable object.
value A value or constant that determines the border style, as described in Settings.
Constant Setting Description
XSWBorderNone 0 There is no border around the window.
XSWWindowSunken 1 (Default) The window is sunken.
XSWWindowRaised 2 The window is raised.
XSWBorderRaised 3 The window is within a raised border.
XSWBorderSunken 4 The window is within a sunken border.
XSWBorderFlat 5 The window is within a flat border.
94 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
For the Legend object, the BorderStyle property settings are:
For the ScaleHistoricalEdge and ScaleLiveEdge objects, the BorderStyle property settingsare:
Constant Setting Description
LGBorderNone 0 (Default) There is no border around the window.
LGWindowSunken 1 The window is sunken.
LGWindowRaised 2 The window is raised.
LGBorderRaised 3 The window is within a raised border.
LGBorderSunken 4 The window is within a sunken border.
LGBorderFlat 5 The window is within a flat border.
Constant Setting Description
YSWBorderNone 0 (Default) There is no border around the window.
YSWWindowSunken 1 The window is sunken.
YSWWindowRaised 2 The window is raised.
YSWBorderRaised 3 The window is within a raised border.
YSWBorderSunken 4 The window is within a sunken border.
YSWBorderFlat 5 The window is within a flat border.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 95
For the Trend Link object, the BorderStyle property settings are:
For the Trend Graph object, the BorderStyle property settings are:
Constant Setting Description
TDBorderNone 0 There is no border around the window.
TDWindowSunken 1 The window is sunken.
TDWindowRaised 2 (Default) The window is raised.
TDBorderRaised 3 The window is within a raised border.
TDBorderSunken 4 The window is within a sunken border.
TDBorderFlat 5 The window is within a flat border.
Constant Setting Description
TGBorderNone 0 There is no border around the window.
TGWindowSunken 1 (Default) The window is sunken.
TGWindowRaised 2 The window is raised.
TGBorderRaised 3 The window is within a raised border.
TGBorderSunken 4 The window is within a sunken border.
TGBorderFlat 5 The window is within a flat border.
TGBorderMono 6 The window is within a mono border.
96 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
BorderWidth Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge, and Trend Link.
Returns or sets the width of a control's border.
Syntax
object.BorderWidth = [number]
The BorderWidth property syntax has these parts:
Remarks
The following table shows the effect of BorderStyle settings on the BorderWidth property:
Part Description
object An object expression that evaluates to an applicable object.
number A numeric expression from 1 to 8192, inclusive.
BorderStyle Effect on BorderWidth
0 BorderWidth setting is ignored.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 97
FeatureSet Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge, Trend Link, and Trend Graph.
Returns or sets the current level of licensing or any feature sets created by the designer.
Syntax
object.FeatureSet = [file As String]
Remarks
The FeatureSet property can be set on the applicable individual objects for a designerprogramming individual objects but it is recommended to set the FeatureSet on the Trend Linkobject which will pass the setting on to the other controls.
Part Description
object An object expression that evaluates to an applicable object.
file A filename of a license file or feature set (e.g. "Basic Feature Set") located in the application directory.
98 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Font Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge, and Trend Link.
Returns or sets font properties for an object.
Syntax
object.Font.[Property] = [value]
Settings
The possible Font property settings for Applies to objects are:
Part Description
object An object expression that evaluates to an applicable object.
Property The name of the Property to return or set as described in Set-tings.
value A value as described in Type to indicate or change what is in the Description
Property Type Description
Name BSTR The facename of the font, e.g. Arial.
Size short The point size of the font.
Bold BOOL Indicates whether the font is boldfaced.
Italic BOOL Indicates whether the font is italicized.
Underline BOOL Indicates whether the font is underlined.
Strikethrough BOOL Indicates whether the font is strikethrough.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 99
Weight short The boldness of the font.
Charset short The character set used in the font, such as ANSI_CHARSET, DEFAULT_CHARSET, or SYMBOL_CHARSET.
Property Type Description
100 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Scale Methods
DisplayScalePropertyPages GetScaleColor PutEnableScale
GetDesiredSize GetScaleName PutTickMarks
GetEnableScale GetTickMarks
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 101
Scale Events
ScaleTickmarkPositions SizeChange
102 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Legend! Properties
! Methods
! Events
Object
Parent.Legend
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 103
Legend Properties= Read Only
BatchMode Count ScrollBarEnabled
BorderStyle FeatureSet ScrollLine
BorderWidth Font
104 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
BorderStyle Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge,Trend Link, and Trend Graph.
Returns or sets the border style for an object.
Syntax
object.BorderStyle = [value]
Settings
For the HistoricalTimeDisplay, IntervalTimeDisplay, and LiveTimeDisplay objects, theBorderStyle property settings are:
Part Description
object An object expression that evaluates to an applicable object.
value A value or constant that determines the border style, as described in Settings.
Constant Setting Description
XSWBorderNone 0 There is no border around the window.
XSWWindowSunken 1 (Default) The window is sunken.
XSWWindowRaised 2 The window is raised.
XSWBorderRaised 3 The window is within a raised border.
XSWBorderSunken 4 The window is within a sunken border.
XSWBorderFlat 5 The window is within a flat border.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 105
For the Legend object, the BorderStyle property settings are:
For the ScaleHistoricalEdge and ScaleLiveEdge objects, the BorderStyle property settingsare:
Constant Setting Description
LGBorderNone 0 (Default) There is no border around the window.
LGWindowSunken 1 The window is sunken.
LGWindowRaised 2 The window is raised.
LGBorderRaised 3 The window is within a raised border.
LGBorderSunken 4 The window is within a sunken border.
LGBorderFlat 5 The window is within a flat border.
Constant Setting Description
YSWBorderNone 0 (Default) There is no border around the window.
YSWWindowSunken 1 The window is sunken.
YSWWindowRaised 2 The window is raised.
YSWBorderRaised 3 The window is within a raised border.
YSWBorderSunken 4 The window is within a sunken border.
YSWBorderFlat 5 The window is within a flat border.
106 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
For the Trend Link object, the BorderStyle property settings are:
For theTrend Graph object, the BorderStyle property settings are:
Constant Setting Description
TDBorderNone 0 There is no border around the window.
TDWindowSunken 1 The window is sunken.
TDWindowRaised 2 (Default) The window is raised.
TDBorderRaised 3 The window is within a raised border.
TDBorderSunken 4 The window is within a sunken border.
TDBorderFlat 5 The window is within a flat border.
Constant Setting Description
TGBorderNone 0 There is no border around the window.
TGWindowSunken 1 (Default) The window is sunken.
TGWindowRaised 2 The window is raised.
TGBorderRaised 3 The window is within a raised border.
TGBorderSunken 4 The window is within a sunken border.
TGBorderFlat 5 The window is within a flat border.
TGBorderMono 6 The window is within a mono border.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 107
BorderWidth Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge,Trend Link, and Trend Graph.
Returns or sets the width of a control's border.
Syntax
object.BorderWidth = [number]
The BorderWidth property syntax has these parts:
Remarks
The following table shows the effect of BorderStyle settings on the BorderWidth property:
Part Description
object An object expression that evaluates to an applicable object.
number A numeric expression from 1 to 8192, inclusive.
BorderStyle Effect on BorderWidth
0 BorderWidth setting is ignored.
108 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
FeatureSet Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge, Trend Link, and Trend Graph.
Returns or sets the current level of licensing or any feature sets created by the designer.
Syntax
object.FeatureSet = [file As String]
Remarks
The FeatureSet property can be set on the applicable individual objects for a designerprogramming individual objects but it is recommended to set the FeatureSet on the Trend Linkobject which will pass the setting on to the other controls.
Part Description
object An object expression that evaluates to an applicable object.
file A filename of a license file or feature set (e.g. "Basic Feature Set") located in the application directory.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 109
Font Property
Applies To: HistoricalTimeDisplay, IntervalTimeDisplay, LiveTimeDisplay, Legend,ScaleHistoricalEdge, ScaleLiveEdge,Trend Link, and Trend Graph.
Returns or sets font properties for an object.
Syntax
object.Font.[Property] = [value]
Settings
The possible Font property settings for Applies to objects are:
Part Description
object An object expression that evaluates to an applicable object.
Property The name of the Property to return or set as described in Set-tings.
value A value as described in Type to indicate or change what is in the Description
Property Type Description
Name BSTR The facename of the font, e.g. Arial.
Size short The point size of the font.
Bold BOOL Indicates whether the font is boldfaced.
Italic BOOL Indicates whether the font is italicized.
Underline BOOL Indicates whether the font is underlined.
Strikethrough BOOL Indicates whether the font is strikethrough.
110 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Weight short The boldness of the font.
Charset short The character set used in the font, such as ANSI_CHARSET, DEFAULT_CHARSET, or SYMBOL_CHARSET.
Property Type Description
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 111
Legend Methods
GetColumnAlign GetColumnVisible PutColumnPercent
GetColumnDescription NextColumn PutColumnVisible
GetColumnOrder PutColumnAlign
GetColumnPercent PutColumnOrder
112 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Legend EventsRowCountChange
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 113
Trends! Properties
! Methods
StdDraw Collection Object
Parent.TrendGraph.Trends
Trend Objects
Parent.TrendGraph.Trends(index)
Part Description
index Required. An expression that specifies the position of a member of the collection. If a numeric expression, index must be a number from 1 to the value of the collection's Count property.
114 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Trends Properties= Read Only
Trends Collection Properties
Count Item
Trends Properties
AnnotationsSupported HighBand LowLimitEnable
AutoScalePrecision HighLimitEnable LowScale
AvgVsRange HighScale LowStaticLimit
BatchName HighStaticLimit MaximumStores
BatchTimeShift IsDynamicBatch Name
Conv1000Separator IsWorking SampleFrequency
ConvGeneralDigits ItemID SampleFrequencyText
ConvNumberDigits LabelScaleAxisPer-cent
ScaleType
ConvScientificDigits LabelTimeAxisPer-cent
ShortName
ConvType LabelVisible TrendColor
Description LastStatus UserTimeShift
DisplayAnnotations LastValue UseShortName
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 115
DynamicAutoScale-Active
LimitColor Visible
DynamicBatchNum-ber
LongName
EngineeringUnits LowBand
116 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
AutoScalePrecision Property
Applies To: Trend Graph and Trends
Returns or sets the precision for all trends under Trendgraph and per trend under Trends( ).
Syntax
object.AutoScalePrecision = [value As Integer]
Settings
The AutoScalePrecision property settings are:
Remarks
AutoScalePrecision determines how close the current view of the trend is scaled within theband area. A tight setting will scale the trend to the full extents of the band area. A loose settingwill allow the trend values to change more without going beyond the scale ranges.
Changes made to AutoScalePrecision under TrendGraph will override any changes made to thesetting under a trend and will also be applied to any new trends added.
Part Description
object An object expression that evaluates to an applicable object.
value A value that detemines the amount of precision described under set-ings.
Setting Description
from -3 (tight) This value will scale the trend to its maximum deflection within the band area.
to 3 (loose) This value will scale the trend to whole rounded numbers.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 117
Count Property
Returns a Long (long integer) containing the number of objects in a collection.
Syntax
object.Trends.Count
Part Description
object An object expression that evaluates to the TrendGraph object .
118 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
DynamicAutoScaleActive Property
Applies To: Trend Graph and Trends
Returns or sets a boolean value indicating whether the DynamicAutoScale is enabled for alltrends under Trendgraph and per trend under Trends( ).
Syntax
object.DynamicAutoScaleActive = [bool]
Settings
The possible boolean values for the DynamicAutoScaleActive property are:
Remarks
When scrolling or the chart is in live mode the trend values will sometimes go beyond the highor low scale values. By enabling the DynamicAutoScale the scale values will automatically beadjusted and an Auto Scale performed on the trend to stay within the band area.
Part Description
object An object expression that evaluates to an applicable object.
Setting Description
True DynamicAutoScaleActive enabled.
False DynamicAutoScaleActive disabled.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 119
HighBand Property
Returns or sets the upper band area for the Trends(Item).
Syntax
object.Trends(x).HighBand = [value As Double]
Part Description
object An object expression that evaluates to the TrendGraph object .
value A value 0 - 100 that determines the upper band area for the Trends(Item) in TrendGraph.
120 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
HighScale Property
Returns or sets the upper scale for the Trends(Item).
Syntax
object.Trends(x).HighScale = [value As Variant]
Part Description
object An object expression that evaluates to the TrendGraph object .
value A value or constant that determines the upper scale for the Trends(Item) in TrendGraph.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 121
IsWorking Property
Applies To: Trend Link, Trend Graph, and Trends
Returns a Boolean value indicating if historical data is currently being retrieved.
Syntax
object.IsWorking
Settings
The possible boolean return values from the IsWorking property are:
Part Description
object An object expression that evaluates to an applicable object.
Setting Description
True Indicates historical data is being retrieved.
False Indicates historical data is not being retrieved.
122 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Item Property
Returns a specific member of a Collection object.
Syntax
object.Trends.Item(index)
Remarks
If the value provided as index doesn’t match any existing member of the collection, an erroroccurs.
Item is the default property for a collection. Therefore, the following lines of code areequivalent:
object.TrendGraph.Trends(index)
object.TrendGraph.Trends.Item(index)
Part Description
object An object expression that evaluates to the TrendGraph object .
index Required. An expression that specifies the position of a member of the collection. If a numeric expression, index must be a number from 1 to the value of the collection's Count property.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 123
LimitColor Property
Returns or sets the limit color of a Trend.
Syntax
object.Trends(x).LimitColor = [RGB function As Long]
Note: To calculate the RGB function as Long, you need to perform the following calculation:
RGB Long = (blue X 65536) + (green X 256) + (red)
RGB Function Syntax
RGB(red, green, blue)
The RGB function syntax has these named arguments:
Part Description
object An object expression that evaluates to the TrendGraph object .
RGB function Returns a Long whole number representing an RGB color value as described below.
Part Description
red Required; Variant (Integer). Number in the range 0–255, inclu-sive, that represents the red component of the color.
green Required; Variant (Integer). Number in the range 0–255, inclu-sive, that represents the green component of the color.
blue Required; Variant (Integer). Number in the range 0–255, inclu-sive, that represents the blue component of the color.
124 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Remarks
Application methods and properties that accept a color specification expect that specificationto be a number representing an RGB color value. An RGB color value specifies the relativeintensity of red, green, and blue to cause a specific color to be displayed.
The value for any argument to RGB that exceeds 255 is assumed to be 255.
The following table lists some standard colors and the red, green, and blue values they include:
Color Red Value Green Value Blue Value
Black 0 0 0
Blue 0 0 255
Green 0 255 0
Cyan 0 255 255
Red 255 0 0
Magenta 255 0 255
Yellow 255 255 0
White 255 255 255
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 125
LowBand Property
Returns or sets the lower band area for the Trends( Item).
Syntax
object.Trends(x).LowBand = [value As Double]
Part Description
object An object expression that evaluates to the TrendGraph object .
value A value 0 - 100 that determines the lower band area for the Trends(Item) in TrendGraph.
126 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
LowScale Property
Returns or sets the lower scale for the Trends(Item).
Syntax
object.Trends(x).LowScale = [value As Variant]
Part Description
object An object expression that evaluates to the TrendGraph object .
value A value or constant that determines the lower scale for the Trends(Item) in TrendGraph.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 127
TrendColor Property
Returns or sets the color of a Trend.
Syntax
object.Trends(x).TrendColor = [RGB function As Long]
Note: To calculate the RGB function as Long, you need to perform the following calculation:
RGB Long = (blue X 65536) + (green X 256) + (red)
RGB Function Syntax
RGB(red, green, blue)
The RGB function syntax has these named arguments:
Part Description
object An object expression that evaluates to the TrendGraph object .
RGB function Returns a Long whole number representing an RGB color value as described below.
Part Description
red Required; Variant (Integer). Number in the range 0–255, inclu-sive, that represents the red component of the color.
green Required; Variant (Integer). Number in the range 0–255, inclu-sive, that represents the green component of the color.
blue Required; Variant (Integer). Number in the range 0–255, inclu-sive, that represents the blue component of the color.
128 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Remarks
Application methods and properties that accept a color specification expect that specificationto be a number representing an RGB color value. An RGB color value specifies the relativeintensity of red, green, and blue to cause a specific color to be displayed.
The value for any argument to RGB that exceeds 255 is assumed to be 255.
The following table lists some standard colors and the red, green, and blue values they include:
Color Red Value Green Value Blue Value
Black 0 0 0
Blue 0 0 255
Green 0 255 0
Cyan 0 255 255
Red 255 0 0
Magenta 255 0 255
Yellow 255 255 0
White 255 255 255
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 129
Trends Methods
AddAnnotation GetAutoScaleRange NextLabelItem
AutoScale GetBatches PutLabelItemOrder
DisplayPropertyPages GetDefaultScaleRange PutLabelItemVisible
GetAnnotation GetLabelItemDescription ReadLocale
GetAnnotations GetLabelItemOrder
GetAnnotationAudit GetLabelItemVisible
130 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
AutoScale Method
Applies To: Trend Graph, and Trends
The AutoScale method scans the values which are currently visible for the trends and changesthe high / low or both scale values so that the trends are scaled appropriately into the band area.
Syntax
object.AutoScale
object.Trends(x).AutoScale [scaleType]
Settings
The AutoScale scaleTypes are:
Remarks
Under the Trend Graph object AutoScale applies to all loaded trends and both upper and lowerscales.
Part Description
object An object expression that evaluates to the TrendGraph object .
scaleType A value or constant that determines the scale, as described in Settings.
Constant Setting Description
TrendAutoScaleBoth 0 Scales both upper and lower values.
TrendAutoScaleHigh 1 Scales the upper value.
TrendAutoScaleLow 2 Scales the lower value
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 131
GetAnnotations Method
The GetAnnotations method returns the annotation times in a variant array, times annotationswere added in a variant array , classification in a long array, the user that added the annotationin a string array and the annotation in a string array.
Syntax
object.GetAnnotations (timeAsString As Boolean, [startTime], [endTime],annotationTimes() As Variant, addTimes() As Variant, classifications() As Long, users()As String, annotations() As String)
Part Description
object An object expression that evaluates to the Standard Draw Trend object .
timeAsString Boolean. True = annotationTimes and addTimes returned as strings. False = times returned as currency values.
Note: Currency values work best for doing calculations and can be passed to the TrendGraph.LiveTime or IntervalTime.
startTime Optional. The beginning of time to search as a currency or time string. No entry will go to the beginning of time in the database.
endTime Optional. The end of time to search as a currency or time string. No entry will go to the end of time in the database.
annotationTimes() A variant array to hold the annotation times returned. This will be a time string if timeAsString = True or currency value if False.
addTimes() A variant array to hold the annotation add times returned. This will be a time string or currency value depending on the value of timeAsString.
classifications() A long array variable to hold the annotations classification returned.
132 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Settings
Syntax of startTime and endTime is:
Remarks
All arrays will have the same dimensions with corresponding elements.
users() A string array variable to hold the users that added the annota-tions returned.
annotations() A string array variable to hold the annotations returned.
Type Syntax Description
Currency 12640456080000 = 7/24/2001 9:48:00 AM EDT
Millisecond value in currency form since 1/1/1601 UTC
String "mm/dd/yyyy hh:mm:ss.000 AM/PM"
Time in string form
Part Description
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 133
GetBatches Method
The GetBatches method returns the batch names in a string array, the batch start times in avariant array and the batch end times in a variant array.
Syntax
object.GetBatches (timeAsString As Boolean, [startTime], [endTime], batchNames()As String, batchStartTimes() As Variant, batchEndTimes() As Variant)
Part Description
object An object expression that evaluates to the Standard Draw Trend object .
timeAsString Boolean. True = annotationTimes and addTimes returned as strings. False = times returned as currency values.
Note: Currency values work best for doing calculations and can be passed to the TrendGraph.LiveTime or IntervalTime.
startTime Optional. The beginning of time to search as a currency or time string. No entry will go to the beginning of time in the database.
endTime Optional. The end of time to search as a currency or time string. No entry will go to the end of time in the database.
batchNames() A variant array to hold the batch names returned.
batchStartTimes() A variant array to hold the batch start times returned. This will be a time string or currency value depending on the value of timeAs-String.
batchEndTimes() A variant array to hold the batch end times returned. This will be a time string or currency value depending on the value of timeAs-String.
134 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Settings
Syntax of startTime and endTime is:
Remarks
All arrays will have the same dimensions with corresponding elements.
Type Syntax Description
Currency 12640456080000 = 7/24/2001 9:48:00 AM EDT
Millisecond value in currency form since 1/1/1601 UTC
String "mm/dd/yyyy hh:mm:ss.000 AM/PM"
Time in string form
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 135
Independent Export ! Methods
! Events
Reference
CLIExport Object
Dim WithEvents objExport As CLIExport
Set objExport = New CLIExport
Methods
Events
AbortExports EnumExportFileTypes Method
ExportDataToFile Method
ExportError ExportProgress
136 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
EnumExportFileTypes MethodApplies To: Trend Graph and Export Objects.
Returns two string arrays of available export file types and export file descriptions.
Syntax
object.EnumExportFileTypes(exportFileTypes() As String, exportFileDescriptions() AsString)
Remarks
The returned arrays are used to provide needed information for a dialog to allow the user toselect the Export Type before doing an ExportDataToFile.
Part Description
object An object expression that evaluates to an applicable object.
exportFileTypes() A string array variable to hold the export file types returned.
exportFileDescriptions() A string array variable to hold the export file descriptions returned.
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 137
ExportDataToFile Method
CLIExport
Example
Exports the data from the database files to a .CSV or .TLG file according to the parameterspassed to it.
Syntax
object.ExportDataToFile(expType As String, exportTagNames() As String, filename AsString, chartDescription As String, sampleRate, startTime, endTime, displayErrors AsBoolean, props() As CLIExportProp)
Part Description
object An object expression that evaluates to the CLIExport object .
expType A string containing the type of export.
exportTagNames() A string array containing the full Item ID's for tags or if a node is used, then all tags below that node will be included in the export. For TBase this would be TBase.dataset name.
The tag or node string is case sensitive and must match the existing case.
filename A string containing the full path where the file is to be created.
chartDescription A string description of the export which can be included in the export file.
sampleRate Sample rate (an interval) that is used to retrieve the exported data. Note that it is also possible to select a STDUBE.EXP type which will result in an interval that follows changes in the data values. Also if you are using the BINARY type, this value can be 0 to use the sample rate that was used to log the data.
138 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Syntax of expType types are:
Syntax of exportTagNames are:
Syntax of sampleRate types are:
startTime Starting and ending time for the export. In addition to specifying an absolute time, you can also specify "NOW" or "NOW + <interval>" or "NOW - <interval>"
endTime
displayErrors Causes errors to be displayed in a window when set to True.
props() An array of CLIExportProp objects. A CLIExportProp object must bedeclared for each Tag in exportTagNames() or as a dynamic array. Adynamic array should be used to export all the tags in a node.
Type Description
BINARY TBase Format(*.TLG)
MATHCAD.EXP Mathcad Array Format(*.PRN)
SPSHEET.EXP Column Heading Format(*.CSV)
STD.EXP Std. Comma Separated Values(*.CSV)
STDBCH.EXP Std. Batch Comma Sep. Values(*.CSV)
STDUBE.EXP Std UBE Comma Sep. Values(*.CSV)
Database Type Description
Demo Demo.[Dataset].[Tagname]
TBase TBase.[Dataset]:[Tagname]
Part Description
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 139
Syntax of startTime and endTime is:
Remarks
If the given file already exists, the method will not fail but overwrite the file without anyprompt.
Example
To test the sample code below in VB the Sample data installed with the Trends Logger mustbe on the system. A reference to the CLIExport Object, and three controls added to the form;command button, combo box and progress bar.
Option ExplicitPrivate WithEvents oExport As CLIExportDim sTypes() As String, sDescrip() As StringDim iarray As Integer
Type Syntax Description
Currency 20500 = 00:00:20.500 = 20.5 seconds Millisecond Interval value in currency form.
String "[x days] hh:mm:ss.[000]"
"1 d 00:10:20.000" = 1 day, 10 minutes, 20 seconds
"2:45" = 2 hours, 45 minutes
Time in string form.
Integer 305000000 = 00:00:30.500 = 30.5 seconds 100 Nanosecond Interval in File time.
Parameter Syntax Description
Start Time "mm/dd/yyyy hh:mm:ss.000 AM/PM" Date/time string.
End Time
140 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
Private Sub Combo1_Click()iarray = Combo1.ListIndexEnd Sub
Private Sub Command1_Click()Dim sTags(2) As String, sFilename As String, sChtDescrip As String, _sProps(2) As CLIExportProp, I As IntegersTags(0) = "TBase.Sample:LINK0THRUPUT"sTags(1) = "TBase.Sample:LINK2THRUPUT"sTags(2) = "TBase.Sample:LINK4THRUPUT"sFilename = "C:\temp\Sample.csv"sChtDescrip = "Test Export"For I = 0 To 2Set sProps(I) = New CLIExportPropNextsProps(0).Description = "hello"oExport.ExportDataToFile sTypes(iarray), sTags, sFilename, sChtDescrip, "00:00:30", _"11/28/90 1:30:20 PM", "11/30/90 1:30:20 PM", True, sPropsEnd Sub
Private Sub Form_Load()Set oExport = New CLIExportoExport.EnumExportFileTypes sTypes, sDescripDim I As IntegerFor I = 0 To UBound(sTypes)Combo1.AddItem sTypes(I) + " " + sDescrip(I)If sTypes(I) = UCase("Std.exp") Then iarray = INextCombo1.Text = Combo1.List(iarray)End Sub
Private Sub Form_Unload(Cancel As Integer)Set oExport = NothingEnd Sub
Private Sub oExport_ExportProgress(ByVal filename As String, ByValpercent As Integer)ProgressBar1.Value = percentIf percent = ProgressBar1.Max Then ProgressBar1.Value =rogressBar1.MinEnd Sub
ISaGRAF Enhanced 4.21 - Trend Link Scripting Language 141
ExportProps
Properties
BatchName ConvType ScaleHi
Conv1000Separator Description ScaleLo
ConvGeneralDigits EngUnits SubsecondDigits
ConvNumberDigits LimitHi TimeShift
ConvScientificDigits LimitLo
142 ISaGRAF Enhanced 4.21- Trend Link Scripting Language
CopyrightInformation in these pages is subject to change without notice and does not represent acommitment on the part of ICS Triplex ISaGRAF Inc. No part of these pages may be reproducedin any form or by any means, electronic or mechanical, for any purpose without the expresswritten permission of ICS Triplex ISaGRAF Inc.
© 1999-2004 ICS Triplex ISaGRAF Inc. All rights reserved.
Product or company names included in these pages are trademarks or registered trademarks oftheir respective holders.
All logos and links used in this guide are, to the best of our knowledge, included with thepermission of the owner - if this is not the case, please let us know immediately.
ISaGRAF Enhanced 4.21 - Trend Link Control 143