ProgramPulsePalParam()
Description
Sends a single channel parameter to the Pulse Pal device.
This is useful in closed-loop feedback applications where a single parameter must be quickly adjusted.
Each parameter is described in depth in the Parameter guide.
Syntax
ConfirmBit = ProgramPulsePalParam(OutputChannel, ParameterCode, ParameterValue)
Parameters
Channel: The channel to adjust (1-4 for output channel params, 1-2 for trigger channel params)
ParameterCode: One byte specifying the parameter to adjust. Valid arguments (followed by descriptions in parentheses) are:
1 (Biphasic pulse (0 = monophasic, 1 = biphasic)
2 (Phase 1 voltage, Volts, -10 to +10)
3 (Phase 2 voltage, Volts)
4 (Phase 1 duration, Seconds, 0.0001-3600)
5 (Inter-phase interval, Seconds)
6 (Phase 2 duration, Seconds)
7 (Inter-pulse interval, Seconds)
8 (Burst duration, Seconds)
9 (Inter-burst interval, Seconds)
10 (Pulse train duration, Seconds)
11 (Pulse train delay, Seconds)
12 (Responds to trigger channel 1, 0 or 1)
13 (Responds to trigger channel 2, 0 or 1)
14 (Custom train identity, 0 (none), 1 or 2)
15 (Custom train target, 0 (pulses), 1 (bursts))
16 (Custom train loop, 0 or 1)
17(Resting voltage, Volts, -10 to +10)
128 (Trigger mode, 0 = normal, 1 = toggle, 2 = pulse-gated)
Alternatively, the parameter code argument may be a string from the following list (for a speed penalty)
'IsBiphasic'
'Phase1Voltage'
'Phase2Voltage'
'Phase1Duration'
'InterPhaseInterval'
'Phase2Duration'
'InterPulseInterval'
'BurstDuration'
'InterBurstInterval'
'PulseTrainDuration'
'PulseTrainDelay'
'LinkTriggerChannel1'
'LinkTriggerChannel2'
'CustomTrainID'
'CustomTrainTarget'
'CustomTrainLoop'
'RestingVoltage'
'TriggerMode'
ParameterValue: One number specifying the new value of the parameter to be changed.
Returns
ConfirmBit =
1 if parameter was changed successfully.
0 if an error occurred during transmission.
Example
% 1. This code changes the pulse amplitude of monophasic pulses on channel 3 to -7.5 volts if condition x is true.
ConditionX = 1;
if ConditionX == 1
ProgramPulsePalParam(3, 0, -7,5);
end
% 2. This code changes the stimulus train duration on channel 1 to 10 seconds, soft-triggers the stimulus, adjusts the % train duration to 5 seconds, and triggers it again.
ProgramPulsePalParam(1, 8, 10);
TriggerPulsePal('1');
pause(10);
ProgramPulsePalParam(1, 8, 5);
TriggerPulsePal('1');