Forums
WavePlayer to trigger multiple waves - Printable Version

+- Forums (https://sanworks.io/forum)
+-- Forum: Bpod (https://sanworks.io/forum/forumdisplay.php?fid=1)
+--- Forum: Software (https://sanworks.io/forum/forumdisplay.php?fid=6)
+--- Thread: WavePlayer to trigger multiple waves (/showthread.php?tid=381)



WavePlayer to trigger multiple waves - Claudina - 09-07-2018

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


RE: WavePlayer to trigger multiple waves - Josh - 09-11-2018

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


RE: WavePlayer to trigger multiple waves - Claudina - 09-11-2018

(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