CygNet Studio > Using CygNet Studio Tools and Controls > Properties, Events, and Methods > Events

Events

This topic lists the events shown on the Events page of the Property Sheet for all CygNet Studio tools.

Event Description

EventAlarmChange

EventAlarmChange runs when the indicator goes in or out of the alarm state. To get the current alarm state from within the event handler use This.Alarm.

EventAlarmDblClicked

EventAlarmDblClicked is fired when an alarm is double-clicked.

EventAlarmRefreshRateChanged

EventAlarmRefreshRateChanged is fired when the refresh rate of the shared alarm cache is changed.

EventAlarmSelected

EventAlarmSelected is fired when an alarm is selected.

EventAlert

EventAlert runs when a point’s alert state is triggered.

EventBeginProcessing

EventBeginProcessing runs at the beginning of retrieving values to be trended from the Value History Service (VHS) and updating the trend display.

EventCancel

EventCancel runs when the nested view is canceled and is expecting to be closed.

EventCardChange

EventCardChange fires when the selected card is changed by user interaction or by scripted methods.

EventChange

EventChange runs when the user changes a selection within the object.

EventClick

EventClick runs when the user clicks the left mouse button once on the object.

EventCommandStatus

 

EventContextMenu

EventContextMenu runs when one of the custom context menu items that is defined or overridden by this object is clicked.

EventContextMenuObjects

EventContextMenuObjects runs when one of the custom context menu items that is defined for objects in the view (and not overridden by the active object) is clicked.

EventContextMenuView

Similar to EventContextMenuObjects except EventContextMenuView handles custom context menu items from TheView’s context menu (defined in the ContextMenuView property).

EventCustom

In the Workspace, EventCustom runs in response to the RaiseCustomEvent and RaiseGroupCustomEvent methods of the Workspace.

In Nested Views, in addition to EventCustom on the appropriate views, this runs when the contained view has called Raise*CustomEvent. It allows TheView to handle messages from its nested views.

EventDblClick

EventDoubleClick runs when the user clicks the left mouse button twice on the object.

EventDClick

EventDClick runs when the user clicks the left-mouse button twice.

EventDClickCol

EventDClickCol runs when the user clicks the left mouse button twice on the column.

EventDClickCorner

EventDClickCorner runs when the user clicks the left mouse button twice on the upper lefthand cell.

EventDClickRow

EventDClickRow runs when the user clicks the left mouse button twice in the row.

EventDragDrop

Obsolete.

EventDragEnter

Obsolete.

EventDragOver

Obsolete.

EventEndProcessing

EventEndProcessing runs at the end after processing is finished, or retrieving values to be trended from the Value History Service (VHS) and updating the trend display.

EventFilterChange

EventFilterChange is fired when the filter is changed.

EventHistoryPlaybackMode

EventHistoryPlaybackMode runs when the History Playback mode changes. The event parameter specifies the new mode.

EventHistoryPlaybackTime

EventHistoryPlaybackTime runs when the History Playback Time has changed. The event parameter is the new History Playback Time.

EventHyperLink

EventHyperLink runs anytime the contained view requests a hyperlink and uses only the basic parameters of Filepath, Site.Service, FacilityID, and Autoclose.

EventHyperLinkSys

EventHyperLinkSys runs immediately after EventHyperLink whenever a HyperLink is requested by the Nested View and passes a string parameter of XML to TheView. HyperLinkSys uses an XML string of the following format:

<HyperLink FilePath="" SiteService="" Facility="" AutoClose="false" NewViewGroup="false" ViewGroup="0"/>

All of these attributes are optional (although omitting FilePath would probably not be useful), which will result in the above values as defaults. Note that ViewGroup is ignored if NewViewGroup="true."

Only handle one of these two events. If the nested view uses HyperLinkSys, the XML string will be directly passed to EventHyperLinkSys (in which case the string may have missing or additional attributes), otherwise the event will construct an XML string with the first five parameters. It is safe to directly pass this parameter to HyperLinkSys, thus preserving the un-nested behavior of the nested screen.

EventHyperLink ignores NewViewGroup and ViewGroup, so if you want to respect the nested view’s use of these parameters (the former also being a parameter of HyperLinkEx), then EventHyperLinkSys is the preferred method.

EventInitialize

EventInitialize runs when TheView is started in Run or Preview mode to allow further initialization for the control.

EventItemChange

EventItemChange runs when a point property associated with the [DisplayItem] property changes.

For the Text Tool only, this event runs when manual mode is enabled or disabled for an associated point. Manual mode is enabled or disabled via the Edit Current Value dialog box.

EventLClick

EventLClick runs when the user clicks the left mouse button once.

EventLClickCol

EventLClickCol runs when the user clicks the left mouse button once on the column.

EventLClickCorner

EventLClickCorner runs when the user clicks the left mouse button on the upper lefthand cell.

EventLClickRow

EventLClickRow runs when the user clicks the left mouse button once on the row.

EventMaximize

EventMaximize is run when the user selects Maximize from the right-click menu in Run mode or calls the CxTrend.Maximize method from script. When entering maximization mode, the Maximize parameter value passed in is "True." When exiting maximization mode, the Maximize parameter value passed in is "False."

EventMouseDown(Button, Shift, X, Y)

EventMouseDown runs when the user clicks a mouse button while the cursor is in the control region. See EventMouse Parameters for descriptions of parameters.

EventMouseMove(Button, Shift, X, Y)

EventMouseMove runs when the user moves the mouse while the cursor is over the control region. See EventMouse Parameters for descriptions of parameters.

EventMouseUp(Button, Shift, X, Y)

EventMouseUp runs when the user lifts a mouse button after having depressed it in the control region. The mouse may have been lifted outside the control region. See EventMouse Parameters for descriptions of parameters.

EventNoteCreated

EventNoteCreated is run before a note is created. This event can be triggered by selecting the Add Note menu option on a trend in Run mode.

Syntax

ObjectCode_EventNoteCreated(ByRef ShowNoteEditor as Boolean, ByRef CreateNote as Boolean, ByRef Note as Note)

Parameters
  • ShowNoteEditor is a modifiable boolean that determines whether the Note Editor will be displayed (True) or not (False) for the note being created. This parameter could be used to suppress the invocation of the standard Note Editor allowing a custom Note Editor to be displayed when the event is fired.
  • CreateNote is a modifiable boolean that determines whether to create (True) the note in CygNet or not (False). Does nothing if ShowNoteEditor is set to True.
  • Note is a modifiable CxNote.Note object that represents the note being created.

See also Notes.

Example

Sub Trend1_EventNoteCreated(ShowNoteEditor, CreateNote, Note)

Dim This : Set This = Trend1

ShowNoteEditor = False

 

Dim msg : msg = Inputbox("Enter a note summary.", "Note Creation")

 

If msg = "" Then

CreateNote = False

Exit Sub

End If

 

note.summary = msg

note.body = note.summary

CreateNote = True

End Sub

EventNoteEdited

EventNoteEdited is run before a note is edited. This event can be triggered by double-clicking an annotation on a trend in Run mode.

Syntax

ObjectCode_EventNoteEdited(ByRef ShowNoteEditor as Boolean, ByRef UpdateNote as Boolean, ByRef Note as Note)

Parameters
  • ShowNoteEditor is a modifiable boolean that determines whether the Note Editor will be displayed (True) or not (False) for the note being edited. This parameter could be used to suppress the invocation of the standard Note Editor allowing a custom Note Editor to be displayed when the event is fired.
  • UpdateNote is a modifiable boolean that determines whether to update (True) the note in CygNet or not (False). Does nothing if ShowNoteEditor is set to True.
  • Note is a modifiable CxNote.Note object that represents the note being created.

See also Notes.

Example

Sub Trend1_EventNoteEdited(ShowNoteEditor, UpdateNote, Note)

Dim This : Set This = Trend1

ShowNoteEditor = False

 

Dim msg : msg = Inputbox("Enter details to append to the note body.", "Note Edit")

note.body = note.body + vbCrlf + msg

 

If msg = "" Then

UpdateNote = False

Exit Sub

End If

 

UpdateNote = True

 

End Sub

EventNotesChanged

EventNotesChanged is run every time the number of note labels within a Trend Tool view window changes. For example, the event fires when note labels come into scope or fall out of scope, and if the DisplayInformation property Notes option is activated or deactivated.

When a Trend Tool is used in conjunction with a Note Feed Tool, the event triggers changes in the feed that reflect the status of note labels on the trend. For example, note labels are added to or deleted from the Note Feed Tool accordingly.

Syntax

ObjectCode_EventNotesChanged()

Parameters
  • This event takes no parameters.

See also Notes.

EventNoteSelected

EventNoteSelected is run after a note label is selected or cleared.

Syntax

ObjectCode_EventNoteSelected(NoteTag As String, SelectState As Boolean)

Parameters
  • NoteTag returns the unique identifier of the (de)selected note in the format SITE.SERVICE~NOTENUMBER. A note's database key with no preceding zeroes makes up NOTENUMBER.
  • SelectState returns a value that indicates that a note label was selected (True) or cleared (False). Both parameters are required.

See also Notes.

EventOnBeforeNewOPCData

EventOnBeforeNewOPCData runs before data from an attached OPC server is sent to the object control. The EventOnBeforeNewOPCData will fire everything when OPC data is received by the object, regardless of whether the data is different than previously received.

EventOnButtonClick

EventOnButtonCLick is fired when a button in the first button column is pressed, if the button is configured to do so, and if the event is scripted to do so. See Button First Column for more information.

EventOnChange

EventOnChange runs when the Active property changes.

EventOnChangeUser

EventOnChangeUser runs when the Active property changes from user interaction with the control.

EventOnClick

EventOnClick runs when the user presses a key while the control has the keyboard focus.

EventOnClickPointer

EventOnClickPointer runs when the Pointer is clicked with the mouse. Use OnClickPointer to specify actions to perform when the pointer is clicked.

EventOnCurrentMaxChange

EventOnCurrentMaxChange runs when the CurrentMax value changes.

EventOnCurrentMinChange

EventOnCurrentMinChange runs when the CurrentMin value changes.

EventOnCustomizeTickLabel

EventOnCustomizeTickLabel runs before each major tick label is painted and allows for the label to be modified.

EventOnDblClick

EventOnDblClick runs when the application end-user double-clicks on an individual object.

EventOnKeyDown

EventOnKeyDown runs when the user presses a key while the control has the keyboard focus.

EventOnKeyPress

EventOnKeyPress runs when the user presses a single key while the control has the keyboard focus.

EventOnKeyUp

EventOnKeyUp runs when the user releases a key while the control has the keyboard focus.

EventOnMouseDown

EventOnMouseDown runs when the user presses a mouse button.

EventOnMouseMove

EventOnMouseMove runs when the user moves the mouse over the object.

EventOnMouseUp

EventOnMouseUp runs when the user releases a key while the control has the keyboard focus

EventOnNewOPCData

EventOnNewOPCData runs when data from an attached OPC server is sent to the object control.

EventOnPositionChange

EventOnPositionChange runs when the Position property changes.

EventOnPositionChangeFinished

EventOnPositionChangeFinished runs when the user changes a Position property value by left clicking and releasing the mouse button.

EventOnPositionChangeUser

EventOnPositionChangeUser runs when the Position value changes due to user interaction with the control.

EventOnPositionOverLimit

EventOnPositionOverLimit runs when the Position property changes to a value greater than an upper bound limit.

EventOnPositionOverMax

EventOnPositionOverMax runs when the Position property changes to a value greater than the CurrentMax property value.

EventOnPositionUnderLimit

EventOnPositionUnderLimit runs when the Position property changes to a value less than an upper bound limit.

EventOnPositionUnderMin

EventOnPositionUnderMin runs when the Position property changes to a value less than the CurrentMin property value.

EventOnSecondButtonClick

EventOnSecondButtonClick is fired when a button in the last button column is pressed, if the button is configured to do so, and if the event is scripted to do so. See Button Last Column for more information.

EventOnSelChange

EventOnSelChange runs whenever a user changes the selected node in the tree. Also see OnSelChange.

EventOnSelChangeLevel

EventOnSelChangeLevel runs when a user changes the current selection in the navigation bar. EventOnSelChangeLevel will trigger whenever SelPrev, NavPrev, SelNext or NavNext are called. See Facility Navigation Bar Tool Methods and Group Navigation Bar Tool Methods.

Also see Synchronizing the View with a Group Navigation Bar for more information about this event.

EventOnStatusValueChange

EventOnStatusValueChange runs when the monitored status point’s value changes. This will only run if a status point is configured.

EventOnTab

EventOnTab is fired when the tab key is pressed.

EventOnValueChange

EventOnValueChange runs when the Value property changes.

EventPointChange

EventPointChange runs when an unrelated point is updated. This event can significantly reduce initialization time for screens that may contain objects configured for unrelated points. Unrelated points can be registered using an object’s RegisterPointForChangeNotice method, if applicable.

EventPostSetPoint

EventPostSetPoint runs directly after the SetPoint operation completes. This event runs whether or not the SetPoint operation completed successfully.

This event has two parameters: ErrorCode and ErrorMessage. If the ErrorCode is 0, then the SetPoint operation was successful.

Error Code Error Message
0 (SetPoint operation successful)
-1 An unexpected error occurred during the SetPoint operation.
-2 Unable to resolve the target point tag using the provided configuration.
-3 Unable to resolve point value using provided configuration.
-4 Unable to resolve timestamp using provided configuration.
-5 Unable to resolve the alternate point tag using the provided configuration.
-6 The SetPoint operation timed out.
-7 The value provided is not of the point data type being enforced.
-8

The alternate point's point data type is not same as target point's point data type.

-9 The SetPoint operation completed successfully, but the status operation was canceled because the status point tag could not be resolved using the provided configuration.

-10

The target point's data type does not match the point data type being enforced.

-11

The SetPoint operation completed successfully, but the status operation was canceled because manual mode was unable to be toggled.

-12

The SetPoint operation completed successfully, but the status operation was canceled by the user before completion.
-13

The SetPoint operation completed successfully, but the status operation was canceled because it timed out.

-14

Unable to resolve the analog minimum point using the provided configuration.

-15

Unable to resolve the analog maximum point using the provided configuration.

-16

The target point's data type is not analog, but analog settings are used in the prompt.
-17 The default value is not within the range configured in the prompt analog min/max value settings.
-18 The SetPoint operation completed successfully, but the status operation was canceled because the status initialization timed out.
-19 The SetPoint operation completed successfully, but the status initialization operation was interrupted while verifying the initialization was successful.
-20 The SetPoint operation was interrupted while verifying the SetPoint was successful.
-21 Unable to convert units between default point and target point.
-22 Unable to convert units between analog minimum point and target point.
-23 Unable to convert units between analog maximum point and target point.
-24 Unable to convert units between prompt configuration units and target point units.
-25

The alternate point's point data type is not analog point data type for performing unit conversions.

-26

The point being used for the minimum value must be of analog point data type.

-27

The point being used for the maximum value must be of analog point data type.

EventPreSetPoint

EventPreSetPoint runs directly before the SetPoint operation.

EventPreToolTip

EventPreToolTip gives a script writer an opportunity to create a custom tooltip via script just before the tooltip is shown, when it is needed, and not during screen initialization, which can reduce loading time.

Example

Sub TextTool1_EventPreToolTip()

Dim This : Set This = TextTool1

This.ToolTipText = The tooltip text()

End Sub

EventPumpData

EventPumpData is a legacy event, and is effectively obsolete. Do not use.

In the past, this event would run when data was "pumped" to TheView.

EventRClick

EventRClick runs when the user clicks the right mouse button once.

EventRClickCol

EventRClickCol runs when the user clicks the right mouse button once on the column.

EventRClickCorner

EventRClickCorner runs when the user clicks the right mouse button once on the corner.

EventRClickRow

EventRClickRow runs when the user clicks the right mouse button once on the row.

EventRefresh

EventRefresh runs when the screen is refreshed.

EventRefreshComplete

EventRefreshComplete runs when the screen refresh is complete.

EventRefreshTargetData

EventRefreshTargetData runs when the target level data is refreshed.

EventResize

EventResize runs while TheFrame is being resized, so users can implement more advanced sizing code than the FlexHorizontal and FlexVertical constraints allow.

Note: TheFrame’s Height and Width properties will not yet have the new size at the time the event is fired. (See the event's Height and Width parameters.)

EventRestarted

EventRestarted runs when TheView is started after having been restarted using the Restart() method. See Event Execution Order.

EventRestarting

EventRestarting runs when TheView is starting after having been restarted using the Restart() method. See Event Execution Order.

EventRowButtonClicked

EventRowButtonClicked runs when the user clicks the button on the row once.

EventRowChange

EventRowChange runs when the user moves the selection between rows.

EventScroll

EventScroll runs after scrolling TheView, so users can implement custom scrolling behavior.

EventSharedMessageReceived

The EventSharedMessageReceived event on TheFrame/TheView can receive a message sent from another instance of CygNet Studio or CygNet Vision by the SendSharedMessage method of TheView.

Example

Sub TheView_EventSharedMessageReceived(MessageID, Data)

' receive message

Dim This : Set This = TheView

If MessageID = "CHANGE_LEVEL1_FACILITY" Then

TheView.Facility = Data

End If

End Sub

EventSendCommand

 

EventServiceStatusChange

EventServiceStatusChange is fired when the service status changes.

EventSelChange

EventSelChange runs whenever a selection in the grid changes.

EventShowTrend

EventShowTrend runs when the Trend option is selected from the right-click context menu. Script must specify whether to open a single point trend in a new window or populate a trend control on the screen.

EventTerminate

EventTerminate runs when TheView is being closed, either manually by the user or using the Cancel() method.

Note: Since closing a Workspace saves the Workspace before closing the Views, and EventTerminate fires when a View closes, any changes that are made to the Dictionary in EventTerminate will not be saved to the Workspace.

EventTimer

EventTimer runs at every timer interval, which is set using TheView’s [TimerInterval] property. The default interval is 0 milliseconds, which disables the timer. Runs when the user selects the associated option from the Context menu on the WatchList.

EventTrendAddTag

EventTrendAddTag runs when a user adds a point to a single-point trend.

EventTrendRemoveTag

EventTrendRemoveTag runs when a user removes a point from a single-point trend.

EventTrendSingleTag

EventTrendSingleTag runs when a user starts a single point trend.

EventTrendSingleTagRollup

EventTrendSingleTagRollup runs when a user starts a rollup trend for a single point.

EventVersionNotify

EventVersionNotify runs when a .csf file loaded from a BLOB service is out-of-date compared to the version on the BLOB. See Setting Periodic Version Checks for more information about this event.

EventViewableAlarmsChange

EventViewableAlarmsChange is fired when there is a change in the viewable alarms.

EventZoom

EventZoom runs when the user left-clicks on a trend and continues to hold down the mouse button while drawing a zoom area.


More:

Back to top

Let us know how we can improve this topic.

CygNet at weatherford.com

© 2020 Weatherford. All rights reserved.