LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get the vi to wait for the user to select a COM port?

Solved!
Go to solution
This is a problem when I run the application.  If the COM port selected is not the one actually connected to the hardware then I get an error.  I can then select the correct COM port, re-run the application and everything is fine.  But I want the application to run when called by the user and wait until the correct COM port is chosen.  I will settle for the selection of any COM port and put the responsibility for proper selection on the user.  Thanks to all.
0 Kudos
Message 1 of 12
(3,912 Views)

Hi Havelld,

you can use an event structure to wait for the selection.

 

Mike

0 Kudos
Message 2 of 12
(3,906 Views)

Had the same problem. I used to select the highest com port number available. When I ported the hardware the com port number used to get incremented.

 

You can use a while loop like this

 

errr.PNG

0 Kudos
Message 3 of 12
(3,898 Views)

Hi muks,

how should someone change/select the com port if you use a constant in a running vi?

 

Mike

Message 4 of 12
(3,895 Views)

Mike,

 

It is just to show the com port number which has gone to 23 in the picture. Obviously one has to change it to a control.

0 Kudos
Message 5 of 12
(3,891 Views)
Okay, that makes sense.  I'll try that.  Thank you for your time.
0 Kudos
Message 6 of 12
(3,866 Views)

Mike,

 

Yes, I have tried that but I am afraid I don't understand event structures well enought to make it work.  Maybe I wasn't properly placing the event structure; i'm not sure if it should be a separate loop or somehow incorporated in, or around, the main loop.

 

Do you have a good example or tutorial I can start with?

 

Thanks,

0 Kudos
Message 7 of 12
(3,868 Views)

Hi Havelld,

the attached picture shows the simplest solution. If you already use an event structure in your vi, then you should integrate this function into the existing structure. I don't recommend to use more than one event structure per vi.

 

Mike

0 Kudos
Message 8 of 12
(3,863 Views)
Solution
Accepted by topic author Havelld
Of course.  It's working great now.  Thanks MikeS81!
0 Kudos
Message 9 of 12
(3,851 Views)

Hello all,

 

is it possible to have your file in Labview8.0, please ?

0 Kudos
Message 10 of 12
(3,824 Views)