From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Programatically Changing Com Ports

I need to programatically change the COM port within LabView.

 

I am writing a program for clients and need to save the COM port settings within an exicutable. I was going to atchieve this by writing to an ini file. I cannot directly save the VISA variable but can save the following properties.

 

Intf Inst Name

Intf Type

Intf  Num

 

The problem is I cannot write to these properties on the initialization state of the program. Is there a way I can save which COM port was being used from one session to another of an exe? Thanks in advance for all your help.

 

Jesse

0 Kudos
Message 1 of 2
(2,226 Views)

Hi Jesse,

you can store it as a string. If you read the string from a file you can directly connect it as a com port selection. It also works if you typecast the string to the com Port type.

 

Mike

Message 2 of 2
(2,220 Views)