LabWindows/CVI

DS_GetStatus

HRESULT DS_GetStatus (DSHandle DSHandle, DSEnum_Status *DSStatus);

Purpose

Returns the status of the connection between a DataSocket object and its DataSocket data source.

When the DataSocket object's status changes, this function calls the callback that you used to create the DataSocket object in DS_Open. The DataSocket object passes the DS_EVENT_ONSTATUSUPDATED value in the event parameter of your callback.

Parameters

Input
Name Type Description
DSHandle DSHandle Pass the handle you obtained from DS_Open, DS_GetAttrHandle, or DS_CreateAttrHandle to identify the DataSocket object.
Output
Name Type Description
DSStatus DSEnum_Status Return the status of the connection between the DataSocket object and its DataSocket data source.

The status can be one of the following constant values:

  • DSConst_Unconnected—The DataSocket object is not connected to any data source or data target.
  • DSConst_ConnectionActive—The DataSocket object is in the process of transferring data or waiting for an update.
  • DSConst_ConnectionIdle—The DataSocket object has connected to the data source and transferred the data.
  • DSConst_Connecting—The DataSocket object is in the process of connecting to the data source or target.
  • DSConst_ConnectionError—The DataSocket object encountered an error connecting to the data source or target. You can call DS_GetLastMessage and DS_GetLastError to obtain specific information about the error.

Return Value

Name Type Description
status HRESULT The value that indicates whether an error occurred. A negative error code indicates function failure.

Error codes are defined in CVIversion\toolslib\datasock\dataskt.h and <Program Files>\National Instruments\Shared\MSDTRedistributables\SDKHeaderFiles\8.1\winerror.h. Other error codes in winerror.h are generated by ActiveX Servers and are passed on to you by the DataSocket Library.

Additional Information

Library: DataSocket Library

Include file: datasock\dataskt.h

LabWindows/CVI compatibility: LabWindows/CVI 5.5 and later

Log in to get a better experience