Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Communicating with labview through 8051 micorcontroller

I am working on a project in which i have to transmit the analog signal to the computer using 8051 microcontroller through its serial port. And analyze the output for e.g applying filteration and other functions.

I have been successful in making a program which transmit data to the computer through serial port and i have read it on the hyper terminal but the problem is that when i am doing the same in the labview an error occours of incorrect framing of the data.

Even i have tried the labview example but could successful in solving it.

Anyone kindly help me in solving this problem

0 Kudos
Message 1 of 9
(5,310 Views)

A framing error probably means that the COM port is not configured to match the settings of the port on the 8051.  How is the port on the 8051 configured?

 

Baud Rate, # Data bits, # stop bits, etc.

0 Kudos
Message 2 of 9
(5,303 Views)

Thanks for replying

As i wrote earlier that i successfully communicated with the hyper terminal of the computer with mentioning the parameters so i must also be able to do it with the Labview.

Here i also want to mention that the problem i am feeling lies in the start bit delay time as all the other parameters are the same as that of the hyperterminal.

The communication parameters are

Baud rate 9600, Stop bit 1, Flow control None.

Tc

0 Kudos
Message 3 of 9
(5,291 Views)

HI Tc,

 

Did you check the parity and if the data is not ascii did you turn off the termination character ?

0 Kudos
Message 4 of 9
(5,287 Views)

Thanks for replying

My data has no parity bit and is in ascii format.

The actual problem is that it takes the data from the controller but somtimes it displays it correctly and sometimes incorrectly, but it doesnt do it countinously. for e.g when i start sending the data, it reads it but incorrectly in the mean time it starts reading it correctly and then give the incorrect framing error.

And it occours in every reading cycle.

What i have realised is that when i change the start bit delay time this error occourance time changes, but the program doesnt work if i omit the start bit delay time. So some error may be lying here in it.

0 Kudos
Message 5 of 9
(5,280 Views)

Can you show us the VI you are using to communicate with the 8051.

I used LV for my dev.boad with a 8051 comp. device to transfer the firmware. Never had a problem with the 8051 uart communication.

0 Kudos
Message 6 of 9
(5,277 Views)
I am using the example of 8.5 labview of basic read write. i dont have installed labview on this computer otherwise i also have send you the file.
0 Kudos
Message 7 of 9
(5,272 Views)

If you use the example in a loop it will open and close the COM port each time you call the VI. It can happen that some COM ports switch the data line when the port is closed. (I saw this with a PXI controller from NI) This will introduce an extra start bit without any data.

 

Try to build a VI, based on the example, that contains a loop with the communication.

0 Kudos
Message 8 of 9
(5,258 Views)

Try in this way

 

Capture.JPG 

 

 

regaurds

A.chaitanya 

0 Kudos
Message 9 of 9
(4,772 Views)