SendCustomPulseTrain()

Description

Sends a sequence of onset times and voltages describing a train of monophasic pulses. 

Syntax

ConfirmBit = SendCustomPulseTrain(TrainID, PulseTimes, Voltages)

Parameters

Returns

1 if custom train was sent successfully.

0 if an error occurred during transmission.

Example

% 1. This code generates a train of three 250μs pulses when trigger channel 2 receives a TTL pulse. 

% 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];

SendCustomPulseTrain(1, PulseTimes, Voltages); % Uploads our train in slot 1 of 2

% For the next three lines, note the parameter codes for ProgramPulsePalParam.

ProgramPulsePalParam(1, 14, 1); % Sets output channel 1 to use custom train 1

ProgramPulsePalParam(1, 4, 0.00025); % Sets output channel 1 to use 250μs pulses

ProgramPulsePalParam(1, 13, 1); % Sets output channel 1 to respond to triggers on trigger channel 2

TriggerPulsePal('1');


% 2. This code accomplishes the same thing 

% but using ProgramPulsePal instead of ProgramPulsePalParam to adjust output channel settings.

Voltages = [-8 2 10];

PulseTimes = [0 .001 .01];

SendCustomPulseTrain(1, PulseTimes, Voltages); % Uploads our train in memory location 1 of 2

load('C:\Users\JohnDoe\Documents\MATLAB\PulsePal 0_4\Programs\PulsePalProgram_Example.mat');

% Note the layout of parameters in the example matrix. 

ParameterMatrix{15,2} = 1; % Sets output channel 1 to use custom train 1.

ParameterMatrix{5,2} = 0.00025; % Sets output channel 1 to use 250μs pulses

ParameterMatrix{14,2} = 1; % Sets output channel 1 to respond to triggers on trigger channel 2

ProgramPulsePal(ParameterMatrix); % Sends parameter changes to Pulse Pal

TriggerPulsePal('1');