ReadSIO
Top  Previous  Next

Description

Reads the specified number of characters from the serial input/output port (SIO). The function will wait for the specified number of milliseconds for data in the receive buffer.


Syntax


[VB]
Value=objActiveDcam.ReadSIO (Count [, Timeout ])


[C/C++]
HRESULT ReadSIO( long Count, long Timeout, bstr* pInput );


Data Types
[VB]

Count: Long
Timeout:
Long (optional)
Return value
: String


Parameters
[C/C++]

Count [in]  
The number of characters to read. If the amount of characters in the receive buffer is less than this parameter, ActiveDcam will keep checking the buffer until the timeout occurs.  
Timeout [in]  
The maximum time to wait for data in the receive buffer, in milliseconds. If this parameter is omitted, the method will return immediately.  
pInput [out,retval]  
String containing the data from the receive buffer. If the timeout occurs, the string will be empty.  
   
Return Values


S_OK  
Success  
E_FAIL  
Failure.  
E_INVALIDARG  
Invalid input argument.  

Example


The following VB example configures the SIO, sends a command string to an external device and displays a 2-character response. The expected response time is less than 2000 ms:

Dim Str As String
ActiveDcam1.Settings "9600,N,8,1"
ActiveDcam1.WriteSIO "move 1200,3600\r"
Str=ActiveDcam1.ReadSIO(2,2000)
MsgBox Str
 

Remarks


This method is available only for cameras that have the SIO feature compliant with DCAM 1.31 specifications.