General Category > Discussion - Software

FT2232H How to create and work with two channels?

(1/1)

Pereubu123:
In the documentation: "..
each channel would be opened with a different instance
and ... Open: 
ftStatus = myFtdiDeviceCHA.OpenByIndex(0);
ftStatus = myFtdiDeviceCHB.OpenByIndex(1);
..."


The question is how to open two instances:

FTDI myFtdiDeviceCHB = new FTDI();
ftStatus = myFtdiDeviceCHB.OpenByIndex(1);

I am writing in C#.
From there I should  access BDBUS and BCBUS...

But I could not access B channel?
Have I done something wrong?

Timbo:

--- Quote from: Pereubu123 on September 28, 2018, 03:01:45 PM ---In the documentation: "..
each channel would be opened with a different instance
and ... Open: 
ftStatus = myFtdiDeviceCHA.OpenByIndex(0);
ftStatus = myFtdiDeviceCHB.OpenByIndex(1);
..."


The question is how to open two instances:

FTDI myFtdiDeviceCHB = new FTDI();
ftStatus = myFtdiDeviceCHB.OpenByIndex(1);

I am writing in C#.
From there I should  access BDBUS and BCBUS...

But I could not access B channel?
Have I done something wrong?

--- End quote ---

Did you ever resolve this? I am in same boat, now.

FTDI Community:
Hello,

If you use multiple channels, ensure to have an instance for each and you can then open and use them as shown below:


--- Code: ---FTDI myFtdiDeviceCHA = new FTDI();
FTDI myFtdiDeviceCHB = new FTDI();
...
...
ftStatus = myFtdiDeviceCHA.OpenByDescription("FT2232H A");  // assuming EEPROM description is "FT2232H"
ftStatus = myFtdiDeviceCHB.OpenByDescription("FT2232H B");  // assuming EEPROM description is "FT2232H"
...
...
ftStatus = myFtdiDeviceCHA.Write(buffer, NumBytesToSend, ref NumBytesSent);
ftStatus = myFtdiDeviceCHB.Write(buffer, NumBytesToSend, ref NumBytesSent);

--- End code ---

Best Regards, FTDI Community








Navigation

[0] Message Index

Go to full version