LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with Max recognizing serial ports

I have created a LV6 program that communicates with three different instruments over RS232. When I run the application on the development computer everything runs fine.

I have made an executable of the program, and I am now installing it on another machine. i have installed NIDaq 6.9 and then NIVisa 2.5 on the new machine (same versions as on development machine).

Now when I go into MAX I cannot see the serial ports under the Devices. When i try to run the program it fails to communicate with the instruments. And the Com ports as listed as ASRL1::INSTR and not COM1.

However when I use HyperTerminal i can communicate with all three instruments with out any problems.

I believe that I must be installing something
incorrectly but I am not sure what. All of the driver software was recently downloaded because I thought the versions I had might have been corrupt.

If anyone could give me some tips on what I a may be doing wrong it would be much appreciated.

Thanks
Mark Kennedy
0 Kudos
Message 1 of 8
(7,118 Views)
Hi,

It probably because you have copied the file 'serpdrv' across with you executable. You will find 'serpdrv' in the same folder as 'labview.exe'. This file is required when using RS232 functions.

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 8
(7,118 Views)
The serpdrv file is only needed with the standard serial functions, not with VISA.

I had the same problem. I installed NI DAQ 6.9.1 (--> MAX2.1) and it was OK. Don't forget to refresh MAX with F5.
0 Kudos
Message 3 of 8
(7,118 Views)
Unfortunately, this seems to be common around here. Although, we do not have any machines that show COM1 in the list of VISA resources. It has always shown up as ASRL1::INSTR. Not having seen anything else, we just thought that was normal. This shows up on all of our computers, though, so that's what we use. Does it work if you use that VISA name?

Rob
0 Kudos
Message 4 of 8
(7,118 Views)
Quite right Rob,

Dont forget you can give the resource ASRL1::INSTR the alias name of COM1 if you so desire.

Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 5 of 8
(7,118 Views)
That's right. Normally MAX creates these aliases for the ports. On a computer without MAX, you can manually edit the visaconf.ini file (in VXIPNP\...\NIVISA).

Open the file, go to the [ALIASES]section and type:

Alias0 = "'COM1','ASRL1::INSTR'"
Alias1 = "'COM2','ASRL2::INSTR'"
Alias2 = "'LPT1','ASRL10::INSTR'"
NumAliases = 3

The format of a line is:
AliasX = "'VISA Alias',VISA Resource Name'"

Add or remove lines and correct the value of NumAliases if you have more or less ports .

From now on the VISA aliases will be used instead of the VISA Resource Names.
0 Kudos
Message 7 of 8
(7,118 Views)
And can you change this programmatically? It's a text file, of course you can, but does the change take immediate effect? No. If you are building a .exe file for distribution on a number of computers, it is much easier to not use aliases. Why confuse the issue? Of course, if you have a computer with HP VISA loaded, the method you propose will not work at all. I always try to build my programs for the easiest and widest distribution (but then I don't use VISA for serial port access at all, because that requires NI VISA and a computer with a non-NI GPIB card that loads NI VISA will lose the use of the non-NI card).

Rob
0 Kudos
Message 8 of 8
(7,118 Views)
COM1 is the VISA alias for the VISA resource, ASRL1::INSTR. Your executable may not recognize the VISA alias, COM1, but it should run if you specify the port to be ASRL1::INSTR.

In order to get VISA to recognize COM1 as the alias, go to the visaconf.ini file on the target computer, and edit the alias section. If you're not sure how to make the entry, simply compare with a visaconf.ini on a computer that recogizes COM1.

The fact that MAX does not see the COM ports should not affect your executable. Just make sure to use to correct VISA resource name.

If it is imperative that MAX sees the COM ports, consider upgrading to VISA 2.5.2.

Kent Leung
Applications Engineering
National Instruments
0 Kudos
Message 6 of 8
(7,118 Views)