Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
youngj01

Junior Member
Registered:
Posts: 9
Reply with quote  #1 
Hi, everyone.  I am new to the forum and to MonkeyLogic.  I am trying to get the mouse support working, but I keep getting this error when I try to use the mouse:

---

<<<*** MonkeyLogic ***>>> Initialization Error
Error using xglmex
Invalid device number

Error in xglrect (line 19)
[lhs1] = xglmex (11, rhs1);

Error in mlvideo (line 257)
       xgl_pos = [xglrect(1); xglrect(2)]; % monitor positions by XGL

Error in mouse3_runtime>eyejoytrack (line 700)

Error in mouse3_runtime (line 24)

Error in monkeylogic (line 566)
       feval(timingfile, TaskObject, TempScreenInfo, DaqInfo, MLConfig.EyeTransform, MLConfig.JoyTransform, BehavioralCodes, TrialRecord, trialtype);

Error in mlmenu (line 2319)
               monkeylogic(condfile, datafile, testflag);

C:\Users\Hamlin\Documents\MATLAB\monkeylogic\MonkeyLogic\mlhelper --cursor-enable
Warning: Calling MEX-file 'C:\Users\Hamlin\Documents\MATLAB\monkeylogic\MonkeyLogic\prttoolbox\prtmex.dll'.
MEX-files with .dll extensions will not execute in a future version of MATLAB. 
In prtnormal (line 7)
 In monkeylogic>error_escape (line 2168)
 In monkeylogic (line 573)
 In mlmenu (line 2319) 
Error using xglmex
XGL has not been initialized

Error in xglshowcursor (line 12)
xglmex (29, rhs1, rhs2);

Error in mlvideo (line 236)
       xglshowcursor(devicenum, val);

Error in monkeylogic>error_escape (line 2170)
mlvideo('showcursor', ScreenInfo.Device, 1);

Error in monkeylogic (line 573)
   error_escape(ScreenInfo, DaqInfo, fidbhv);

Error in mlmenu (line 2319)
               monkeylogic(condfile, datafile, testflag);

Error while evaluating UIControl Callback

----

I am using Windows 7, MATLAB 2015b (32 bit), and the current version monkeylogic from the forum (12/24 I believe).  I get this error when I try any of the mouse scripts included.

Any help you could give me would be greatly appreciated, and I am happy to tell you about any other ones I run into in the process of debugging.
0
Edward

Administrator
Registered:
Posts: 260
Reply with quote  #2 
Have you tried any other projects to isolate the problem is indeed in the mouse sample?

Looks to me like your video resolution and display number are incorrect
0
youngj01

Junior Member
Registered:
Posts: 9
Reply with quote  #3 
Sorry for my slow reply.  You were completely right.  It wasn't initializing because I was piloting it on a system with only one monitor.  Now it has two and the monitor setting issues have been corrected.  

However, mouse3 is throwing another error:

<<< MonkeyLogic >>> Initialization trial starting...
C:\Users\Hamlin\Documents\MATLAB\monkeylogic\MonkeyLogic\mlhelper --cursor-disable
Warning: skipped 2 frame(s) of C:\Users\Hamlin\Documents\MATLAB\monkeylogic\MonkeyLogic\initializing.avi at 598.6 ms
C:\Users\Hamlin\Documents\MATLAB\monkeylogic\MonkeyLogic\mlhelper --cursor-enable
<<< MonkeyLogic >>> Successfully initialized Timing Files.
<<< MonkeyLogic >>> BHV File: C:\Users\Hamlin\Documents\MATLAB\monkeylogic\MonkeyLogic\Tasks\mouse\Experiment-jake_test17-01-15-2016(01).bhv. Started running trials at 3:48 PM...
C:\Users\Hamlin\Documents\MATLAB\monkeylogic\MonkeyLogic\mlhelper --cursor-disable
C:\Users\Hamlin\Documents\MATLAB\monkeylogic\MonkeyLogic\mlhelper --cursor-enable
<<<*** MonkeyLogic ***>>> Timing File Execution Error
Operands to the || and && operators must be convertible to logical scalar values.

Error in mouse3_runtime (line 111)

Error in monkeylogic (line 1127)
TrialData = feval(timingfile, TaskObject, ScreenInfo, DaqInfo, MLConfig.EyeTransform, MLConfig.JoyTransform, BehavioralCodes, TrialRecord, trialtype);

Error in mlmenu (line 2319)
monkeylogic(condfile, datafile, testflag);

---

What happens on the screen is that you can see both boxes and the cursor, but the cursor isn't moving.  

0
Edward

Administrator
Registered:
Posts: 260
Reply with quote  #4 
I'm not exactly sure, because the error starts as a Timing File Execution Error, and I'm assuming you didn't modify the sample timing file. Can you check the following:

In the MonkeyLogic Menu, the advanced section, Enable Mouse/System Keys, should be checked to ON. That maybe one reason, the other is that you should not click anywhere other than the stimulus display.
0
youngj01

Junior Member
Registered:
Posts: 9
Reply with quote  #5 
Ok that got it working.  I didn't realize that was an option there, but I redownloaded to this build of MonkeyLogic to make sure nothing was changed.  It definitely will crash out if you click off the screen though.  

0
Edward

Administrator
Registered:
Posts: 260
Reply with quote  #6 
Progress is always a good thing!

I've had both of the other issues on my back burner for a while now. If I can figure out how to automatically set that GUI option within the timing file, I will certainly notify the forum. Likewise, if you figure it out, let us know.  Also, the solution to clicking outside the video stimulus window is not simple (as far as I know). So, until we think of something, you'll have to tolerate that one annoying problem. 

Let me know if you have any other questions or feature requests.
0
Edward

Administrator
Registered:
Posts: 260
Reply with quote  #7 

For using the touch screen or mouse, as stated earlier, its necessary for the user to enable the mouse/ system keys option in the advanced menu. However, you can now also add these 3 lines of code to the top of your timing file, it will come included in all the sample tasks from now on.

dirs = getpref('MonkeyLogic', 'Directories');
message = sprintf('%smlhelper --cursor-enable',dirs.BaseDirectory);
system(message);

0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.