LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -1073807252 while Reading and saving data from a serial port

Solved!
Go to solution

I need to read an instrument data connected via a serial port (RS-232) with the following characteristics: 

  • 8 data bits
  • No parity bits
  • 1 stop bits
  • 19200 baud
  • No hardwarehandshake
  • No XON/XOFF handshake

The instument sends out every ~0.033 seconds a text string containing 4 numbers: two intergers, followed by two floats. The first two integers are diagnostic data and can be discarded. I am interested only in the subsequent 2 floats, which are the actual instrument reading.

 

As I am new to labVIEW I started from the example "Continuous serial and write.vi", trying to adapt it to my needs. I erased the writing block, as I am only interested in reading the data. 

 

I then added a series of operations to save the reading of the instrument, together with the current time, in a text file as tab delimited data. 

 

As not need to sample the data every 0.1 s, I slow down the loop with the "wait until next ms mutiple" function. 

 

Here I get a strange behaviour: if I set the time to wait to small numbers (10, 20, 30 ms)  everything seems to work pretty fine. Instead if I set larger numbers (50 up to the desired value of 100 ms), after a few seconds I get the Error -1073807252 with the possible reason:

 

VISA: (Hex 0xBFFF006C) An overrun error occurred during transfer. A character was not read from the hardware before the next character arrived.

 

error_labview.PNG

 

I do not understand this error, as the data flow is pretty limited and the computational speed should not be a problem.

 

Attached you can see my code and the error message. 

Thanks for the help!

Download All
0 Kudos
Message 1 of 6
(1,684 Views)

What LabVIEW version are you using?  Do you have a sample of the serial output?  You can collect it with TeraTerm (it's free).  Is the output comma delimited with a carriage return for the next line?  You may have over complicated your VI.  It may be a good idea to separate serial data read from the parsing and data recording function.  The producer consumer structure.  Let  me know what version labview you're using so I can send you a sample code.

0 Kudos
Message 2 of 6
(1,677 Views)

@davidedalbosco wrote:

I need to read an instrument data connected via a serial port (RS-232) with the following characteristics: 

  • 8 data bits
  • No parity bits
  • 1 stop bits
  • 19200 baud
  • No hardwarehandshake
  • No XON/XOFF handshake

The instument sends out every ~0.033 seconds a text string containing 4 numbers: two intergers, followed by two floats. The first two integers are diagnostic data and can be discarded. I am interested only in the subsequent 2 floats, which are the actual instrument reading.

 

As I am new to labVIEW I started from the example "Continuous serial and write.vi", trying to adapt it to my needs. I erased the writing block, as I am only interested in reading the data. 

 

I then added a series of operations to save the reading of the instrument, together with the current time, in a text file as tab delimited data. 

 

As not need to sample the data every 0.1 s, I slow down the loop with the "wait until next ms mutiple" function. 

 

Here I get a strange behaviour: if I set the time to wait to small numbers (10, 20, 30 ms)  everything seems to work pretty fine. Instead if I set larger numbers (50 up to the desired value of 100 ms), after a few seconds I get the Error -1073807252 with the possible reason:

 

VISA: (Hex 0xBFFF006C) An overrun error occurred during transfer. A character was not read from the hardware before the next character arrived.

 

error_labview.PNG

 

I do not understand this error, as the data flow is pretty limited and the computational speed should not be a problem.

 

Attached you can see my code and the error message. 

Thanks for the help!


Think about what you just said:

The device sends a message every 0.033 seconds, or 33 ms - yet you are slowing the loop down to read every 100 ms.  So the data piles up in the buffer and eventually it overflows.

 

The represents an incomplete understanding of basic communications (not LabVIEW).  For something like this, you read as fast as you can and work on just the data you want and throw out the rest.  Notice that "10, 20, 30 ms" are all less than 33 ms, so you're reading the messages as they arrive - if only barely so.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 3 of 6
(1,648 Views)
Solution
Accepted by topic author davidedalbosco

Shameless plug: VIWeek 2020/Proper way to communicate over serial


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 6
(1,638 Views)

I am using LabView 2020. I would like to use labview because the data acquisition software in our laboratory is built in labview. 

 

A line of the of the output of my instrument is something like

3 003 -58.7391 0.5033

 

The terminination character of the line is hex D (ascii) which corresponds to the carriage return. 

0 Kudos
Message 5 of 6
(1,591 Views)

Then I would just do something like this.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 6
(1,579 Views)