Shop OBEX P1 Docs P2 Docs Learn Events
Incorporating FTDI's D2XX Driver into a VB.net application? — Parallax Forums

Incorporating FTDI's D2XX Driver into a VB.net application?

SteelSteel Posts: 313
edited 2007-01-21 04:03 in General Discussion
Has anybody done this?

This might not be the right place, but I don't know where else I can get good information.

I purchased the FT232RL.· There are 2 possible drivers for it:· The VCP and the D2XX.· I am making an application, and I would really like seemless USB functionality(the user doesn't need to know what com port the device was assigned to) and was under the impression the D2XX provided that.

Unfortunately, in my application, I am not able to call a reference to the FTD2XX.DLL object.· I get "I reference to ...could not be added.· Make sure that the file is accessible, and it is a valid assembly or COM Component"

How do I reference the D2XX so I can access it's functions?

Please help
Shaun

Comments

  • Desy2820Desy2820 Posts: 138
    edited 2007-01-20 02:15
    I'm not a programmer or a world class computer person, so this information may be contradicted.

    Shaun, as far as I know, the driver has to be loaded by Windows as a "device", just like a printer,·camera, etc.· I think that only Windows would be able to talk to the device drivers.· (security reasons?)· Once Windows installs the drivers and the USB device is plugged in, your application would talk to it·just like it would talk to·any other system port,·such as serial, parallel,·firewire, etc.

    I would think that there would be a way within VB.net to ask Windows which port it assigned to the device, how you do that I have no clue.· Once you know which port it is, you can talk to it.· I would also think that you may need to do this every time the program is started since the port may "move" as the user unplugs and adds other devices.

    As far as installing the drivers, you could do that as part of your application's install routine, or create very clear directions for the end user on which files to install and in what order.
  • Keith MKeith M Posts: 102
    edited 2007-01-20 04:07
    I've interfaced with the FTDI232BM with Parallax's USB2SER development tool using the VCP drivers. I'm writing everything in C in .net, and the VCP drivers make it very easy and fairly transparent. Simple serial port calls get automatically translated.

    You would not necessarily have to involve the user with selecting a com port, you could certainly search the list of available ports for the string "USB Serial Port" which is how the device should show up.

    An example of how to do this in VB can be found here, although be forewarned that I'm not a VB programmer.

    vbnet.mvps.org/index.html?code/enums/enumports.htm

    You could also use a registry method to extract the com port number, by checking HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM and look for a REG_SZ string key with "VCP" in the name. This would yield the comm port number to open.

    With this being said, I'm guessing you've checked FTDI's site and found www.ftdichip.com/Projects/CodeExamples/VB.htm ?? I found FTDI's site to be full of good info, and I emailed their support at

    E-Mail (Support): support1@ftdichip.com

    and found them to be quick and helpful.


    Hope this helps,

    Keith
  • DigitalDjDigitalDj Posts: 207
    edited 2007-01-21 04:03
    Steel,

    Write your code as you would as normal to the serial port. The when you plug in your project to the usb port it will ask you for the driver. Both .dll's you listed above are now integrated together and when windows asks for the driver point it to your folder where the files are. After plugging in your project and installing the driver goto control panel, system, hardware, device manager and goto the list to ports and double click and this will tell you your virtual com port to set your software to.

    Also you are talking about not having to specify the port in your app and have it auto detect, not an easy task but you will have to know more on the .dll from FTDI Chip. I know in my app it is not possible without extenisive programming. You will need to: Call Get (then .dll specs for that function)

    Kevin


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Education And Experience Teaches Knowledge Not Arrogance ! (Unknown)
    The Only Stupid Question Is The One Not Asked ! (Unknown, of coarse this is something that i would say)
    Do Not Burn The Bridge That Has Brought You Forth You May·Need To Journey Back ! (Chinese)


    Post Edited (DigitalDj) : 1/21/2007 4:13:34 AM GMT
Sign In or Register to comment.