Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | File Exchange
ATOMS : ScilabSerialLib details
Login with GitLab

ScilabSerialLib

Serial ports communication on Windows (Scilab 5.3+)
(0 downloads for this version - 8186 downloads for all versions)
Details
Version
0.4
A more recent valid version with binaries for Scilab exists: 5.3
Author
ASkr
Owner Organization
TKÜV
Maintainers
AS Kr
Allan CORNET
Categories
License
Creation Date
October 18, 2012
Source created on
No source archive has been provided for this toolbox version.
Binaries available on
This toolbox is in the process of being built
Description
            NEWEST VERSION ALWAYS AVAILABLE FROM:
http://www.askrprojects.net/software/siseli/index.html

Serial ports communication on Windows (Scilab 5.3+)

slCheck          — Check availability of a COM port.
slClose          — Closes a COM port.
slConfig         — Configure a COM port
slCount          — Counts the available bytes in receive buffer.
slFlush          — Flushes the receive buffer and resets the OV flag.
slInit           — Initializes some internal objects.
slLoad           — Loads the library and links functions.
slMount          — Creates a handle to a COM port.
slOpen           — Opens a COM port.
slReadArray      — Reads up to 32 bytes of data from the buffer.
slReadArrayN     — Read an arbitrary amount of data from the buffer.
slReadByte       — Reads a byte from the receive buffer.
slSendArray      — Sends an array to the COM port.
slSendByte       — Sends a byte to the COM port.
slSendPacket     — Sends a DLE STX DATA DLE DLE ETX packet
slSetPacketChar  — Allows configuration of the special character byte
slSetPacketEnd   — Allows configuration of the 2 packet end bytes
slSetPacketStart — Allows configuration of the 2 packet start bytes
slUMount         — Deletes the handle and frees internal objects.
slUnload         — Unload the library
slVersion        — Returns the version of the library

Tested and supported builts/platforms:

 - Scilab 5.3.0-BETA4 (32 bit)
 - Scilab 5.3.0 (32 & 64 bit)
 - Windows XP Pro and Home (SP3, 32Bit)
 - Windows 7 (32 & 64 Bit)


If you need serial ports in Scilab 5+, give it a try.
If it doesn't work:

- Drop me a note and I'll see what I can do.
- Source code is included. Use it ;-)

ASkr


===
*UPDATE* 01/2011:
  Added x64 version (ASkr)

*UPDATE* 11/2011:
  Packaged as ATOMS module (Allan CORNET - Scilab)

*UPDATE* 10/2012:
  Updated to V0.4, included function slReadArrayN
  x64 version pending (still V0.3)
  ASkr
            
Files (0)
News (0)
Comments (3)     Leave a comment 
Comment from ivan stanisheuski -- October 20, 2012, 07:16:12 PM    
Some serial-to-USB-host bridges (for example, CP210x) provide speeds higher than 115200 up

to 921600 bps. Is it feasible, or at least sensibly, to implement extra (for example, 
230400, 460800, 921600) baud rates?
Comment from Thaufeek Ahmed -- August 27, 2014, 02:30:06 PM    
I am not able to open the serial port. I have installed the serial port tool box, but i 
keep getting errors like

-->slConfig(22,9600,8,0,1);
-->slConfig(22,9600);
 !--error 4 
Undefined variable: nBits
at line       2 of function slConfig called by :  
slConfig(22,9600);


-->com = openserial(22,"921600,n,8,1");
 !--error 999 
TCL_EvalStr,  at line 1
	couldn't open "COM22:": no such file or directory
    while executing
"open COM22: r+"
    invoked from within
"set porthandle [open COM22: r+]"
at line      17 of function openserial called by :  
com = openserial(22,"921600,n,8,1");



->sp = serialport(COM22, '9600,n,8,1');
                  !--error 4 
Undefined variable: COM22


I have shown 3 different commands that tried to open the serial port, but one works... 
please help me to open the serial port and receive the serial data from arduino
 
Answer from AS Kr -- August 27, 2014, 02:51:20 PM    

Pleace notice, that the current version is 0.7, not 0.4
(though it probably deserves a 1.1 now ;-)

> I am not able to open the serial port. I have installed the serial port tool box, but
i
> 
> keep getting errors like
> 
> -->slConfig(22,9600,8,0,1);
> -->slConfig(22,9600);
>  !--error 4 
> Undefined variable: nBits
> at line       2 of function slConfig called by :  
> slConfig(22,9600);
> 

slConfig() needs 4 parameters, like in your first call above.
It will fail (2nd line of your code) if you call it with less parameters.


> -->com = openserial(22,"921600,n,8,1");
>
> *SNIP*
>
> ->sp = serialport(COM22, '9600,n,8,1');


I am sorry, I don't know what "openserial()" or
"serialport()" are. These are not part of this library.

Also: None of the SiSeLi functions use strings as arguments.

Are you sure, that you are posting at the right place?

SiSeLi comes with a "quite detailed" (TM) documentation,
including some code examples and a walkthrough.

If you still need help, just ask!
Answer from Thaufeek Ahmed -- August 27, 2014, 02:56:38 PM    
> 
> Actually i dont know the right command to open the serial port .. i just want to know
how 
to use the slOpen command to open the serial port. can u just help me with the syntax to 
open the serial port.. 
Answer from AS Kr -- August 27, 2014, 03:12:00 PM    
> > 
> > Actually i dont know the right command to open the serial port .. i just want to
> know how 
> to use the slOpen command to open the serial port. can u just help me with the syntax
to
> 
> open the serial port.. 

I assume that you are using the newest version of the library (V0.7).
The following steps will not work with older releases.


MINIMAL STEPS TO OPEN A PORT:

1) load the lib
exec("slLoadLib.sci")

2) get a port handle
port1 = slMount()

3) configure the port referenced by handle "port1"
ret = slConfig( port1, 9600, 8, 0, 1 )

4) open COM port 22 on handle "port1"
ret = slOpen( port1, 22 )

Answer from Thaufeek Ahmed -- August 28, 2014, 06:31:33 AM    
> 
> Actually i dont know the right command to open the serial port .. i just want to know
how 
to use the slOpen command to open the serial port. can u just help me with the syntax to 
open the serial port.. 
Comment from Thaufeek Ahmed -- August 27, 2014, 02:52:24 PM    
I am not able to open the serial port. I have installed the serial port tool box, but i 
keep getting errors like

-->slConfig(22,9600,8,0,1);
-->slConfig(22,9600);
 !--error 4 
Undefined variable: nBits
at line       2 of function slConfig called by :  
slConfig(22,9600);


-->com = openserial(22,"921600,n,8,1");
 !--error 999 
TCL_EvalStr,  at line 1
	couldn't open "COM22:": no such file or directory
    while executing
"open COM22: r+"
    invoked from within
"set porthandle [open COM22: r+]"
at line      17 of function openserial called by :  
com = openserial(22,"921600,n,8,1");



->sp = serialport(COM22, '9600,n,8,1');
                  !--error 4 
Undefined variable: COM22


I have shown 3 different commands that tried to open the serial port, but one works... 
please help me to open the serial port and receive the serial data from arduino
 
Leave a comment
You must register and log in before leaving a comment.
Login with GitLab
Email notifications
Send me email when this toolbox has changes, new files or a new release.
You must register and log in before setting up notifications.