Quick Setpointer syntax question

The basics of how to develop, test, and use models.
Post Reply
JamesKyeh
Posts: 7
Joined: Mon Jan 11, 2016 2:38 pm

Quick Setpointer syntax question

Post by JamesKyeh »

Hello,

I've been trying to get a pointer from one of my point processes (ostim) to communicate with a custom channel (chanrhod) but seem to be having syntax problems. I create a new object named "stim" which is an ostim object and can use that with the setpointer command without problems. However, whenever I try doing something such as:

setpointer stim.irradiance, chanrhod.source_irradiance

I get a syntax error pointed at chanrhod. I'm assuming there is a fundamental issue with how channel mechanisms need to interact in the setpointer command that I am unaware of and can't seem to figure it out. Do I need to do something similar as what is done with point processes and somehow assign it to an object first?

Thanks in advance for any clarification!
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Quick Setpointer syntax question

Post by ted »

I always have to remind myself of the correct syntax for referencing GLOBALs. For density mechanisms, you can always discover it for yourself by clicking on
NEURON Main Menu / Tools / Distributed Mechanisms / Viewers / Mechanisms (Globals)
and then selecting the suffix of the density mechanism.

Q: "What makes it easier to remember that long menu path, than to just memorize the proper syntax in the first place?"
A: Any idiot can descend a menu because a menu provides its own prompts. All one has to remember is where to find the menu.

Anyway, the names you need are of the form
varname_suffix
with no dots and no brackets or parentheses or range values.
I just made a toy model with a single compartment that has pas and chanrhod, to which I attached an instance of the ostim class that I called ost. Here's how I connected ost's POINTERs to chanrhod's GLOBALs

Code: Select all

setpointer ost.irradiance, source_irradiance_chanrhod
setpointer ost.flux, source_flux_chanrhod
setpointer ost.photons, source_photons_chanrhod
ostim is nice, but it does have a couple of warts: POINTERs called tstimon and tstimoff. IMO they don't do anything useful, but you have to link them to something or your program won't run. Here's what I did

Code: Select all

tstimon = 0 // these two must exist before they can be referenced
tstimoff = 0 // although it is not at all clear what value they add
             // other than perhaps being "clean-looking" symbolic names
setpointer ost.tstimon, tstimon
setpointer ost.tstimoff, tstimoff
JamesKyeh
Posts: 7
Joined: Mon Jan 11, 2016 2:38 pm

Re: Quick Setpointer syntax question

Post by JamesKyeh »

Ah thank you for the help! This completely answers my question and more.
Post Reply