sendCustomPulseTrain()
Description
Sends a custom monophasic pulse train to the device. A "pulse train" is a sequence of pulse onset times and voltages.
The custom train can be played on any output channel by setting its customTrainID parameter.
While this function sets pulse onset times, pulse duration is uniform, and set by adjusting each channel's phase1Duration parameter.
Pulses that are continuous or overlapping will merge (see the Parameter guide)
Syntax
confirmed = sendCustomPulseTrain(trainID, pulseTimes, voltages)
Parameters
trainID: The index of the custom pulse train to program (1 or 2 on Pulse Pal 2, and 1-4 on Pulse Pal 3)
pulseTimes: A list of pulse onset times given in seconds
voltages: A list of monophasic pulse voltages given in volts
Returns
confirmed (boolean):
true if custom train was sent successfully.
false if an error occurred during transmission.
Examples
% 1. This programs and triggers a train of three 250μs pulses on output channel 2
% The pulses occur at at times 0ms, 1ms and 10ms.
% Their voltages are -8V, 2V and 10V.
Voltages = [-8 2 10];
PulseTimes = [0 .001 .01];
P.sendCustomPulseTrain(1, PulseTimes, Voltages); % Program custom pulse train 1
P.customTrainID(2) = 1; % Set output channel 2 to use custom pulse train 1
P.phase1Duration(2) = 0.00025; % Set output channel 2 to use 250μs pulses
P.trigger(2); % Trigger output channel 2