LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI exported to EXE can't read com port

Solved!
Go to solution

Personally I don't think it is a driver issue unless your COM port is a virtual COM port and requires a driver.

 

The problem is the code which you haven't show us which determines which COM ports are on your PC. I asked for it, and you ignored it and posted something else.

 

 

.

0 Kudos
Message 11 of 17
(1,892 Views)

You should be careful in regards to the COM port number, they don't always match for different machines.  Furthermore, ports which are assigned via an adapter (say a USB-serial adapter) can be arbitrarily assigned by windows (and they can change if you remove/reconnect devices often).

 

Use "VISA Find Resource.vi" to get the list of ports/devices  (ASRL*  are your comm ports).  If your device has a known query response (something similar to *IDN? looking for a model or serial number), iterate through the list until you get the correct response, you have now located your device.

0 Kudos
Message 12 of 17
(1,886 Views)

@nyc_(is_out_of_here) wrote:

Personally I don't think it is a driver issue unless your COM port is a virtual COM port and requires a driver.

 

The problem is the code which you haven't show us which determines which COM ports are on your PC. I asked for it, and you ignored it and posted something else.

 


You did not specifically ask for the code in any of your posts.

 

I just ran the exported EXE file on the same machine that I built the VI on and it worked perfectly, so it was not the code. Then I installed the VISA runtime engine on the PC that I transferred the EXE to, and everything started working great.

 

Thanks everyone for your help. I marked UliB and GerdW's responses as the solution.

0 Kudos
Message 13 of 17
(1,884 Views)

As general advice for you in regards to building an application for a target PC.

 

You typically need to consider the following.  

1) any input files (config files) your code relies on

2) any external DLL files your code calls (this can include manufacturer LabVIEW drivers)

3) any hardware drivers your external hardware requires (common for USB devices)

4) any NI drivers your code uses for communication.  This commonly means NI-VISA, NI-488.2, NI-DAQmX, NI-Serial, etc.

5) Run-time engine for the appropriate LabVIEW version

6) Optional toolkits may require additional support (like "NI Vision Development Module Run-Time" for NI Vision functions )

 

This is the reason others were directing you to create an installer.  You can wrap everything you need together instead of installing them 1 at a time.

Message 14 of 17
(1,882 Views)

Thank you, agreed creating an installer would have been better. I found that how-to in the LV help files so will do that going forward.

0 Kudos
Message 15 of 17
(1,875 Views)

@lavadisco wrote:

@nyc_(is_out_of_here) wrote:

Personally I don't think it is a driver issue unless your COM port is a virtual COM port and requires a driver.

 

The problem is the code which you haven't show us which determines which COM ports are on your PC. I asked for it, and you ignored it and posted something else.

 


You did not specifically ask for the code in any of your posts.

 


I asked you how you were populating the dropdown box.

If that isn't asking for code, I don't know what is!

 

 

.

0 Kudos
Message 16 of 17
(1,869 Views)

@nyc_(is_out_of_here) wrote:
I asked you how you were populating the dropdown box.

If that isn't asking for code, I don't know what is!

The dropdown box is a I/O Control provided by NI in the palettes (IO >> VISA Resource Name). The list populates itself, no need for code.

You even can apply 'IO Name Filtering' or 'Select VISA Class' over right click menu.

See http://zone.ni.com/reference/en-XX/help/371361R-01/lvconcepts/io_controls_and_indicators/

 

0 Kudos
Message 17 of 17
(1,859 Views)