BpodSystem.EmulatorMode
Description
When no Bpod device is found, the user can launch the Bpod software in emulator mode.
BpodSystem.EmulatorMode is automatically set to 1 in emulator mode (0 = default, actual hardware).
Emulator mode is a tool for protocol development; timing data and sound / visual display timing may be imprecise depending on the platform. Protocols developed with the emulator should be validated on hardware prior to any experiment.
Inputs are read and the hardware state is indicated on the Bpod console while running a state machine.
When designing a protocol that can be run in emulator mode, block off code that interfaces with unavailable hardware (see example).
Example
% 1. This code connects to a remote TCP server using the SerialEthernet plugin, only if NOT in emulator mode.
if BpodSystem.EmulatorMode == 0
SerialEthernet('Init', 'COM65'); % Set this to the correct COM port
% for Arduino Leonardo
pause(1);
RemoteIP = [192 168 0 104]; RemotePort = 3336;
SerialEthernet('Connect', RemoteIP , RemotePort);
else
disp('Fake-connected to a fake TCP server')
end