proc SendCommand {Server Port Command} { set chan [socket $Server $Port] fconfigure $chan -blocking 0 set var1 m puts -nonewline $chan $var1 flush $chan after 1000 set var2 $Command puts -nonewline $chan $var2 flush $chan after 200 set data [read -nonewline $chan] puts $data close $chan } ::SendCommand 10.100.102.140 5000 "MB0020?" ::SendCommand 10.100.102.140 5000 "MB0020,1"