04-22-2015 10:10 PM
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)
2)
Solved! Go to Solution.
04-23-2015 03:50 AM - edited 04-23-2015 04:01 AM
I remember finding the COM-ports with Visa Find Resources...
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!
Good luck!
04-23-2015 06:19 AM
@_Xilinx_ wrote:
I remember finding the COM-ports with Visa Find Resources...
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!
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.
04-23-2015 07:27 AM
04-23-2015 02:16 PM
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.
04-23-2015 02:19 PM
I agree, but unfortunately there doesn't seem like there is a better way to do it...
04-23-2015 02:23 PM
04-23-2015 02:30 PM
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.
04-23-2015 03:46 PM
04-23-2015 03:57 PM
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.