Generate a Profile’s Data Programmatically
You can plot a Time Profile’s change in value by manually adding vectors to the Profile’s graph (see Edit a Time Profile), or you can:
- Produce a Profile Based on Historic Data
- Generate a Profile’s Data Programmatically.
Use the SetVectors method to modify a Profile’s vectors programmatically using a custom program, Logic, or script. The SetVectors method has these arguments:
- Times (Word array)—The array of times to be used for the Profile’s vectors.
If the Profile Period is Daily, the times have to be in minutes from midnight at the start of the day. As such, the times have to be between 0 and 1439 minutes (the number of minutes in a day).
If the Profile Period is Weekly, the times have to be in minutes from midnight at the start of the week (Sunday). As such, the times have to be between 0 and 10079 minutes (the number of minutes in a week).
- Values (Array of the appropriate type)—The array of values to be used for the Profile’s vectors. Ideally, the array should contain the type of value that corresponds to the Profile’s type (for instance floating point 32-bit values to modify a Float Time Profile’s vectors programmatically). However, if an array contains different type(s) of value, Geo SCADA Expert will automatically convert those values to the correct type when the SetVectors method is executed.
To successfully modify a Profile’s vectors programmatically:
- All Times have to be in sequential order, starting with the earliest time.
- All Times have to be unique.
- Both arrays have to contain the same number of entries.
- All Values and Times have to be within the Profile’s Range (see Specify the Profile’s Range) and time Period (see Specify the Profile’s General Properties).
If any of the above are not adhered to, the method call will be unsuccessful and Geo SCADA Expert will not modify the Profile’s vectors.
For an example that demonstrates how a Time Profile’s vectors might be generated programmatically, see Use a VBScript Program to Modify a Time Profile’s Vectors Programmatically.