WavePlayer Serial Interface

Description

Allows the state machine or PC to play analog waveforms using the analog output module.

Requires a 4-channel analog output module board with firmware loaded from:

OR, an 8-channel analog output module board with firmware loaded from:

The analog output module must be connected to a serial port on the state machine module.

State Machine Command Interface

The state machine command interface consists of bytes sent from the Bpod state machine to the WavePlayer module to start and stop playback.

SerialUSB Command Interface

The SerialUSB command interface allows configuration of the WavePlayer module from MATLAB or Python before a trial begins. The WavePlayer plugin for Bpod/MATLAB wraps this interface. The first two commands are the same as for the state machine interface, and additional commands follow.

Examples

% Play waveform# 4 on output channel 1 from an ArCOM serial object in MATLAB: 

D = ArCOMObject('COM43', 115200);

D.write(['P' 1 3], 'uint8');

clear D


% Play waveform# 4 on output channel 1 from the Bpod state machine

LoadSerialMessages('WavePlayer1', {['P' 1 3]});  % Set serial message 1

sma = NewStateMachine();

sma = AddState(sma, 'Name', 'PlaySound', ...

    'Timer', 0.1,...

    'StateChangeConditions', {'Tup', 'exit'},...

    'OutputActions', {'WavePlayer1', 1}); % Sends serial message 1

SendStateMachine(sma);

RawEvents = RunStateMachine;