Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial communication problem - Parity and Framing error

I am trying to read a signal from an instrument (through the Serial port), which has the following characteristics: 4800 baudrate, 1 start bit, 8 data bits, 1 "command bit", 1 stop bit.
The problem is that I can´t configure the serial port correctly. If I set no parity bit, Visa Read returns the framing error (0xBFFF006B). And assuming this "command bit" as being the 9th data bit (therefore setting the parity bit for "Space" or "Mark") I receive the Parity error (0xBFFF006A) from the Visa Read command.
So, how can I solve this issue?
 
Since now thank you for any answer.
 
Kind regards,
Guilherme
0 Kudos
Message 1 of 4
(7,142 Views)
First, you should post this question in Instrument Control or LabVIEW Forums.
 
For you question, I think you can use MAX to test first. Lauch MAX, go to Device and Interface->Serial & Parallel, select the port you use. In "Port Setting" page, configure the parameters. Than, click "Open VISA Test Panel" on top of the window. There you can send or receive data with serial instrument. It's easier than LabVIEW programming.
Ryan Shi
National Instruments
0 Kudos
Message 2 of 4
(7,134 Views)

Hello Ryan,

Ok, doing the reading by MAX worked. I checked the message that is being sent by the instrument, and it is correct when I select "no parity bit".

But in the field "return status", in the VISA Test Panel, it shows the same hexadecimal code for the framing error. So, if I use the VISA Read command, in Labview, it will keep on not working. What should I try now, so that I don´t have this framing error anymore?

Thank you once more for your answer.

Regards,

Guilherme

0 Kudos
Message 3 of 4
(7,125 Views)
I have just discovered another interesting thing: the information that I am trying to read through the serial port has 5 bytes, but only the first one uses the "command bit". So, that´s why it was working fine on the VISA Test Panel when I selected "no parity bit". But it is also interesting that the first bit (the one with a 9th data bit) was also correctly read.
So, now I know why I am getting the framing error (the first bit of the message uses 9 data bits and the others only 8), but how can I proceed to get the hole message using VISA Read with Labview, without the framing error?
0 Kudos
Message 4 of 4
(7,111 Views)