Created
December 14, 2012 21:45
-
-
Save CodingMinds/4288921 to your computer and use it in GitHub Desktop.
modified scilab socket library functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prot=funcprot() | |
funcprot(0) | |
function mat=SOCKET_read(id) | |
mat=[]; | |
cmd=["set tclsocketlong 0;"; | |
"set response 0;"; | |
"while {$tclsocketlong >= 0 || $response != 1} {"; | |
"set tclsocketlong [gets $tclsocket"+string(id)+" tclsocketline];"; | |
"if {$tclsocketlong >= 0} {"; | |
"flush $tclsocket"+string(id)+";"; | |
"set response 1;"; | |
"ScilabEval ""mat=\[\""[string map {\"" \""\"" \'' \''\''} $tclsocketline]\"";mat\];"""; | |
"}"; | |
"}"]; | |
TCL_EvalStr(strcat(cmd," ")); | |
endfunction | |
function mat=SOCKET_query(id,commande) | |
SOCKET_write(id,commande); | |
mat=SOCKET_read(id); | |
endfunction | |
funcprot(prot) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment