LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

managing com ports when deploying application

I have not been able to come up with a good solution for the problem I have faced in more than one application that I built.
 
My application is to communicate with an instrument via RS-232 port. When I make executable and installer for the application, I choose some default com port (eg. COM1) to use at start of VISA configure.vi. Unfortunately, many of the target computers that I deploy the application to, have different com port names (eg. COM2, COM4, etc.) and my application does not run on them. So, either I individually change the COM port names on every machine I install to or I built series of executable and installers (one for COM1, one for COM2, one for COM3, etc..).
 
I believe there shall be a better way to deal with this situation, some dll which will give me the com port name on the machine and tell me something about it. So, if you know anything like that, please reply here.
 
Thank you.
0 Kudos
Message 1 of 3
(2,159 Views)
There was a somewhat complex solution posted to this question today. A simple Find VISA Resource can be used to populate a combo box or something similar. The VISA Find Resource help can explain how you can search for just serial interfaces. I usually just put a VISA Resource Name control on the front panel of the main VI and allow the user to pick. The latest versions of LabVIEW and VISA have filtering built into the control that is very nice. You also need to have a mechanism in your program so that the VI does not run the init com port before a value is selected.
0 Kudos
Message 2 of 3
(2,146 Views)

Thank you Denis.

I will look more into this, since it gives out all serial ports (including RS-232 and USB), I will have to figure out a way to decide which COM port my device is connected. But this is a good start point.

 

0 Kudos
Message 3 of 3
(2,140 Views)