CxTrend Methods
The CxTrend object contains the following methods:
AboutBox
The AboutBox method displays an About dialog box for the control.
Syntax
AboutBox()
Example
The following examples launch an About dialog box for the control.
Sub ShowAboutBox()
<Object>.AboutBox
End Sub
Sub ButtonTool_EventClick()
Dim This : Set This = ButtonTool
<Object>.AboutBox
End Sub
AddSeriesDialog
The AddSeriesDialog method calls the Series dialog box where you can add a new series to your trend.
Syntax
AddSeriesDialog()
Cancel
The Cancel method closes an object and TheView.
Syntax
Cancel()
ClearNoteSelection
ClearNoteSelection clears every note label selection in a Trend Tool.
Syntax
ClearNoteSelection()
DeleteAllSeries
The DeleteAllSeries method removes all series from a trend.
Syntax
DeleteAllSeries()
DeleteSeries
The DeleteSeries method clears trend selection(s) from a check list that was created by using the Microsoft ListView control.
Syntax
DeleteSeries()as Boolean
Remarks
This method returns a Boolean value.
DisplayedToConfiguredAxis
Returns the configured (XML) axis index number for a given displayed axis index number.
Syntax
DisplayedToConfiguredAxis() As Integer
EditAxesDialog
The EditAxesDialog method calls the Axis Configuration dialog where you can edit an axis in the trend.
Syntax
EditAxesDialog() As Boolean
Remarks
Returns true if saved.
EditSeriesDialog
The EditSeriesDialog method calls the Series dialog box where you can edit a series in the trend.
Syntax
EditSeriesDialog()
Remarks
Returns 1 if refresh; 2 if restart recommended.
Export
The Export method exports the contents of the grid to a temporary CSV file and opens the file with the default spreadsheet viewer for the user to view and save to disk.
See also Exporting Trends.
Syntax
Export()
ExportAsImage
The ExportAsImage method allows export of an image of a trend.
See also Exporting Trends.
Syntax
ExportAsImage(ByVal nImageType As Long, ByVal path As String, ByVal canOverwrite As Boolean)As Boolean
Parameters
| Parameter | Required | Description |
|---|---|---|
|
nImageType |
Yes |
File type of image as number. The only allowable values are:
|
|
path |
Yes |
Target destination of exported image. |
|
canOverwrite |
Yes |
Overwrites image at target destination (true) or does not overwrite image at target destination (false) and returns false. |
Example
ExportAsImage
Sub ButtonTool1_EventClick()
Dim This : Set This = ButtonTool1
Dim success
success = Trend1.X.ExportAsImage (0, "C:\My\Path\Downloads\asdf.jpeg", True)
If Not (success) Then
msgbox "save asdf.jpeg failed"
End If
success = Trend1.X.ExportAsImage (1, "C:\My\Path\Downloads\asdf.png", True)
If Not (success) Then
msgbox "save asdf.png failed"
End If
success = Trend1.X.ExportAsImage (2, C:\My\Path\Downloads\asdf.bmp", False)
If Not (success) Then
msgbox "save asdf.bmp failed"
End If
End Sub
GetAlarmLimitInfoXml
The GetAlarmLimitInfoXml method returns an XML string of the trend’s alarm limit configuration.
Syntax
GetAlarmLimitInfoXml() As String
GetAxisById
The GetAxisById method returns the configured (XML) axis index number for a given axis ID number.
Syntax
GetAxisById()
GetDisplayedNotes
GetDisplayedNotes returns an array of DisplayNote objects that are currently displayed in the view window of the Trend Tool.
Syntax
GetDisplayedNotes() As Variant
Remarks
Returns an array of DisplayNote objects that are currently displayed on the Trend Tool.
GetSelectedAlarmLimitSeries
The GetSelectedAlarmLimitSeries method returns an index of series currently selected to have its alarm limits displayed.
Syntax
GetSelectedAlarmLimitSeries() As Short
GetSelectedNote
The GetSelectedNote method returns the SITE.SERVICE~NOTENUMBER of the currently selected note label. The database key (DbKey) for the note with no preceding zeroes makes up NOTENUMBER.
Syntax
GetSelectedNote() As String
Remarks
This method returns the SITE.SERVICE~NOTENUMBER of the selected note. If no note is selected, the method returns an empty string.
GetTemplateXml
The GetTemplateXml method returns properties in XML format without Point Tag specifiers.
Syntax
GetTemplateXml() As String
GetValuesAtTime
The GetValuesAtTime method returns the value of a series at a time slice.
Syntax
GetValuesAtTime(DATE TimeSlice)
Parameters
| Parameter | Required | Description |
|---|---|---|
|
DATE |
Yes |
The date of the time slice. |
|
TimeSlice |
Yes |
Value, date, and time of a plotted point. |
Maximize
The Maximize method maximizes the trend. When entering maximization mode, the Maximize parameter value passed in is "True." When exiting maximization mode, the Maximize parameter value passed in is "False."
Syntax
Maximize()
Parameters
| Parameter | Required | Description |
|---|---|---|
|
True |
Yes |
Value passed in when entering maximization mode. |
|
False |
Yes |
Value passed in when exiting maximization mode. |
The Print method prints the contents of the control, grid, or viewer. When this method is called, the Print dialog box is shown to allow configuration.
Syntax
Print()
PrintToDefaultPrinter
The PrintToDefaultPrinter method prints a trend grid to the default printer.
Syntax
PrintToDefaultPrinter()
ReadFromFile
The ReadFromFile method reads the trend from a file.
Syntax
ReadFromFile(FileName As String) As Boolean
Parameters
| Parameter | Required | Description |
|---|---|---|
|
FileName |
Yes |
Name of the file from which the trend will be read. |
Refresh
The Refresh method refreshes the contents of the control from the Current Value Service (CVS).
Syntax
Refresh()
Restart
For objects, the Restart method stops and restarts Run mode. For TheFrame/TheView, the Restart method restarts TheView with new site, service, and facility information, if applicable. See also RestartSoft.
Syntax
Restart()
ScrollBackward
The ScrollBackward method scrolls the data window backward through trend time.
Syntax
ScrollBackward()
ScrollForward
The ScrollForward method scrolls the data window forward through trend time.
Syntax
ScrollForward()
SelectNote
SelectNote selects a note item in the Trend Tool. Both this method and the Note Feed Tool method SetSelection must be called in order for a Trend Tool and a Note Feed Tool to synchronize. This method fires this tool's EventNoteSelected event.
Syntax
SelectNote(NoteTag As String, SelectionState As Boolean)
Parameters
| Parameter | Required | Description |
|---|---|---|
|
NoteTag |
Yes |
Returns the unique identifier of the selected note in the format SITE.SERVICE~NOTENUMBER. |
|
SelectionState |
Yes |
Returns a Boolean value that indicates that a note label is selected (True) or cleared (False). |
Remarks
This method returns a Boolean value that indicates that selection was successful (True) or unsuccessful (False).
SetAlarmLimitInfoXml
The SetAlarmLimitInfoXml method sets the trend’s alarm limit configuration XML string.
Syntax
SetAlarmLimitInfoXml (NewXml As String)
Parameters
| Parameter | Required | Description |
|---|---|---|
|
NewXml |
Yes |
Sets new XML string of alarm limit configurations. |
SetMaximizedCheck
The SetMaximizedCheck method sets the check next to the Maximized context menu item.
Syntax
SetMaximizedCheck(MaximizedCheck As Boolean)
Parameters
| Parameter | Required | Description |
|---|---|---|
|
MaximizedCheck |
Yes |
Sets the check next to the Maximized context menu. |
SetSelectedAlarmLimitSeries
The SetSelectedAlarmLimitSeries method changes or sets the series for which to display alarm limits.
Syntax
SetSelectedAlarmLimitSeries (NewIndex As Short)
Parameters
| Parameter | Required | Description |
|---|---|---|
|
NewIndex |
Yes |
Sets the index to the new series to display alarm limits. |
UseCygNetMaximize
The UseCygNetMaximize method uses the CygNet version of maximize instead of ProEssentials.
Syntax
UseCygNetMaximize()
WriteToFile
The WriteToFile method writes the trend to a file.
Syntax
WriteToFile(FileName As String) As Boolean
Parameters
| Parameter | Required | Description |
|---|---|---|
|
FileName |
Yes |
The name of the file to which the trend will be written. |


