Forum
Register Calendar Latest Topics
 
 
 


Reply
  Author   Comment   Page 1 of 2      1   2   Next
cognoman

Junior Member
Registered:
Posts: 23
Reply with quote  #1 
Hi All, 

I'm new to ML and would appreciate your inputs on using a USB joystick, more specifically, a CTI electronics - Inductive control joystick (M20U9T). Also, can I get ML to work without a DAQ card?
You might be wondering why: I'm setting up a lab for human psychophysics currently and might not need any DAQ cards, but would like to be able to design experiments on ML that can be ported later on to the monkey set up. 

Thanks!
0
ryklin

Administrator
Registered:
Posts: 230
Reply with quote  #2 
Hi,

Regarding the USB joystick, I don't think it will work. We haven't implemented handlers for one; just a USB mouse/touchscreen. You'll need to use an analog joystick until we implement a USB one, but that's not a top priority for us right now.

I believe you can run ML without a DAQ card, but I'm not sure what will happen with the timing of events. I've never tried it. Presumably, you can port the experiment over to the monkey setup in the future with additional hardware for reward, etc., and the lack of a DAQ card on the human side shouldn't make a difference. Maybe someone else can comment further on this question.

For the psychophysical stimulus, do you plan to display movies?
0
Wael.Asaad

Administrator
Registered:
Posts: 54
Reply with quote  #3 
The problem with USB devices is their relatively slow communication rate.  It's not uncommon to have 20-50ms lags in data transfer due to the intermittent packet-based nature of USB protocols.  Therefore, support for USB devices is considered relatively low priority because they are inherently limited in light of our ~1ms response time goals.  We appreciate there are situations in which slower devices are probably ok (e.g., psychophysics in the absence of neurophysiology), so there is nevertheless the possibility that someone may wish to implement their own driver for USB joysticks the future.


0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #4 
cognoman,

I don't have a USB joystick, but can you download the attached program and see if it works with your joystick? If you can upload a screenshot back, it would be helpful.

 
Attached Files
zip Joystick.zip (25.53 KB, 11 views)

0
cognoman

Junior Member
Registered:
Posts: 23
Reply with quote  #5 
@ryklin and Assad: Yes, USB is not as seamless as we would want it to be! But, nevertheless, it is quite decent for the experiments we are carrying out.  
  
@Jaewon: Your application is detecting the joystick. Here's the screen shot. Hope this helps. joystick.jpg

0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #6 
Thanks, cognoman.

I have a couple of more questions. 1) Does your joystick have any button? The program seemed to detect a button press when you captured the screenshot. 2) When you move the joystick around, is there any pointer on the screen indicating its current position? If there is, do X Axis and Y Axis on the application report the same coordinate every time you relocate the pointer on a particular spot on the screen? For example, are X Axis and Y Axis always 0 (or some other values), when you move the pointer on the top-left corner of the screen?

I will be able to add USB joystick support to MonkeyLogic if I get answers to those questions, although I cannot tell when exactly it will be.
0
ryklin

Administrator
Registered:
Posts: 230
Reply with quote  #7 
Did this get resolved?
0
cognoman

Junior Member
Registered:
Posts: 23
Reply with quote  #8 
Hi, Jaewon! My apologies for the delay. Here're the answers to your questions.
Yes, the joystick has 3 buttons and your program does detect them, reliably. 
The joystick positions are consistent but I did not see any pointer on the screen. 



0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #9 
Thanks, cognoman. By the way, how can you tell if the joystick position is consistent, when there is no pointer on the screen?
0
cognoman

Junior Member
Registered:
Posts: 23
Reply with quote  #10 
The panel, that you see in the screen shot I had sent last time, shows me x and y coordinates. All I did was move the joystick to the 4 extreme positions a few times. But I took different routes to those endpoints to check for any hysteresis.
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #11 
Your testing wasn't exactly what I expected, but I know what you meant. Thank you. Please have a little patience until the USB joystick is supported.
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #12 
Hi cognoman,

I added USB joystick support to NIMH DAQ Toolbox. Can you help me test it? I don't have a joystick. If you are willing to help, please download the package below and install it. You may need to install VC2013 redistributable as well. The instructions are in the readme.txt file.

There is an example script (joytracker.m) in the \daqtoolbox\examples\ directory. It will print out the joystick position and the button status on the command window for 10 sec, when you run it. Please see if the printed numbers are reasonable. Thank you in advance.
0
cognoman

Junior Member
Registered:
Posts: 23
Reply with quote  #13 
Jaewon, sorry for the delay. I did as instructed but the code halts because "daqmex.mexw32" cannot be found. Do you happen to know why? I couldn't find the corresponding .c file to 'build' on my own, too.
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #14 
The installation instructions are in the readme.txt. I think you need to install VS 2013 redistributable.

https://www.microsoft.com/en-us/download/details.aspx?id=40784

You may see other problems since I wrote it without any testing. Any feedback will be a great help. Thanks.
0
cognoman

Junior Member
Registered:
Posts: 23
Reply with quote  #15 
I have installed VC 2013 redistributable but dont have VS. Is that the problem? 
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #16 
You don't need VS. If you installed the 32-bit redistributable correctly, there must be some other missing DLLs on your system. You can test it with the Dependency Walker. Since you are using 32-bit MATLAB, download the x86 Dependency Walker and open '\daqtoolbox\daqmex.mexw32' from it. Then it will show a window like the attached figure. If you can post back the names of the modules with a yellow/red mark or just a screenshot, we can track down what the problem is.

Attached Images
png file.png (99.17 KB, 4 views)

0
cognoman

Junior Member
Registered:
Posts: 23
Reply with quote  #17 
Cool. Here's the screenshot. daqmex screenshot.jpg
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #18 
What is your NI-DAQmx version? Somehow daqmex.mexw32 is not finding it.
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #19 
Hi cognoman,

I made NI-DAQmx as a separate module in NIMH DAQ so that you can run NIMH MonkeyLogic without a DAC board. Would you test if your USB joystick works with it?

http://forums.monkeylogic.org/post/nimh-monkeylogic-8118700?pid=1292719464

I attached a screenshot below to show where you can enable your joystick. If things go well, you should be able to see joystick buttons on the control screen as well as the joystick cursor.

Attached Images
png USB_joystick.png (26.98 KB, 7 views)

0
Levi2506

Junior Member
Registered:
Posts: 5
Reply with quote  #20 
Dear Jaewon,

We are also trying to use a USB Joystick. We downloaded the latest version of monkeylogic, which seems to work. We also run the joystick.exe, which detects perfectly our joystick. 

However, monkeylogic doesn't have the button to enable the joystick you were showing in your last screenshot. It still detects an USB joystick that can be detected in Touchscreen (not in joystick because that requires an analog input). However, we can't find an example task in monkeylogic that we can use to test our joystick.

Any suggestions!?!

Thanks
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #21 
Hi Levi2506,

Thanks for trying it out. The screenshot I showed is NIMH MonkeyLogic which you can download from the link below.

http://forums.monkeylogic.org/post/nimh-monkeylogic-8118700?pid=1292719464

I did not make any example task. If you don't have any task to test with, then try the next.

1) add \MonkeyLogic\daqtoolbox to the MATLAB path

2) go to \MonkeyLogic\daqtoolbox\examples

3) run joytracker.m

'joytracker' will print out the joystick positions and the button status for 10 secs. See if the numbers change as you move around your joystick or press the buttons.
0
Levi2506

Junior Member
Registered:
Posts: 5
Reply with quote  #22 
Hi Jaewon, 

Thank you very much for your help.

I downloaded the new version you implemented of ML. It is working fine with an analog Joystick. However, when I try to use the USB Joystick I still have some issues.

I think ML is detecting the USB joystick. Indeed, once the USB joystick is connected, the USB enable button displays "None" and "0" (while when I don't connect the USB joystick there is only "None" option). 

However, when I tried to run the  joytracker.m, it gives back the following error, which I am not wrong it is because ML doesn't detect correctly the USB joystick:

Error using pointingdevice (line 70)
JoyTrack::SetCooperativeLevel() failed, Code 0x80070006

Any ideas of how I can solve this problem?

Thanks a lot!



0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #23 
Hi Levi2506,

Your feedback is exactly what I needed. Would you download the zip file attached below, overwrite the contents on \MonkeyLogic\daqtoolbox and do the same test again? Thank you for your help.
0
Levi2506

Junior Member
Registered:
Posts: 5
Reply with quote  #24 
Hi Jaewon,

Thank you very much for the help and the link.

I have downloaded the .zip file.

Now monkeylogic is readying correctly the USB joystick.

However, the code joytracker.m gets stock in the function getsample. I think there is a problem on getting the correct data from the USB joystick.

Any idea while this is happening?

Thanks a lot!
0
Jaewon

Senior Member
Registered:
Posts: 312
Reply with quote  #25 
I made it print out some error message instead of being stuck. Please test it again. I know this is a tedious process, but there is no other way. I appreciate your help.

To see whether the joystick is detected correctly, you can try the following command.

>> joy = pointingdevice('joystick',0);
>> daqhwinfo(joy)

By the way, your post in this thread contradicts what you posted in this thread. Please let me know if you are experiencing a trouble in using your USB joystick.

 
Attached Files
zip daqtoolbox.zip (166.29 KB, 4 views)

0
Previous Topic | Next Topic
Print
Reply

Quick Navigation: