Use a JScript Program to Modify a Time Profile’s Vectors Programmatically
This example demonstrates how JScript 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® JScript 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.
var Times = new Array(5);
Times[0] = 300;
Times[1] = 500;
Times[2] = 800;
Times[3] = 1000;
Times[4] = 1200;
var Values = new Array(5);
Values[0] = 10.0;
Values[1] = 25.0;
Values[2] = 50.0;
Values[3] = 30.0;
Values[4] = 20.0;
var Profile = Server.FindObject("My Time Profile");
Profile.Interface.SetVectors(Times, Values);