Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
stremblay

Member
Registered:
Posts: 65
Reply with quote  #1 
Hi all,

Using Matlab 2013b or 2014a and ML 1.0.75, or .79, or .80 with a task involving a touchscreen, I see that my mouse pointer disappears when I start the task. The problem is that it never reappears, whether to do a manual block change (B), or even after quitting the task and monkeylogic. Oddly, the mouse is still active (i can still click), but it becomes invisible whenever is hovers a matalb-related window, whether it is the control screen or the main matlab interface.

Using Matlab 2015b, I do not experience this bug. Sadly, 2015b gives very long cycle latencies, as discussed in another thread, which makes it unusable.

Do anybody else experience this bug? Any hint for a solution?

Thanks in advance!
0
Edward

Administrator
Registered:
Posts: 260
Reply with quote  #2 
Try going into the conditions file and editing the end of the file where xglshowcursor is called. Maybe by debugging this you can get the cursor to reappear properly. Otherwise, I will handle this myself next week.
0
ctestard

Junior Member
Registered:
Posts: 20
Reply with quote  #3 
Hi Ryklin,

I have run some debugging with XGL to solve this issue of the mouse not reappearing or not disappearing when xglshowcursor calls are made and found something you might want to know.

If there are two calls to xglshowcursor(OFF) in a row, a single call to xglshowcursor(ON) will not make the cursor reappear. To make it reappear, you would need a second call to xglshowcursor(ON). In other words, there needs to be a balanced number of OFF and ON calls for xglshowcursor to work properly.

Unfortunately, the pipeline in ML makes several calls to xglshowcursor in a row, either directly or through mlvideo('showcursor'). This leads to ON-OFF imbalances that will make XGL stop responding properly to xglshowcursor calls. Thats why sometime, depending on the pipeline, the cursor will reappear properly or not after exiting ML.

Importantly, if an ON-OFF imbalance persists when xglrelease is called, XGL will start behaving weirdly and lead to crashes in ML. This is when you need to restart Matlab to have your cursor again. This type of error is made, for example, by mlflush.m which calls mlvideo('flush'). The latter initializes XGL, calls a xglshowcursor(ON), then releases XGL. However, depending on whether xglshowcursor was already ON or not, this will cause XGL to behave weirdly. For example, if you click the Run button in ML more than once in a single ML session, this will call 'flush' twice and create the silent error that only manifests itself when exiting ML and the cursor not coming back. This also explains why you would not get this error on the first run of ML on a fresh MAtlab session.

A simple fix to this bug was to comment out mlvideo('flush') in mlflush.m. Since then, my cursor is always behaving properly; hiding during task execution, and coming back after ending the task.

I hope this helps.

ps. I am using ML version 1.0.97 on Matlab r2013b
0
ctestard

Junior Member
Registered:
Posts: 20
Reply with quote  #4 
Another point about XGL....

I often get the following error running my tasks:

<<<*** MonkeyLogic ***>>> Task Loop Execution Error

Error using xglmex

XGL has not been initialized

This can occur for several different reason, but here is at least one of them.

Whenever there is a call to the XGL toolbox after it has been released, you will get this error. Now this occurs all the time when the function error_escape is called from monkeylogic.m. This is because error_escape makes calls to XGL after an error has occurred with ML. However, the error has probably in the first place led XGL to be released, which will then trigger a second error:

<<<*** MonkeyLogic ***>>> Task Loop Execution Error

Error using xglmex

XGL has not been initialized

 

Error in xglshowcursor (line 12)

xglmex (29, rhs1, rhs2);

 

Error in mlvideo (line 225)

        xglshowcursor(devicenum, val);

 

Error in monkeylogic>error_escape (line 2152)

mlvideo('showcursor', ScreenInfo.Device, 1);

 

Error in monkeylogic (line 1123)

        error_escape(ScreenInfo, DaqInfo, fidbhv);

 

Error in mlmenu (line 2327)

                monkeylogic(condfile, datafile, testflag);

 

This has several consequences, such as improper saving of ML error messages that can be useful.

To solve this issue, I have commented out the two following lines inside the error_escape function:
-mlvideo('showcursor', ScreenInfo.Device, 1)
-close_video(ScreenInfo);

This will avoid the second error involving XGL to occur, and will allow proper handling of the initial error by ML.

Hope this helps,

best,
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.