LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB to RS 232 device COM assignment

I have a VI that pulls data from one of two power meters depending on the expected current draw of a motor under test. They are connected via RS-232 to USB Cable to a USB hub. These meters are identical except for the range. I have set these meter up on COM 4 and COM 6. What if anything ensures that upon restarting of the system that the assignments are not reversed? I have restarted the system a couple times with no change but I do not have confidence that on the 100th time they will not switch.

0 Kudos
Message 1 of 7
(2,931 Views)

USB and RS-232 assignments are not well defined.  And what about someone switching the USB cables?

 

If you can read the range settings or the serial numbers from the power instruments, that would probably be a more reliable method.

 

Lynn

0 Kudos
Message 2 of 7
(2,922 Views)

Dear friend Ofcourse you cant be sure for that but if you are using third party software for USB to serial converter than each time you can search before using the COM port.

There is a mechanism for that also (I wrote myself).

 

Let me know if you are interested in that.

 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 3 of 7
(2,870 Views)

I also have a similar issue, Can you please post your solution 

Thanx

0 Kudos
Message 4 of 7
(2,866 Views)

Hope this help.

 

 

Let me know

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 5 of 7
(2,863 Views)

I have found that the NI USB 232 cables have serial numbers. So when you set them up using MAX, they will always stay assigned to the same com port. My question now is when I make an executable and put this on a shop PC, will it assign the same com port numbers? I doubt it.

0 Kudos
Message 6 of 7
(2,837 Views)

As you can check on this article below, you are right, in the same computer they are going to be assigned in the same com port (NI-serial), but in a different computer it changes.

How are the COM Ports for My USB Serial Device Assigned?

 

However,  there are a few VISA functions that allow you to scan your system for serial devices. You could use the VISA Find Resource.vi function to return only serial devices in your system, and allow the user to manually or programmatically select which COM port they want to use.

0 Kudos
Message 7 of 7
(2,803 Views)