DS_Update
- Updated2023-02-21
- 2 minute(s) read
HRESULT DS_Update (DSHandle DSHandle);
Purpose
Causes the DataSocket object to synchronize its data value and attributes with the DataSocket data source to which the DataSocket object is connected.
If the DataSocket object is configured for Read mode, DS_Update obtains the current data value and attributes from the DataSocket data source. If the DataSocket object is configured for Write mode, DS_Update sends the current data value and attributes to the DataSocket data source. This function has no effect on DataSocket objects that are configured for ReadAutoUpdate mode or WriteAutoUpdate mode.
DS_Update is useful when you have DataSocket objects that have several attributes that you must set or obtain at the same time. You can synchronize the updating of all the attributes and the data value for a particular DataSocket object by configuring the DataSocket object for Read mode or for Write mode, setting the values of all of the attributes, and calling DS_Update once to transfer the data value and all of the attributes between the DataSocket object and the DataSocket data source.
![]() |
Note This function is asynchronous, and returns before the update operation is completed. In read mode, after calling this function, you must wait for the DS_EVENT_DATAUPDATED event in your callback function or call DS_GetDataUpdated to check that the data has been updated before getting the new data value or attribute value. |
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. |
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
