Use a VBScript Program to Modify a Time Profile’s Vectors Programmatically

This example demonstrates how a program written in VBScript™ might be used to generate a Time Profile’s vectors.

Example:

A Time Profile’s values are to be compared with the point data that is being retrieved from plant. The Time Profile’s values are to be generated programmatically.

A Double Time Profile named ‘My Time Profile’ is added to the database.

The Time Profile’s Period is specified as Daily.

A Microsoft® VBScript™ program is used to generate a Time Profile’s vectors programmatically. This particular program uses constant values, but the values and times could equally be calculated according to a particular algorithm.

Public Sub SetTimeVectors

Dim Times(4)

Times(0) = 300

Times(1) = 500

Times(2) = 800

Times(3) = 1000

Times(4) = 1200

Dim Values(4)

Values(0) = 10.0

Values(1) = 25.0

Values(2) = 50.0

Values(3) = 30.0

Values(4) = 20.0

Set Profile = Server.FindObject("My Time Profile")

Profile.Interface.SetVectors Times, Values

End Sub

Further Information

Generate a Profile’s Data Programmatically.

Server Automation.


Disclaimer

Geo SCADA Expert 2022