Admin Production ni-theme
Current Publication

DSBindPlot

LabWindows/CVI

DSBindPlot

int DSBindPlot (int panelHandle, int controlID, int plotID, char *URL, DSHandle *DSHandle, HRESULT *dataSocketError);

Purpose

Binds a graph plot to the DataSocket connection specified in the URL parameter.

Note Note  This function is not supported for 64-bit applications.

(Linux) This function is not supported.

A plot can be bound only in READ mode. If you pass -1 for plotID, LabWindows/CVI creates a new plot.

For some protocols such as dstp, the DataSocket server must be launched on the machine referenced in the URL.

Supported Controls

You can use DSBindPlot with graph controls.

Parameters

Input
Name Type Description
panelHandle int Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel.
controlID int The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by functions such as NewCtrl and DuplicateCtrl.
plotID int The ID of the graph plot to be bound to the data source.

If you pass -1, LabWindows/CVI creates a new plot. If plotID is invalid, DSBindPlot returns an error.

If you specify a plot ID at bind time, the access mode must be READ. In this case, the type of plot you specify must be compatible with the data type in the DataSocket source. Valid plot types are X, Y, waveform, point, intensity, scaled intensity, and text.

If you do not specify a plot ID at bind time, and the access mode is READ, the graph control creates a plot dynamically that matches the data type in the DataSocket source. Use ATTR_DS_BIND... attributes to set initial preferences for this plot.
URL char * The URL of the data source for the DataSocket object's connection.

The URL you pass can resolve to different types of data sources. A URL consists of a scheme and a data source path. The scheme specifies the type of data. The DataSocket library supports the following URL schemes:

http—hypertext transfer protocol
ftp—file transfer protocol
file—local files
dstp—DataSocket transfer protocol
opc—OPC (OLE for Process control) servers
logos—an internal National Instruments technology for transmitting data between the network and your local computer
fieldpoint—a protocol that uses the National Instrument logos protocol to send and receive live data to and from a National Instruments Fieldpoint module

The data source path specifies the exact location of the data. The format of the data source path depends on the URL scheme.

URL examples

http://www.natinst.com/cworks/datasocket/chirp.dsd
ftp://ftp.natinst.com/support/compworks/datasocket/chirp.wav
dstp://localhost/wave
dstp://weather.natinst.com/weather/current
file://datafiles/newwave.txt
opc://machine/National Instruments.OPCDemo/SINE:0.0..8.0:2.0
logos://computer_name/process/data_item_name
fieldpoint://computer_name/process/data_item_name
Output
Name Type Description
DSHandle DSHandle A handle that you can use to identify the DataSocket object in subsequent function calls. The handle is never 0.

The status of the connection between a bound control and its DataSocket data source can be obtained by passing the DSHandle to DS_GetStatus.

The DSHandle received from DSBindCtrl should never be passed to DS_DiscardObjHandle. Call DSUnbind to unbind the control.
dataSocketError HRESULT The HRESULT if this function causes a DataSocket error. A value of NULL can be passed in if the HRESULT is not needed.

In the event of a DataSocket error, this function returns a value of UIEDataSocketError.

Return Value

Name Type Description
status int Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 7.0 and later

Example

Refer to userint\databinding.cws for an example of using the DSBindPlot function.