[Scilab-users] Sockets in scilab 6.0

James Holland j_holland at msn.com
Thu Jun 21 22:23:16 CEST 2018


This is my code:

// Exemple avec Socket
SOCKET_open(1,"192.168.1.72",3000);
SOCKET_write(1,["*IDN?"]);
SOCKET_read(1)
SOCKET_close(1);

I've modified the write routine from this:


function SOCKET_write(id,commande)
	TCL_EvalStr([	"puts $tclsocket"+string(id)+" """+commande+ascii(10)+"""";
			"flush $tclsocket"+string(id)]);
endfunction

to this:

function SOCKET_write(id,commande)
TCL_EvalStr([	"puts $tclsocket"+string(id)+"" ""+commande+"";
					"flush $tclsocket"+string(id)]);

endfunction

That has already removed some spurious LF/CRs.  
Putty also works OK and doesn't add the CR/LF at the end.



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html



More information about the users mailing list