LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

COM Port selection logic?

Hello,

I am building a test where the DUT requires 4 COM Ports. I have a USB to 4 port adapter I plan on using but I also want to make the test fail safe in case it is tested on a system with only 1,2 or 3 Com Ports. Basically when the test starts it would get set-up for the ports on the system, then when each port will be accessed, if 2 ports on the DUT share a port from the PC it will prompt the user. I know I can make something but it might get messy really quick. Is there anyone that has a suggestion to make it simple?

Remember the DUT has 4 ports and the PC will have anywhere from 1 to 4. Part of my problem is that it is Monday so my Brain has not reset to work mode from the weekend.

Thanks
Jeff D.

Certified Architect LabVIEW Champion DQMH Framework

0 Kudos
Message 1 of 6
(2,768 Views)
Hi jdebuhr,

I'm not sure what method you were planning on, but you may want to use the VISA Find Resource VI (in the VISA Advanced palette) for this purpose. For the expression input, use ASRL[0-9]*::?*INSTR and this VI will return an array of strings listing all of the available serial ports. You could also use the return count output to see how many serial ports are on the computer.

Is this what you were looking for? Does anyone else have any better ideas?

john
Applications Engineer

Message Edited by JohnM 64 on 04-05-2005 02:50 PM

0 Kudos
Message 2 of 6
(2,747 Views)
I never even thought of that.. This would work to find the Serial ports, I am out of the office today but will try it tomorrow, I do have a favor though.

the attachment is LV7.1 at work I am stuck with 6.0.2 (waiting/hoping for the upgrade to go through) could you downconvert it for me? or attach a jpeg of the code?

thanks

Jeff
Jeff D.

Certified Architect LabVIEW Champion DQMH Framework

0 Kudos
Message 3 of 6
(2,740 Views)
Sure thing. The code is extremely simple, so I just attached a screenshot. Hope this helps!

john
0 Kudos
Message 4 of 6
(2,732 Views)
I just tried this with LV 6.0.2, while it works, it does nto seem to return the com port names. It also returns a count of 2, but the PC has only 1 com port and 1 GPIB. how can it differentiate between them?
Jeff D.

Certified Architect LabVIEW Champion DQMH Framework

0 Kudos
Message 5 of 6
(2,723 Views)
It just dawned on me that the ASRL10 is the parallel port, Odd thing is I did a query of 0-9...

I used this command: ASRL[0-9]*::?*INSTR and it gave me Com1 and LPT1, if I changed the command to ASRL[0-9]::?*INSTR, I just get the COM Ports, So I am headed int he right track, This will work out well I can auto-assign COM ports, Then if I don't have 4 ports, since I assigned them I will then know when to prompt the user to switch the correct cable to the correct port.

THANKS!!

Jeff
Jeff D.

Certified Architect LabVIEW Champion DQMH Framework

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