FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Author Topic: FTD2XX_NET.DLL - how do I make it work?  (Read 8387 times)

Nebr

  • Newbie
  • *
  • Posts: 2
    • View Profile
FTD2XX_NET.DLL - how do I make it work?
« on: March 22, 2023, 03:14:38 PM »

Hello, I have a seemingly very basic problem that I was unable to solve. I want to program an MX-Series II device with the help of the D2XX driver. I have seen that there exists a C# wrapper, the FTD2XX_NET.DLL. So i downloaded the wrapper and tried to create a very simple console app just to test the proper working:

    var myClass = new FTD2XX_NET.FTDI();
    string desc;
    myClass.GetDescription(out desc);
    Console.WriteLine(desc);
    Console.ReadLine();

I added a reference to the FTD2XX_NET.DLL to my project and also installed the D2XX driver by downloading and executing the driver file CDM212364_Setup.exe. The drivers were properly installed in my temporary driver store (C:\Windows\System32\DriverStore\FileRepository), so it seems that this worked. But when I run the program, I get the error message

"Attempting to load FTD2XX.DLL from:
C:\MyConsoleApp\bin\Debug\net6.0
Failed to load FTD2XX.DLL.  Are the FTDI drivers installed?"

Referencing the ftd2xx.dll in my project won't work ("The reference is invalid or unsupported"). Putting the dll into the bin\Debug\net6.0 folder does not change anything. I even tried to import the DLL directly via DllImport:

[DllImport("ftd2xx.dll")]
static extern uint FT_ListDevices();

However, I only get a System.BadImageFormatException.

I also tried to get the example codes provided working, but I failed as well. The USBTransfer example shows exactly the same problem with the AID.DLL.

I seem to be unable to get this working. What am I doing wrong? Can anybody help me here?

Version info: I am using Windows 11 Pro and Microsoft Visual Studio Professional 2022 (64-bit), Version 17.4.4. The wrapper version is FTD2XX_NET_v1.2.0.
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 892
    • View Profile
Re: FTD2XX_NET.DLL - how do I make it work?
« Reply #1 on: March 23, 2023, 04:19:37 PM »

Hi Nebr,

MX-Series II is an OEM device that is not made by FTDI, but it does seem to be using one of our chips inside. the issue may be that the device is using a custom driver. could you please send me a USBView screenshot of the device plugged in please and i can check the VID/PID.

You can also reference our C# examples. They can be found on our website here: C# Examples.

Best Regards
FTDI Community
Logged

Nebr

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: FTD2XX_NET.DLL - how do I make it work?
« Reply #2 on: March 24, 2023, 10:45:19 AM »

Hello,

thank you for your response! I have the same problem with the C# example: I can't work with example 1 because the file AID.dll is not found or not accepted as reference (exactly the same behavior as described with the ftd2xx.dll. I feel like I am doing something fundamentally wrong...

Please find the requested USB View screenshot in the attachment.

Best regards


EDIT: I seem to have solved the problem. The drivers I downloaded seem indeed to have some issue. I have installed the Rheodyne Titan Valve Control Software and now it works with the drivers the software installation process installs.
« Last Edit: March 24, 2023, 02:27:00 PM by Nebr »
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 892
    • View Profile
Re: FTD2XX_NET.DLL - how do I make it work?
« Reply #3 on: March 24, 2023, 04:41:21 PM »

Hello,

Example 1 is provided by a Third Party.

Can you try Example 3 which uses the FTDI C# wrapper?
Please also update it with the latest C# wrapper found at the top of the page.

I'm glad to read that you have solved the original problem though.

Best Regards,
David Paterson
Logged