Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I determine that a port is a really serial port?

System: PC and LabVIEW
I have a machine and make VISA Find Resource with a pattern of "ASRL?*". This will give me a list with the entries "ASRL1::INSTR", "ASRL2::INSTR", "ASRL3::INSTR", "ASRL4::INSTR" and "ASRL10::INSTR". Only "ASRL1::INSTR" and "ASRL2::INSTR" are really serial ports the others are network printer ports and the parallel interface.

I'm looking for a method to determine which is a serial port to display it in a list box of a configuration dialog. Properties like "Baud rate" will always give 9600 even when they make no sense for a parallel port.

The method must work on a machine which has only VISA rutime and LV runtime installed.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 1 of 6
(3,971 Views)
Hi Waldemar,

The only attribute I found that would indicate if the resource is a serial port is the Interface Information >> Interface Description string.

This is a read-only string. For serial ports it returns "ASRL1 (COM1 - Communications Port)". For the parallel port is returns "ASRL10 (LPT1 - ECP Printer Port)".

DiegoF
National Intruments.
Message 2 of 6
(3,971 Views)
Hi Diego,

I have seen this property, but I was not sure if this will work if no development environment is installed. I was unsure about that because in this case the alias name cannot be used as resource name at least under VISA 2.6. On my machine I got the string "ASRL1 (COM1)" and expected to get only "ASRL1".

I didn't got the time to make an application from the FindSerialPort VI found here in the catagory and test it in an runtime only system.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 3 of 6
(3,971 Views)
Dear Diego,

now I got the time to make some tests. All tests are performed on a Windows NT 4.0 SP6a german system with a development system and a NI clean system (meaning no NI products were installed before the test).

The hardware has two serial ports and two parallel ports. On the development system there were three COM ports emulated by my AVM Fritz! ISDN card. The NI clean system has the same hardware but there were no drivers installed for the AVM Fritz! ISDN card.

The tests are running with LV 6.0.2, LV 6.1, LV 7.0 with VISA 3.0 on the development system and VISA 2.6 on the NI clean system. All test results are the same. I've got "ASRL1 (COM1)", "ASRL2 (COM2)" and so on. The ports for the AVM Fritz! ISDN card are reporting "(AVMISDN
". Using the interface description string and scanning for "(COM" will give all serial ports.

Interestingly on my NI clean system FindResource also found "ASRL3::INSTR" and "ASRL4::INSTR" with an empty interface description string. My scanner is connected to "ASRL10 (LPT1)" and the printer to "ASRL11 (LPT2)" which will be displayed correctly. On my development system it was "ASRL6::INSTR" and "ASRL7::INSTR" with an empty interface description string. MAX reports them with an alias and Port Binding named HPF_151 and HPF_152 and an unknown interface name. These ports are listed in the registry as a DosDevice and some further searching results in that this ports belong to the printer driver and the HP Printing system for Windows.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 4 of 6
(3,971 Views)
Another thing I have found and which is not explained in the LabVIEW help (I have not checked this in the programmers Reference of VISA).

VISA Find Resource does not return resources which are in the system but are allocated by another application. I saw this during a test. I used Hyperterminal to open COM1. COM1 was then not listed as a resource.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 5 of 6
(3,971 Views)
Light bulb turns on!

Thanks for the post. I seem to remember seeing this.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 6
(3,971 Views)