LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain the label of the COM ports?

Solved!
Go to solution

Post the code so we can tell what is going on inside. 

 

"I tried to make COM@ as a constant in the VISA resouce names" 

Did you right click on the control and set it as default?

 

"it gives me a list of COM's connected" 

 

Is that a seperate PopUp or the drop down list when you click on the VISA Ref front panel control.

 

Omar
0 Kudos
Message 11 of 18
(1,842 Views)

Hello Omar,

 

As per our discussion I have attached some ppictures and I will explain you now what I need. So, this is the main VI, the first picture you can see below and there is a box which says Connect instrument. If I go into it, I find another sub Vi which is in the next picture 2.

 

Untitled1.png

 

 

In this second picture you must be able to the box which says Select Device Ok. This is the pop up window which comes up asks the user to select a port for use. My concern is that this pop up window doesn't shows up and the COM port is automatically selected. Now, I was easily able to dissapear the pop-up window by disabling the select device ok box but how can I make sure that it also selects the COM 2 as a default port. In the next picture 3 I have shown the block diagram of this Select Device Box where I have put the COM 2 as a constant but I do not know where to join it so that COM 2 is default and selected automatically.

 

The pop up window comes up when I execute the program and the last picture is showing it how does it look like.

 

I hope the situation is much clear for you to help me.

 

 

2.jpg4.jpg5.jpg

0 Kudos
Message 12 of 18
(1,785 Views)

hello

 

sorry about not replying but I briefly stopped to work on this project.

 

the Blokks's solution is the best appropriate for me. I'm able to dress the list of COM devices present in the computer

 

thanks for your contributions.

Pierre FCentum TNS, Grenoble
Certified LabVIEW Associated Developer
0 Kudos
Message 13 of 18
(1,659 Views)

Unfortunately, I have another problem 😞

 

the diagram in the image 1 below, gives the result in the image 2, that's correct

 

however, the .exe gives the image 3: nothing is displayed

 

any idea?

 

1)

1 test popup vi diagram.png

 

2)

2 test popup vi front panel.png

 

3)

3 test popup executed.png

Pierre FCentum TNS, Grenoble
Certified LabVIEW Associated Developer
0 Kudos
Message 14 of 18
(1,627 Views)

I confirm the problem, I get the following error when the VI is launched from a build (does your app report errors properly?):

 

VISA_error_1.png

 

This is the VI:

 

list_d_BD.png

 

I dig into what is the cause...

0 Kudos
Message 15 of 18
(1,614 Views)

Solution:

 

You need to properly close the VISA references:

 

list_d_BD.png

0 Kudos
Message 16 of 18
(1,607 Views)

hi blok

 

your solution is working, but....not working 🙂

 

 

let me make my device more clear. I'm developping with the computer A, where the labview licence is registered. the compiled .exe code is dedicated to the target computer B, which has no licence and is running with runtimes

 

thanks to your solution, I can see all COM inputs from the .vi and .exe in the computer A

But I still can't see them in the computer B.

 

 

I have a clue: computer A has "NI-VISA 14.0.1" and "NI-VISA runtime 15.0" while computer B only have "NI-VISA runtime 15.0"

 

I will ba testing my vi by installing the same year-version for both runtime and normal one. I hope it will work.

Pierre FCentum TNS, Grenoble
Certified LabVIEW Associated Developer
0 Kudos
Message 17 of 18
(1,589 Views)

Or just create a stand-alone installer of your application including the required VISA driver...? So you do not need to install anything manually on a target computer.

If later you need a new version of your code, a "patch", you can just exclude the drivers, so the installer will only contain the application and will be a few MB only...

0 Kudos
Message 18 of 18
(1,586 Views)