LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How is VISA resource name & COMport name mapping done?

I want to give names like COM1 etc. on front panel. On diagram how to convert it to VISA resource name, in order to be able to give it as I/P to open VISA session vi.
0 Kudos
Message 1 of 12
(3,851 Views)
I'm not sure if this is exactly your question, but I think this is the problem you may be seeing.

In Windows, COM1 and COM2 are assigned as aliases to the devices ASRL1::INSTR and ASRL2::INSTR. The RT Controllers use a real-time operating system (OS) for LabVIEW Real-Time. The real-time OS does not create the association between COM1 and COM2 for ASRL1::INSTR and ASRL2::INSTR, respectively. Therefore, you cannot reference COM1 and COM2 as the Resource Name for the VISA Configure Serial Port function.

So under LabVIEW RT, the VISA Resource Name for accessing serial ports should be explicitly specified as

ASRL1::INSTR
ASRL2::INSTR

for COM1 and COM2 respectively. The fact that "COM1" and "COM2" appear in the pull-down menu still is a known issue when using V
ISA and serial with RT, and has been reported to R&D. In order to type in the resource names listed above, you may need to right-click the VISA Resource control and be sure there is a check next to "Allow Undefined Names".
0 Kudos
Message 2 of 12
(3,850 Views)
You may want to use the friendlier names that NI-VISA can give you. I'm attaching a VI that gets those names for you in both LabVIEW 6i and 6.1, since you don't mention your version.

Starting with NI-VISA 3.0 (coming soon), you'll also be able to use names like "COM1" even if MAX is not on the system. However, that is a feature for only Win32 and LabVIEW RT, since those names do not exist on Unix systems. So a VI making use of that feature will not be completely platform independent.

Dan Mondrik
Senior Software Engineer, NI-VISA
National Instruments
Download All
Message 3 of 12
(3,849 Views)
I'm using LV8 and I didn't see "Allow Undefined Names" when I right-click my VISA Resource control.
0 Kudos
Message 4 of 12
(3,626 Views)
Newer versions of NI-VISA no longer have this option.  All resources should be configured in Measurement and Automation Explorer before use in LabVIEW.  What version of NI-VISA do you have installed?  What problems are you running into?
Robert Mortensen
Software Engineer
National Instruments
0 Kudos
Message 5 of 12
(3,607 Views)
Well, that sucks. What version implemented this change? This means that if I'm on my desktop, I can't define a control or constant for an instrument until I get my tester up and running? I always thought 'Allow Undefined Names' was a very nice feature. Smiley Mad

Message Edited by Dennis Knutson on 07-27-2006 10:50 AM

0 Kudos
Message 6 of 12
(3,599 Views)
My bad.  The option is now under "(Right-click) >> I/O Name Filtering >> Advanced".  It is selected by default and allows you to type in whatever name you want.  I apologize for the misinformation.

Message Edited by Robert M on 07-27-2006 01:26 PM

Robert Mortensen
Software Engineer
National Instruments
0 Kudos
Message 7 of 12
(3,587 Views)

Robert,

Thanks for clearing that up. I feel better now.

Dennis

0 Kudos
Message 8 of 12
(3,580 Views)

On a related note...

Is there a clean way to programmatically get the canonical VISA resource name from an alias?

Let's say for example the alias can be first proven valid by opening a session with VISA Open. Now, how to get the real   VISA resource name?

The only thing I've come up with is using VISA Find with the alias, use that to get the device info, building enough of a canonical string to do another find, then get the matching resource ID. Very clumsy when I know there is a table somewhere that translates all this.

0 Kudos
Message 9 of 12
(3,485 Views)

Try this.

Message Edited by Dennis Knutson on 10-30-2006 03:41 PM

0 Kudos
Message 10 of 12
(3,482 Views)