Pushes a single or array values into the data value vector. | |
Syntax: | object.Push Data |
Parameters: |
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:
7 Integer 7 Long 7 Single 7 Double 7 Decimal 7 Boolean 7 Byte 7 Variant 7 String |
Description: | CimData.Push allows you to insert
one or more data values through the end of the data vector. This
method is similar to CimPairData.Push. It differs in that
it pushes the data into the X or
the Y vector individually. This
is very useful if you want to push X data without having to push Y
data or vice versa. Pushing data is particularly useful if your
series plots a continuous flow of data. Example of continuous flow of data A function curve such as cosine of an incremental variable. Example on pushing data values You have the following data values: 22 17 9 -7 22 41 You push the following data values: 59 37 21 6 The data values are now the following: 22 41 59 37 21 6 The first four values have been removed from the vector because its size is fixed. Script Examples The following CimView script excerpt pushes an integer and a double value into Series 1: ' Create an integer and a double value: Dim x as Integer x = 7 Dim y as Double y = 22.74 ' Get the series object: Dim series as CimSeries Set series = cimOleObj.Series("Series 1") ' Push the data into the series object: series.Data.X.Push x series.Data.Y.Push y The following CimView script excerpt creates an array of variant values and an array of double values and pushes them into Series 1: ' Create an array of variant values: Dim x(4) As Variant x(0) = 1 x(1) = Null x(2) = 4.78 x(3) = Empty x(4) = "5.78" ' Create an array of random double values: Randomize Dim y(4) As Double For i = 0 To 4 y(i) = Random(0, 50) Next i ' Get the series object: Dim series as CimSeries Set series = cimOleObj.Series("Series 1") ' Push the data into the series object: series.Data.X.Push x series.Data.Y.Push y Pushing 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 push it into a series. For array points you can use GetSafeArray or a combination of Get and SafeArray to get a single value and push it into a series. Script Examples The following CimView script excerpt pushes the single values of two CIMPLICITY points into Series 1: ' Get two point values: Dim x As New Point x.Id = "X_POINT" Dim y As New Point y.Id = "Y_POINT" ' Get the series object: Dim series as CimSeries Set series = cimOleObj.Series("Series 1") ' Push the data into the series object: series.Data.X.Push x.GetValue series.Data.Y.Push y.GetValue The following CimView script excerpt pushes the array values of two CIMPLICITY HMI points into Series 1: ' Get two point values: Dim x As New Point x.Id = "X_ARRAY_POINT" Dim y As New Point y.Id = "Y_ARRAY_POINT" ' Get the series object: Dim series as CimSeries Set series = cimOleObj.Series("Series 1") ' Push the array data into the series object: series.Data.X.Push x.GetSafeArray series.Data.Y.Push y.GetSafeArray |