Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

overrun error when using multiple serial ports

Hi,
I am using a LV code to take measurements from several different devices at the same time. Recently I started getting an overrun error (1073807252 ). I am wondering what is causing my problem. I am operating my program on a computer with 2.0Ghz processor and 256mb RAM.
Below I am posting my code. Please if anybody has suggestions how to solve the problem, let me know.
Thanks,
Tony
=)))
0 Kudos
Message 1 of 17
(4,311 Views)
Hi

I tried to understand your program and I advise to study how LabVIEW parallel programming really works.
You add sequence frames all over the place to prevent parallellisme where simply connecting error wires already do the job.

Overrun means that your input buffer fills up more quickly than you are reading from it.
I stopped at analyzing your program also because my screen is "only" 1280 by 800 pixels and your program is a bit too big for this screen.

try to read from the serial line as fast as possible and do that for both serial ports and eventually buffer the data yourself.
but first make your program mor readable by wiring neatly and proably you see what is what faster.


greetings from the Netherlands
Message 2 of 17
(4,292 Views)
Thanks for your advice,
since I just started LabView, would you recommend anything specific that I can use to understand parallel programming?
Thanks,
=)
0 Kudos
Message 3 of 17
(4,222 Views)
In short, read the manual about parallellism in LabVIEw.

Even simpler though, all items that are not connected by wires (the wire dictates execution order) CAN run in parallel.
Can, because it depends on your system, the compiler, the hardware etc.
On a dual core pc some will run in parallel and in quad core, even more will run in parallel.

good luck, parallel processing in LabVIEW is so simple that above rules are enough.

greetings from the Netherlands
0 Kudos
Message 4 of 17
(4,215 Views)
Hi,
I tried to simplify my program by introducing SubVIs so it is more readable. However, I stillcannot figure out how to fo the whole thing using parallel programming. Also, I am reading from all serial ports at maximum speed (baud rate=1600). Still, there is overrun error appearing. As for "buffering the data myself", I do not quite get what it means.
Thanks a lot for your help.
T
=)
Download All
0 Kudos
Message 5 of 17
(4,187 Views)
your baudrate is the speed on the serial line and overrun occcurs in your pc
your simply not reading fast enough and taking the highes possible baudrate makes it worse.

In your main vi you need two loops (running in parallel)
in one read reaad all seril ports one by one and dump the data in an action engine (see link below on action engines)

http://forums.ni.com/ni/board/message?board.id=170&message.id=240328

In the other loop read from the action engine and process the data.

good luck
greetings from the Netherlands
0 Kudos
Message 6 of 17
(4,171 Views)
Hi,
thanks for your advice. One more thing: after reading the thread that you suggested I did not quite get the idea of the Action Engine. Can you provide an example of an AE (if possible readable by LV 7.0)?
Thanks,
T
0 Kudos
Message 7 of 17
(4,113 Views)
I'll do my best but reading and trying action engines is possible for yourself.
Just draw what happens.

The trick is the uninitialised shiftregister that keeps information over calls.
try with a simple vi with just a while and an uninitialised shiftregister and a case statement with in each case an action.
and see what happens.


greetings from the Netherlands
0 Kudos
Message 8 of 17
(4,105 Views)
Hi,
as you advised I tried writing a simple .VI. I post it below here. However, I still do not get the concept. Can you please look at my file and suggest what I can change about it so that it Action Engine concept is implemented properly.
Thanks,
Tony
=)
Download All
0 Kudos
Message 9 of 17
(4,094 Views)
Hi Toni

Here is an example of an extreme sinple action engine.
It does not solve your overrun problem but structures your code.

One of the essential problems you had was a bad error handling.
Now the program stops on an error and shows you this in error out

One of the things you can do in the serial read to overcome overrun is to check how many bytes are available and read them all in one string.

the main vi is "more serial lines.vi"





greetings from the Netherlands
Download All
0 Kudos
Message 10 of 17
(4,084 Views)