sendCustomWaveform()

Description

Sends a sequence of voltages describing a train of continuous monophasic pulses, with periodic onset times.

  • This method is equivalent to sendCustomPulseTrain, but it automatically computes a pulse time vector of regular pulses using a specified sampling period.

  • For a continuous waveform, any output channels targeted should be manually adjusted so that phase1Duration matches the sampling period specified.

Syntax

sendCustomWaveform(customTrainID, pulseWidth, pulseVoltages)

Parameters

  • customTrainID: The custom pulse train to program (1 or 2)

  • pulseWidth: The intended period between all pulse onset times (0.0001s-3600s).

  • pulseVoltages: An array containing one voltage for each pulse (datatype = list)

Returns

None

Example

# Set output channel 2 to play a sine wave when triggered

import math

voltages = range(0,1000)

for i in voltages:

voltages[i] = math.sin(voltages[i]/float(10))*10 # Set 1,000 voltages to create a 20V peak-to-peak sine waveform

pulseWidth = 0.0001 # Set the sampling period for 10kHz sampling

myPulsePal.programOutputChannelParam('phase1Duration', 2, pulseWidth) # Set output channel 2 to use 100us pulses

myPulsePal.programOutputChannelParam('customTrainID', 2, 1) # Set output channel 2 to use custom train 1

myPulsePal.sendCustomWaveform(1, pulseWidth, voltages) # Send the custom waveform