Using the timer object

You use the Timer object to dictate or automate the occurrence of an event action based on time intervals.

About this task

You can find the Timer object in the Miscellaneous palette.

To insert a Timer object:

Procedure

  1. In the editor window, select the visual dashboard scene to which you want to add the Timer object. If the scene is not open in the editor, then double-click the scene in the Project Explorer view.
  2. From the Palette view, select the Timer object and click the editor window. The Timer object is drawn on the canvas in the editor window and it is added as a node in the Project Explorer.
  3. From the Properties view, set the EventInterval property value. You will specify a time value in this property. The default is set to one (1) second.
  4. You can create multiple Timer objects each having a different value for the EventInterval property. For example, one Timer object can have an EventInterval set to one second. Another Timer object can have an EventInterval set to five seconds.
  5. In order for the Timer object to have any effect, you must set an event action to occur each time the EventInterval time elapses. For example, if you set the EventInterval property to one second, the event action that you assign to the specific Timer object will occur every one second.
  6. To set an event action for the Timer object, select the Timer object from the Project Explorer view.
  7. Double-click Tick from the Events view. The [timerobjectname] Behavior window opens.
  8. Click the Add New Action icon. The Add New Action wizard opens. You can choose one of the following actions to occur on every tick of the EventInterval:
    • Jump to new location
    • Navigate to embedded scene
      Note: The Navigate to embedded scene action is only available to objects other than the Embedded Scene object if the Embedded Scene object is in the current scene.
    • Execute SQL statement
      Note: The Execute SQL statement action is only available to objects if one or more repository connections have been defined for the visual project in the Connections folder.
    • Execute procedure
    • Set values
    • Navigate back
    • Print scene
    • Execute shell command
    • Show message
    • Execute Java™Script
    • Export to Excel
    • Set focus
    • Reload scene
    • End session
    • Export to PDF
    • Send Email
    • Send Event to Embedded Scene
    • Save Cookie
    • Load Cookie
    Although you can select any of the actions, the most common use of the Timer object is to control the behavior of another object. To control the behavior of another object at each tick of the EventInterval, select the Set values action. If you intend to control the behavior of another object, then you must have created the object before you start the process of assigning an action to the Tick event.
  9. Click Next. The next window that opens depends on the action that you selected. If you selected the Set values action, the Set values action parameters window opens.
  10. Double-click the Parameter cell. The Expression Designer opens.
  11. The Expression Designer tree lists each object that is included in the selected visual dashboard. Expand the node for the object whose behavior will be changed at each tick interval. A list of the object's properties is displayed.
  12. Select the property of the object that will change at each tick interval. For example, if the object is a Label object, select the Text property. Specify what the value of the text property will be at each tick of the interval using one or more of the available functions.
  13. Click OK. At runtime, with a tick interval of one second, the content of the Label object will change to the new value that you specified every one second.