FTDI Community

General Category => Discussion - Software => Topic started by: Oric on November 21, 2023, 06:57:31 PM

Title: Access to 1 FT245B with 2 different programs simultaneously
Post by: Oric on November 21, 2023, 06:57:31 PM
Hello FTDI Community  ;D

Originally I had a DLL written in Visual Studio 6 ( win98 ) to communicate with an ISA card.
Several programs written in Visual Basic 6 can access this DLL and communicate simultaneously with the card. The DLL is written using mutex principles.
I replaced the bus part of the card with an Ftdi FT245. I rewrote the DLL to use D2xx driver. I can make the programs work, but only one at a time. I use the FT_Open, FT_Write, FT_Read, FT_Close functions.
I tried to share the handle in shared memory.
The other programs recover it well and do not open the port if it is already open, and uses the handle retrieved from shared memory to control the FT_Write, FT_Read functions, but these write and read functions return an error.

Thank you for your help
Title: Re: Access to 1 FT245B with 2 different programs simultaneously
Post by: FTDI Community on November 22, 2023, 04:07:26 PM
Hello,

When using the D2xx driver it can only be accessed by one handle at a time.

Note that FT245B is Not Recommended for New Designs (NRND) and is being made EOL.
See AN_559 Migrating from FT2xxB (https://ftdichip.com/wp-content/uploads/2022/05/AN_559-Migrating-from-FT2xxB.pdf) however the same limitation applies with the D2xx driver.

There could be other FTDI Community members who have experience with sharing a handle in shared memory but it's not something that FTDI support.

Best Regards,
FTDI Community
Title: Re: Access to 1 FT245B with 2 different programs simultaneously
Post by: Oric on November 22, 2023, 09:50:04 PM
Yes, I know that the FT232 and FT245 can only be opened once. They provide a handle once opened.
This is why I only open it once and save the handle in shared memory so that other programs use it for read and write functions, but it doesn't work. I also have the same problem with the VCP driver
Title: Re: Access to 1 FT245B with 2 different programs simultaneously
Post by: FTDI Community on November 23, 2023, 04:50:35 PM
Hello,

Unfortunately this is not something that we have any experience with.

Other FTDI community users may be able to help.

Best Regards,
FTDI Community