CimPairData.Push (method)

Pushes a pair of X and Y single or array values into the X and Y data value vectors.
Syntax: object.Push XData, YData
Parameters:
XData As VARIANT* - Specifies the X 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
YData As VARIANT* - Specifies the Y 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: CimPairData.Push allows you to insert one or more pairs of X and Y data values through the end of the X and Y vectors. This 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 a series whose X and Y values are the following:

X 5 10 15 20 25 30
Y 22 17 9 -7 22 41

You push the following X and Y values:

X 35 40 45 50
Y 59 37 21 6

The series X and Y values are now the following:

X 25 30 35 40 45 50
Y 22 41 59 37 21 6

The first four pairs of XY values have been removed from the series because the size of the X and Y vectors 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
' Push the data into the series object:
cimOleObj.Series("Series 1").Data.Push x, 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
' Push the data into the series object:
cimOleObj.Series("Series 1").Data.Push x, 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"
' Push the data into the series object:
cimOleObj.Series("Series 1").Data.Push x.GetValue, 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.Push x.GetSafeArray, y.GetSafeArray