Handling long traces

  • Infinite recording

It is allowable to set the Trace Length to Inf (Matlab's term for Infinity). This effectively converts Ephys/Acquirer into an oscilloscope. The main issue to be aware of is data storage. If the XSG is set to auto-save, all the data will be buffered, leading to a crash in a relatively short amount of time. Logging to disk will allow running in this configuration for a long period, but it is still possible to fill up the disk.

  • Direct disk logging

To save data directly to disk during acquisition, check the 'Stream to Disk' option in the xsg. There will be one file for EACH acquisition channel (extension: *.xsglog).

The header information is saved twice, in two separate files - one at the start of the acquisition (using a *.xsghdr file) and one at the end (using a *.xsg file).

Use the 'Zip' option in the xsg to wrap all the files into a single compressed file. Files may even be compressed even without using the Stream to Disk option.

  • Update Rate Option

Normally traces are displayed only after they are fully acquired and saved. For long acquisitions, especially those lasting many seconds or minutes, it is preferable to see the data appear during acquisition. Set the Update Rate option in the ephys and acquirer guis. The update frequency will be applied to all channels. This rate also applies to the timing of calls for userFcns and disk logging events.

  • Display Width

Typically, the width of the scope displays is fixed and chosen to match the Trace Length. It is now possible to set this value, which can result in a variety of behaviors, including the scrolling of traces across the screen as new data becomes available.

Scope Presets

The presets (buttons) on the ephysScopeAccessory gui, used for quickly changing the holding voltage/current, are programmable from the command line. The programmed values will be saved into configurations (ultimately making them programmable via HotSwitch).

ephysAcc_setPresets([-5, 25], [100, 250])

Sample Rate

The various programs each maintain their own sampleRate, all defaulted to 10000 Hz. This value may be changed from the command line. The user must be aware that all channels on the same board MUST be set to the same sample rate when used simultaneously.

setGlobal(progmanager, 'sampleRate', 'ephys', 'ephys', 20000);
setGlobal(progmanager, 'sampleRate', 'stimulator', 'stimulator', 20000);
setGlobal(progmanager, 'sampleRate', 'acquirer', 'acquirer', 20000);
setGlobal(progmanager, 'sampleRate', 'mapper', 'mapper', 20000);

External Triggering

The simplest way to trigger externally is to disconnect the cable that feeds the trigger signal (specified by 'triggerOrigin' in the initialization file) to the trigger destination ('triggerDestinations', e.g. PFI0) and instead connect an external trigger source to the trigger destination. Hitting the 'Start' buttons on the various programs (or 'Map' button on the mapper, etc.) will launch the acquisition and/or stimulation, which will then be suspended until the trigger signal arrives.

Another way that avoids connecting/reconnecting any cables is to specify a second 'triggerDestination' (e.g. PFI1). This can then be selected in the drop-down menu under the 'External' buttons in Ephys/Acquirer/Stimulator. Selecting a different trigger destination on one program automatically switches the other programs to the same selection, because only a single trigger source can be used. NOTE: Currently the mapper requires that PFI0 is the trigger destination.

  • No labels