LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing and renaming rs232 port

Hi!
 
My program is used to controll camera by sending commands to the rs232 port, pan and tilt.  The commands are in an event structure.  I also have the com port as a constant ( com1) inside the event structure and the VISA configuration, plus open and close VISA. 
 
I want to be able to chosse which com port to use.  So if I change the contant for com port to controller, I'll get a drop down list of all available com ports pluss LPT.  And they are called Com1, Com2 and so on.
 
I want to only see maybe com1 , com4, com5, and call them other name... like Controller-1(com1), Controller-2(com4) and so on.
Do I have to make an other sub vi or can I customize the com port controller? and how to I do that????
 
Hoping someone will be able to help me 🙂
 
attaching an image
 
Best regards
Martin
0 Kudos
Message 1 of 4
(2,901 Views)
You can do this in Measurement and Automation Explorer. Just set the alias for the COM port to whatever you want. Screenshot.


Message Edited by smercurio_fc on 03-17-2008 12:25 PM
0 Kudos
Message 2 of 4
(2,897 Views)
I'm making exe files of the progam and installing it on other computers,  will the renaming of the com ports still be active if I install it on a computer that only have runtime engine?
And how do I filter the com ports, so only com1, com4 and com5 shows in the drop down list?? Pluss the other com ports that don't show must be active because I using them for another programs
0 Kudos
Message 3 of 4
(2,886 Views)
If you're building an installer you can include the MAX configuration. You first need to export the configuration from MAX (File->Export..., and select the "NI Configuration File" format). Then, in the installer, in the "Advanced" tab there's an option to include a hardware configuration file. Select this exported file.

The built-in VISA Resource Name control gets its list from MAX. One way to limit this list is to disable the item from MAX (the "Disable enabled" checkbox). However, this will disable it for any LabVIEW app. Another way is to display your own list you need to use a regular menu ring control and set the items. You can get the list of aliases from MAX using the VISA Find Resource function. You can then check each item to see if you want it, and populate a string array only with the items you want (presumably based on some name format). Example:



The selected string from the menu ring can be passed directly to a VISA Open since it's an alias.


Message Edited by smercurio_fc on 03-17-2008 01:19 PM
0 Kudos
Message 4 of 4
(2,876 Views)