You have overwritten the standard run command, if you do not include the original commands that are in that function you end running only your self written code.
The original procedure is (nrn 5.8: stdrun.hoc)
Code: Select all
proc run() {
running_ = 1
stdinit()
continuerun(tstop)
}
Including this in your code gives:
Code: Select all
proc run(){
// Prepare data structures
objref data,fok
data=new Vector()
// Start recording
data.record(&soma.v(0.5))
// Start run
running_ = 1
stdinit()
continuerun(tstop)
// Export result to file
fok=new File()
fok.wopen("okan.dat")
data.printf(fok)
fok.close()
// Plot soma membrane potential to command window???
print soma.v(0.5)
}
But as Ted pointed out:
https://www.neuron.yale.edu/phpBB2/view ... initialize
the record statement should actually be moved out of this code. So if you are calling the code from a loop for setting parameters you might aswell rename your function to myRun and define the variable you will use for recording first by calling prepareMyRun(). Also you don't have to overwrite the standard run system to get this job done, therefore it is better if you don't:
Code: Select all
proc prepareMyRun(){
// Prepare data structures
objref data
data=new Vector()
// Start recording
data.record(&soma.v(0.5))
}
Code: Select all
proc myRun(){
objref fok
// Start run
run()
// Export result to file
fok=new File()
fok.wopen("okan.dat")
data.printf(fok)
fok.close()
// Plot soma membrane potential to command window???
print soma.v(0.5)
}
IF you still want to start these functions from the GUI just add:
Code: Select all
xpanel("myRunController")
xbutton("Prepare my simulation", "prepareMyRun()")
xbutton("Run my simulation", "myRun()")
xpanel()