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
(7489 downloads for this version - 14963 downloads for all versions)
Details
Version
2.0.1
Author
Tibault Reveyrand
Owner Organization
XLIM C2S2 (CNRS)
Maintainer
Tibault Reveyrand
License
Creation Date
September 27, 2012
Source created on
Scilab 5.4.x
Binaries available on
Scilab 5.4.x:
Windows 64-bit Windows 32-bit Linux 64-bit Linux 32-bit MacOSX
Scilab 5.5.x:
Windows 64-bit Windows 32-bit Linux 64-bit Linux 32-bit MacOSX
Install command
--> atomsInstall("socket_toolbox")
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
makes it available for Scilab 5.4
[52.44 kB]
OS-independent binary for Scilab 5.4.x
Binary version
Automatically generated by the ATOMS compilation chain

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

News (0)
Comments (8)     Leave a comment 
Comment from David Schalk -- December 30, 2012, 07:30:25 PM    

Hi,
Thanks a lot for your effort,

I spent some time to try to build a socket-server with scilab.
please see the download link below. As I am no experienced programer it is just 
experimental - i dont know anything about TCL
and work as a hardware developer.

Feel free to download/change/post..

https://office.1und1.de/client/index.html?path=scilab%20-%20david
%40schalks.de&token=C5E8985C5A383749&mandant=02&product=WEBDESK&locale=de&viewType=0&lang=
de&username=@nonymous&incarnation=office_eu


there are two examples

Example_SynchonServer.sce
that uses
SERVER_Tools.sci and SERVER_Tools.TCL

--> this is an server implemented in the main loop of a scilab program.

and

Example_BackgroundServer.sce
that uses 
SERVER_EventTools.sci and SERVER_EventTools.TCL

--> the server is located inside of a background routine that is called
    whenever a read event is executed.


both examples should work together with "Example_Client.sce" , a example using
the 
standard
socket tool (a time/date server). please note that I modified the SOCKET_write and named 
it SOCKET_writeBlank - I just removed the added char(10) to each line as this results
in calling the read event twice..


--


The main trick is to use the "TCL readable fileevent" to react on incoming write
access.


Its hard to understand how the TCl and Scilab code interacts.
what took me some time to understand:
1. when calling a scilab function from inside a TCL Event it will be executed at the end 
of
   the event
2. all changes to TCl variables inside a TCl Event does not affect the variable-values 
when accessing
   it from outside the event (even when declared as global)



It is a dirty workthrough but usefull for me..


P.S.: I think it would be possible to improve the standard SOCKET_read by using the 
fileevents, too. As in my first server-example you 
should be able to use the fileevent to wait until the other side reacts on your request 
(better than a simple delay).


David Schalk
Comment from David Schalk -- December 30, 2012, 07:34:34 PM    
if the download lin does not work please try

https://office.1und1.de/guest?path=scilab%20-%20david
%40schalks.de&token=C5E8985C5A383749&mandant=02&product=WEBDESK&locale=de&viewType=0
Comment from Jakob Brunhart -- May 18, 2013, 06:47:28 PM    

Hi

sorry but I can`t open your example files. By cklicking to the appropriate link i get to a
new tap:

"Welcome to 1&1 Online Office

You now have guest access to a shared folder:"

Herre I can do nothing more.

Thank you

Jakob Brunhart
Answer from David Schalk -- September 21, 2013, 08:04:00 AM    
https://office.1und1.de/client/index.html?path=scilab%20-%20david
%40schalks.de&token=C5E8985C5A383749&mandant=02&product=WEBDESK&locale=de&viewType=0&lang=de
&username=@nonymous&incarnation=office_eu

Hi Jakob, 

try to copy the link and paste it in the browser - and remove the spaces resulting from the

line brakes. That works for me..

Answer from David Schalk -- September 21, 2013, 09:57:32 AM    
https://office.1und1.de/client/index.html?path=scilab%20-%20david
%40schalks.de&token=C5E8985C5A383749&mandant=02&product=WEBDESK&locale=de&viewType=0&lang=de
&username=@nonymous&incarnation=office_eu

Hi Jakob, 

try to copy the link and paste it in the browser - and remove the spaces resulting from the

line brakes. That works for me..

Comment from Samuel Gougeon -- August 19, 2013, 04:17:17 AM    
Hello,

When loading the toolbox, we could expect the related library being
socket_toolboxlib. Actually, it is loaded through the .start file (line#18) as
toolbox_skeletonlib = lib(pathmacros);

It should be changed into
socket_toolboxlib = lib(pathmacros);

Best regards
Samuel Gougeon
Comment from Aaron Archibald -- November 17, 2014, 08:50:47 PM    
Hello, 

this is really nice work, thanks for your efforts!

Im trying to use this to communicate with a TCP server hosted on an arduino, and 
networked through my home wifi.

I can successfully write data to the server from scilab, but I can only get data from 
the server into scilab if it was written by the arduino in a certain way. 

If I use a .write command in arduino and send data to the server 1 character at a 
time, I can read it into scilab with the SOCKET_read command. but if i use a .print 
command in arduino and send data to the server, the SOCKET_read command will return 
an empty array.

I can connect to the server at the same time using puTTY to Telnet connect to the 
server, and the arduino will write the data to all clients connected to the server. 

When I do this and use the .print command in arduino, the data will arrive correctly 
in the telnet PuTTY window, so I know the data is getting printed to the server in a 
readable way, it just seems like the SOCKET_read command doesn't know how to 
interpret it.

Does anyone have any clues on how to fix this??

thanks so much for any suggestions!
Comment from Tri Nam Tan Nhang -- November 23, 2016, 09:05:21 AM    
tks you su much
https://goo.gl/cvUpmj
Answer from Samuel Gougeon -- November 23, 2016, 09:21:15 AM    
> tks you su much https://goo.gl/cvUpmj
This link is a SPAM. Nothing about Scilab.
Comment from Samuel Gougeon -- November 23, 2016, 09:20:30 AM    
This comment has been deleted.
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.