LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I correct a framing error in serial data

My application is a telemetry link between a robot and PC. I use a PIC to gather the data and then transmit it via Quickblue to a Bluetooth USB dongle on the PC where it is displayed in graphical form. The data is 10 separate bytes sent in a packet every 2 milli secs at 115KB.

 

Using a hard wired test link to COM 1 the data is stable at 115KB, but using Quickblue to COM5 the received sequence moves one byte to the right at random intervals of about 5 secs. At 57KB, however, the data is stable. I assume that EMI is responsible.

 

How can I correct this intermittent framing error? I am new to Labview and have based my VI on the serial example in V8.5.1.   I don't mind the occasional corrupt data packet provided the framing error recovers immediately. I could easily send a constant byte value to identify the first byte in the packet.

0 Kudos
Message 1 of 5
(11,848 Views)

Hi Roboteer,

you can store your received data in a shift register. Search for your identification and build your message over all received packages.

 

Hope it helps.

Mike 

0 Kudos
Message 2 of 5
(11,827 Views)

Hi roboteer,

                   Have you tried increasing the baudrate?

Message Edited by muks on 08-23-2008 09:31 AM
0 Kudos
Message 3 of 5
(11,825 Views)

Increasing the baud rate will simply make the framing error occur more often, which is rather pointless. Also, the poster explicitly indicated that the communication was stable at a lower baud rate.

 

A framing error occurs when a byte is received, but it is not in the proper format. They can also occur if the serial port settings do not match exactly between the device and the port. At the speed that you are running are you using handshaking? When you have a hard-wired and the serial port settings match, framing errors are usually caused by bad cables or noise on the line. In your case you indicated that you have a Bluetooth USB dongle. I would highly suspect that it's simply not capable of running at that speed. Have you tried talking to a different device (such as a test instrument that has a serial connection) at that speed?

0 Kudos
Message 4 of 5
(11,794 Views)
Thanks Mike and Smercurio for your suggestions. I will try programming a shift register and will also try a friends dongle.
0 Kudos
Message 5 of 5
(11,785 Views)