Thursday, November 12, 2009

Serial to scilab

from: http://www.gds-sw.de/goodies.htm

Scilab shared archive: serial.dll
(für Windows Platformen, entwickelt unter XP, Scilab3.0)

Sie nutzen Scilab und suchen nach einer Möglichkeit, über die serielle Schnittstelle Daten einzulesen und auszugeben.
Dann sind Sie hier richtig! Bis zu 4 serielle Verbindungen gleichzeitig!

serial.zip
comconfig.sci (save as)

!!! Lese-Timeout hinzugefügt / Read Timeout added !!!

Eingbaute Funktionen / embedded functions:

Stand: 19.09.2005
// function to open and configure port
handle = opencom(com_config);
or
handle = opencom(1,9600,8,0,0,0,1000);
or
handle = opencom('Port',1,'Baudrate',9600,'Nbits',8,'Parity',0,'Stopbits',0,'Protocol',0,'Timeout',1000));
// function to write ascii char via com port
ok = writecom(handle,STRING);
// function to write binary bytes via com port
ok = writebincom(handle,outbytes);
// function to read NUMBER of bytes via com port
[inbytes,ok] = readbincom(handle,NUMBER);
// function to reset com port, clear In and Out Buffer
ok = resetcom(handle);
// function to close com port
ok = closecom(handle);
// function to get com port handles
[handles,comNr]=getcomhandles();
// closing all by serial.dll opened comm ports
closecom(getcomhandles())

have a lot of fun ... hope it works good

No comments: