|Sets a single or array values starting at a specified index in the data value vector.|
|Syntax:||object.Set AtIndex, Data|
AtIndex As long - Specifies the index to start setting values.
Data As VARIANT* - Specifies the value. This value can be a single variable or array value of any of the following types, as long as it results in a numeric value:
|Description:||CimData.Set Set allows you to set
one or more data values starting at a specified index. The index is
a number from 0 to Count minus
1. This method is similar to CimPairData.Set. It differs in that it
sets the data in the X or the
Y vector individually.
Example on setting data values
You have the following data values:
You set the following data values starting at location 2 (index 1):
The data values are now the following:
The values at locations 2 through 5 are updated with the new values.
The following CimView script excerpt sets the fifth location (index 4) in Series 1. The X is set to an integer and the Y to a double value:
The following CimView script excerpt creates an array of variant values and an array of double values in Series 1. In addition, it sets the X and Y elements starting with the fifth element (index 4) through the ninth. (It goes all the way through the ninth element because the arrays being used have five elements.):
Setting Values from Points
CimEdit Scripts provide you with a type called Point. Point can be used to set and get CIMPLICITY point management information. For single (1 element) points you can use GetValue or a combination of Get and Value to get a single value and set it in a series. For array points you can use GetSafeArray or a combination of Get and SafeArray to get a single value and set it in a series.
The following CimView script excerpt sets the first location (index 0) in Series 1. The values of two CIMPLICITY points are used:
The following CimView script excerpt sets Series 1 with array values of two CIMPLICITY HMI points. The set starts at the first location up to the smaller of either the size of the array points or the number of available locations in the series.: