06-17-2008 04:45 AM
Hi All
I also encountered the same problem recently. I need to programmatically control Lab Brick digital attenuator which is also a HID compliance device.
I've tried the same way matt68 tried. Using VISA driver wizard but also couldn't open VISA session at MAX as matt68 did. (The error is exactly the same
as "max1.gif" attached at the top of this thread.
Then I tried to use call library function node to call HID.dll directly but all the function call require a void parameter and I don't know why.
The same problem happened when call setupapi.dll. I attached a pic "call dll viod.jpg" to show my situation.
So my questions are
1. How did I end up with void function prototype when calling DLLs?
2. Have anyone succeed to call HID and wrap it to a DLL (maybe not labview dll)? Would you mind sharing the experience with
06-17-2008 04:45 AM
Hi All
I also encountered the same problem recently. I need to programmatically control Lab Brick digital attenuator which is also a HID compliance device.
I've tried the same way matt68 tried. Using VISA driver wizard but also couldn't open VISA session at MAX as matt68 did. (The error is exactly the same
as "max1.gif" attached at the top of this thread.
Then I tried to use call library function node to call HID.dll directly but all the function call require a void parameter and I don't know why.
The same problem happened when call setupapi.dll. I attached a pic "call dll viod.jpg" to show my situation.
So my questions are
1. How did I end up with void function prototype when calling DLLs?
2. Have anyone succeed to call HID and wrap it to a DLL (maybe not labview dll)? Would you mind sharing the experience with me?
Thank
06-18-2008 11:31 AM
06-19-2008 07:57 PM
Thank you, Eric.
The information is helpful and I amm studying the example at the link you provided.
Kirika
06-20-2008 12:08 PM
12-28-2008 06:04 PM
Hello all. Trying to find USB devices without creating a USB raw driver is a headache to say the least.
I had someone create a dll which calls the Setupapi dll. I call his dll with a library node and selected the funtions i needed to comunicate,
.
What I what to do is call the setupapi.dll directly to find all devices connect to USB ports. See below link.
http://www.eggheadcafe.com/software/aspnet/32984513/setupdienumdeviceinterfac.aspx This link explains the process. My problem is I don't know what the parameters are for each call.
I don't know C++. I was looking at the header file and I can't make hwads or talls of it. l need documatation that would show the the parametrs of each call using the library node.
For example when I call setupapi and funtion SetupDiGetClassDevsExW, is the output just a string which returns all devices. Do I need input parameters?
Your help would be appriciated.
Thanks
01-01-2009 12:44 PM
found this link http://zone.ni.com/reference/en-XX/help/370051H-01/cvi/calling_windows_sdk_functions/ These are the some of the dll's I need to call.
The first thing I need to do;
-call the SetupDiGetClassDevs which is in the setupapi,dll. see link http://msdn.microsoft.com/en-us/library/ms792959.aspx
SetupDiGetClassDevs returns a handle to a device information set that contains all installed devices that matched the supplied parameters.
Depending what I set for parameters i can get imformation on all devices connected to all ports.
My problem is don't know how the parameters are configured.
HDEVINFO
SetupDiGetClassDevs(
IN LPGUID ClassGuid, OPTIONAL (how do I configure each of the parmteters in labview)
IN PCTSTR Enumerator, OPTIONAL
IN HWND hwndParent, OPTIONAL
IN DWORD Flags
);
There are more call I need to make ,but need to get this imformation first.
Thanks
01-06-2009 04:43 PM
Matt,
I do not actually have the Windows Driver Kit installed myself right now, but here are a few links that may help to get you started:
Where Can I Get Help Calling Windows API Functions from LabVIEW?:
http://digital.ni.com/public.nsf/allkb/09057CC08746FD47862566E800619B12
Windows API Function Utilities (32-bit) for LabVIEW:
http://sine.ni.com/devzone/cda/epd/p/id/4935
An example for calling the Win32 API from the LabVIEW 8.5 Help:
http://zone.ni.com/reference/en-XX/help/371361D-01/lvexcodeconcepts/ex_3_call_the_win32_api/
An example for calling the Win32 API from the LabVIEW 8.6 Help:
http://zone.ni.com/reference/en-XX/help/371361E-01/lvexcodeconcepts/ex_3_call_the_win32_api/
Eric
National Instruments
Applications Engineer
01-06-2009 10:09 PM
01-07-2009 05:17 PM
Takeshi O,
Do you have a hardware driver for your USB device from the manufacturer? I can look into what may be causing your error in device manager if needed, but this sounds like a case where a driver should already exist, and you may be able to play audio through the USB audio mixer just like you would through an internal sound card. If you do have a driver from the manufacturer, try installing it and then try using a sound output VI example, such as Sound Player.vi in the example finder.
The example finder can be found by opening LabVIEW, opening the help menu at the top and selecting "Find Examples". Once this is open select the 'Search' tab in the, and searching for "sound". From there scroll down towards the end of the list and you should find the "Sound player.vi" example. Open this example and try running it with a selected .wav file and trying different Audio device ID's to find you USB Audio Mixer device.
Let us know if this helps or not!
Eric K
Applications Engineering
National Instruments