hi,i m trying to simulate wsn. in my tcl script i've written a procedure for
the creation of sensor node. the procedure contains no arguments , so i simply
call the procedure by its name but when i run the simulation it gives the error
invalid command name. i have read that procedures can be created without an
argument and also the same method is used for the sample scripts available from
mannasim . please guide how to resolve this issue.regards,najma ismat
#=================#error#=================najmaismat@ubuntu:~/ns-allinone-2.29/ns-2.29$
ns hi.tclnum_nodes is set 5invalid command name "create_common_node" while
executing"create_common_node " (file "hi.tcl" line 50)
# ======================================================================# Main
Program (Part of the script)#
======================================================================##
Initialize Global Variables#set ns_ [new Simulator]set tracefile [open hi.tr
w]$ns_ use-newtrace$ns_ trace-all $tracefile
# set up topography objectset topo [new Topography]$topo load_flatgrid $val(x)
$val(y)## Create God#create-god $val(nn)set rng [new RNG] $rng
seed [clock seconds]set chan [new $val(chan)]
#common sensor node procedure callcreate_common_node
## procedure common sensor node
proc create_common_node {} { global val ns_ node_ topo udp_ app_ gen_
contador_nodos rng
$ns_ node-config -sensorNode ON \-adhocRouting $val(rp) \-llType $val(ll)
\-macType $val(mac) \-ifqType $val(ifq) \-ifqLen $val(ifqlen) \-antType
$val(ant) \-propType $val(prop) \-phyType $val(netif) \-topoInstance $topo
\-agentTrace ON \-routerTrace ON \-macTrace ON \-movementTrace ON \-channel
$chan \-energyModel $val(en) \-initialEnergy 10.0\-rxPower 0.024 \-txPower
0.036 \