LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232, take a output string.

Dear,
I programmed RS232 with Labview 6.0.
Almost steps are Okay.
But the read data is scrolled.
For example, 0.000 0.000- have often showed as 0.000- 0.000.
Of course, I set the string size exactly(here 12bytes).
Inserting timer(about 1~2sec) between writing and reading is not helpful.
How can I fix this problem?

Thanks in advance.
0 Kudos
Message 1 of 2
(2,494 Views)
"often"
This makes it sound like it works correctly sometimes.

I suspect the 1-2 second deya is hurting you more than it is helping you. If you start your read to late, you may be missing the first part of the response from your device.

If the read operation would only start reading after the first part of the response was sent, then the first thing it sees is the last part of the resonse.

First "flush your buffer" by checking how many bytes are waiting, and reading tht amount. If its 0, who cares. If there bytes, toss them.

Then do your write imediately followed by the read. When you do the read, give it a sufficient amount of time to read the response.

If you post a copy of your code, someone will probably be able to give you some more ideas.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 2
(2,494 Views)