LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding FTDI Chip COM Port Numbers

Solved!
Go to solution

I was seaching for any easy way to obtain the COM port numbers of FTDI Chips to know whether or not to attempt to connect to a device. FTDI Chip has LabVIEW drivers on this page but they only use an ID number (Handle) to communicate with the devices. Here is how to do it for those interested....

 

Referencing the FTDI Chip manual....

http://www.ftdichip.com/Support/Documents/ProgramGuides/D2XX_Programmer%27s_Guide%28FT_000071%29.pdf

 

All the functions in the manual call "FTD2XX.DLL" which is installed with the FTDI Chip D2XX driver. A call not included in the LabVIEW drivers is the "FT_GetComPortNumber" function which uses a the ID number (Handle) to obtain a COM port number.

 

Attatched is the edited FTDI Chip drivers with two new VIs:

1) FT_Get_Com_Port_Number.vi

2) Get COM Port Number Demo.vi

 

Block diagrams:

1)

get_com_port_number.JPG

 

 

2)

com_example.JPG

Message 1 of 18
(11,640 Views)

I remember finding the COM-ports with Visa Find Resources...

 Visa_find.png

 

to know what filter you want you should use: devcon microsoft

 

It works this way to.... (from the old thread 🙂 )    , I have two ftdi's connected to my machine and it shows me the 1st one when I use ASRL as filter!

Visa_find.png

 

Good luck!  

0 Kudos
Message 2 of 18
(11,607 Views)

@_Xilinx_ wrote:

I remember finding the COM-ports with Visa Find Resources...

 Visa_find.png

 

to know what filter you want you should use: devcon microsoft

 

It works this way to.... (from the old thread 🙂 )    , I have two ftdi's connected to my machine and it shows me the 1st one when I use ASRL as filter!

Visa_find.png

 

Good luck!  


Why not just autoindex the array?  Then you do not need to wire up the N or use Array Index.  That's what my code for this setup does.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 18
(11,588 Views)
I really dislike using the D2XX driver since the ports don't show has RS232. It forces you to only use ftdi converters and you can't use the normal LabVIEW serial functions.
0 Kudos
Message 4 of 18
(11,566 Views)

I believe the issue with this method is that you can't get any information from the ASRL resource to denote that it is an FTDI Chip, or whatever manufacturer for that matter. So say you have 10 ASRL devices connnected, and only one of them is an FTDI Chip, using NI functions you would have to query each resource and hope for a reponse.

0 Kudos
Message 5 of 18
(11,537 Views)

 I agree, but unfortunately there doesn't seem like there is a better way to do it...

0 Kudos
Message 6 of 18
(11,531 Views)
Why would you even care if its ftdi or not? It's all transparent when emulating a serial port. Generally, what is important is the actual instrument connected at the other end. Knowing a certain port is using an ftdi converter will not tell you the actual instrument.
0 Kudos
Message 7 of 18
(11,529 Views)

Serial instrument drivers tend to have long timeouts when initializing resources with an invalid resource. This can be eliminated by understanding what serial interfaces the resources use and only attempting to communicate with those. Plus, querying invalid resources could result in unwanted communication errors.

0 Kudos
Message 8 of 18
(11,522 Views)
Timeouts are as long as you make them. You know how to change them, don't you? You would still have to query each port to determine which instrument is connected. The VISA function returns valid ports. Nothing returns valid instruments. You've probably never seen instruments connected in a random fashion after several have been removed for calibration or seen an instrument vendor change its chipset set when an internal converter is used. Sorry, but let's agree to disagree and leave it at that.
0 Kudos
Message 9 of 18
(11,507 Views)

Timeouts are specific to the device connected. If the device needs 2 seconds to respond to an identification/initialization query then it needs an even longer timeout. When attempting to scan for connected devices, waiting for 3 seconds for each device is a waste of time when its is not going to respond.

 

Of course, I would never use this functinoality on a piece of hardware I didn't develop. But as the hardware designer I know that it will always be an FTDI Chip.

 

I've stated my problem clearly and provided a solution for others to use; if you don't have anything useful to say then please don't clutter the thread.

Message 10 of 18
(11,502 Views)