closeserial The Scilab Serial Communication Toolbox readserial

The Scilab Serial Communication Toolbox >> The Scilab Serial Communication Toolbox > openserial

openserial

open serial port

Calling Sequence

h = openserial(p,smode,translation,handshake,xchar,blocking,timeout)

Parameters

p

port number, or port device name. Numbers are mapped in the following standard way
p MSDOS Unix
1 COM1: /dev/ttyS0
2 COM2: /dev/ttyS1
... ... ...
If needed (e.g. on unix systems using different naming conventions), the serial port device can be specified as a string instead. If omitted, default is 1.

smode

string, communication parameters, in the form "baud,parity,data_bits,stop_bits"

translation

string, either "auto", "binary", "cr", "crlf" or "lf". Default is "binary".

handshake

string, either "none", "rtscts", "xonxoff" or "dtrdsr"

xchar

xon and xoff characters

timeout

timeout for reading? msec

blocking

boolean, blocking mode of the serial channel. If %t, Scilab hangs until all the requested characters are read from or written to the serial port. Default is %f.

h

string, handle to the serial port file returned by TCL

Description

Examples

h=openserial(1,"9600,n,8,1")
writeserial(h,"#02"+ascii(13))
xpause(200000)
readserial(h)
closeserial(h)

See Also

Authors

Enrico Segre

Maintainers

Aditya Sengupta <apsengupta@iitb.ac.in>

Bibliography

closeserial The Scilab Serial Communication Toolbox readserial