I have a compartmental cell and a linear mechanism testLC.hoc generated from the LC-builder (for testing purposes consisting of a voltage source (B2), resistor (R1) and cell node (N2) in series). All seems to work fine:
Code: Select all
from neuron import *; from nrn import *; from neuron import gui
cell = generatecell()
xopen('testLC.hoc') # load the linear mechanism, named LM
stim = h.LM() # create an instance
stim.N2_loc(.5, cell.soma) # attach the soma to the resistor
stim.install() # insert the mechanism in the simulation
stim.R1 = 100 # change the resistor value
stim.refill() # update the mechanism
stim.E_B2 = -20 # change the voltage of the source
h.run() # run the simulation
However, I would now like to play a variable waveform in this voltage. For a SEClamp, I would use:
Code: Select all
MyWave.play(myclamp._ref_amp,tstim,1,sec=cell.soma
Now for my linear mechanism, playing into stim.E_B2 does not seem to have any effect. Neither does playing into stim._b.x[3] to which E_B2 refers. Mimicking the code for the SEClamp by playing into stim._ref_E_B2 throws an error: "Hoc pointer error, E_B2 is not a hoc variable or range variable".
Thanks in advance for your help, it is much appreciated.
(I use NEURON 7.3 on a MAC with python 2.7.8)