Cannot run example file vecevent.hoc

The basics of how to develop, test, and use models.
Post Reply
ps0322

Cannot run example file vecevent.hoc

Post by ps0322 »

I'm learning how to compile and use mod file. After I read the post Driving a synapse with recorded or precomputed spike events , I try the example for VecStim at nrn/examples/nrniv/netcon . When I try to run vecevent.hoc the screen show error as in the following image.
Image
I wonder what is the problem in this case? Is it a bug in the program? And how could I solve it? (I'm now using 32 bit version of Neuron 7.3 on 64bit Windows 7)

Actually, I was trying to use Ipulse3.mod that was provided in Faq page. After I extract the pulsedistrib.zip, check unit, run the mknrndll, and then I can run the test_3.hoc file successfully.(Because of this I think the previous problem with vecevent.hoc might be because the hoc file was obsolete for the NEURON version that I'm using)
In the test_3.hoc file, you use point process manager to make new mechanism in ses file and then call it in the test3.hoc again. I wonder is it possible to add the new mechanism to the hoc code directly without using GUI?
< My guess was that if I compiled the mod file I made and put all corresponding files in the same folder with hoc file, then I can just call, for example, ipls = new Ipulse3(0.5). But it seem to be wrong. >

Thank you in advance!
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Cannot run example file vecevent.hoc

Post by ted »

I wonder what is the problem in this case?
There is nothing wrong with vecevent.hoc, vecevent.mod, or vecevent.ses. The problem is that you hadn't compiled vecevent.mod before you tried to execute hoc code that referenced the mechanism defined in vecevent.mod. How do I know this? If vecevent.mod had been compiled with mknrndll, NEURON's banner would have been followed by a message of the form

Code: Select all

Additional mechanisms from files
 vecevent.mod
Forgetting to compile mod files is a common mistake, so it's good to know how to recognize the symptoms--and there's no better way to learn than by making the mistake yourself (ask me how I know . . . )
is it possible to add the new mechanism to the hoc code directly without using GUI?
In NEURON, "point processes" are implemented as classes, and any individual point process is an instance of a particular class. To create a new instance of a class, first create a new variable name that is declared to be an objref, then associate that objref with an instance of a class. Example:

Code: Select all

objref foo
foo = new Graph()
To learn more, read chapter 13 in The NEURON Book, or if you don't have the book, read this prepublication draft of chapter 13:https://www.neuron.yale.edu/ftp/ted/boo ... xedref.pdf
ps0322

Re: Cannot run example file vecevent.hoc

Post by ps0322 »

Thank you so much for your answer, I am able to run the file now.
In NEURON, "point processes" are implemented as classes, and any individual point process is an instance of a particular class. To create a new instance of a class, first create a new variable name that is declared to be an objref, then associate that objref with an instance of a class.
Thank you. As I mentioned that, I've tried "ipls = new Ipulse3(0.5)" but it was not working. I just found that the problem is on my machine. After I restart my PC, the code works normally.

Next thing I would like to ask for your advice is I want to injected fluctuated current with noise to a cell ( the Ipulse3 varies the event time with fixed current amplitude).
Would you please suggest me how could I do that? My idea is make the vector of fluctuation current and add some noise. For the noise, I'll have to varies the seed also.

I quote NET_RECEIVE block of Ipulse3.mod here.

Code: Select all

NET_RECEIVE (w) {
  if (flag == 0) { : not a self event
    if (on == 0) {
      : turn it on
      ival = amp     //the amp will change to vector not scalar
      on = 1
      : prepare to turn it off
      net_send(dur, 1)
    }
  } else { : a self event
    : turn it off
    ival = 0
    on = 0
  }
}
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Cannot run example file vecevent.hoc

Post by ted »

ps0322 wrote:I want to injected fluctuated current with noise to a cell
This new question should really start a completely new discussion thread. I have posted it in the Forum's "Other questions" area at this location
viewtopic.php?f=8&t=2986
which is where you will find my answer.
Post Reply