IPen.DataServer [Property][Get/Set]
- Last UpdatedJul 18, 2023
- 1 minute read
Get or Set the server that this pen is bound to.
Defined As
-
[VBA] String DataServer
-
[Cicode] STRING DataServer
-
[C++] BSTR DataServer
Execution Result
If the property get/set succeeds, the return value will be Success. If the return variable is bad, the return value will be InvalidArgument. If the server connection cannot be found, the return value will be InvalidArgument. If the pen is deleted, the return value will be GeneralFailure.
Remarks
This property currently only supports two options, "localhost" and "" (empty string), which indicates an unbound connection. Local host means the pen will use the local Plant SCADA client to source data from the Plant SCADA Trends/Alarm Servers.
This property works in conjunction with the DataPoint property. This property can be changed during the lifetime of the pen.
Calling Syntax
Assumes you have passed a valid pen object into the function.
[VBA]
Sub Example(pen As Object)
Dim server As String
`Getting Property value
server = pen.DataServer
`Setting Property value
pen.DataPoint = "localhost"
End Sub
[Cicode]
FUNCTION Example(OBJECT hPen)
STRING server;
// Getting current property value
server = _ObjectGetProperty(hPen, "DataServer");
// Setting Property
_ObjectSetProperty(hPen, "DataServer", "localhost");
END