When I compile the mod file everything runs OK, but once I start neuron I get the following error:
Code: Select all
in stdrun.hoc near line 522
realtime = startsw() - rtstart
^
xopen("stdgui.hoc")
execute1("{xopen("stdgui.hoc")}")
load_file("stdgui.hoc")
What am I missing ?
The clue is in the error message that came earlier:
Code: Select all
syntax error
in stdrun.hoc near line 521
step()
^
xopen("stdrun.hoc")
Giving your mechanism the name "step" causes a problem when stdrun.hoc is loaded.
"But I didn't load stdrun.hoc."
stdrun.hoc is one of the files that NEURON loads automatically if you start NEURON by executing
nrngui
or if your program contains one of these statements:
load_file("nrngui.hoc")
load_file("noload.hoc")
load_file("stdgui.hoc")
stdrun.hoc defines many important variables, procedures, and functions that are part of NEURON's standard run system. One of those procedures is called step. Maybe that's why the error occurred.
The problem will vanish if you simply change
SUFFIX step
to
SUFFIX mystep
or, better,
SUFFIX pulse
pulse is also a better name than step for your mechanism because "step" implies a single transition, but your mechanism specifies two transitions--the first from off to on, and the second from on to off.
Other comments and suggestions:
There are lots of ways to change a parameter during a simulation, but which is easiest or "best" depends on whether you want a density mechanism (something that would affect many compartments) or a point process (something that affects only one compartment). A second but possibly important issue is that it would be good for the mechanism to be compatible with variable time steps. Anything that relies on testing t in the BREAKPOINT block will not work reliably with variable time steps; events would be better.
Am I correct to assume that you are trying to change the concentration of something? If the answer is yes, I should inform you that no other mechanism will "see" the concentration change. There is a proper way to implement concentration changes, but due to limited time I won't get into that unless it is really relevant to what you are trying to do.