Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WavePlayer to trigger multiple waves
#1
Hello, 

I would need to send 3 different sine waves (to operate a laser's AOM and scanning XY mirrors) to 3 different channels of the Bpod analog out module. I would ultimately need to trigger them simultaneously, in a specific state. Is it possible using WavePlayer? 

Thanks!
Claudia
Reply
#2
Hi Claudina,


You'd need to set a trigger profile:

W = BpodWavePlayer('COM3');
...
Load 3 waveforms with W.loadWaveform()
...
W.TriggerProfiles(1,Smile = [1 2 3]; % Set trigger profile 1 = waverforms 1, 2 and 3 simultaneously
W.TriggerProfileEnable = 'On';

Now in MATLAB, you can trigger all 3 with:
W.Play(1);

You can also load a serial message and then trigger all 3 from the state machine output actions:
LoadSerialMessages(1, ['P' 0]); % Note: this previously said ['P' 1], see comment on thread below
...
(in AddState's output actions)
{'WavePlayer1', 1}

Also see trigger profiles here.

I hope this helps!
-Josh
Reply
#3
(09-11-2018, 02:29 AM)Josh Wrote: Hi Claudina,


You'd need to set a trigger profile:

W = BpodWavePlayer('COM3');
...
Load 3 waveforms with W.loadWaveform()
...
W.TriggerProfiles(1, Smile = [1 2 3]; % Set trigger profile 1 = waverforms 1, 2 and 3 simultaneously
W.TriggerProfileEnable = 'On';

Now in MATLAB, you can trigger all 3 with:
W.Play(1);

You can also load a serial message and then trigger all 3 from the state machine output actions:
LoadSerialMessages(1, ['P' 1]);
...
(in AddState's output actions)
{'WavePlayer1', 1}

Also see trigger profiles here.

I hope this helps!
-Josh

Thanks Josh, I figured it out as you said. Only difference, the profile 1 gets triggered by the message LoadSerialMessages(1, ['P' 0]). 
Thanks again!
Claudia
Reply


Forum Jump: