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

Socket

Basic socket functions for Scilab
(7561 downloads for this version - 18832 downloads for all versions)
Details
Version
2.0
A more recent valid version exists: 2.0.2
Author
Tibault Reveyrand
Owner Organization
XLIM C2S2 (CNRS)
Maintainer
Tibault Reveyrand
License
Creation Date
January 19, 2010
Source created on
Scilab 5.2.x
Binaries available on
This toolbox is in the process of being built
Description
            Here is a SOCKET toolbox for Scilab. This toolbox enables communications between
an instrument or server located via TCPIP protocol and Scilab.             
Files (3)
[16.52 kB]
Source code archive

[33.40 kB]
linux binary for Scilab 5.2.x
Linux binary version
Automatically generated by the atoms compilation chain

[45.45 kB]
windows binary for Scilab 5.2.x
Windows binary version
Automatically generated by the atoms compilation chain

News (0)
Comments (5)     Leave a comment 
Comment from Gerfried Cebrat -- November 28, 2010, 09:48:05 PM    
Hi, any info appreciated about working environments using TCP/IP connected data acquisition

like labjacks  UE9. thanks
Comment from Oscar Van Der Velde -- January 17, 2011, 06:25:46 PM    
I had a problem with SOCKET_write, it gave one enter command more than necessary. In my
case the result was that I could not see the answer to the command, but instead the answer
to an empty command (simple enter). I fixed it by removing the +ascii(10) part in
macros/SOCKET_write.sci, then rebuilt from the source (had to outcomment some lines that
gave problems in builder.sce)

best regards,
Oscar
Comment from Dominique D\\\'inverno -- May 26, 2011, 07:44:28 PM    
Hi,

I tried to access simply a HTTP page through socket using following sequence :

SOCKET_open(1,<address>,80);
SOCKET_write(1,"GET HTTP/1.0");
r = SOCKET_read(1);

In that case, it seems that SOCKET_read output cannot be "silently" redirected to
the
variable, and all content is fed to the interpreter command line.
Am I missing something, or is there a way to avoid this ?

Best Regards,
Dominique.
Answer from Samuel Gougeon -- April 8, 2012, 02:06:52 AM    
> r = SOCKET_read(1);
> 
> In that case, it seems that SOCKET_read output cannot be "silently"
redirected
> to the variable, and all content is fed to the interpreter command line.

For me, it works with SOCKET_read() as well as with SOCKET_query(). 
Yet, the module has not been updated since your post...
The only issue is about ' in the answer (see my other post today,
and the fix).

Regards
Samuel
Comment from Samuel Gougeon -- April 8, 2012, 01:53:26 AM    
Hello,

SOCKET_read() bugs when the answer contains some ' chars
(as it bugged for " chars). The fix is the same:

Replace
// bug en cas de ""
	"ScilabEval ""mat=\[\""[string map {\""
\""\"" } $tclsocketligne]\"";mat\];""";

with
// bug en cas de " ou '
	"ScilabEval ""mat=\[\""[string map {\""
\""\""  \'' \''\''}
$tclsocketligne]\"";mat\];""";

Then it works

Cheers
Samuel
Answer from Aditya Sengupta -- April 9, 2012, 09:33:56 AM    
> Hello,
> 
> SOCKET_read() bugs when the answer contains some ' chars
> (as it bugged for " chars). The fix is the same:
> 
> Replace
> // bug en cas de ""
> 	"ScilabEval ""mat=\[\""[string map {\""
> \""\"" } $tclsocketligne]\"";mat\];""";
> 
> with
> // bug en cas de " ou '
> 	"ScilabEval ""mat=\[\""[string map {\""
> \""\""  \'' \''\''}
> $tclsocketligne]\"";mat\];""";
> 
> Then it works
> 
> Cheers
> Samuel

I had tried getting in touch with the author about this bug almost a year ago but never
got a response. I've pushed out a fixed version of this here: 

https://github.com/sengupta/scilab-socket (feel free to use this version)

I have had to do this since I am writing a toolbox that will require socket functions
(this toolbox: https://github.com/sengupta/scilab-http) to work; and this bug would not
allow me to use the existing socket toolbox. 
Comment from Parag Kulkarni -- March 13, 2014, 01:46:19 PM    
Hi, I am new to both linux and Scilab.
I have Ubuntu 12.10 and Scilab5.3.3. I have downloaded socket_toolbox_2.0-
1.bin.linux.tar.gz file.
But I don't know how to include it in Scilab.
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.