change rate in patch module

40 views
Skip to first unread message

Antonin Blot

unread,
May 6, 2014, 10:09:31 AM5/6/14
to ac...@googlegroups.com
Hi all,

I'm really happy to see a open source acquisition software in python and I'm trying to test it with a multiclamp 700B and a NI-DAQ. Everything works fine in the task runner, but I have some problem configuring the patch module. I don't manage set the acquisition rate properly and I get NIDAQErrors. If I change the default rate in the source (L43 of PatchWindow.py) from 400000 to a more reasonable 50000, it fixes my problem. It also works fine if I start the Patch Module and then open the console to change the rate manually (man.getModule("Patch 1").ui.params["rate"] = 50000) but adding the option on the configuration file doesn't seem to work (I've copied my devices.cfg below). There is no warning or error but the rate is not changed. Should I move the option elsewhere?

Thanks!

Antonin


devices.cfg:

DAQ:
    driver: 'NiDAQ'
    mock: False
    # Default mode for AI channels. Options are NRSE', 'RSE', and 'DIFF'
    # This may be overridden for individual channels.
    defaultAIMode: 'diff'

Clamp1:
    driver: 'MultiClamp'
    channelID: 'model:MC700B,sn:00830289,chan:1'
    commandChannel:
        device: 'DAQ'
        channel: '/Dev1/ao0'
        type: 'ao'
    primaryChannel:
        device: 'DAQ'
        channel: '/Dev1/ai0'
        mode: 'diff'
        type: 'ai'
    secondaryChannel:
        device: 'DAQ'
        channel: '/Dev1/ai1'
        mode: 'diff'
        type: 'ai'
    vcHolding: -65e-3
    icHolding: 0.0
    rate: 50000 # LINE THAT APPEARS USELESS
    defaults:   # Default amplifier state. The amplifier will be
                # reconfigured with these options every time ACQ4 is
                # started.
        IC:
            HoldingEnable: False
            Holding: 0.0
            TestSignalEnable: False
            SlowCurrentInjEnable: False
            #NeutralizationEnable: True
            #OscKillerEnable: True
            PrimarySignalGain: 2
            PrimarySignalLPF: 20e3
            PrimarySignalHPF: 0
            OutputZeroEnable: False
            BridgeBalEnable: False
            BridgeBalResist: 15e6
        VC:
            HoldingEnable: False
            Holding: 0.0
            TestSignalEnable: False
            #NeutralizationEnable: False
            WholeCellCompEnable: False
            RsCompEnable: False
            OscKillerEnable: True
            PrimarySignalGain: 2
            PrimarySignalLPF: 20e3
            PrimarySignalHPF: 0
            OutputZeroEnable: False
            LeakSubEnable: False

Luke Campagnola

unread,
May 6, 2014, 3:12:14 PM5/6/14
to acq4
On Tue, May 6, 2014 at 10:09 AM, Antonin Blot <antoni...@gmail.com> wrote:
I'm really happy to see a open source acquisition software in python and I'm trying to test it with a multiclamp 700B and a NI-DAQ. Everything works fine in the task runner, but I have some problem configuring the patch module. I don't manage set the acquisition rate properly and I get NIDAQErrors. If I change the default rate in the source (L43 of PatchWindow.py) from 400000 to a more reasonable 50000, it fixes my problem. It also works fine if I start the Patch Module and then open the console to change the rate manually (man.getModule("Patch 1").ui.params["rate"] = 50000)

Hi Antonin!  There is currently no configuration setting for affecting the behavior of the Patch module, but this is a frequently requested item: https://github.com/acq4/acq4/issues/5. It would be a fairly straightforward change; I might have time to work on it this week (or if you'd like to try, I'm happy to review a PR). 

Please note also the 'downsample' parameter which is set to 10 by default. This reduces the effective sample rate from 400 to 40kHz and substantially reduces noise (however I agree that the default should be set more conservatively to support slower acquisition devices). You will probably want to set this value to 1 at the same time you change the sample rate.
 
but adding the option on the configuration file doesn't seem to work (I've copied my devices.cfg below). There is no warning or error but the rate is not changed. Should I move the option elsewhere?

Error checking on the configuration files is rather thin. I have just opened an issue for this: https://github.com/acq4/acq4/issues/14.
Note that, if the option were to be made available from the configuration files, the natural place for it would be the Patch module configuration, since any module may choose to operate the clamp at a different sample rate.


Luke

Marton Rozsa

unread,
Aug 16, 2019, 5:45:59 PM8/16/19
to ACQ4
Hi,
It would be a good feature. Is this implemented in acq4 already? I don't find it in my version.
(I am new to acq4 so pardon me if my question is trivial.)
Thanks,
Marton

On Tuesday, May 6, 2014 at 3:12:14 PM UTC-4, Luke Campagnola wrote:

Luke Campagnola

unread,
Aug 16, 2019, 5:55:54 PM8/16/19
to ACQ4
The patch module does accept `sampleRate` and `downsample` options in its configuration. For example, in default.cfg:

    Patch 1:
        module: 'Patch'
        shortcut: 'F3'
        config:
            clampDev: 'Clamp1'
            sampleRate: 20000
            downsample: 1

The `downsample` option here is used to average samples together to reduce noise; I find that sampling at the highest rate possible and then downsampling to the desired rate often yields cleaner recordings.


Cheers,
Luke


From: ac...@googlegroups.com <ac...@googlegroups.com> on behalf of Marton Rozsa <qty...@gmail.com>
Sent: Friday, August 16, 2019 2:45 PM
To: ACQ4 <ac...@googlegroups.com>
Subject: Re: [acq4] change rate in patch module
 
CAUTION: This email originated from outside the Allen Institute. Please do not click links or open attachments unless you've validated the sender and know the content is safe.

--
You received this message because you are subscribed to the Google Groups "ACQ4" group.
To unsubscribe from this group and stop receiving emails from it, send an email to acq4+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/acq4/d32c840e-909d-413f-a708-bcee06635cab%40googlegroups.com.

Marton Rozsa

unread,
Aug 16, 2019, 8:02:45 PM8/16/19
to ACQ4
Thanks!
I was trying the 'rate' parameter as was written in Antonin's script.
Best,
Marton
To unsubscribe from this group and stop receiving emails from it, send an email to ac...@googlegroups.com.

Marton Rozsa

unread,
Aug 19, 2019, 2:15:03 PM8/19/19
to ACQ4
Hi Luke,
I have a somewhat related question:
Can I also set the default values for "delay length", "pulse length", "cycle time" etc. and the value sets for the buttons "Bath" "Patch" and "Cell"? (in the patch module)
Maybe I am just missing it in the documentation?
Thanks,
Marton
(btw the software rocks!)
To unsubscribe from this group and stop receiving emails from it, send an email to ac...@googlegroups.com.

Luke Campagnola

unread,
Aug 19, 2019, 2:58:15 PM8/19/19
to ACQ4
No, but how's your Python? You can see where the sampleRate and downsample parameters get pulled from the config here:
It' would be pretty straightforward to fix that code to make _any_ of the parameters configurable.

The mode buttons are implemented here: 
This should likewise be simple to make configurable.

Sent: Monday, August 19, 2019 11:15 AM
To unsubscribe from this group and stop receiving emails from it, send an email to acq4+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/acq4/c761480c-806b-455c-aee9-f3f4b02be45f%40googlegroups.com.

Luke Campagnola

unread,
Aug 19, 2019, 3:01:34 PM8/19/19
to ACQ4
FYI: I haven't put much effort into the Patch module recently because I have been focusing on the MultiPatch module, which is much more advanced and incorporates a lot of new automatic patching functionality.. hoping to merge all of those changes in to the `develop` branch later this year.


Luke

From: Luke Campagnola <lu...@alleninstitute.org>
Sent: Monday, August 19, 2019 11:58 AM

Marton Rozsa

unread,
Aug 19, 2019, 5:13:51 PM8/19/19
to ACQ4
Thanks, I can do that for myself!
This patch module does everything I need right now. I am looking forward to the new functionality though.
Best,
Marton
Reply all
Reply to author
Forward
0 new messages