LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can a VISA class be programmable at run-time?

I have several test stations that use an Agilent 34401A DMM with serial port control on COM3.  I now need to add stations that use the Agilent 34405A on USB port.  Can my LabView Application be written to detect which meter is connected and configure the VISA resource (COM3 or USB) at run-time?
0 Kudos
Message 1 of 7
(3,616 Views)

Sure. One way is to use the IVI DMM Class functions since both have IVI drivers available. You install the correct driver and configure MAX on each tester and the same program can be used for both. If you ever change to another DMM, then the same program would work without modification.

You could also assign the same VISA alias on the different testers. If you name it 'DMM', then that would be the VISA Resource Name on both testers and the first thing you would do is a *IDN? query. Depending on the response, use one or the other native LabVIEW drivers. VISA will know whether the alias corresponds to a serial or USB instrument so you can use identical names.

The advantage of IVI is that for the most part, you can stop worrying about modifying programs for different instruments. As long as a new instrument has an IVI driver available, it becomes interchangeable (the first 'I' in IVI). The downside of IVI is that the drivers are written in LabWindows/CVI so they are difficult to debug and edit if you need to do that. Also, some companies are using a different IVI technology called IVI-Com. This complicates IVI for no purpose that I can see.

0 Kudos
Message 2 of 7
(3,608 Views)
Thanks for the info.  The 34401A IVI driver does not support SERIAL communications.  I'll try using the VISA alias...
0 Kudos
Message 3 of 7
(3,591 Views)
That's too bad. One of the downsides of IVI to LabVIEW users is that you need CVI to modify the code. Adding serial support to the driver would not take that long. It probably would take longer to undergo the validation testing than to make the actual code changes but you could still request that NI add serial support. They are unlikely to change a driver unless they get requests from users. You could also post a question on the CVI board to see if someone there could modify the driver for serial or see if someone has already done it. You could also check with Agilent to see if they have a different driver with serial support.
 
I'm not really a big fan of IVI in general and I think the VISA alias approach will work just fine but just wanted to point out some more options.
 
 
0 Kudos
Message 4 of 7
(3,584 Views)
Would the LabVIEW driver for the 34405A be of any help?
0 Kudos
Message 5 of 7
(3,577 Views)
Thanks for the help!!  I created a LabView VI that uses the LabView "VISA FIND RESOURCE" VI.  I iterate through the returned array of resources until one of them responds to the meter INITIALIZE VI without an error.  If the first 3 characters of the resource are "USB", I use the AG34405A INITIALIZE VI;  if the first 3 characters of the resource are "ASR", then I use the AG34401A INITIALIZE VI.  The resulting VISA resource is used for the remainder of the meter communications.  It works well in my application.  I found that instruments connected to a computer serial port are not recognized by NI-MAX, so I cannot assign an alias to them.
0 Kudos
Message 6 of 7
(3,562 Views)
No, MAX does not run a query on all serial ports to see if anything is connected. There's just no way to write a query that all serial instruments would respond to. There's just to many variables such as baud rate, partity, stop bits, different termination characters, etc. But, you can assign an alias to a serial port. If you look in MAX and see 'Com1', that itself is an alias for ASRL1::INSTR. You can change 'Com1' to anything you want.
0 Kudos
Message 7 of 7
(3,556 Views)