LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

App Builder does not apply my custom Visaconf.ini file

My application uses serial ports beyond the LabVIEW 7.1/VISA COM9 default and I've created an alternate C:\VXIpnp\WinNT\NIvisa\visaconf.ini that operates properly in the development environment. How do I get the LV 7.1 App Builder to install my custom visaconf.ini file instead of the generic version supplied by App Builder? Things I've tried:
1) in App Builder/"Installer Settings"/"Advanced", checked the 'Serial Port Support' checkbox
2) in App Builder/"Source Files"/"Add Support File", added my custom 'C:\VXIpnp\WinNT\NIvisa\visaconf.ini' file
3) after building the application, examined the contents of the resulting data.cab file and found my custom visaconf.ini file as well as the LV generic version (it is named: visaconf.ini.BD[about 30 hex chars here])
4) after installing the application on a non-development machine the generic visaconf.ini.BD... file above is the one installed in: C:\VXIpnp\WinNT\NIvisa\visaconf.ini, NOT my customized file
5) my .exe application works fine when I manually replace the generic file with my custom file -- not something I want my end-users to do!

Thanks,
Dean.....
0 Kudos
Message 1 of 7
(3,704 Views)
Dean,

I am not sure what COM9 default you are referring to that requires a new visaconf.ini file. Could you please elaborate on this?

It is generally not recommended to copy your visaconf.ini file from one machine to another because both machines would have to be identical(same hardware, number of instruments...). If this is your case, and your end users will have identical machines to your development machine they can either manually replace the file, which you suggested you don't want them to do, or you can probably automate this process in LabVIEW using the File I/O VIs.

Shawn B.
National Instruments
Use NI products on Linux? Come join the NI Linux Users Community
0 Kudos
Message 2 of 7
(3,680 Views)
Shawn,

Apparently others have experienced the same >COM9 serial port problem that I had, and a search of the LabVIEW KnowledgeBase turned up the following Problem and Solution:

http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/6e1c422eea4d54f286256ada0053fba2?OpenDocument
(Last Updated: 06/29/2004)

Quoting in part from the 'Solution':

".....By default, resource descriptors ASRL1 through ASRL9 are associated with serial ports and resource descriptors. ASRL10 and higher are associated with parallel ports. If you want to use a serial port above COM9 (i.e., you want ASRL10 or higher to be associated with a serial port, instead of a parallel port), then you must modify the visaconf.ini file in the \VXIpnp\[OS]\NIvisa installation directory....."

I modified my visaconf.ini as recommended by the example given in the Solution and it works fine in the development environment. I just can't get App Builder to install it on a non-development machine.

Dean.....
0 Kudos
Message 3 of 7
(3,677 Views)
Dean,

I am not entirely sure that this KnowledgeBase is still valid for recent versions of NI-VISA. What version of NI-VISA are you using? Here is what happens with NI-VISA 3.2:

ASRL10 is reserved for the parallel port, but it is mapped to LPT1
If you have more than 9 serial ports they can still be mapped to COM10, COM11..., however they may be shifted for example ASRL11 is mapped to COM10.

It seems you would only need to modify VisaConf.ini if you are using ASRL1, ASRL2... and need ASRL10 to be a serial port. Is this your case?

If you have to replace VisaConf.ini you can automate this by building a separate application that does this task. I've attached a VI and EXE that does this so you can see an example. If you run the executable in a folder that contains your VisaConf.ini file it will replace the original. You may want to have the front panel close when finished so the user doesn't see anything but this is just an example.

You can also include the this executable in your installer and in the Advanced options choose Run Executable After to have the installer run this program and your end user will never know it happened. Remember that you end user will have to have an identical system, or you should not replace the VisaConf.ini!

Shawn B.
National Instruments
Use NI products on Linux? Come join the NI Linux Users Community
0 Kudos
Message 4 of 7
(3,643 Views)
Shawn,

All users of our system have two, 8-port serial cards that Windows XP installs as COM3 through COM18, above the COM1 and COM2 defaults. My application requires 14 contiguous COM ports, COM3 - COM16, exclusive of COM1 and COM2 which are "owned" by a non-LabVIEW application running concurrently. The real cause of the problem originally described was the upgrade from LabVIEW 6.1 to 7.1. All previous releases of my application were built using the 'serpdrv' serial driver which is no longer available in LabVIEW 7.x. The serpdrv driver has been completely replaced by VISA. The old serpdrv method did not have the bizarre characteristic of defining a parallel port in the middle of a list of extended serial port definitions. VISA does.

Prior to this reply, I was using VISA 2.6.0 with LV 7.1 but have since installed VISA 3.2. I'm not sure why a newer version of VISA wasn't installed when I moved from LV 6.1 to 7.1 but either way, the VISA serial port mapping for installations with extended serial ports is essentially unchanged. NI MAX tells me that the default VISA 3.2 visaconf.ini maps the ports like this on my development system:

ASRL1 thru ASRL9: COM1 thru COM9
ASRL10: LPT1
ASRL11 thru ASRL18: COM11 thru COM18

What happened to COM10? It's been mapped to ASRL19! For this reason, I created a customized version of visaconf.ini that moved COM10 to its expected (proper!) place and parked LPT1 eleswhere. Again, I'm simply requesting a way to get App Builder to use my file instead of the default. If App Builder cannot do this, I plan to overwrite the default version programmatically when my application loads. Clunky, but possible. At the moment I'm leaning toward something that will uniquely identify my version of the file, either by content or perhaps file creation date, and overwrite the default if there's a mismatch. Should I expect maintenance headaches with this technique as newer versions of VISA and/or LabVIEW are released?

Dean.....
0 Kudos
Message 5 of 7
(3,631 Views)
dkl wrote:

> The old serpdrv method did not have the bizarre characteristic of
> defining a parallel port in the middle of a list of extended serial
> port definitions.

Actually it did! You had to edit the LabVIEW.ini file explicitedly to
assign different com port assignements. The current default settings of
VISA are simply taken over from the default settings of the serpdrv driver.
If no according entry was found by serpdrv in Labview.ini it simply assumed:

serialDevices="COM1;COM2;COM3;COM4;COM5;COM6;COM7;COM8;COM9;LPT1;LPT2;LPT3;LPT4;

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 6 of 7
(3,625 Views)
Rolf,

Well, perhaps labview.ini should have been changed as you suggested but I just looked at my old LV 6.1 and 5.1 labview.ini development files (4.x is long gone...) and neither has a 'serialDevices=' entry or anything else that looks like explicit serial port assignments. The serpdrv assignments on the higher-numbered COM ports must be transparent to the simple 3-wire serial configurations our hardware requires.

Shawn: Your earlier suggestion of executing a small .exe directly from the App Builder Installer looks to be a much cleaner method for replacing visaconf.ini than what I suggested at the end of my last post. I'll try that idea first.

Dean.....
0 Kudos
Message 7 of 7
(3,622 Views)