Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | File Exchange
ATOMS : Serial Communication Toolbox details
Please login or create an account

Serial Communication Toolbox

Communication over a RS-232 Serial Port with Scilab on Windows and Linux
(9091 downloads for this version - 49377 downloads for all versions)
Details
Version
0.4.2
Authors
Enrico Segre
Aditya Sengupta
Owner Organization
Indian Institute of Technology Bombay
Maintainers
Aditya Sengupta
Administrator Atoms
Samuel Gougeon
Categories
License
Creation Date
March 13, 2017
Source created on
Scilab 6.0.x
Binaries available on
Scilab 6.0.x:
Windows 64-bit Windows 32-bit Linux 64-bit Linux 32-bit MacOSX
Install command
--> atomsInstall("serial")
Description
            
Serial Communication Toolbox for Scilab
=======================================

This toolbox enables the use of Serial Communication in Scilab (http://www.scilab.org) and in Scicoslab (http://www.scicoslab.org).

This is a port of the __Portable Serial Toolbox__ for Scilab originally written
by Enrico Segre (http://www.weizmann.ac.il/home/fesegre)
and has been ported to Scilab 5.x and released with his kind permission. It is
licensed, at his request, under the GPLv3. 

Enrico does not wish to provide support for this toolbox anymore. Therefore, for
any support related queries or otherwise, please raise an issue on the Github
project page (https://github.com/sengupta/Scilab-Serial).
You can reach me at [this address](mailto:aditya@sengupta.me), but I would
prefer you raise an issue on Github for problems with the toolbox. 

This toolbox is known to have worked so far on Linux based systems and on
Windows (up till Windows 7). 

The implementation via TCL wrappers is certainly suboptimal, but shouldn't be
such a penalty, given the low bandwidth and the intrinsic asynchronous mode of
serial communication. And mainly, it relieves the developer from supporting many
platforms at once. 

Release Notes: 
==============

0.4.2: 13/3/2017: Toolbox ported to Scilab 6.0
0.4.1: 2/10/2012: Toolbox ported to Scilab 5.5
0.4  : 15/4/2012: Toolbox ported to Scilab 5.4
0.3  : 14/5/2011: Initial release on ATOMS by Aditya Sengupta
       serial is now compatible with Scilab 5.x
0.2.x: 12/1/2009: Final Release by Enrico Segre
0.2  : corrected version after http://bugzilla.scilab.org/3829 : 
       readserial/writeserial were confused by strings containing
       nonprintable ascii characters

Toolbox essentially still geared for scilab 4.x (4.1.2, scicoslab) in the sense
that:

- in many points the detour ``TCL_EvalStr("set answ [....]");
  TCL_GetVar("answ")`` is still implemented (was mandatory prior to
[request 319](http://requestzilla.scilab.org/show_bug.cgi?id=319)),
it is not required since scilab 4.1.2
 
            
Files (2)
[83.85 kB]
Source code archive

[51.77 kB]
OS-independent binary for Scilab 6.0.x
Binary version (all platforms)
Automatically generated by the ATOMS compilation chain

News (0)
Comments (4)     Leave a comment 
Comment from Samuel Gougeon -- March 13, 2017, 11:34:22 PM    
Great to have it in Scilab 6.0 now
Thanks
Comment from Jeff Waters -- May 15, 2017, 03:30:21 PM    
i use readserial from arduino and do not get continuous read... why ??    can it be done
without modification to toolbox... 
maybe its an issue with USB ... comments ??? 
Answer from Samuel Gougeon -- July 13, 2018, 01:38:10 PM    
> i use readserial from arduino and do not get continuous read... why ??    can it be
done
> without modification to toolbox... 
> maybe its an issue with USB ... comments ??? 

This issue could likely be due to the Scilab 6 serious bug 
http://bugzilla.scilab.org/15101 about ascii(0)
Comment from Nicolas Boizot -- June 8, 2017, 05:49:30 PM    
I'm using this tollbox with Scilab 6 and it works great.
It seems however that, when using openserial, the COM port must be less than 10. Is that
really the case ?
Answer from Samuel Gougeon -- June 8, 2017, 05:52:34 PM    
> I'm using this tollbox with Scilab 6 and it works great.
> It seems however that, when using openserial, the COM port must be less than 10. Is
that
> really the case ?

As far as i remember: Yes, it is a limitation for all versions. We could analyze where it
comes from: TCL or elsewhere. On my side, i never needed more than 9 ports.
Answer from Jerome Briot -- August 2, 2018, 01:16:40 PM    
> As far as i remember: Yes, it is a limitation for all versions. We could analyze
where
> it comes from: TCL or elsewhere. 

See there:
https://support.microsoft.com/en-us/help/115831/howto-specify-serial-ports-larger-than-com9

Modify the first lines of code in openserial.sci:

function h=openserial(p,smode,translation,handshake,xchar,timeout)
//port name
  if ~exists("p","local") then p=1; end
  if type(p)==1 | type(p)==8 then
    if p<=0 then error("port number must be greater than zero"); end
    if getos() == "Windows" then
      port="\\\\.\\COM"+string(p)
    else
      port="/dev/ttyS"+string(p-1)
    end
  elseif type(p)==10
    if strcmp(part(p,1:3), 'COM', 'i')==0 then
      port="\\\\.\\"+p
    else
      port=p 
    end
  else
     error("port to open must be either a number or a string")
  end

You have to rebuild the corresponding bin file.

Then you can use for example openserial(17,...) or openserial('COM17',...) or any number
greater than 9 for the COM port.

> On my side, i never needed more than 9 ports.

It's very handy when you use many USB to UART bridges that emulate virtual COM ports.
Comment from Güner Güvenç -- July 23, 2017, 09:10:12 AM    
It should definitely be a value under com port 10.
My port com 11 I have not been successful for 2 weeks.
I made comport 6.
Everything is fine
Leave a comment
You must register and log in before leaving a comment.
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.