Status Property (Read Only)

NI DataSocket

Status Property (Read Only)

Syntax

CWDataSocket.Status

Data Type

CWDSStatus

You can use the following constants with this data type:

  • cwdsConnecting–DataSocket is in the process of connecting to the data source or target.
  • cwdsConnectionActive–DataSocket is in the process of transferring the data or waiting for an update.
  • cwdsConnectionError–DataSocket encountered an error connecting to the data source or target.
  • cwdsConnectionIdle–DataSocket has connected to the data source and transferred the data.
  • cwdsUnconnected–DataSocket is not connected to any data source or data target.

Purpose

Specifies the current status of the data connection.

Remarks

The value of this property is the same as the last status value passed to the OnStatusUpdated event.

If an error is encountered while connecting to the source or target, the status indicates the last step attempted. The LastError and LastMessage properties describe the error.

Example

'Display the current status in the form
'[status:error] Message
Dim str As String

If (CWDataSocket1.StatusUpdated) Then
   str = "[" & CWDataSocket1.Status & ":" & _
           CWDataSocket1.LastError & "]" & _
           CWDataSocket1.LastMessage
   MsgBox str
End If

See Also

LastError

LastMessage

StatusUpdated

OnStatusUpdated