COM - dpGet()

Reads values from data point attributes and saves the values in variables.

Synopsis

HRESULT dpGet([in] VARIANT vDpName, [out] VARIANT *vValue);

Parameter

Parameter Description
vDpName Data point attributes to be read.
vValue Variables the values are saved in.

Description

The function dpGet retrieves one or more strings with data point attributes in the vDpName parameter and returns the result in the vValue parameter. The type of vValue depends on the attribute type. If a data point does not exist, an error code is returned in vValue.

If only the data point is specified, :_online.._value is added. See also CTRL function dpGet().

Example

(See ComSample.xls, CComSample)

Public Sub dpGet()
Dim asDp(2) As String
Dim vValue As Variant
Dim i As Integer
'Abfrage eines einzelnen Wertes
moComManager.dpGet "ExampleDP_Arg1.:_online.._value", vValue
Debug.Print "ExampleDP_Arg1.:_online.._value", vValue
'Abfrage mehrerer Werte
asDp(0) = "ExampleDP_Arg2.:_online.._value"
asDp(1) = "ExampleDP_Result."
asDp(2) = "dp.dpe:conf.det.attr"
moComManager.dpGet asDp, vValue
For i = 0 To 2
Debug.Print asDp(i), vValue(i)
Next i
End Sub

Assignment

COM