LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get a reliable sync with streaming data in RS232?

I have an application running in LV6i that must grab data from a continuous serial ASCII stream destined for a VT100 terminal. The stream repeats about every 1/10th of a second. The stream contains approximately 4k of data. There are no separators, but the VT100 positioning data repeats with every scan.

The problem: I cannot seem to get a good sync when reading the stream with LabVIEW. Initial reads of the stream may result in characters that are one byte off (garbage). An analysis of the hex data shows the data is read correctly, it's just one byte off (3D 45 read as D4 5C, for example). Rereading the stream will eventually produce good data, but then it may read only a few lines instead of a
full buffer (I read for one second, see how many bytes are in the buffer, and read the entire buffer. Then, parse the string for the VT100 commands I need and split the string into the variable data I need). It often requires 15 to 20 re-reads to get the buffer to fill. Oddly, once I get this working in a given session, it is pretty reliable.

Does anyone have a solution for this? It's driving me NUTS!

TIA,
Larry Stein
Woodward Governor
0 Kudos
Message 1 of 2
(3,092 Views)
Well, after much more digging around, I found that the VISA serial read vi was not reading all the data in the buffer. Knowledgebase article 0ACAKCRP had the answer.

Hope this helps someone else someday.

Larry
0 Kudos
Message 2 of 2
(3,092 Views)