Hey Everyone!
Thanks for taking the time to try and help me out. I am new to NEURON and so this question is probably really simple to answer.
I have recently added a procedure to a mod file which I placed below
PROCEDURE block_pna(A) {
LOCAL block_fraction
block_fraction = A
gnabar = block_fraction * 2.0e-5
: gnabar = $1 * 2.0e-5
}
The mod file is inserted into a hoc file and I want to be able to call the procedure from the mod file using the terminal prompt. However, every time I try I get error messages. I am fairly certain I need to follow a format like
soma.mod.file name. procedure_name(value)
but I have been hitting dead ends. Again I am sure this is a very easy fix, and so I appreciate anything you can offer in way of advice or example.
Calling procedure from mod.file using terminal prompt
-
- Site Admin
- Posts: 6394
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Calling procedure from mod.file using terminal prompt
Insufficient information to answer your question. Please provide the contents of the mechanism's NEURON block. Also provide an example of exactly how you are trying to call the procedure from hoc, including the actual error message. Use the mouse cursor to select and copy, from NEURON's terminal, what you entered at the oc> prompt and what hoc said in reply, and paste it into your next post in this discussion thread.arp93 wrote:every time I try I get error messages
Re: Calling procedure from mod.file using terminal prompt
Thanks here is a copy of the NEURON Block and error messages
And here a copy of the error messages I get when I try to call the procedure (my format may be incorrect, but that is why I posted the question unfortunately)
Once again the procedure I am trying to call is
Thank you again!
Code: Select all
NEURON {
SUFFIX GrC_pNa
USEION na READ ena WRITE ina
RANGE gnabar, ina, g, alpha_m, beta_m
RANGE Aalpha_m, Kalpha_m, V0alpha_m
RANGE Abeta_m, Kbeta_m, V0beta_m
RANGE V0_minf, B_minf
RANGE m_inf, tau_m
}
And here a copy of the error messages I get when I try to call the procedure (my format may be incorrect, but that is why I posted the question unfortunately)
Code: Select all
oc>block_pna(.5)
nrniv: block_pna undefined function
near line 24
block_pna(.5)
^
block_pna(0.5 )
oc>proc block_pna(.5)
nrniv: syntax error
near line 26
proc block_pna(.5)
^
oc>soma.pNa.block_pna(.5)
nrniv: pNa not a section variable
near line 27
soma.pNa.block_pna(.5)
^
Code: Select all
PROCEDURE block_pna(A) {
LOCAL block_fraction
block_fraction = A
gnabar = block_fraction * 2.0e-5
: gnabar = $1 * 2.0e-5
}
-
- Site Admin
- Posts: 6394
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Calling procedure from mod.file using terminal prompt
According to the NEURON block, this is a density mechanism with SUFFIX GrC_pNa. So every name in this mechanism that is visible to hoc will include the suffix _GrC_pNa. This means that PROCEDURE block_pna will be known to hoc as block_pna_GrC_pNa.
The NMODL code for this procedure iswhich reveals that the procedure references a range variable--gnabar. This means it is necessary to use setdata to specify the mechanism instance before calling the procedure from hoc (see p. 126 in The NEURON Book, and also the documentation of setdata in the Programmer's Reference)
Let me know if that takes care of it--which means "be sure to check that this does indeed work as expected" (in case I mistyped something).
The NMODL code for this procedure is
Code: Select all
PROCEDURE block_pna(A) {
LOCAL block_fraction
block_fraction = A
gnabar = block_fraction * 2.0e-5
: gnabar = $1 * 2.0e-5
}
Code: Select all
soma setdata_GrC_pNa(0.5) // specify mechanism instance
block_pna_GrC_pNa(0.3) // changes soma.gnabar_GrC_pNa(0.5) to 0.3*2.0e-5
Re: Calling procedure from mod.file using terminal prompt
Thank you! Your advice and suggestions worked perfectly!