From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parity & Framing errors on Serial Port read

Solved!
Go to solution

Hello, I'm writing a program that reads an IR thermometer from the serial port. Intermittently, I get both parity and framing errors and cannot explain why or figure out how to fix them. All the serial parameters have been double checked and verified. I get no errors when using Hyperterm yet, when I do test reads in MAX, I do see these errors occasionally. I've tried the suggestions in the knowledge base for these such as introducing a delay between the Visa configure and the Visa read or flushing the transmit buffer before reading but neither has worked. Any insight or ideas would be appreciated.

 

Additionally, while searching through the threads about parity and framing errors, I saw one where a user recommended the following: "use wait on event triggered by the termination character and when the error occurs I just remove the error, flush the buffer, (wait for the next termination character) and read again." If this sounds like a sound solution, how would I go about implementing it?

 

I've attached a screenshot of my serial read loop so you all can see what I'm doing. The error code I'm doing the check on is for timeout.

0 Kudos
Message 1 of 3
(2,471 Views)
Solution
Accepted by topic author RudyB
Since you have enabled the termination character, you should not be using the bytes at serial port. You should not need the delay or any flush buffer functions.

p.s. You also need to fix the way your loop stops.
0 Kudos
Message 2 of 3
(2,461 Views)

Will try the loop without the delay, flush etc and let you know if that has an effect.

0 Kudos
Message 3 of 3
(2,445 Views)