Jump to content
Joshwa

Problem with a .dll for HID device

Recommended Posts

Hello,

 

I am a .dll  that act as interface with my HID device and Windows API.

I am a problem to open a connection with my device using the CLFN. But if i run the example, that is made with VC++, that is provided from  the Author of the .dll, the function return me the error code: "Device not Found"

 

The function and prototype in the DLL is:

 

FT260_STATUS FT260_OpenByVidPid(WORD vid, WORD pid, DWORD deviceIndex, FT260_HANDLE* pFt260Handle)

FT260_STATUS is an enum that i defined it as uint8 enum in labview

 

 

This is how I configured the CLFN:

 

uint8_t FT260_OpenByVidPid@16(uint16_t Vid, uint16_t Pid, uint32_t DeviceIndex, uint32_t* SessionID)

Convenction call is: stdcall (WINAPI)

 

 

Can someone help me to understand what is the problem?

 

Thank you very much

Share this post


Link to post
Share on other sites

I'm not a HID device expert (Rolfk maybe?), but there seems to be several DLL wrappers to talk to HID devices, but the best solution is to use NI-VISA and talk to it over USB Raw.  For this you'll need to make your own INF driver using the NI-VISA Driver Wizard (should be installed with NI-VISA).  Then install that driver for your device instead of the one from Microsoft (Device Manager).  For this in Windows 8 and newer you'll need to disable driver verification.  Then the device shows up in MAX, and the Help >> Find Examples and searching VISA Raw will show some examples.

http://www.ni.com/tutorial/4478/en/

https://forums.ni.com/t5/LabVIEW/Nugget-1-of-n-GEtting-started-with-USB-communication-via-VISA/td-p/743518

https://forums.ni.com/t5/LabVIEW/Nugget-2-of-n-USB-Control-transfers-using-VISA/td-p/757011

If you can't or won't use VISA then there are lots of other DLL wrappers but I haven't found one that works as well as VISA with custom driver.

http://ahidlib.com/pages/programming_labview.php?lang=en (license needed for full?)

https://forums.ni.com/t5/Example-Programs/Windows-API-HID-Functions-Enumeration/ta-p/3513868

https://forums.ni.com/t5/LabVIEW/Confusion-between-HID-and-VISA-communication/m-p/1741390#M610130

https://forums.ni.com/t5/LabVIEW/Need-Example-Code-to-Interface-with-a-USB-HID-compliant-Device/m-p/2763516#M814451

https://forums.ni.com/t5/LabVIEW/How-to-configure-the-call-library-function-using-a-dll-for-HID/m-p/2757194#M813218

https://www-user.tu-chemnitz.de/~heha/mb-iwp/Durchflussmesser/

 

Share this post


Link to post
Share on other sites
On 5/15/2019 at 5:18 PM, Joshwa said:

Hello,

 

I am a .dll  that act as interface with my HID device and Windows API.

I am a problem to open a connection with my device using the CLFN. But if i run the example, that is made with VC++, that is provided from  the Author of the .dll, the function return me the error code: "Device not Found"

So when you run the VC++ example you get an error! Well that is hardly LabVIEW related isn't it?

You must make sure that you pass the right VID (vendor ID) and PIC (product ID) as programmed in the chip. The chips should come with a default VID and PID from FTDI but it can be changed by a utility from FTDI. Check in the Windows device manager for your interface and in the driver settings you can see the VID and PID values, but they are in hexadecimal notation.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.