LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Serial Read (Error -1073807252 (Hex 0xBFFF006C))

Hello,

 

I am trying to read from an RS422 device using a RS422 to USB converter and then to my PC using LabVIEW. I don't understand what the problem is since all I want is to just print the data on screen in real-time (no logging or storing). I have attached a snapshot of the vi. i would appreciate help in what i am missing. thanks!

 

 

info: 

LABVIEW version: 2021

Device info: 

            Baud rate: 921600

            data bits: 8

            stop bits: 10

0 Kudos
Message 1 of 5
(713 Views)

malshehri@sami.com.sa wrote:

I don't understand what the problem is since all I want is to just print the data on screen in real-time (no logging or storing).


Your error means: An overrun error occurred during transfer. A character was not read from the hardware before the next character arrived

 

Is the termination character correct? Is the message size less than 100? Why do you use a greedy loop?

 

A good place to learn serial would be this presentation.

0 Kudos
Message 2 of 5
(709 Views)

@altenbach wrote:

malshehri@sami.com.sa wrote:

I don't understand what the problem is since all I want is to just print the data on screen in real-time (no logging or storing).


Your error means: An overrun error occurred during transfer. A character was not read from the hardware before the next character arrived

 

Is the termination character correct? Is the message size less than 100? Why do you use a greedy loop?

 

A good place to learn serial would be this presentation.


Christian, The VISA Read will pace the loop, it is not greedy.

 

I would first look at placing the error wire on a Shift register and OR it with the Stop button to exit the loop on first error to see how often the error occurs.  Every Read? Every N reads?...

Then it's time to look at the Converter.  Which model? What driver is installed?  What are the Power Manager settings for that USB Hub? Is there a configuration setting for latency timer or packet size?  With high speed transfers you may need to reduce the latency timer (it controls how long to wait for a full packet before sending it anyway) or the packet size (number of characters to send at a time)


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 5
(666 Views)

You may somewhat improve by disabling the termination character, since you don't have one. The effect would depend on the nature of your data.

Maybe your system (Windows?) simply cannot keep up with this rate.

I guess that your code is a preliminary test, since you are doing nothing with the data. With a steady stream, you would receive about 93 kb of data every second in about 930 reads; this amount of data cannot be really viewed on the screen.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 5
(653 Views)

If that device is spewing data at full speed with that 921kB speed, I would as first attempt for a fix try to increase the amount of data to be read per iteration from 100 to at least 1000. 921kBaud corresponds to almost 100kByte of data, and reading that 100 bytes a piece requires the VISA Read to run at least every ms. While 1ms for a loop iteration is not that high for LabVIEW normally, it definitely increases the effort to allocated those 100 byte each time, display it and deallocate it then.

Allocating a buffer of 100 byte costs exactly as much time as allocating one of 1000 or 10000 bytes and this amount is NOT negligibly small. Writing and reading that buffer is for a few 100 bytes almost insignificant in comparison. Calling through the entire driver stack of NI VISA for a single read also takes a significant time that stays pretty much the same if you do it for 100 bytes or 1000 bytes. So reading more bytes per read will generally reduce the time needed to read a certain amount of bytes.

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 5
(625 Views)