clSerialWrite
Top  Previous  Next

clSerialWrite ( string Output [, integer Timeout ] )

Use this function to write a string of characters to the currently open camera-link serial device.

Parameters
 
Output  
 
A string containing the data to be sent to the serial device.  

Timeout  
 
Integer specifying the timeout in millisecond. The function will try to write the data to the serial device for the specified period of time. If the data could not be written within that time, the timeout error flag will be raised. If this parameter is omitted, the timeout will never occur.  
 
Error flags

ERR_OK  
 
The flag set if successful.  
 
ERR_FAILED  
 
The flag set if failed.  
 
ERR_NOTFOUND  
 
No open serial device found.  
 
ERR_TIMEOUT  
 
The timeout occurred  

Remark
To open and configure a serial port, use clSerialOpen.  
 
Example
 
This set of statements sets the exposure time of a Dalsa Piranha2 camera to 100 microseconds by sending a corresponding command through a camera-link serial port. Refer to Dalsa documentation for a list of available commands:  
 
clSerialOpen (0)  
clSerialWrite("set_exposure_time 100.000\n")  
clSerialClose()