06-30-2010
06:52 PM
- last edited on
04-23-2025
12:36 PM
by
Content Cleaner
Hi all,
Software is not exactly my strength, so I apologize if this question is poorly worded or trivial.
I am trying to use NI-VISA 4.6 to create a driver for a USB mouse. My eventual goal is to read off the raw positional data from the USB rather than read the mouse's position on the screen. This way I will be able to use the mouse to track distance traveled without having to worry about the cursor going off the edge of the screen. My VI will be working roughly along the lines of this one, which was so kindly offered by Intaris on this thread.
I am running into problems installing the driver I created with NI-VISA mostly following directions from here. I created the .inf driver and copied it to C:\Windows\inf. Since I am using Windows 7, I copied the Vista driver rather than the driver for earlier versions of windows (another user on the tutorial I linked to above said this worked). I selected my .inf file and clicked "install" from the right mouse button drop-down menu. I received an error message the first time I tried saying that the driver was not verified and proceeded anyway. No .pnf file was created in the inf folder (as I believe that it should have). I tried updating the driver for this particular mouse to the new driver I created in the device manager. Windows resisted, saying that it already had installed the best driver for the job.
So now I am not exactly sure what to do. I believe that other people have figured out how to get this to work, but I am clueless as to what I can do differently. Does anyone out there know what might be wrong? Does there need to be a .pnf file in order to get the driver to work?
Thanks
Solved! Go to Solution.
07-02-2010
02:54 AM
- last edited on
04-23-2025
12:36 PM
by
Content Cleaner
Hi Dr. Olfe,
Although your mouse probably falls within the USB RAW category, the caveats listed in this KnowledgeBase: Why is NI-VISA Unable to Control my USB Device? still apply. As it mentions in that article, "NI-VISA was designed to be used with USB devices that do not have a specified class and do not have a current driver installed..."
That being said, I am curious if you see the same behavior with different mice. I hope this helps!
Sincerely,
- Greg J
07-02-2010 12:44 PM
Thanks for the help, Greg.
Unfortunately, the issue is the same with every mouse. I can specify both the class and the vendor in NI-VISA without a problem. The problem, as best I can tell, is that Windows 7 insists on reading the generic USB Mouse HID driver instead of the one I installed. I believe this is a common problem, from looking at the knowledge base pages. It seems that I now have two options:
1: I can uninstall the generic USB HID drivers fro my computer.
2: I can read the raw mouse input from hid.dll
The first solution makes me very nervous, as if I mess something up, my lab's IT support will be rather upset. Also, I am not sure if I will even be able to use my PS/2 mouse once these drivers are uninstalled.
The second solution would be the way to go if I had any idea what I was doing. I know that the general response is "check out Microsoft documentation and use the Call Library Function Node." Given my total lack of knowledge with C or .NET programming (not to mention that I am a beginner with LabVIEW) this looks like it will be really difficult. Does anyone have sample code for reading hid.dll with a Call Library Function Node? Is there another way around this?
-David
07-07-2010
09:43 AM
- last edited on
04-23-2025
12:37 PM
by
Content Cleaner
Dr. Olfe,
I don't know if you've seen the following KnowledgeBase articles, if not, they might prove to be helpful.
How Can I Communicate With a Device Using NI-VISA USB RAW Mode?
Programming HID Compliant USB RAW Devices in Windows Vista using NI VISA
Also, from searching our website I wasn't able to find anybody who posted any code that shows how to use this DLL, but may people did reference the follow forum post as being really helpful.
Nugget: 1 of n : Getting started with USB communication via VISA
07-14-2010
03:58 PM
- last edited on
04-23-2025
12:37 PM
by
Content Cleaner
Thanks for everyone's help. I think I finally found the solution .
I did a lot of fumbling with Windows and eventually I got a driver I created in NI VISA to be accepted. Since the whole thing was hacked together, I am having trouble determining the steps that got it to work. I am not sure that this list of steps is either entirely necessary or complete, but in the interest of helping out people with a similar problem, I will try to explain what I did to get the mouse to be read.
The key was probably uninstalling the mouse that I wanted to use for the project. I did this in the device manager, and then found the USB root hub that was running my device. I updated the driver through here rather than through the "Mouse" section. The information on how to do this is explained in more detail in these two KnowledgeBase articles:
http://digital.ni.com/public.nsf/allkb/28C5E7D2E9FBB4CC86257536005A3692
http://digital.ni.com/public.nsf/allkb/3C335141B64C038886257141000036F2?OpenDocument
I created the NI-VISA drivers and saved them in the default folder (under MyDocuments/National Instruments/NI-VISA) and installed them from there. I am not sure if the installation step was necessary. Then I updated the drivers as explained in the second linked KnowledgeBase article listed.
I think that the crucial step was uninstalling the mouse in the Device Manager. This might be the "firmware" mentioned in the KnowledgeBase article linked below, but the wording is so ambiguous that I thought I would have to uninstall the drivers.
http://digital.ni.com/public.nsf/allkb/273BB58D3B52CE6886256F3B00714D03
Thanks again for the help
-David
07-14-2010 09:28 PM
That pretty much makes sense. The firmware is inside the mouse and is what the mouse uses to communicate with the PC through the USB port and is what tells Windows it's a mouse. The only reason the wording might be ambiguous is because the KB article is written to help people use any USB device that is not being identified the way the user wants it to in Windows. There are probably many devices that have ID codes that Windows would think is a mouse or a keyboard when you first plug it in even when it isn't, but something unusual. Actually, I'd say your use case of trying to use a mouse in a way that non-mouse-like way in the Windows world is unusual.
Have you ever noticed that most installation instructions now tell you to install the drivers for a device before you actually plug in the device. (Back in the old days, you were usually told to plug in the device into an RS-232 port first, then run the driver. That was so when the driver ran, it could immediately go out and establish communication and verify operation.) Now, you install the drivers first because it is the Windows plug and play system that goes to work. As soon as you plug a device in, PnP tries to identify the device and use the best driver it has a available for it. So if you plug in a mouse, of course, you get a mouse driver. Probably a generic mouse driver. If you use some sort of display, you might get some generic display driver. But, if you first install the drivers that come with the device, now Windows will have the best, most correct driver, then when you finally do plug in the device, Windows can correctly identify the device and use the driver that was intended by the vendor.
07-11-2013 09:10 AM
I dont know how to describe my problem exactly, but I am facing same problem as faced by author. I am trying to communicate my microcontroller as USB RAW visa device in windows xp system, but everytime I am seeing HID-compliant device. However, 2-3 years back I have not faced this problem while communicating with windows vista OS. I can still communicate my microcontroller with labview as USB RAW device in my other PC with having Vista OS.
Now, I dont remember what special I did at that time. I did everything suggested by author, but not helping.
Kindly help.
07-12-2013 07:33 PM
Hello,
It sounds like you might be experiencing a slightly different problem than this original post. Did you look at the additional documentation that is linked regarding HID devices and using USB RAW in LabVIEW?
You will also probably get more responses from a new discussion as this thread is a couple years old and has already been marked as solved.