CWBinding

Measurement Studio User Interface

CWBinding

The CWBinding object binds a control to an external data source or target. External data sources and targets might be data items on HTTP, FTP, OPC, DSTP, or file servers located anywhere on the Internet. The CWBinding object associates a property with the external data item. For example, you can create a CWBinding to bind the value of a slide display to a data item on a DataSocket Server to display changes in the data source on the user interface of your program. The CWBinding associates CWSlide.Value with the data location "dstp://localhost/wave".

You can bind most Measurement Studio User Interface control properties to external data sources or targets. For example, you can bind the color of a data plot, a caption name, or a background color to external data items.

The CWBindingDataUpdated event is generated when data is ready to be sent (in write mode) or has just been received (in read mode). Use the CWBindingDataUpdated event to manipulate data values as they are sent or read. For example, you might want to scale values or ignore them if they don't meet your criteria.

A CWBinding object uses National Instruments DataSocket technology to connect to data sources and targets and share live measurements over the Internet. Refer to the DataSocket Web site at www.ni.com/datasocket for more information about DataSocket technology and sharing live data over the Internet.

Note: For security reasons, the CWBinding functionality is disabled when a Measurement Studio User Interface control is running directly within a Web page because the Web page could initialize or script the control to connect to potentially dangerous data sources. To use the CWBinding functionality within a Web page, embed the Measurement Studio User Interface control in a custom control using Visual Basic or Visual Basic Control Creation Edition, and place the custom control on the Web page.

Properties

AccessModeSpecifies the read or write connection to make when connecting to the data source.
ActualURLIdentifies the actual URL of the current data source.
AutoConnectSpecifies if the binding automatically connects to the source as soon as the program is run.
BindPropertySpecifies the name of the property that you are binding to an external data item.
DataUpdatedIndicates if value or attributes on the CWBinding object have been set since they were last read.
DataUpdatedEnabledIndicates if the binding generates the CWBindingDataUpdated event when the bound data changes.
LastErrorReturns the last error code used in an CWBindingStatusUpdated event.
LastMessageStores the last message used in a CWBindingStatusUpdated event.
NameSpecifies the name of the CWBinding object.
StatusSpecifies the current status of the data connection.
StatusUpdatedIndicates if the binding status has changed or if an error has occurred.
TimerIntervalAutomatically calls the Update method at a regular interval specified in milliseconds.
URLSpecifies the location as a URL of the data source or target to which you are binding.

Methods

ConnectConnects the CWBinding to a data source or target.
ConnectToConnects the CWBinding object to a data source or target.
DisconnectDisconnects the CWBinding from the data item to which it is currently connected.
SelectURLEnables interactive browsing and selection of data items and files on DataSocket and OPC servers. With this method you can easily create data URLs, rather than constructing the URLs yourself, or display a simple text box in which you can enter HTTP and FTP URLs.
SetBindObjectObject whose property will bind to a data source or target. This object might be either a control or one of the objects on that control.
UpdateCauses the CWBinding to read from a data source or write to a data target.

See Also

CWBindings