#!/bin/sh #\ exec /site/coda/2.6.2/Linux/bin/wish4.0 -f "$0" ${1+"$@"} # exec /usr/bin/wish -f "$0" ${1+"$@"} # # Remote init of Highland v851 VME Pulser # # functions: # v851Init(unsigned long addr, int id) # addr - A16 board switch address (0x0 - 0xffff) # id - number of v851 in a crate # # # SP, 26-Apr-2013 set inp_str [split $argv " "] set inp_N [llength $inp_str] set roc -1 #*** Check input parameters *** set flag 0 if { $inp_N != 1 } { set flag 1 } else { set roc [string tolower [lindex $inp_str 0]] } #puts "\n flag=$flag; \n inp_N=$inp_N; \n roc=$roc; \n " #*** Print help message *** if { $flag != 0 } { puts "\n Usage: v851_init roc" puts " --------------" puts " Where \"roc\" - name of VME crate \n" exit } #*** Execute function *** set exename "v851Init(0xd000,0)" set result " error: Can't get result for $exename \n" catch {set result [exec tcpClient $roc $exename]} puts "\n$result" exit