LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI loads slowly if VISA serial control is on the front panel

The VISA Resource control must be querying the OS, or Measurement & Automation Explorer, in order to populate COM ports in the control. Why does this take so long?
0 Kudos
Message 1 of 10
(3,242 Views)
Are the VISA-Resources pre-assigned (default)?
0 Kudos
Message 2 of 10
(3,242 Views)
What version of LabVIEW and VISA are you using?
0 Kudos
Message 3 of 10
(3,242 Views)
I am using the pre-assigned VISA resources. That is, the ones that Measurement & Automation Explorer has converted (ASRL1::INSTR aliases to COM1).

For a serial device in LabVIEW, would it be better to select the following VI Class for the VISA resource name object on the front panel: VI Class::I/O Session::Serial Instr, instead of the default, VI Class::I/O Session::Instr
0 Kudos
Message 4 of 10
(3,242 Views)
Sorry, this is using LabVIEW 7.0
0 Kudos
Message 5 of 10
(3,242 Views)
I think that all it queries is visaconf.ini in \vxipnp\WinNT\NIVisa. I haven't noticed any speed problems with opening a VI with a VISA resource name control and my pc isn't particularly fact. How long is "long"?
0 Kudos
Message 6 of 10
(3,242 Views)
With nothing but one VISA resource control on the front panel, it takes about 8 to 10 seconds to populate the control with the VISA resources. This was done with two computers that I have (P4, 1.6 GHz).

The long delay only happens the first time LabVIEW opens a front panel with a VISA resource control. Opening subsquent VI's with a VISA resource control happens instantaneosly.

I just noticed that my visaconf.ini has extra entries for hardware resources were on my computer and some of them are enabled. There is probably some timeout as VISA tries to connect to the resource. I'll see about flushing those resources.
0 Kudos
Message 7 of 10
(3,242 Views)
I found the problem. It had to do with stale entries in the visaconf.ini file. Just delete the file and let Measurement & Automation Explorer create a new one. This was caused by using a USB device that adds serial ports. When the USB device is disconnected, the resources stay listed and in the enabled state. I'm surprised that Measurement & Automation Explorer does not update the status of the resources automatically.
0 Kudos
Message 8 of 10
(3,242 Views)
Measurement & Automation Explorer does not change the VISA Configuration from itself. It is meant that those settings are only changed when M&A is open and the user requires a rescan or removes or disables devices explicitedly. It is always tricky to do full autodetection and automatic configuration adaption without sometimes loosing carefully edited configuration items.

As to the delay I have seen that too, but assumed that it was a standard VISA 3.0/LabVIEW 7.0 problem. It's interesting information that this may have to do with (default or stale) information in the visaconf.ini file to non existing resources.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 9 of 10
(3,242 Views)
I have the same problem with the very slowly loading VI due to a VISA resource control. Unfortunately in my case none of the tricks posted in this and similar threads helped: I installed the newest VISA version 3.2, deleted visaconfig.ini, disabled most of the options in the VISA General Settings of MAX and even tried disabling the unneeded VISA passports. But the problem remained. The first time the VI is loaded (in both the LabView 7.0 IDE and an built application) it takes several seconds on my 2.8 GHz PC to show the front panel.
Meanwhile I found kind of a workaround by replacing the VISA resource control by a Combo Box. I populate its string list upon its "Mouse Down?" event programmatically with the help of the "VISA Find Resource" VI. Now the VI loads
fast and only when the user tries to change the port he eventually has to wait a little. Whatsoever, I have the feeling that this cumbersome way should not be necessary. Does anyone know a simpler solution.

Regards

Arno

PS:
- Windows 2000 SP4
- Labview 7.0
- VISA 3.2
0 Kudos
Message 10 of 10
(3,242 Views)