LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with labiew serial in XP

Hi

I've written an application (using Labview 7.1) which is communicating via
serial (laptop serial port) to an instrument. The instrument has 1200baud,
81N, no flow control. The serial problem happens when I request data from
the instrument, which is done by sending a short string to it. Using the
basic serial read write VI and setting the delay between reading and
writing to something big enough to allow for the slow speed of the port
(the return is 12 bytes so anything over 300ms should be plenty) and then
making the VI execute repeatedly gives unexpected results. Occasionally a
double entry appears in the read string.
Obviously this is a very brief description of a complicated problem but
thought it worth asking here in case there are any obvious "gotchas" that
I've overlooked. For instance, does Win XP do anything unusual that
affects serial behaviour wrt labview and VISA and that I need to disable?
There doesn't seem to be a VI or VISA module to clear the serial if it
gets into knots?

Many thanks in advance

Regards

Bill
0 Kudos
Message 1 of 4
(2,800 Views)
Did you try and use the bytes at serial port and wait for bytes to arrive to the port before reading.  This might help your problem by giving you a consistent time when you should read instead of creating a delay and waiting.  In your case wait until 12 bytes appear at the port and then read.  Hope this helps.
 
 
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 2 of 4
(2,785 Views)

to clarify look at the function below the VISA configure serial port.  It is called VISA bytes at serial port.

 

BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 3 of 4
(2,789 Views)
Here's a little wait vi that I use when reading from a COM port. 
 
0 Kudos
Message 4 of 4
(2,705 Views)