Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Test usb devices

Hello,

we produce usb devices like RS232 to USB (FTDI Chip) or RS485 to USB ( Prolific) devices. Now I want to test it with LabView. Have someone an idea or examples to do this?
The biggest problem is that the usb device generates a virtual com-port. But this port is counted up if I plug in a new device ...

Have anybody a solution???

thankyou

Schwede
0 Kudos
Message 1 of 5
(4,901 Views)
Hi Schwede,

In the case of the FTDI CDM driver, you could use the D2XX interface instead of the COM port.  This allows you to talk to the device through a DLL instead of via the VISA serial port VIs.  FTDI provide VIs that have the calls to the DLL already set up for you here: http://www.ftdichip.com/Projects/CodeExamples/LabVIEW.htm


If you would prefer to use the COM port interface, you could enable the ignore hardware serial number option in the Windows registry.  The COM ports are allocated according to the serial number of the device, which is generally different from device to device.  By enabling the IgnoreHWSerNum entry for these devices in the registry, all devices with the same VID and PID combination will be treated as the same device and hence have the same COM port number.  You need to connect it to the same USB port on your PC for this to work though, as connecting it to a different USB port will result in a different COM port number.  You can find out more about this here: http://www.ftdichip.com/Support/Knowledgebase/ignorehardwareserialnumber.htm

For the default FTDI VID (0x0403) and PID (0x6001), you would need the following REG_BINARY registry entry under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\USBFlags:

IgnoreHWSerNum04036001 with a value of 01.

Hope this helps.


Mark A
0 Kudos
Message 2 of 5
(4,871 Views)

From VISA library, you can control the device with through ASRLx::INSTR resource, where the "x" specifies the actual COM port#.  For example, if using COM4 port, you can use ASRL4::INSTR to open a VISA session by LabVIEW's VISA Open function. 

If you want to map your device to a specific COM port#, you can assign it at the Windows Device Manager.  Launch Device Manager, open the "Ports (COM & LPT)" tree then right-click on your USB device name to show its Property.  In the "Port Settings" tab, click the "Adavanced..." button then you can assign any COM port# you want. 

0 Kudos
Message 3 of 5
(4,857 Views)
Hello,

i have tried the solution with the registry, but i can`t see variabel for the ftdi chip (only an other). If i insert the variabel manuell it doesn`t work.

Have i any problems with the installation?

greetings   schwede
0 Kudos
Message 4 of 5
(4,843 Views)
Hi Schwede,

Windows might not act on the IgnoreHWSerNum entry if there are existing registry entries for devices with the same VID and PID.

Create the REG_BINARY entry in the registry and uninstall the driver (Control Panel > Add Remove Programs then FTDI USB Serial Converter Drivers or similar), this will remove the registry entries.  Next, connect your device to a USB port and reinstall the driver. 

You should then be able to connect other FTDI devices with a matching VID and PID to that port and use the same COM port number to communicate with them.


Mark A
0 Kudos
Message 5 of 5
(4,840 Views)