Using the HDCV Data Acquisition Program

advertisement
Using the HDCV Data Acquisition
Program
This manual describes HDCV.exe, the data acquisition portion of the HDCV
(High Definition Cyclic Voltammetry) program suite from the University of North
Carolina at Chapel Hill.
Contents
Hardware………………………………………………………
Time and Terminology………………………………………..
The Main Screen………………………………………………
Basic Control Buttons………………………………….
Experimental Control…………………………………..
The Graph Area………………………………………...
Little Analysis …………………………………………..
Setup Hardware……………………………………………….
Hardware Resources…………………………………..
Setup Experiment……………………………………………..
CV Ramp………………………………………………..
CV Ramp Advanced……………………………………
STIM……………………………………………………..
Analog Inputs…………………………………………...
EPhys……………………………………………………
Digital Outputs………………………………………….
Digital Inputs…………………………………………….
Analog Background Subtraction………………………
Compatibility…………………………………………….
pg. 1
pg. 1-2
pg. 2-8
pg. 2
pg. 3-5
pg. 5-8
pg. 8
pg. 9-11
pg. 10-11
pg. 12-20
pg. 12
pg. 13-14
pg. 14-15
pg. 15
pg. 15
pg. 16
pg. 16
pg. 17-19
pg. 20
Hardware
HDCV Data Collection is programmed to interface with the PCIe-6363 - X Series
data acquisition card sold by National Instruments (visit http://www.ni.com/ for
more information). This single card handles all digital and analog I/O’s necessary
for a wide range of experimental paradigms. Four analog outputs and 16 analog
inputs support multi-electrode recordings and electrical stimulations. Forty DIO
connections are available on the current breakout box design. This allows control
over events such as an iontophoresis ejection or a flow cell injection. It also
provides the ability to read timestamps during behavioral experimentation.
Note that while HDCV will control the timing of combined
electrophysiology/electrochemistry experiments, it will not record the
electrophysiology signal. A separate computer and card are necessary for these
experiments (See Takmakov et al. Rev Sci Instrum. 2011 July; 82(7): 074302).
Breakout boxes for the PCIe-6363 are available for purchase by the Electronics
Facility at the University of North Carolina – Chapel Hill. If you wish to build
your own box, wiring schematics are available by request.
Time and Terminology
The smallest unit of time in HDCV is the sample time. This is the interval at which
each data point in the waveform is generated and measured, typically on the
order of 10 microseconds. All other times used in HDCV are multiples of this
one. Its inverse, the sampling rate, is a commonly quoted figure.
Next is the interval at which the HDCV ramp is output. This is the frame time,
typically 100 milliseconds. The time from the beginning of one ramp to the
beginning of the next is one frame. Its inverse, the cyclic voltammetry frequency or
CVF, is also commonly mentioned.
The cyclic voltammetry scan only occupies a subset of the frame time. This is the
scan, and its duration is the scan time. In the case that multiple different
waveforms are being output on different channels, the frame begins when the
first waveform begins, and the scan time runs until the last waveform ends. The
remainder of the frame is the rest time.
A common type of CV experiment consists of a series of timed events in which
some stimulus is given and CV data are recorded for an interval before and after
1
that time. Each such event, with the recording of data, is one run. The entire
series of runs, the largest unit of operation that HDCV will automatically control,
is the experiment. There are also experiments that are run in continuous mode,
where data is collected continuously throughout, and not broken up into runs.
1. The Main Screen
The Main screen is divided into three major sections. The upper left region
displays one of several graphs showing input data, regardless of whether a data
collection session is in progress. The upper right region is where the user sets up
and controls data collection experiments. The lower half of the screen, known as
"Little Analysis," provides a preview of data recently collected. As the name
implies, it is the little brother to HDCV Analysis, and provides a subset of its
features.
A few buttons at the upper left of the screen provides some basic controls.
Basic Control Buttons
Set up Hardware opens a configuration screen for dealing with the hardware.
Here you tell the system what input and output channels you will be using, and
for what purposes. Digital input and output lines are also configured here. If you
move your experiment to a new machine, expect to need to give this screen a
little attention.
Set up Experiment opens the main configuration screen for your experiments.
Here you will tell the system what signals to put out on your output channels,
and how to interpret the data received on the input channels that you configured
in Set up Hardware. When moving your experiment to a new machine, you
should not need to change these settings.
Exit ends a session of HDCV.
The "Waveforms on" switch turns on the output of HDCV. When it is on,
waveforms are being sent to the electrodes, and digital signals of the "Once per
frame" variety are active, unless you have configured them to run only when an
experiment is running.
2
Experiment Control
The upper right area is for controlling your experiments. To specify a directory,
click on the little folder icon to create or choose a folder in which experiment data
will be stored. In the file dialog that pops up you may also type a file name if you
wish. If so, it will be entered into the filename field. By default, if no action is
taken, data files will be named data1, data2, etc. and will be stored in {user's
home}\Documents\LabVIEW Data, or wherever LabVIEW has been configured
to store data files by default.
If you run several experiments during the same HDCV session, the Filename
field will be incremented automatically as each experiment ends. If the original
filename ends in a number, that number will be increased by one. If it doesn't, a
number will be added at the end.
Along the top of the Experiment Control Panel you will find the option to collect
in three different acquisition modes:
1. Single run. Data will be collected for one short session; a stimulation and/or
TTL pulse(s) may be delivered at specified times during a session.
If a Stim has been specified in Setup Experiment, schedule its onset in the ‘time
before STIM’ input box on the bottom left hand side of the panel. Beside this is
the displayed stim duration, but you cannot change it here. This is calculated
3
from several factors set in Set up Experiment.
2. Multiple runs. Data will be collected in several runs, specified by a set
downtime between runs during which no data are collected. Timed stimulation
and TTL outputs may be delivered during each run. One .hdcv data file is
generated, consisting of all the runs together.
For multiple run experiments, you need to additionally specify:
 Number of run to be collected
 Length (s) of each run
 Time (s) between runs
3. Continuous. Data will be collected for one long session. No stimulation or
other predefined event will be scheduled. This mode is designed for experiments
on live, behaving animals, in which a stimulation and other events are likely to
take place in response to digital inputs. Such an experiment can produce a very
large .hdcv data file. A partner .dig file is written at the end of data collection as
well. This file contains the timing of the digital input and output signals
triggered during the collection session.
Several additional controls and indicators are visible on the Experiment Control
panel:
Header
Comments
Time
Indicator
Start
Button
Stop
Button
Input any information you would like saved as part of the file
header. The header can be accessed when opening the file in
HDCV Analysis.
This indicator is visible on the bottom right hand side of the panel.
During data collection it marks the time elapsed since the
beginning of the run or file. In multiple collection mode it counts
down the time until the next run.
Pressing this will begin your experiment. The clock starts, and the
first (or only) run begins. The clock will count until the run ends. In
a multiple run experiment, during the delay between runs, the
clock will count down to the beginning of the next run.
If If anything goes wrong, press this button to abort the
experiment. A .hdcv will still be created; it may or may not contain
any valid data for the run that was aborted. For Continuous
experiments we try very hard to handle Stop in a manner that
preserves the data.
4
Experimental Controls and Indicators Continued
This is used for multiple run experiments only. It can pause the
experiment between runs without aborting it. If you press it during
a run, the clock will pause at the end of the current run. When
Pause
pressed the Pause button will change state. Press it again to
Button
resume. The experiment will resume in such a manner that the
delay created by the pause may perhaps be longer, but never
shorter, then the delay between runs originally specified.
Experiment This indicator appears green whenever an experiment is running.
in
For multiple run experiments this includes the time between runs.
Progress
When on, the Stop button is meaningful.
Run in
This indicator appears green when a run is being collected and is
Progress
off during a delay between runs.
STIM
This indicator is on when a stimulation train is being delivered.
This displays the number of the run currently being recorded or
Run
about to be recorded. It is only valid when the Experiment in
Progress light is on.
The Graph Area
The graph area will display one of five graphs. These are meaningful whenever
the "Waveforms on" switch is on. In order:
Color Chart displays a continuous color plot style strip chart of the data being
collected. To use background subtraction, click "Set BG". It will set the
background to whatever is being collected at the current moment. If you don't
like the results, wait until you see a better moment and click it again. Autoscale
will change the color scale to make the color display as effective as possible for
the data in view. Change the Chan selector to view a different channel in a multichannel experiment.
5
Data Point selects one data point per scan and graphs the current at that data
point, as a continuous strip chart. If there are multiple channels you will see
them all, viewed at the same data point. Choose that data point in the control
below the graph to the left. Use the control to the right to designate how many
data points in the CV scan should be averaged around this point for display. The
small graph to the right of the strip chart is the oscilloscope view, showing one
frame of data as currently collected. Press the Select button below it to go to the
Line Selection screen, discussed below.
Strip Chart is a rapid strip chart of data being collected. Though not useful to
most users most of the time, it can be helpful for making sure that the system is
live and collecting real data, because it tends to show motion even when the data
are changing very little.
6
Scope is the oscilloscope view. It shows one frame of data, updated at the frame
rate. It can display both input and output signals. Use the Pan and Zoom dials to
view a portion of the frame in more detail if needed. The legend at the right
shows the signals and their names. Use the Select button below it to go to the
Line Selection screen and choose which inputs and outputs will be displayed.
Those that are not currently displayed are grayed out in the legend.
The Digital graph displays digital input data, on as many lines as you have
configured to use. Like the Scope, it normally displays one frame. If your
experiment has no digital lines configured, it will be blank.
The Line Selection screen displays checkboxes corresponding to the various
analog input and output lines in the current configuration. You can check them
on and off to choose which lines to display in the Scope or Data Point graphs.
The graph will update immediately as you change checkboxes. Press Done when
satisfied. Don't be surprised if the vertical scale jumps radically as you turn
7
checkboxes on and off. This behavior is normal if you have Autoscale Y turned
on for the graph.
Little Analysis
The lower portion of the screen is the little brother to the HDCV Analysis
program, providing a quick preview of data recently collected. You may use it in
two modes. "Current experiment" keeps it connected to the experiment in
progress. The display will update as any run ends. For multiple run files, Little
Analysis is the only way to view your data before your experiment ends. "File"
allows you to load a file of your choice and view it, without interruption as the
current experiment runs. "Current experiment" mode does not support
Continuous mode experiments, as they would overload the capacities of Little
Analysis.
The ABS Capture button is used in conjunction with the Analog Background
Subtraction feature, described above under Set up Experiment.
All other features of Little Analysis behave just like the corresponding features of
HDCV Analysis. Please read the Analysis manual for details.
8
2. Set up Hardware
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
In this screen you tell the system how it will be using its hardware. There are two
primary modes: Simplified Setup and Manual Setup. Simplified Setup assumes
that you are using the standard HDCV hardware: a 6363 card or something very
close to it (perhaps a successor). In this case you only need to tell it how many of
each resource you will need for each purpose, and it will allocate them according
to the plan of the standard HDCV breakout box. As you specify each resource on
the left, it will show you what it is allocating on the right.
Manual Setup is for all other situations. A nonstandard breakout box, a
nonstandard card, or other nonstandard usage. Use the menus to choose any
single resource in any field. The menus will not help you select multiple
resources. For this purpose use syntax like: Dev0/ai0:2 (analog inputs 0 through
2) or Dev0/ai0,Dev0/ai3 (analog inputs 0 and 3). No spaces around the comma! If
you wish to designate non-sequential lines you will need to use Manual Setup.
Note: HDCV uses analog inputs in Differential mode, which means that each
input is paired with another one which serves as a reference. On a 6363, the 16
Differential mode analog inputs are numbered 0-7 and 16-23. How inconvenient.
9
To use more than the first eight of them, you will need to set up in Manual Setup.
When you press the Done button to exit this screen, the program will actually try
and allocate those resources, to see if it can be done. If it fails, you will see the
error message without leaving the screen. If you find yourself stuck with an error
message you can't understand, press Cancel.
Hardware Resources
CV inputs
Non-CV
inputs
CV output
ABS output
STIM
Voltage
limits
CVF
Digital
STIM
Here you specify the channels for a multichannel CV experiment.
If you have other signals in the system that you would like to
record, that should not be interpreted as cyclic voltammograms,
specify them here. Normally 0.
Here you specify the channels on which waveforms will be output.
More than one channel would be used in an experiment where
different waveforms are being sent to different electrodes,
probably to monitor different chemicals. Standard configuration:
ao0-3 as needed. Analog STIM cannot be used when all four of
these channels are configured as waveform outputs.
Analog Background Subtraction is a special technique in which an
extra output channel is used to carry a recorded background
waveform, and external hardware subtracts it from the incoming
signal. This allows for a very sensitive reading of the varying
signal, the difference between the two. As of this writing, no more
than one ABS channel is supported.
The channel for the stimulation signal, if used. In the ultimate
design of HDCV, a stimulation signal may be output through an
analog channel or two digital lines. As of this writing, the digital
version is not supported. Standard configuration: ao3.
Specify here the hardware voltage range that will be used for the
card, for all analog inputs and outputs. The maximum operating
range of a 6363 is -10 to 10. Use narrower limits to provide a finer
reading of a smaller signal.
A signal at the scan frequency is always output on some digital
line. It is high during the scan time and low during the rest time.
Standard configuration: port0/line30.
Not yet implemented.
10
Hardware Resources Continued:
EP
VCG
Optional
digital
outputs
Digital
inputs
For use in combined electrophysiological and electrochemical
measurements. When selected, separate hardware can be used to
record electrophysiological signals during the CV rest time. The EP
output controls the relay that switches between the two sources.
Standard configuration: port0/line31.
Selecting this will output collection information through a serial
port (or USB adapter) to an external video character generator.
Two VCG boxes from Decades Engineering are supported: the
XBOB-3 and the XBOB-4. When activated, the file name, date, time
and CV scan number will display as text on the connected TV
monitor.
Can be set up to output either: a periodic signal that rises and falls
once per frame; or, a signal that rises and falls once per run.
Standard configuration: port0/line27 and downward.
Digital data will be monitored and recorded on these lines.
Commonly used in behaving-animal experiments, to record the
timing of cues, lever out, stim, etc. Standard configuration:
port0/line0 and upward.
11
3. Set up Experiment
At the top of the screen are two numbers set apart from the rest: CV Frequency,
and Sampling Rate. These set the fundamental timings of your experiment, and
they pretty much control everything else. Apart from these, everything is
organized into tabs. Here they are.
CV Ramp
Here you define the ramp, or output waveform, for your experiment. This
simplified panel assumes that your ramp will be a symmetrical triangle wave,
ranging from V1 to V2. Depending on choices you have made in Set up I/O, you
may have more than one waveform to configure. If so, use the radio buttons at
the upper left of the pane to choose which one you are working on at the
moment. Also note the program uses the same number of data points to record
each channel. This number will be based on your longest waveform.
CV Ramp Parameters
Phase shift
Number of cycles
Start delay
Scan rate
Data points per scan
Offset
Name
measured in degrees, shifts the starting point in the wave
how many times the wave will cycle from V1 to V2 and
back
time from start of frame until this waveform starts. Useful
only when more than one waveform is present -- and they
should not all be nonzero. Otherwise this violates the
definition of the start of frame, which can only lead to
confusion.
measured in V/s. Changing this value will change the
number of points per scan based on the value of the
Sampling rate.
changing this value directly will change the Scan rate
based on the value of the Sampling rate. Change the
Sampling rate to increase or decrease the number of data
points without changing the Scan rate.
this shift in voltage (input as mV) is used to compensate
for observed shifts in voltage elsewhere in the system.
if you choose to give your waveform a name, that name
will appear in the waveform selector above, and in
various places throughout HDCV and Analysis.
12
CV Ramp Parameters Continued
Multiplier
Duration of scan
in order to get the most possible bits of precision out of
the interface card, experimenters will sometimes set a
multiplier to multiply the output voltage higher than the
value actually desired, something close to the configured
limit of the card. External hardware will be set to divide
the voltage by the same number, restoring it to its true
intended value. If in doubt, use 1.
computed from Scan rate and Data points per scan
CV Ramp Advanced
This alternative panel for specifying waveforms allows a wider variety of
choices. Waveforms may be chosen from several standard wave shapes, or
customized. The scan rate cannot be specified here, but is rather computed from
other parameters. Any choice other than the Triangle wave shape will cause the
scan rate to disappear, because it is not a simple, single quantity.
Additional options:
Piecewise
From file
This type allows you to specify a waveform as a series of linear
segments. Click the Edit button to open the editor. In the Voltage
column type the voltage for each segment endpoint desired. In the
Time column specify, between each two voltages, the number of
milliseconds that should take place between them. If you find that
you have entered more voltage numbers than you intended, click
the [ - ] button to delete excess segments. After each change the
graph will update.
This type allows you to specify a waveform by loading a file. Press
the Load button to choose a file. File format: a text file, a list of
floating-point numbers, separated by spaces, tabs, and/or newlines.
The number of numbers in the file will determine the number of
data points per scan, and thus the duration of the scan. Such files
can easily be exported from Excel and many other programs. Note:
once the file has been loaded, it is the collection of points that have
been loaded from a file, and not the filename, that is remembered
to determine the waveform. Editing the text file will not change
anything unless you explicitly Load that file again.
13
When toggling between the CV Ramp and CV Ramp Advanced tabs, HDCV will
highlight the edge of the one that is active. Make sure this is correct before
reentering the main collection screen.
STIM
Here you set up the form of the stimulation signal. This will be a square wave, a
train of a specified number of pulses.
The pulse train that you specify must fill an exact number of frames. It won't
have four pulses each for two frames, and then to pulses left over in a final
frame. This boils down to the following rules: Stim frequency must be a multiple
of CVF, and the number of pulses must be a multiple of (Stim frequency / CVF).
You also want to be sure that the Stim signal never coincides with the CV ramp
signal. The graph on the right shows stim and all ramps in a representative
frame, and it will warn you: any part of the ramp signal that overlaps a stim
signal will be highlighted in red.
The Combined Waveform Graph at the bottom shows the entire Stim pulse train,
together with CV ramps that take place during it.
Stimulation Parameters:
Frequency
Amplitude
Pulse length
# Pulses
Start Delay
Duration
Polarity
the frequency of pulse delivery in Hz
measured in V0p
the length of each individual pulse in ms
the total number of pulses
time between the start of a frame and the start of the first Stim
pulse. Use this to make sure that Stim pulses and CV ramp never
overlap.
calculated from the total duration of the stimulation pulse train
This describes the form of the pulses:
Monophasic (+) the pulse goes positive
Monophasic (-) the pulse goes negative
Biphasic the pulse goes positive for (pulse length) time and then
goes negative for (pulse length) time, then returns to zero.
NOTE: this makes a total pulse that goes twice as long as Pulse length.
14
Stimulation Parameters Continued
Triggering
Bursts
controls when the stimulation happens:
Internal
stim happens at a set time after the start of a run.
External
stim happens when the specified DIO line (digital
input) makes the specified transition (Rising or Falling). Turn on
the Rising button to specify the Rising transition, otherwise it will
be Falling.
stimulation may be specified as a series of bursts, i.e. pulse trains
as specified above. Burst frequency tells how often a new burst
will begin. NOT IMPLEMENTED.
Analog Inputs
You can specify a name for each of the CV and other inputs. If you do, this name
will be used on the labeling of graphs throughout the HDCV system.
You can also specify:
Gain
Using
waveform
a conversion factor between volts measured and the current
indicated
supports experiments that involve multiple waveforms and multiple
CV input channels. Each waveform may be applied to more than one
input channel, and here is where you tell the system about that oneto-many relationship.
EPhys (electrophysiology)
The EPhys signal is used in experiments that use the electrode to do double duty:
during the CV rest time, the electrode is used to do electrophysiology
measurements, controlled by separate hardware. This signal controls the relay
that switches between the two sources. Here you may specify the "dead time" on
either end of the CV ramp before the relay switches. During this dead time
voltage is applied to the electrode, but the current is not recorded. This is
desirable to prevent any switching transient from interfering with the CV data.
15
Digital Outputs
These are your programmable digital output lines. Can be set up to output
either: a periodic signal that rises and falls once per frame; or, a signal that rises
and falls once per run. In the case of "once per frame" signals, you can specify
that the signal is only emitted during a run, and falls quiet between runs or while
no experiment is taking place. For "once per frame" signals, the rise and fall times
will be less than or equal to one frame time. For "once per run" signals they will
probably be many times one frame time. The resting state of the signal will be
based on Rise or Fall, whichever comes last.
"Once per run" signals are useful for controlling the valve in a flow cell
experiment.
Digital Inputs
Here you may name your digital input lines. If you do, these names will appear
in graph labels throughout the HDCV system.
16
Analog Background Subtraction
Analog Background Subtraction (ABS) is a special technique used to neutralize
the recorded charging current of the electrode, which is usually much larger than
the faradaic signal of interest. ABS is performed by making a recording of the
original background current and then applying it to the inverting input of the
headstage amplifier. By removing the contribution of the charging current to the
recording, the voltage limits of the cards can be reduced in ‘Setup Hardware’ to
decrease quantization noise (see Hermans et al. Anal Chem. 2008. 80(11): 4040-8).
Note that the ABS signal is only applied during the timeframe of the voltage
scan. Therefore a large capacitive spike occurs each time the ABS output is
applied. To prevent this current artifact from overlapping with the waveform,
you will need to add 50-100 points of holding potential to the beginning of the
scan. This can be done by using the Piecewise or Load from File options in the
Advanced CV tab. Any extra points can be deleted later during data analysis (see
‘Data Point Removal’ in the Analysis Manual). The image below shows an
example of how a modified dopamine waveform with 100 buffering points is
built with the ‘Piecewise’ feature. The time column is in units of milliseconds on
this screen, and the number of data points per phase is the time (s) multiplied by
the sampling rate (Hz).
17
Unlike all other parts of the HDCV system, ABS involves a feedback loop.
Therefore, you won't usually enter the ABS tab in ‘Setup Experiment’ directly.
Instead, here is the procedure:
1. Design a waveform with extra data points before your desired voltage scan.
2. After conditioning your electrode with your waveform, collect a short run to
obtain a sample background.
3. Once the file is finished, view it in Little Analysis with filtering and
background subtraction off.
4. Move the white cursor to a position that represents the background, to your
satisfaction. The option, "Columns to average for CV" is effective.
5. Press the ABS Capture button. A file with the name of the current experiment
and an extension of ".ab" will be created in your data directory.
6. You will be taken to the Analog Background Subtraction tab in Set up
Experiment. The new background will show in the Captured Background graph.
7. Press the "Use captured" button to transfer this new information into the actual
working background. Set the Scale Factor to 1 divided by the gain of your ABS
circuitry. If you purchased your hardware from UNC the gain usually is around
200 nA/V (but not always), giving you a Scale Factor of 0.005. The Scale Factor can
also be used to solve a “Voltage out of range” error if you get one. Keep in mind
that the amount of current you can subtract is limited by the ABS gain. For
instance if the ABS gain is 200 nA/V with a ±10 V DAQ, the maximum current
you can apply is ±2000 nA.
18
8. Once you’ve captured the ABS signal, exit ‘Setup Experiment’ and go back into
the ‘Setup Hardware’ screen. Change the Number of ABS Outputs to 1. The
program designates AO3 as the output line by default. When you apply the
waveform again you should see a drastic reduction in the background current.
8. Make adjustments. Use the DP shift to adjust the timing of the analog
background. It will be shifted by the specified number of data points (sample
times). This is useful to avoid glitches at the beginning or end of the scan caused
by misalignment of the background and the CV input. If the background current
has not been zeroed to your satisfaction, repeat steps 2 - 6 to make additional
background recordings. When you enter into the ABS tab use the ‘Add captured’
button instead of the ‘Use captured’ button to sum the .ab files.
Recorded charging current (white trace) before and after analog background subtraction
19
Compatibility
This feature is for those who may be using HDCV with an old breakout box. It
supports the switching of an external valve in a flow cell experiment, by using
the STIM output to represent one digital output line. Tell it what voltage you
want to use for a High state, it will use zero for Low. A signal will be output that
corresponds to whatever you specify for the first Digital Output.
20
Download