Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to connect to AnalogInput Module after stopping previous session
#1
Wink 
Dear Bpod Users,
I am new here and slowly trying to read into the bpod scripts.
For some time now, I have been having problems starting a new session after previously ending the previous session via stop button.
I get the following error message:


Code:
Error in Light2AFC_AnalogStreaming (line 47)
    A = BpodAnalogIn(BpodSystem.ModuleUSB.AnalogIn1);

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

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



Is it because the AnalogInput module is not exiting properly? I also get this error message when I run the test script "Light2AFC_AnalogStreaming"
The last lines of code look like this:


Code:
SendStateMatrix(sma);
    RawEvents = RunStateMatrix;  
    if ~isempty(fieldnames(RawEvents)) % If trial data was returned
        BpodSystem.Data = AddTrialEvents(BpodSystem.Data,RawEvents); % Computes trial events from raw data
        BpodSystem.Data.TrialSettings(currentTrial) = S; % Adds the settings used for the current trial to the Data struct (to be saved after the trial ends)
        BpodSystem.Data.TrialTypes(currentTrial) = TrialTypes(currentTrial); % Adds the trial type of the current trial to data
        UpdateSideOutcomePlot(TrialTypes, BpodSystem.Data);
        SaveBpodSessionData; % Saves the field BpodSystem.Data to the current data file
    end
    HandlePauseCondition; % Checks to see if the protocol is paused. If so, waits until user resumes.
    if BpodSystem.Status.BeingUsed == 0
        A.scope_StartStop; % Stop Oscope GUI
        A.endAcq; % Close Oscope GUI
        A.stopReportingEvents; % Stop sending events to state machine
        return
    end


Does anyone have a solution for this? 
Many thanks in advance
Cheers,
Daniel
Reply


Forum Jump: