12-11-2015 12:52 AM
Hi,
Is there a way to read out the COM port number of a device in LabView? I would like to make an initializing program that tracks the right COM port of a device, for example a USB device reading temperature, and set this COM port as the correct port when the main LabView program starts. I want to do this, because a USB device usually gets different COM port dedication on different computers. Our application is running on 80 different computers. A program like that would be very pleasant.
Can anyone help me?
Paal
Solved! Go to Solution.
12-11-2015 01:01 AM
12-11-2015 01:05 AM
12-11-2015 01:14 AM
12-11-2015 05:41 AM
Thank you.
br,
Paal
12-11-2015 06:32 AM
Back in the '80s, I thought, "It sure will be nice in the future when Serial Communication is replaced with something modern". I underestimated the fact that it was is the cheapest solution and (in the end), it works. At least things have improved. It's been a while since we've had to move jumpers and modify cables. But we still can't escape the occasional "paper clip loopback".
As Dennis suggested, get an array of the COM ports.
Reverse the array to save time, since COM 1 and COM 2 are usually reserved for the motherboard or addin card.
Reducing the default 10 second timeout also saves time.
Then iterate through the array of COM ports, testing for your device.
In your case, you could try to take a reading and see if it's valid and no errors occurred.
Once you find your device, use that reference for your program.
To let the user know what's going on, you can display messages: "Testing COMX", "Found Thermometer on COM3". etc
steve
12-11-2015 07:04 AM
Great tips 🙂
br,
Paal