CREATING AN EVENT BASED SCHEDULE
Creating an "Time based" or Event based" schedule is straight forward. Create an entry in the database that the scheduler can monitor (MySchedule).
Create a global color table and point your datalinks to this global table.
Right click on the "SCHEDULES" in the system tree. Click on "New Schedule" from the menu. This will open the Schedule editor.


Right click in any column and select either "Add New Timer Entry" For time based events or "Add New Event Entry" for event based events.
Select "Add Event Entry" from the menu. This will open the add event entry window.
.

In the "Schedule Info" field enter a name for this event and a description of what it does.
In the "Trigger Info" field Select a data source using the "Expression Builder" button. This is the value the schedule will monitor. In the "Event Type" filed, select what will trigger this even from the pull down menu.
In the "Action Info" field select an operation from the pull down menu. If "Custom Script" is selected you will need to write a VBA script. Press the VB Editor button to launch the VB editor. The cursor is placed at the point where the scheduler has written a stub for the function name consisting of the event name and the event type (MyColor_2_OnTrue).
Private Sub MyColor_2_OnTrue()
:
:
:
End Sub
Write the script to change the colors and levels in the global color table (MyColorTable1).
Private Sub MyColor_2_OnTrue()
Rem Remove the current levels
user.MyColorTable1.removeAllLevels
Rem assign new levels. addlevel (LoLimit, color, HiLimit) to user.deflimits2
user.MyColorTable1.Addlevel 0, vbRed, 20#
user.MyColorTable1.Addlevel 20, vbCyan, 40#
user.MyColorTable1.Addlevel 40, vbYellow, 60#
user.MyColorTable1.Addlevel 60, vbGreen, 100#
Rem Update the table with the new values
user.MyColorTable1.UpdateLevelIndirectedProperties (0)
user.MyColorTable1.UpdateLevelIndirectedProperties (1)
user.MyColorTable1.UpdateLevelIndirectedProperties (2)
user.MyColorTable1.UpdateLevelIndirectedProperties (3)
End Sub
Save the file and exit the editor.
Press the OK button.
Save the schedule.
Create a picture that will use the new event based schedule.

Add datalinks to display some data. Point the links animation colors to the global color table (MyColorTable1) used in the VB script.
Create a datalink to the database entry that the schedule monitors. (MySchedule). Allow this datalink to accept keyboard input. Set the "Data Entry field to "In-Place".

Save the picture and switch to run.
The data colors being display are the default colors that the global table was created with. Enter a 1 in the MyEvent entry box. The data display colors and trip levels should be the colors and levels setup in the VB script. A second event could be created to reset the colors and levels back to their original values by firing an event and Vbscript when "MySchedule" goes to zero.

