02.03.2014 Views

Tornado

Tornado

Tornado

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C<br />

<strong>Tornado</strong> Tools Reference<br />

Blocks are coded for the endianness of the target that supplied them, and the<br />

memBlockSet and memBlockGet routines automatically swap 16- and 32-bit quantities<br />

when they are stored to or retrieved from a block.<br />

USING A SCRIPT FILE<br />

C<br />

Specifying a file in the wtxtcl command line makes wtxtcl use this file as script file.<br />

wtxtcl then executes all specified procedures from the script file. This does not act like a<br />

sourced file in that wtxtcl exits after having executed the script file.<br />

Example<br />

First write the myWtxTcl.tcl script<br />

# myWtxTcl.tcl - user defined WTX / Tcl script file<br />

#<br />

# modification history<br />

# --------------------<br />

# 01a,02jun98,fle written<br />

#*/<br />

#<br />

# DESCRIPTION<br />

# This tcl script file contains user-defined WTX-Tcl procedures<br />

#<br />

########################################################################<br />

#<br />

# cpuNumGet - gets the CPU number of the specified tgtSvr<br />

#<br />

# SYNOPSIS<br />

# cpuNumGet tgtSvr<br />

#<br />

# PARAMETERS<br />

# tgtSvr : the target server to get CPU number from<br />

#<br />

# RETURNS: The CPU number or -1 on error<br />

#<br />

# ERRORS: N/A<br />

#<br />

proc cpuNumGet { tgtSvr } {<br />

set cpuNum -1<br />

if { [catch "wtxToolAttach $tgtSvr" tgtSvrName] } {<br />

return $cpuNum<br />

}<br />

if { [catch "wtxTsInfoGet" tsInfo] } {<br />

return $cpuNum<br />

}<br />

wtxToolDetach<br />

433

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!