Graeme Posted March 17, 2007 Report Share Posted March 17, 2007 Hi all, I have a requirement to generate a list of all COM ports present on the localhost. Twist is, the list should be in numerical order, not the alphabetical(ish) order that the VISA Find Resource function returns. I have a VI or two that does the job but, as ever, a bit clunky and prone to failure under some circumstances. Can't help feeling there's a neat way to do it, it's just that I can't see it. It would be great if a solution could cope with the VISA Find Resource function returning the raw VISA name (e.g. ASRL2::INSTR) or its machine alias (e.g. COM2). In addition, asking the VISA Find Resource function to return ASRL?+::INSTR returns all COM ports but the parallel port (LPT1) too (ASRL10::INSTR). For the life of me I can't come up with a regular expression that excludes the parallel port. Thoughts most welcome. Regards. Quote Link to comment
Eugen Graf Posted March 18, 2007 Report Share Posted March 18, 2007 You can parse the string array returned from find VISA ressource to get right number and then sort them. Where is the problem? Eugen Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.