HOC file undefines section?

Anything that doesn't fit elsewhere.
Post Reply
hallockk
Posts: 43
Joined: Fri Jul 23, 2010 9:02 am

HOC file undefines section?

Post by hallockk »

I am using a HOC file to modify an axon model with many sections, one of which is named "lead". I load up the DLL and the SES file using NEURON's File menu, and the load the HOC file using the xopen command line function. The SES, DLL, and HOC files all run fine, but if I save the SES file after running my HOC file, I receive an error and the file won't load.

Here is the error I'm getting:

nrniv: undefined variable lead
in Wholecell110329e.ses near line 26035
}
^
xopen("Wholecell110329e.ses" )
NEURONMainMenu[0].execute1("{xopen("Wholecell110329e.ses")}" )
NEURONMainMenu[0].load_file(1"./Wholecell110329e.ses" , )
NEURONMainMenu[0].load("*.ses"1 , )

But I don't modify the lead section in the HOC file so I don't know where to begin debugging. Any suggestions would be appreciated.
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: HOC file undefines section?

Post by ted »

Code: Select all

nrniv: undefined variable lead
 in Wholecell110329e.ses near line 26035
 }
  ^
xopen("Wholecell110329e.ses"        )
This means that Wholecell110329e.ses contains some hoc statement that refers to a non-existent thing called lead.
hallockk
Posts: 43
Joined: Fri Jul 23, 2010 9:02 am

Re: HOC file undefines section?

Post by hallockk »

I don't know why running a separate HOC file, and then saving the file, would prevent me from reopening the file. I thought that running a HOC file wouldn't permanently alter the SES file. The sequence of events I'm wondering about are:

Open SES file
Save SES file
Close SES file
Restart NEURON
Open SES file using File menu (no error)

vs.

Open SES file
Run HOC code via xopen line command
Save SES file
Close SES file
Restart NEURON
Open SES file using File menu (generates error posted above; file doesn't open)

I don't understand how running the HOC file might alter the SES file and create the error.

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

Re: HOC file undefines section?

Post by ted »

In order to answer the implied question, I must first be able to reproduce the symptom. If you want me to take a shot at this, please zip up and send just enough stuff for me to be able to reproduce the symptom. That means just the hoc and ses files, and any dat or txt files that your program might read. Do not send .o, .c, .dll, or .bak files. My email address is ted dot carnevale at yale dot edu
hallockk
Posts: 43
Joined: Fri Jul 23, 2010 9:02 am

Re: HOC file undefines section?

Post by hallockk »

I've identified the line of code in the HOC file that is the culprit:

CellBuild[0].continuous = 0

I confirmed this by turning off Continuous Create using the GUI (and without running a HOC file) and save the file with it remaining off. I get the same error when I try to load modified file using the File menu.

I hope to spend time troubleshooting more today and I'll post again when I learn something new.

Thanks.
hallockk
Posts: 43
Joined: Fri Jul 23, 2010 9:02 am

Re: HOC file undefines section?

Post by hallockk »

I haven't figured out the source of the problem, but if I turn on Continuous Create before saving the file I can reopen the file without the posted error. This at least provides me a workaround.
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: HOC file undefines section?

Post by ted »

hallockk wrote:I haven't figured out the source of the problem, but if I turn on Continuous Create before saving the file I can reopen the file without the posted error.
Actually this is the source of the problem. If a CellBuilder is saved to a ses file with Continuous Create off, then when you read that ses file in the future the CellBuilder will be recreated, but it will not create any sections.
hallockk
Posts: 43
Joined: Fri Jul 23, 2010 9:02 am

Re: HOC file undefines section?

Post by hallockk »

ted wrote:Actually this is the source of the problem. If a CellBuilder is saved to a ses file with Continuous Create off, then when you read that ses file in the future the CellBuilder will be recreated, but it will not create any sections.
Thanks! Now back to modeling.
Post Reply