openserial The Scilab Serial Communication Toolbox serialstatus

The Scilab Serial Communication Toolbox >> The Scilab Serial Communication Toolbox > readserial

readserial

read characters from serial port

Calling Sequence

buf = readserial(h [,n])

Parameters

h

string, Tcl handle to the serial port

n

number of characters to be read. If omitted, all the characters currently in the input buffer are retrieved (serialstatus is used).

NB: if the input buffer contains less than n characters and the blocking mode of openserial is true, readserial hangs until n are received (this can last forever).

buf

string retrieved from the serial port

Description

Examples

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

See Also

Authors

Enrico Segre

Maintainers

Aditya Sengupta <apsengupta@iitb.ac.in>

Bibliography

openserial The Scilab Serial Communication Toolbox serialstatus