Correct directory path under MSWindows

Post Reply
antonioutb
Posts: 2
Joined: Sun Mar 30, 2014 8:18 pm

Correct directory path under MSWindows

Post by antonioutb »

Dear Dr. Carnevale and Dr. Hines,
I download the zip file for this model: https://senselab.med.yale.edu/ModelDb/S ... del=125857

I have been able to create the dll with the “mknrndll” tool, and to run the “mosinit.hoc” by loading it with the “File-->load hoc” Neuron main menu option. I have a problem when I try to select any option from the xpanel. I get the following error message:

Image

This is the code for the mosinit.hoc:

Code: Select all

load_file("nrngui.hoc")

objref nil, tobj
strdef tstr

xpanel("Lee, J 2007 Fast Rhythmic Bursting cells... Penn McNair Research Journal")
  xlabel("Choose a cell")
  xradiobutton("2FRB","restart(\"2FRB\")")
  xradiobutton("FRB3","restart(\"FRB3\")")
  xradiobutton("FRB_12_19","restart(\"FRB_12_19\")")
  xradiobutton("FRB_12_21","restart(\"FRB_12_21\")")
xpanel(5,100)

pwmcnt = PWManager[0].count // the initial gui should not be dismissed

proc restart() {local i
	objref graphItem, save_window_
	for i=0, n_graph_lists-1 {
		graphList[i].remove_all()
	}
	flush_list.remove_all()
	fast_flush_list.remove_all()
	doNotify()

	for (i= PWManager[0].count-1; i >= pwmcnt; i -= 1) {
		PWManager[0].close(i)
		doNotify()
	}
	stoprun = 0
	cvode_active(1)
//	dt = .025
//	steps_per_ms = 40
//    remove all sections
	forall delete_section()
	sprint(tstr, "%s.hoc", $s1)
	load_file(1, tstr)
}
I think that it might be a problem in the path directory. However I have not figured how to declare the right directory path in the mosinit.hoc code. This is the actual directory where I have extracted all the files for the model mentioned above: C:\nrn73w64\FRB. I am using NEURON 7.3 for Windows (7 Ultimate,64 bits).

Thanks for your help and time.

Antonio
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Correct directory path under MSWindows

Post by ted »

antonioutb wrote:I have been able to create the dll with the “mknrndll” tool, and to run the “mosinit.hoc” by loading it with the “File-->load hoc” Neuron main menu option.
The problem occurs because your chosen method for launching the model fails to set the current working directory properly. It will not occur if you just double click on the mosinit.hoc file. BTW, each of the entries in ModelDB comes with a readme file that provides instructions for running it. For most NEURON models the process is mercifully straightforward: use mknrndll to compile the mod files, then double click on a mosinit.hoc file. For some models, however, code is organized in elaborate directory structures that can complicate the process. In those instances, the readme file can be a real lifesaver.
antonioutb
Posts: 2
Joined: Sun Mar 30, 2014 8:18 pm

Re: Correct directory path under MSWindows

Post by antonioutb »

Dear Dr. Carnevale,

Thanks for your immediate help. Your instructions worked.

Antonio
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Correct directory path under MSWindows

Post by ted »

Actually the instructions bundled with the model's source code worked.

Double clicking on a hoc file in Windows Explorer (MSWin's file and directory manager) is usually the most convenient way to launch NEURON, specify the working directory, and execute the contents of the hoc file. There are two alternative approaches that you could have used.
1. You could have started nrngui, then
NEURON Main Menu / Files / working dir
which would bring up a file browser that you could have used to change the working directory to the one that contained mosinit.hoc. After that, File / load hoc would have worked without complaint.
2. Assuming that you started mknrndll by double clicking on its icon, then used its file browser to navigate to the directory that contained the mod files, you could subsequently have used
NEURON Main Menu / File / recent dir
at which point you could select from a list of paths, one of which would take you right back to the directory that contained the mod files. If mosinit.hoc was in the same directory, File / load hoc, select mosinit.hoc, and you're off and running.
Post Reply