LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Functional difference between VISA resource name ASRL1::INSTR and COM1

Config: LabVIEW 6.02, VISA 2.6.0

I have used a text constant for "VISA Configure Serial Port.vi" for years, and just now I have run into problems.

With my application, a text constant of ASRL2::INSTR would properly open the port, but it would not send any data, but using COM2 worked.

What is the difference?
0 Kudos
Message 1 of 17
(24,229 Views)
I don't have a strong understanding of this problem, but did run into it a
little while ago. One of the names is the true name for the com port and
the other is an alias. I thought I remembered that the ASRL was the real
name, but could be wrong.

Also, consider using a visa control instead of a string constant. That way
the operator can click on the control and it will tell him what port names
are available. Some computers like com1 and some like ASRL1.

"labviewman" wrote in message
news:506500000008000000E1610000-1031838699000@exchange.ni.com...
> Config: LabVIEW 6.02, VISA 2.6.0
>
> I have used a text constant for "VISA Configure Serial Port.vi" for
> years, and just now I have run into problems.
>
> With my application, a text constant
of ASRL2::INSTR would properly
> open the port, but it would not send any data, but using COM2 worked.
>
> What is the difference?
Message 2 of 17
(24,229 Views)
I thought ASRL::Instr was the real name also.

Funny thing is ASRL works fine for the built-in ports (1/2), but not for the NI-RS232/8. I don't blame the NI card, since the code worked fine at my desk, but not the tester for the NI card.

The tester is an automated system, with the ports hard coded, but, I could find which resources are available, and find the name that is found with the port# that is needed.
Message 3 of 17
(24,229 Views)
ASRL2::INSTR or COM2 should worked equally. ASRL2::INSTR is the visa resoucre name (descriptor for the COM2) while COM2 is the alias. Use MAX to check that you have correct settings for your COM2.
Message 4 of 17
(24,229 Views)
I agree they should work equally.

I checked the settings with MAX, and I think I found the problem. The VISA Resource Name for port 3 (I am using ports 3 thru 6) is ASRL11::INSTR, and the Alias is COM3. That explains why I had problems since I was sending commands out of ASRL3:INSTR which was really COM10, and expecting data to be received on ports ASRL4/5/6.

How does MAX configure the resource names and alias's? I certainly did not do this on either machine.

Thanks for your help!
0 Kudos
Message 5 of 17
(24,228 Views)
MAX sets up serial port aliases automatically when possible. Let me try to explain.

If the alias "COMx" was not previously configured in NI-VISA, and you have a serial port really named "COMx", and that VISA resource string does not have any other user-configured alias, then MAX will bind that alias to that port, regardless of what the full VISA resource string is. That part actually makes sense and shouldn't confuse anyone. If the alias "COMx" is taken, or the user has manually configured a different alias for the serial port (such as "MyDMM", for example), then MAX does not auto-assign the alias for that port. So far so good.

The confusing part in many cases is how NI-VISA itself assigns the VISA resource string. For COM3, normall
y NI-VISA would assign ASRL3::INSTR, and so on. There is 1 conflict that usually screws everything up. Since NI-VISA on Win32 allows you to open the parallel port by default as ASRL10::INSTR (for extremely historical reasons), the conflict occurs when you really have a COM10. It's not a terrible conflict, but it is confusing. NI-VISA will match every other port that it possibly can, and then just assign a unique resource name (ASRLx::INSTR) for COM10.

I am not sure why in your case NI-VISA didn't match COM3 to ASRL3::INSTR. If you want to do some experimenting, try this. Go into MAX, delete all your VISA aliases, delete LPT1 from the tree, exit MAX, restart MAX, and refresh. See if that cleared it up.

Dan Mondrik
Senior Software Engineer, NI-VISA
National Instruments
Message 6 of 17
(24,228 Views)
Look up the file Visaconf.ini. You will probably find alias associations
there.

"labviewman" wrote in message
news:506500000005000000E0AB0000-1031838699000@exchange.ni.com...
> I agree they should work equally.
>
> I checked the settings with MAX, and I think I found the problem. The
> VISA Resource Name for port 3 (I am using ports 3 thru 6) is
> ASRL11::INSTR, and the Alias is COM3. That explains why I had
> problems since I was sending commands out of ASRL3:INSTR which was
> really COM10, and expecting data to be received on ports ASRL4/5/6.
>
> How does MAX configure the resource names and alias's? I certainly
> did not do this on either machine.
>
> Thanks for your help!
0 Kudos
Message 7 of 17
(24,229 Views)

Hello, 

 

I am a rookie Labview programer and I am having trouble communicating with a device using the serial configurations. 

How do I know which serial port # am I using?

From what I understand COM or ASRL are equivalent. How are they actually the same (i.e. COM1 is ASLR1 ...etc )? How do I set this up? What is this MAX that I read you guys are talking about? It seems to me that here is where you set up the aliases for the ASLR'values.

 

I think my code is correct, I have a VISA serial config.vi, a VISA serial write, VISA serial read, VISA serial close, and a simple error handler. But I get the following error:

 

–1073807343 VI_ERROR_RSRC_NFOUND Insufficient location information or the device or resource is not present in the system.

 

My guess is that I am impting the wrong VISA resource name. 

 

Any suggestions? Thanks

0 Kudos
Message 8 of 17
(23,114 Views)

short answer first.  MAX is Measurement and Automation Explorer.  You'll see that icon on your desktop or under National Instruments in the Program Files menu.  It is important to know this if you are using any NI hardware or software.

 

Once you have opened that up and looked through it, it should help you understand the previous posts.  Then post back with any questions you may still have.

0 Kudos
Message 9 of 17
(23,103 Views)
And MAX should tell you the names of the serial ports. When you use the VISA Resource Name control or constant in LabVIEW, you should always click on the little arrow on the right side of the control. That will give you a list of valid resource names that you can choose from. Never assume the names of the ports that your pc has.
0 Kudos
Message 10 of 17
(23,097 Views)