Professional Documents
Culture Documents
1) Installing DataStreamer
Download the software installer to your local machine and then launch it. The current software
version is Windows-based, but please contact us (see section 5 for contact information) if there
is a need for the software on other operation systems. During the automatic installation
process, DataStreamer will be installed as a single standalone file on your desktop and the
MatLab DataPlugin will be installed. The plugin, which is alternatively available for free from the
National Instruments website (see http://www.ni.com/example/29178/en/), is only needed for
users who want to generate protocol files in MAT format. To use DataStreamer, connect your NI
DAQ card via USB to your machine, switch it on, make sure it is correctly recognized by the
operation system, and then launch DataStreamer.
NOTE 1: Both starting and correctly closing the DataStreamer software causes the program to
stream a series of ‘zeros’ to the NI DAQ card. This is to ensure that, if a tCS machine and
participant are connected in subsequent measurements, the starting voltage is at zero, ensuring
that no unexpected electrical stimulation can occur. We therefore strongly recommend to
always close DataStreamer using the Exit button. The well-known program closure button (red
‘x’ in top-right of program window) does not reset channels to zero and should therefore be
avoided. If for whichever reason proper closure of the program was not possible, the same
functionality (resetting of voltages) is implemented when DataStreamer is started. Best practice
is therefore to always (re)start DataStreamer before connecting a participant.
Firstly one should create a Stimulus Protocol (loaded in the ‘MATLAB Source File’ in the user
interface), which needs to be a matrix containing four rows with an equal number of columns
(even if the first two ‘audio channels’ are not desired or used, these rows cannot be omitted
from the Stimulus Protocol). Rows represent the sequential channels of the NI DAQ card.
Row 1: ‘Audio Channel’ 1 (can also be connected to non-audio devices as mentioned above).
Row 3: ‘tACS Channel’: the waveform to be sent to a tCS machine with a remote control option.
While not restricted to tACS, most likely this row will hold a sinusoid signal of a particular
frequency (not the sampling frequency, but a sinusoid at the desired tACS stimulation
frequency, sampled at the stimulus protocol’s sampling frequency, see template/example
scripts provided along with the software and this manual).
Row 4: ‘trigger Channel’: digital channel containing instantaneous triggers that can be used to
trigger stimulation devices directly (e.g. LED, TMS, EEG). The relative timing of these events with
respect to the tACS signal in row 3 determines the phase at which stimuli are triggered.
There should be one sampling frequency that pertains to the stimulus protocol as a whole,
which can be determined per experiment as desired or required. As a rule of thumb, the higher
the sampling rate the better (the higher the resolution of waveform signals and the better the
sound quality in case of auditory stimulation), as long as the computer running DataStreamer
and the NI DAQ can handle the data stream. A sampling rate of 10.000 Hz for instance should
easily be sufficient and be feasible on most standard hardware.
Values in rows 1-3 (“analog channels”) must be floating point values and should fall within the
range between -1 and +1. Row 4 (“digital channel”) should only contain unsigned 8 bit integer
values corresponding to the requested digital output. These integer values should range from
zero to 255 or less, depending on the number of bits for which the LPT port of the to-be-
triggered external device is configured. We suggest implementing a 50ms up-phase (i.e.
duration) of the digital output to ensure that the trigger can be detected by the external
hardware. Finally, the last column of the entire matrix (final sample) should contain only zeros
to reset all voltages (an extra precaution related to safety considerations discussed in Note 1
above).
The format of the Stimulus Protocol, i.e. source file, is a file (.mat) created in MATLAB
(MathWorks), in which the matrix containing the rows is a variable of the type Double, named
stimuli. A Matlab script for generating a template stimulus protocol file in .mat format can be
downloaded together with the present manual from this website: https://osf.io/h6b8v/. A
version of DataStreamer that can read .txt files is available upon request. Users without access
to Matlab can adapt this version to other programming environments. We can be contacted for
support.
Once a Stimulus Protocol is created you can use the user interface. Open DataStreamer, change
the Sample Rate and Chunk Size as required, then load the stimulus protocol (i.e. source file),
and wait until the file is fully loaded. This is indicated by the status indicator ‘armed’. Change
the audio gain and the tACS gain factor as desired. In tACS experiments, we recommend to now
connect the participant and enable the external control of voltages from your tCS machine.
DataStreamer will not start until it receives a start trigger. Dependent on the version of the
program it will be sensitive to different trigger types. The USB version of the program waits for a
USB input resembling a keypress of number 5 (one could just press number 5 on the keyboard
to start the program). The LPT version waits for any input from the connected LPT port. Once
the trigger is detected, the indicator ‘trigger’ will light up and the streaming process will be
initiated instantaneously. Ensure that you have downloaded the correct version for the specific
needs of the experiment.
When a tCS machine is connected ensure that you only allow external control of voltages after
DataStreamer has been newly opened (see NOTE 1 above). For example in a NeuroConn
(Neuroconn, Ilmenau, Germany) device only start the Remote option after the program is
opened. Moreover, disable the Remote option or disconnect participants during breaks and
before turning on or off, or (dis-) connecting the NI DAQ to avoid sending an electric pulse to
the subject.
More generally, we advise that safety checks and voltage measurements should always be
performed before using new lab equipment and experimental setups, to ensure participant
safety. If there are questions, please contact us for support.
The current version of the Data Streamer is created to have two auditory, 1 tACS, and one
digital trigger channel output. However, this can be easily adapted upon request to
accommodate more channels with different features if required.
There are a few stages involved in going from the tACS channel amplitude (the numbers in Row
3 of the Stimulus Protocol) to the actually achieved intensity of electrical stimulation. We take
this example of a tACS experiment:
1) Stimulus protocol file. Row 3 contains a sinusoid signal that oscillates between -1 and 1
(any extremer values will be clipped). Note that in actual tACS experiments, one will
usually want to ramp up/down the stimulation intensity at the beginning/end of the
experimental run. Ramping can be implemented in the stimulus protocol by sequential
multiplication of the first and last sections of the sinusoidal signal with a monotonically
increasing/decreasing value between 0 and 1 over samples.
2) Conversion (gain) Factor in DataStreamer user interface. The value of each sample in row
3 is multiplied by the Conversion Factor times 0.5, yielding a specific voltage at the
output of the NI DAQ that depends on the configured output voltage range. E.g., a
Conversion factor set to 0.8 mA/V (Datastreamer GUI) will convert a value of ±1
(Stimulus protocol, row 3) into an output voltage of ±0.4V for an NI DAQ configured to
have a ±1V output range.
3) Transfer gain of the tCS. The tCS machine converts the NI DAQ output voltage into a
current. Note that users should always check with the manufacturer or documentation
of their tCS macines how exactly the device converts input voltage into output current
(transfer gain). In our lab, we use NeuroConn stimulators with a transfer gain of 2 mA/V;
i.e., an input voltage (NI DAQ output voltage) of ±0.4V results in an output current (tACS
intensity) of ±0.8mA.
4) Note that tCS machines may produce a constant current offset irrespective of external
input signals. This should be checked with the manufacturer or documentation of the
used tCS machines, and/or should be measured at the output of the tCS (i.e. with an
amperemeter). Any current offset should be corrected for.
Goal: administer tACS with 1.6 mA intensity from peak to peak (i.e., -0.8 to +0.8mA).
Stimulus protocol: sinusoid signal in Row 3 (ramped up and down) ranging from -1 to 1.
5) Contact information