LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA read in exe file is not working

Hi all,

 

I am having problems with VISA read in an exe file created.

 

I am trying to write to and read from a programmable power supply via RS232. The VI writes a command to the instrument to set the voltage level. It then writes another command, requesting the resulting current value. This value is then read by VISA read

 

The VI is working fine on the development PC, which has LabVIEW installed. The exe file is also working fine on this PC. However, when I try to run the exe file on another PC (I've tried several) everything seem to work except for the VISA read functions. The voltage level command is sent, as well as the On and OFF commands, but the current is not read back.

 

I guess there must be something I have missed in the installation. I am working in LabVIEW 8.5. I have created an installer and included

 

Runtime Engine 8.5.1

VISA runtime 4.5

 

Is there something else I should do? I am really running out of ideas here...

 

I hope someone has a clue about this!

 

Clara 

 

 

0 Kudos
Message 1 of 23
(5,453 Views)

Try adding in NI-Serial (either in your installer or through the Device Drivers CD) to the target computer.

 

Is this for a Keithley?

 

~js



2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 2 of 23
(5,437 Views)

NI-Serial is required if you are using an NI serial product.

 

One thing I noticed is that you did not install MAX. You might want to try that just to have some sort of diagnostic tool.

0 Kudos
Message 3 of 23
(5,423 Views)

Hi again,

 

Thanks for the advice. I had not installed VISA Serial, so I did. I also upgraded the MAX on the target PC. Unfortunatly, it is still not working.

 

I find it strange that everything seems fine except the read function, which as I said works fine on my PC.  I tried to check and validate the port settings in MAX at the same time as having the exe file open (but not running) and I got a "port busy" message. Could this have something to do with it? Should the port be busy when the exe is not running? The read is however is the middle of the VI, and the commands both before and after are working.

 

Any ideas?

 

Thanks for all the help!

 

Clara 

0 Kudos
Message 4 of 23
(5,389 Views)

Clara-

1. Have you verified that the COM port settings in Windows (check under device manager) are matching how you initialize them (Baud, bits, parity, and flow control) and that these match the power supply's settings?

 

2. Also, are you trapping an error message after the attempted Read command (this will make it a lot easier to diagnose).

 

3. Do you programmatically close the VISA session at the end of the program?

 

4. You can always post the code to see if the forum members will catch the porblem.


~js



2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 5 of 23
(5,376 Views)

Bad serial port or cabling on the other PC? Test communications in Hyperterminal as a sanity check.

 

-AK2DM 

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 6 of 23
(5,356 Views)

Hi again,

 

Thanks for that suggestion! It seemed that there was something wrong with my soldering of the cable. I have to have a constant 12 V on one pin, so I have soldered that to the cable. When I noticed that it was loose I redid it, but it dis not solve the problem unfortunately.

 

The program still works fine on my computer, but not on the target PC. Could it be a problem that it is an older laptop? Is there something else that should be included in the installer. As befor, everything works except for the read.

 

Running oit of both hope and ideas...

 

 

Clara

0 Kudos
Message 7 of 23
(5,285 Views)

You didn't specify if a message error appeared during the read.

 

If not, perhaps you encounter a simple problem of unadapted numeric separator (',' and '.') on your target PC.

 

Other way, use NI-Spy to scan the com.

0 Kudos
Message 8 of 23
(5,273 Views)

It could indeed be a problem with the laptops serial port. Again, I would suggest to try writing and reading some commands and data with Hyperterminal. If you still cannot read within Hypertermianl then that would eliminate your LabVIEW program as the source of the problem.

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 9 of 23
(5,261 Views)

Hi again,

 

I seems that we have located the source of the problem. It appears that the program is not working on a laptop, unless it's connected to a docking station. I guess this has something to do with the powering of the serial port? The write commands are working, but not the read commands.

 

Thanks for all the help, I just thought I's share what we learned. I guess the solution is just to not use a laptop.

 

Clara

0 Kudos
Message 10 of 23
(5,197 Views)