07-10-2009 10:20 AM
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
07-10-2009 02:32 PM
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
07-10-2009 03:59 PM
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.
07-13-2009 04:21 AM
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
07-13-2009 07:47 AM
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
07-13-2009 10:41 AM
Bad serial port or cabling on the other PC? Test communications in Hyperterminal as a sanity check.
-AK2DM
07-20-2009 07:21 AM
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
07-20-2009 07:48 AM
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.
07-20-2009 11:59 AM
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
07-29-2009 07:46 AM
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