NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
robojeff
Posts: 56
0 Kudos

how to set a com port in Labview

I have an application that uses USB that is set up as a virtual com port in Windows XP.

 

How can I set up a com port in labview on my development PC and guarantee that when I install the compiled executable version of my vi on a target system that my device when plugged in will either always be set to a certain com port?

 

Or how can I set up my code to automatically select the com port where my USB device is connected?

 

What I currently have is an I/O device that I set up with Max but for some reason,  this does not configure itself with the same 

name on my target PC, so I am not sure if I need to change my code or set the installer up in a different way.

 

I am using LV v 8.2.1...

 

thanks

 

 

port setting.JPG

Active Participant
MoReese
Posts: 780
0 Kudos

Re: how to set a com port in Labview

You can use this VI to programatically change your com port.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
Member
robojeff
Posts: 56
0 Kudos

Re: how to set a com port in Labview

Thanks-

Please supply your example in version 8.2.1 or older

 

thanks again

Active Participant
MoReese
Posts: 780

Re: how to set a com port in Labview

Here you go (v8.0)

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
Proven Zealot
Jeff·Þ·Bohrer
Posts: 5,323
0 Kudos

Re: how to set a com port in Labview

ALSO- you can export your MAX configuration and import it to the new machine during instal.  At least with later LabVIEW versions I haven't played with 8.2 for a few years


"All shall be well and all shall be well and all manner of things shall be well" -Julian
Member
robojeff
Posts: 56
0 Kudos

Re: how to set a com port in Labview

I tried configuring it with MAX and it appears to load it but unfortunately this does not set thet com port to com 9

Proven Zealot
Jeff·Þ·Bohrer
Posts: 5,323

Re: how to set a com port in Labview

two ways around that.

Rename the Alias in MAX

Use Windows hardware manager to re-assign the port number


"All shall be well and all shall be well and all manner of things shall be well" -Julian
Member
Japper
Posts: 56
0 Kudos

Re: how to set a com port in Labview

nd out later that Max did work and in the hardware device manager, when the device was plugged into the USB port and appeared in the device list that I had to select it and under the advanced tab, I had to scroll down and select com 9 and then the PC will map the device to com port every time it is plugged into the PC...

 

 

Thanks for your help

Active Participant
Ranjeet_Singh
Posts: 435
0 Kudos

Re: how to set a com port in Labview

Hello all,

                    Now i want to communicate through device using USB. I think i need to use virtual com port for commnication between PC & device. I am selecting this because i dont want to give feature for selecting the com port each time. so for this i want to use the feature of USB named HOT PLUGGABLE in my project i.e. without configuring the port user can communicatio from the device, Take a example of usb keyboard or mouse.

 

U seem to be have some experience in this usb field.

Please show me the direction.

 

Thanks- 

Ranjeet

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent & i deserve it.

I need my difficulties because they are necessary to enjoy my success.
Ranjeet Singh
Knight Rider
Active Participant
MoReese
Posts: 780
0 Kudos

Re: how to set a com port in Labview

Have you tried what's already been suggested in this thread?

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page