Writes data to the connection you specify in connection in.
The connector pane displays the default data types for this polymorphic function.

![]() |
connection in identifies the data item to write. connection in can be a string that describes the URL or a shared variable control. | ||||||
![]() |
data is the data written to the connection. data can be in any format or LabVIEW data type. | ||||||
![]() |
ms timeout specifies the number of milliseconds the function waits for the pending operation to complete. The default is 0, which means the function does not wait for the operation to complete. Use a timeout value of –1 to make the function wait until the operation completes. Currently, only the dstp, opc, and file protocols support nonzero timeout values for this function. You must enable synchronous notifications to use a nonzero timeout value with the psp protocol. When you enable synchronous notifications, the function waits until the operation completes or the timeout expires. You must append ?sync=”true” to the end of the psp URL to enable synchronous notifications and allow nonzero timeout values for write operations. Enabling synchronous notifications can cause slower performance, particularly on RT targets. | ||||||
![]() |
error in describes error conditions that occur before this VI or function runs.
The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
| ||||||
![]() |
connection out is the data source that specifies the data connection. | ||||||
![]() |
timed out returns FALSE if the operation completed within the timeout interval with no errors. If ms timeout is 0, timed out is FALSE. | ||||||
![]() |
error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces.
Right-click the error out front panel indicator and select Explain Error from the shortcut menu for more information about the error.
|
Refer to the following VIs for examples of using the DataSocket Write function: