LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA serial communication in LV 7 application

My development environment is Labview 7.0 running under
Windows 2000. I have a VI that communicates via VISA
serial. The VI works fine, and information flows back
and forth over the serial line. When I build the VI
into an application and run it on my development
system, everything appears to work fine. There are
no errors of any type reported. However,
no information is communicated over the serial
line. This is really frustrating!
0 Kudos
Message 1 of 6
(3,189 Views)
Ah, yes, serial communication is supposed to be simple, but it is often frustrating. I have done a fair amount of this, but none under LV7.

Whether or not you get errors depends on the nature of the communication. For instance, suppose you send a request for status information to your serial device. Maybe you send a "sts" to the device. If there is nothing to receive your command, you will not get an error in your code. You will in fact send "sts" to the device, even though your device isn't hearing it. If you do a serial read each time you make this request, then you should get an error. If no device is listening to your command, then you should get a serial timeout error.

The error reporting might have something to do with the new automatic error
reporting features in LV7. Make sure that you are not using only the automatic error handling feature, which is unavailable in the run time engine.

Before you conclude that the code is fine just because it ran on your development machine, make sure that it is even possible for your code to generate serial communication errors. Generally, it should be possible, but based on the limited information that you provided in your question, I have to issue this caution.

Assuming your code can indeed generate serial communication errors and you are monitoring those errors properly, then you should double check the serial port resources. Make sure that your target control machine is defined according to the code you wrote, e.g. all of the settings, including the visa resource name should be identical.

If you attach your source code, or perhaps a reduced example of your code, I'm sure we could get to the bottom of it quickly.
jc
Mac 10.4
LV7.1
CLD
0 Kudos
Message 2 of 6
(3,189 Views)
Be sure, when you build your application, that you check the checkbox to include serial support. This will include the VISA serial support in the resulting installer.

I suspect that you are getting an error somewhere in your application; it's just not getting reported somehow.

Brian
0 Kudos
Message 3 of 6
(3,189 Views)
I have made a new VI. All it has in it is

VISA Configure Serial Port.vi

The only input wired is VISA resource name, which is
"ASRL2::INSTR". The only output wired is "error out".

When I run the VI, I get a green checkmark in the
error out status and 0 for the error out code.

When I build this VI into an application and run
it on the development system, I get a red X in the
error out status and -1073807246 in the error out code.

I have a feeling that either VISA serial communication
is broken on my Windows 2000 development system or LV7.

I really need to make this work, and I have no idea
what to do.
0 Kudos
Message 4 of 6
(3,189 Views)
That error implies that the visa resource exists on your machine, but that it may be in use by another application. Make sure that no other application is trying to communicate over that port.

This situation is described on the NI site at

http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/862567530005f09c862564e000017e89?OpenDocument
jc
Mac 10.4
LV7.1
CLD
0 Kudos
Message 5 of 6
(3,189 Views)
In regard to another application using the serial port, an application that uses the serial port and is often loaded on system startup is PDA synchronization software. This is such a common technical support call for us that we have specific warnings in our manuals to instruct users to make sure the PDA synch software is disabled.

Allen Weekley
Alpha Technics
aweekley@alphatechnics.com
0 Kudos
Message 6 of 6
(3,189 Views)