LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Port connection

Hello, 

 

Although, the device manager sees the port and I can control in the device with its software, but the LabVIEW don't see the port. Also, it does not appear in the MAX.

 

Can you help!

0 Kudos
Message 1 of 5
(2,533 Views)

Your device is an USB device? If so that is fully expected behaviour.

 

VISA only supports USB VCP (Virtual Com Port) and USB TMC (Test and Measurement Class) devices out of the box. It does have also the possibility to access other USB devices through an USB RAW interface but that is seldom a viable option for several reasons:

 

1) Windows does not allow two separate drivers to claim the same device except for certain special drivers through so called filter drivers. But a filter driver is a kernel device driver and developing such drivers is very advanced Windows kernel programming knowledge. So if you assign your device to VISA as USB raw, the original driver that came with your device will be disconnected and the applications that came with your device will stop working.

 

2) It also requires you to know and understand the full USB class specific protocol and implement it in LabVIEW using the VISA USB nodes. This is often impossible since many devices use a vendor proprietary USB protocol and the vendor is seldom willing to provide the protocol documentation. Even if you have the full protocol specification, it is a tedious and cumbersome way to implement your own USB protocol handling.

 

3) Since Windows 7, all device drivers need to be signed. That also applies to the VISA INF file that you must create in the Instrument driver wizard in order to assign the USB device to VISA, so VISA can claim and access it. Driver signing requires a commercial certificate and is therefore for most users not an option. You could disable driver authentification in Windows 7 and with some hacks still can in Windows 10 but this is tedious and would need to be done on every computer you want to use your unsigned VISA USB Raw driver. That's a totally unmaintainable solution for anything but an incidential hack, but for such a hack the significant effort to develop your USB protocol driver is simply time and money thrown away.

 

And certificates expire so your driver signing will expire too. That means that you can not install such a driver on a Windows computer after your certificate expired. You would be required to maintain a valid certificate for the future, which costs every year again some money to pay to some certification authority.

 

Most device manufacturer applications do use a user space DLL to interface to the proprietary device driver. And some manufacturers do provide documentation to that user space DLL, so that it is possible to call this DLL through the Call Library Node in LabVIEW. This still is fairly advanced programming as getting the Call Library Nodes setup properly is some serious work and requires more than basic C programming knowledge despite that you don't really program in C, but it is many times more feasable than trying to implement the custom USB protocol on top of VISA USB RAW.

Rolf Kalbermatter
My Blog
Message 2 of 5
(2,521 Views)

What is the device?

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 5
(2,488 Views)

let me show the problem with more clearance. 

 

My operating system is Windows 10.

The device is MCA.

The software which already works well with me is DPPMCA Display & Acquisition Software.

The supporting LabVIEW kit are available also here.

 

The problem: 

As I mentioned before, the software works well and the device appears on the device manager. 

But when I try to run the Labview test (TestDppSDK_USB.vi) I found the attached error where I get an indicator that VISA open not work. And Also, The device does not appear on the MAX.

Please see the attached.

 

I hope you get the idea. 

 

Download All
0 Kudos
Message 4 of 5
(2,430 Views)

Download the LabVIEW Beginners Guide file from their website. Unpack it, and search for the document that is titled "LabVIEW Visa-USB Driver Setup.txt", read it!

 

And please note the General Note section in there! A Windows USB device can only be claimed by one device driver. That means you can operate your device either from the Amptek software or through LabVIEW and VISA but not both! So if you assign your device to VISA, the Amptek software won't work anymore and you have to deassign/uninstall the VISA driver to make it work again with the Amptek software. (Or use their workaround by pluging in the device in one USB port for VISA/LabVIEW and assign this device instance to VISA, and use a different USB port for the original software, leaving its assignment as default.

 

Also this may be a lot more painful nowadays then when Amptek developed those drivers about 10 years ago. Since Windows 7, device drivers need to be signed in order for Windows to install them. This also applies to the VISA INF file that you generate in the VISA instrument driver Wizard. NI can't sign it for you since the file does not exist until you create it on your machine and they can't create a tool to do that yourself, since that would require them to put the private key for the signing certificate into that tool and that would not only go against the very meaning of a private key but allow anyone to sign the most malicious device driver to appear as if it is from NI. So unless your company owns a valid signing certificate from an official signing authority, you can't really install a self generated VISA USB device driver anymore. Windows 7 did allow to disable driver authentification temporarely so you could install such drivers and after a reboot the driver was still fully operational as driver signing is only checked during installation of a driver. Windows 10 tightened down on that a lot and the current way that still allows installing unsigned drivers would qualify more as hack than a legit procedure. It's likely that future Windows versions will make this even harder, similar to how it already is on the latest MacOS X platforms.

 

It may seem like a big pain in the ass, but industry is requiring operating systems to be safer and safer and a device driver installed in the kernel has virtually no single restriction in what it can do. It's the perfect vessel to transport very malicious code into a system and allows far reaching measures to avoid detection of such activities from even advanced threat scanning tools.

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 5
(2,405 Views)