From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA serial port question

My LabView work normally consists of developing a control application (on my office workstation) for a customer's system we are building, then installing the application as an executable on the customer's system PC.
 
I have had a problem with a system that required several serial ports. The system PC has an eight port PCI card installed in addition to the 2 integrated com ports. So the PC has COM1 through COM10 which all function fine when tested with Hyperterminal. The system design uses COM3, COM4, COM9 andCOM10 for various control and monitoring interfaces. When I developed the application on my workstation using VISA serial vi's, I had intended to hard-code the resource ID accordingly, which I typed in, because my office PC would only expose COM1 and LPT1 as available resources. When the application was installed, the COM10 port would not work. COM3, COM4, and COM9 functions communicated perfectly. Changing the hard-coded "COM10" to COM1 allowed the device formerly connected to COM10 work perfectly on COM1. This was programmed in LV 8.1.
 
I have done similar work in the past, using LV versions 5 & 6, using the older serial vi's that required serpdrv to use, and that would succesfully communicate with COM10.
 
For the moment, I am not dead in the water with this project because of the spare COM ports, but I haven't been able to find any reference that explains why COM10 wouldn't work. Please let me know if you can explain it, Thanks! I can post vi's if necessary, but they are pretty straightforward serial routines.
 
0 Kudos
Message 1 of 6
(2,961 Views)
0 Kudos
Message 2 of 6
(2,951 Views)
I know for a fact that VISA will work just fine with Com10. I'm connect right now through an 8 port USB->RS-232 converter. If your system does not map the new ports on your system with a single integrated RS-232 the same way as a system with multiple integrated RS-232, that, imho, is more an issue with windows and the device driver for the add-in board. Unclebump provided a link to some valuable information. The nice thing about VISA is that it doesn't matter how windows or VISA assigns the ports. With VISA, the "Comx" is just an alias. The actual VISA name is something like ASRLx::INSTR. You can change the alias of any com port to anything you want. You could, for example, rename the actual port connected to a certain instrument, the same as the instrument (i.e. "Com3" to "DMM"). Then your VI would reference "DMM", which is more meaningful than "Com3". The ability to assign aliases has another benefit. I have had some programs that were hard coded to use "Com1" which was a port integrated onto the motherboard. When the port has died, I could hook up a USB->RS-232 adapter, rename "Com1" to "ComDEAD", and then rename the port I just added to "Com1". Total time to be back up and running was about 10 minutes or less. I did not have to either modify the program or replace the motherboard. You would have had to do either with the old serial drivers.
0 Kudos
Message 3 of 6
(2,944 Views)
Thanks for the help from both of you. One thing I didn't mention before was that I temporarily installed LV8 on the target PC in evaluation mode to test the code, and it worked perfectly with COM10 in that instance. I think I should be able to get to the bottom of this soon. It's just that I know in the future I may again have to program a VISA resource that doesn't exist on my office PC, and I'd like to learn how to best guarantee the application will work correctly when installed on the target PC.
0 Kudos
Message 4 of 6
(2,934 Views)
The resource name COM10 will perfectly work if it's defined as ALIAS for the correct resource, as explained by Dennis.
You may check this by using NI MAX. If you don't have MAX installed, you can do it looking into the file visaconf.ini, in Vxipnp\winnt\nivisa.
AFAIK, VISA predefines aliases only for ASRL1::INSTR (COM1), ASRL2::INSTR (COM2) and ASRL10::INSTR (LPT1) - I don't have the last VISA version  installed, though.
In one system, I had to use 2 16-ports PCI cards. As I initially wrongly mapped all COM# to ASRL#::INSTR, my software clearly did not work on COM10.
It turned out that COM10 was indeed ASRL33::INSTR, so I needed to manually add the COM10 alias to visaconf.ini in order to get the program run correctly.
I hope this helps.

Paolo

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 6
(2,919 Views)

VISA might have give the alias COM11 to your 10. serial port.  I have seen this difference between windows naming and visa naming on some of our lab-pcs with usb2rs232 devices. A  visa find resource will tell you that you have access to 10 serial ports.

Like stated in the former posts, it's just an alias that can easely be changed. (Even with LabVIEW itself: Using the .ini-file vis and poke the visaconf.ini Smiley Wink )  And I have in mind that there is a possibility to tell VISA to NOT use asrl10 for the LPT1 so the COM10 will be there automatically.

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 6 of 6
(2,907 Views)