From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Com Port Finder

The com ports are very tricky to calibrate. They change sometimes when the hardware is connected. I thought my solution was to search for all the com ports and send an id to them. Look for one that returns the hardware. Then I can use that com port in the rest of the program.

Another idea was to create a button that would open up MAX then go to devices and interfaces then go to serial. This would be used to identify the com ports that are connected. The user would have to input what is seen in MAX.

CLD Certified 2014
0 Kudos
Message 11 of 17
(875 Views)
If you put a VISA com port control on your front panel, it should show all of your valid com ports, then the user can pick which one they think is correct.
0 Kudos
Message 12 of 17
(869 Views)
Okay. The thing that was happening was the correct comport was always right after com 3. I thought I could just search for the com port but I guess I can't. Thank you.
CLD Certified 2014
0 Kudos
Message 13 of 17
(861 Views)
Of course you can. You get a list of all com ports and send the *IDN? command. The one that you get the correct response from is the one you use. It is not enough to just send *IDN? if multiple instruments are connected and more than one uses the command.
0 Kudos
Message 14 of 17
(848 Views)
That is what I tried to accomplish in my Com Finder Vi.
CLD Certified 2014
0 Kudos
Message 15 of 17
(843 Views)
You started okay but as already mentioned, you are not doing a coorect read. It simply does not make any sense to wire the bytes written to the number of bytes to read. You also had no code to handle the responses you did get back or even a read timeout.
0 Kudos
Message 16 of 17
(822 Views)
That is true. I will work on that. Thank you.
CLD Certified 2014
0 Kudos
Message 17 of 17
(820 Views)