question about hocmech()
Posted: Wed May 08, 2013 8:08 pm
Hi, I was trying to use the hocmech() to add new mechanisms in hoc file, following the instruction on the documentation page( http://www.neuron.yale.edu/neuron/stati ... t=makemech)
I simply loaded the example code using nrngui.
The interpreter reported error:
makemech undefined function in hocmech_test.hoc near line 25
Then I noted that even the example code is for hocmech(), the function isn't used in the code. So I changed the makemech to hocmech. Still the interpreter showed error:
makemech undefined function in hocmech_test.hoc near line 25
I tried locate hocmech in the terminal, and the return showed
/home/ximing/neuron/nrn/src/nrniv/hocmech.cpp
/home/ximing/neuron/nrn/src/nrniv/hocmech.lo
/home/ximing/neuron/nrn/src/nrniv/.deps/hocmech.Plo
/home/ximing/neuron/nrn/src/nrniv/.libs/hocmech.o
So the source code of hocmech() is there, but somehow the hoc interpreter doesn't know it. The operating system of my computer is Debian. I installed neuron7.3 using nrn-7.3.i686.deb. After installing, I added the neuron path to PYTHONPATH so the neuron module works in python.
My question is how to call hocmech() in nrngui? Also are there other ways to use the mechanism in the template? Thanks!
I simply loaded the example code using nrngui.
Code: Select all
load_file("noload.hoc")
create soma
access soma
{ L = diam = sqrt(100/PI) insert hh}
objref stim
stim = new IClamp(.5)
{stim.dur = .1 stim.amp = .3 }
begintemplate Max
public V
proc initial() {
V = v($1)
}
proc after_step() {
if (V < v($1)) {
V = v($1)
}
}
endtemplate Max
makemech("max", "Max")
insert max
run()
print "V_max=", soma.V_max(.5)
makemech undefined function in hocmech_test.hoc near line 25
Then I noted that even the example code is for hocmech(), the function isn't used in the code. So I changed the makemech to hocmech. Still the interpreter showed error:
makemech undefined function in hocmech_test.hoc near line 25
I tried locate hocmech in the terminal, and the return showed
/home/ximing/neuron/nrn/src/nrniv/hocmech.cpp
/home/ximing/neuron/nrn/src/nrniv/hocmech.lo
/home/ximing/neuron/nrn/src/nrniv/.deps/hocmech.Plo
/home/ximing/neuron/nrn/src/nrniv/.libs/hocmech.o
So the source code of hocmech() is there, but somehow the hoc interpreter doesn't know it. The operating system of my computer is Debian. I installed neuron7.3 using nrn-7.3.i686.deb. After installing, I added the neuron path to PYTHONPATH so the neuron module works in python.
My question is how to call hocmech() in nrngui? Also are there other ways to use the mechanism in the template? Thanks!