[Scilab-users] Sockets in scilab 6.0
James Holland
j_holland at msn.com
Thu Jul 12 21:33:26 CEST 2018
The tcl script that I'm running is below. It always returns datareadyflag =
-1 even though it should stay in the loop until there is data to collect.
#declare variables
set outStr "*IDN?"
set dataReadyFlag 1
set tclDataReceived "noData"
#/----------------------------------------------------
#open a connection
set tclsocket1 [socket "192.168.1.72" 3000]
fconfigure $tclsocket1 -blocking 0 -translation binary
#/----------------------------------------------------
#send a command
puts $tclsocket1 $outStr
flush $tclsocket1
after 100
#/----------------------------------------------------
#get a response
while {dataReadyFlag>=0} {
set $dataReadyFlag [gets $tclsocket1 tclDataReceived]
puts "tclDataReceived $tclDataReceived"
}
#output to console
puts "dataReadyFlag $dataReadyFlag"
puts "done"
--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
More information about the users
mailing list