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
AccessMode | Specifies the read or write connection to make when connecting to the data source. |
ActualURL | Identifies the actual URL of the current data source. |
AutoConnect | Specifies if the binding automatically connects to the source as soon as the program is run. |
BindProperty | Specifies the name of the property that you are binding to an external data item. |
DataUpdated | Indicates if value or attributes on the CWBinding object have been set since they were last read. |
DataUpdatedEnabled | Indicates if the binding generates the CWBindingDataUpdated event when the bound data changes. |
LastError | Returns the last error code used in an CWBindingStatusUpdated event. |
LastMessage | Stores the last message used in a CWBindingStatusUpdated event. |
Name | Specifies the name of the CWBinding object. |
Status | Specifies the current status of the data connection. |
StatusUpdated | Indicates if the binding status has changed or if an error has occurred. |
TimerInterval | Automatically calls the Update method at a regular interval specified in milliseconds. |
URL | Specifies the location as a URL of the data source or target to which you are binding. |
Methods
Connect | Connects the CWBinding to a data source or target. |
ConnectTo | Connects the CWBinding object to a data source or target. |
Disconnect | Disconnects the CWBinding from the data item to which it is currently connected. |
SelectURL | Enables 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. |
SetBindObject | Object 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. |
Update | Causes the CWBinding to read from a data source or write to a data target. |