Connect Method

Measurement Studio User Interface

Connect Method

Syntax

CWBinding.Connect

Purpose

Connects the CWBinding to a data source or target.

Remarks

You must set the URL and AccessMode properties before you can use the Connect method. Use the ConnectTo method to specify the URL and AccessMode properties as part of the method call.

If you connect a reading client to a DataSocket item that does not exist, the DataSocket Server creates the item with a default value of 0.

Example

'Create a binding that charts wave data
'from a local DataSocket Server on a graph.
Dim Binding As CWBinding

'Add new CWBinding
CWGraph1.CWBindings.Add
Set Binding = CWGraph1.CWBindings.Item(1)

'Set AccessMode to automatically read and update
Binding.AccessMode = cwdsReadAutoUpdate
'Specify the data source on the DataSocket Server
Binding.URL = "dstp://localhost/wave"

'Bind the URL to CWGraph control, YData property
Binding.SetBindObject CWGraph1
Binding.BindProperty = "YData"

'Connect to data source
Binding.Connect

See Also

AccessMode

ConnectTo

URL