Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
launch manager while bench testing
#1
Hi,

I am trying to activate the "operant" protocol from the consule as part of the bench testing protocol,

I am using the example's "Operant", "FakeSubject" and "DefaultSettings" (from Bpod_Gen2 repo). 

However, I receive the following error:


"Reference to non-existent field 'GUI'.


Error in BpodParameterGUI (line 37)
        ParamNames = fieldnames(Params.GUI);

Error in Operant (line 17)
BpodParameterGUI('init', S); % Initialize parameter GUI plugin

Error in run (line 86)
evalin('caller', [script ';']);

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


Can you please help me figure out what did I do wrong?
I am new to Bpod so it may be very basic...

Thank you!
Noa
Reply
#2
Hi Noa


That definitely shouldn't happen - and it will be interesting to find out what's causing it.

When you run the Operant protocol from the Launch manager, having selected the "DefaultSettings" option, your computer loads an empty struct into the BpodSystem object's "ProtocolSettings" field, from from /Documents/Bpod Local/Data/FakeSubject/Operant/Protocol Settings/Default.mat

The Operant protocol (located at /Documents/Bpod Local/Protocols/Operant/) has this block of code near the top:

Code:
S = BpodSystem.ProtocolSettings; % Load settings chosen in launch manager into current workspace as a struct called S
if isempty(fieldnames(S))  % If settings file was an empty struct, populate struct with default settings
   S.GUI.CurrentBlock = 1; % Training level % 1 = Direct Delivery at both ports 2 = Poke for delivery
   S.GUI.RewardAmount = 5; %ul
   S.GUI.PortOutRegDelay = 0.5; % How long the mouse must remain out before poking back in
end

So the empty struct you selected from the launch manager (now known in the code as BpodSystem.ProtocolSettings) should be copied into local variable S. If S is empty (which it should be, since the default struct is empty), it is assigned a GUI subfield, containing the paramters you want to have accessible from the ParameterGUI plugin.

The error you're seeing, claims that S does not have a subfield called 'GUI' - which could have happened if: 
1. S was really not empty, or 
2. isempty(fieldnames(S)) evaluated incorrectly (perhaps in the latest MATLAB version?).

So to get to the bottom of it, we'll need some info about your setup:

-Matlab version
-OS
-From the editor, if you put a breakpoint on line 40 of operant.m (nSinglePokeTrials = 5Wink, and hover over S, what do you see?

Thanks,
Josh
Reply
#3
(07-12-2017, 08:49 PM)Josh Wrote: Hi Noa


That definitely shouldn't happen - and it will be interesting to find out what's causing it.

When you run the Operant protocol from the Launch manager, having selected the "DefaultSettings" option, your computer loads an empty struct into the BpodSystem object's "ProtocolSettings" field, from from /Documents/Bpod Local/Data/FakeSubject/Operant/Protocol Settings/Default.mat

The Operant protocol (located at /Documents/Bpod Local/Protocols/Operant/) has this block of code near the top:

Code:
S = BpodSystem.ProtocolSettings; % Load settings chosen in launch manager into current workspace as a struct called S
if isempty(fieldnames(S))  % If settings file was an empty struct, populate struct with default settings
   S.GUI.CurrentBlock = 1; % Training level % 1 = Direct Delivery at both ports 2 = Poke for delivery
   S.GUI.RewardAmount = 5; %ul
   S.GUI.PortOutRegDelay = 0.5; % How long the mouse must remain out before poking back in
end

So the empty struct you selected from the launch manager (now known in the code as BpodSystem.ProtocolSettings) should be copied into local variable S. If S is empty (which it should be, since the default struct is empty), it is assigned a GUI subfield, containing the paramters you want to have accessible from the ParameterGUI plugin.

The error you're seeing, claims that S does not have a subfield called 'GUI' - which could have happened if: 
1. S was really not empty, or 
2. isempty(fieldnames(S)) evaluated incorrectly (perhaps in the latest MATLAB version?).

So to get to the bottom of it, we'll need some info about your setup:

-Matlab version
-OS
-From the editor, if you put a breakpoint on line 40 of operant.m (nSinglePokeTrials = 5Wink, and hover over S, what do you see?

Thanks,
Josh

Thank you Josh for the detailed reply,
I use MATLAB R2017a, 
and Windows 10.

When trying to run operant from the editor i recieve an error before line 40:

Error in Operant (line 32)
S = BpodSystem.ProtocolSettings; % Load settings chosen in launch manager into current workspace as a struct called S
struct contents reference from a non-struct array object.

I am not sure if that's helpful....
Reply
#4
(07-13-2017, 05:38 AM)Noa Wrote:
(07-12-2017, 08:49 PM)Josh Wrote: Hi Noa


That definitely shouldn't happen - and it will be interesting to find out what's causing it.

When you run the Operant protocol from the Launch manager, having selected the "DefaultSettings" option, your computer loads an empty struct into the BpodSystem object's "ProtocolSettings" field, from from /Documents/Bpod Local/Data/FakeSubject/Operant/Protocol Settings/Default.mat

The Operant protocol (located at /Documents/Bpod Local/Protocols/Operant/) has this block of code near the top:

Code:
S = BpodSystem.ProtocolSettings; % Load settings chosen in launch manager into current workspace as a struct called S
if isempty(fieldnames(S))  % If settings file was an empty struct, populate struct with default settings
   S.GUI.CurrentBlock = 1; % Training level % 1 = Direct Delivery at both ports 2 = Poke for delivery
   S.GUI.RewardAmount = 5; %ul
   S.GUI.PortOutRegDelay = 0.5; % How long the mouse must remain out before poking back in
end

So the empty struct you selected from the launch manager (now known in the code as BpodSystem.ProtocolSettings) should be copied into local variable S. If S is empty (which it should be, since the default struct is empty), it is assigned a GUI subfield, containing the paramters you want to have accessible from the ParameterGUI plugin.

The error you're seeing, claims that S does not have a subfield called 'GUI' - which could have happened if: 
1. S was really not empty, or 
2. isempty(fieldnames(S)) evaluated incorrectly (perhaps in the latest MATLAB version?).

So to get to the bottom of it, we'll need some info about your setup:

-Matlab version
-OS
-From the editor, if you put a breakpoint on line 40 of operant.m (nSinglePokeTrials = 5Wink, and hover over S, what do you see?

Thanks,
Josh

Thank you Josh for the detailed reply,
I use MATLAB R2017a, 
and Windows 10.

When trying to run operant from the editor i recieve an error before line 40:

Error in Operant (line 32)
S = BpodSystem.ProtocolSettings; % Load settings chosen in launch manager into current workspace as a struct called S
struct contents reference from a non-struct array object.

I am not sure if that's helpful....
I have now retried after activating Bpod and indeed the problem is with isempty(fieldnames(S)),
The error I receive is:
"Error using fieldnames
Invalid input argument of type 'double'. Input must be a structure or a Java or COM object.

Error in Operant (line 33)
if isempty(fieldnames(S))  % If settings file was an empty struct, populate struct with default settings"

When I hover over S I see nothing...
Reply
#5
Hi Noa


That's odd. BpodSystem.ProtocolSettings is a struct - so S = BpodSystem.ProtocolSettings should copy the struct to local variable S.

2 things that will help nail the problem:

1. If you put a breakpoint at the isempty(fieldnames(S)) line, at the debug prompt type:

 whos S

You should see:

Code:
>> whos S
 Name      Size            Bytes  Class     Attributes

 S         1x1                 0  struct    

If you see something else, we'll have to figure out why.

2. At the same breakpoint, if you type BpodSystem.ProtocolSettings at the prompt, you should see:

Code:
ans =

struct with no fields.

At this point, I'm split between the possibility that there's an incompatability with MATLAB r2017a, and the possibility that something else is wrong. Please let me know what you find for these two tests.
Reply
#6
Hi Josh,

Thank you!!

Here is my output for the two debugging tests:
Code:
K>> whos S
 Name      Size            Bytes  Class     Attributes

 S         0x0                 0  double              

K>> BpodSystem.ProtocolSettings

ans =

    []

For some weird reason I now get a different error message when I try to activate a protocol from the launch manager (and the GUI cannot identify the experiment, subjects, and settings when I choose the 'Operant' folder).  
Code:
Index exceeds matrix dimensions.

Error in NewLaunchManager (line 75)
SelectedProtocolName = ProtocolNames{SelectedProtocol};

Error in RunProtocol (line 28)
           NewLaunchManager;

Error while evaluating UIControl Callback.

I can try testing it on a computer with older version of MATLAB to see whether its a matter of versions.
Reply
#7
Hi Noa

If you have an older MATLAB version available, I'd love to know whether that fixes the problem.
Either way, we can run a remote desktop session to find out what happened more quickly. If you'd like to do this (later today or tomorrow), please follow up at support@sanworks.io.

-Josh
Reply
#8
(07-16-2017, 12:19 PM)Josh Wrote: Hi Noa

If you have an older MATLAB version available, I'd love to know whether that fixes the problem.
Either way, we can run a remote desktop session to find out what happened more quickly. If you'd like to do this (later today or tomorrow), please follow up at support@sanworks.io.

-Josh

HiJosh & Noa,

I experience exactly the same error using Bpod2.0 using Matlab 2017a on a Windows 7 64 bit machine.
How did you fix the issue?
Reply
#9
Hi MouseSF

I can't recall what the solution was, except that we found and solved it quickly. I vaguely remember it having to do with the paths being misconfigured. Apparently this isn't yet fixed in the repository, so let's nail it once and for all.

Please write to support@sanworks.io and we'll schedule a remote desktop support session for later on today or tomorrow.

Thanks!
-Josh
Reply
#10
Hi Josh,

Thanks a lot for your quick feedback!
Just wrote to the support at Sanworks.

Sarah
Reply


Forum Jump: