Waveform size of 8ch output module

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Waveform size of 8ch output module
#1
Hi, 

I am using the 8 channel analog module with Bpod State Machine R2 to control optical stimulation. 
According to the description for Waveplayer, the maximum sample size is 1M. 

However, with the current setup, I get the following error when the waveform size is set to be anything bigger (>) than 499997: 




Quote:Error using serial/fwrite (line 199)
Unsuccessful write: The number of bytes written must be less than or equal to OutputBufferSize-BytesToOutput.

Error in ArCOMObject_Bpod/write (line 293)
                    fwrite(obj.Port, ByteString, 'uint8');

Error in BpodWavePlayer/loadWaveform (line 329)
            obj.Port.write(['L' WaveIndex-1], 'uint8', nSamples, 'uint32', WaveBits, 'uint16');

Error in Airpuff_v4 (line 104)
W.loadWaveform(3, Pulse20Hz');

Error in run (line 91)
evalin('caller', strcat(script, ';'));

Error in NewLaunchManager>LaunchProtocol (line 707)
run(ProtocolPath);
 
Error while evaluating DestroyedObject Callback.


Only Ch1 and Ch2 of the output Module are currently in use, and the sampling rate is around 44k. 

The protocol runs as long as the sample size of those waveforms are set to be less than (<=) 499997. 


Do you know what could be causing this issue with the waveform size and how to increase it to reach 1M? Thanks!

Best,
Miao
Reply
#2
Hi Miao,

I was able to replicate the issue here.
It's odd, since MATLAB reports the output buffer size to be 1M samples. Increasing to 2M samples didn't help.
The error is coming from MATLAB's Java serial interface, so it will take some digging to solve.

For now, there's an easy fix - if you install PsychToolbox, Bpod will default to PsychToolbox's IOPort interface instead of MATLAB's Java.
I verified that it works.

-Josh
Reply
#3
(10-07-2019, 06:24 PM)Josh Wrote: Hi Miao,

I was able to replicate the issue here.
It's odd, since MATLAB reports the output buffer size to be 1M samples. Increasing to 2M samples didn't help.
The error is coming from MATLAB's Java serial interface, so it will take some digging to solve.

For now, there's an easy fix - if you install PsychToolbox, Bpod will default to PsychToolbox's IOPort interface instead of MATLAB's Java.
I verified that it works.

-Josh

Hi Josh,

Installing the PsychToolbox solves the issue. I didn't realize that PsychToolBox was not installed in the newer version of Matlab I am using. Thanks a lot! 

Best,
Miao
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)