Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC16F877A+UART for LABVIEW

Status
Not open for further replies.
Hi keat and Noel, since data sent serially to LabVIEW is interpreted as a string, you need to convert it in to numerical form to display it on a graph. You can use the string to numeric array function to do this and display it on the graph. The downside of using a waveform graph is that when you send in another array than the previously plotted data gets wiped out. Here is an example i am uploading. It plots the data from the serial port on the waveform graph.

Also, Visa Resource Name out is not the data out, you should connect the read buffer output which is the output terminal for the Read VISA.

If you find any problem, let me know.
 

Attachments

  • Plots serial data on a waveform graph.zip
    18 KB · Views: 222
Noel_t...As I was struggling to get a serial communication going!! I've modified some other code (found on internet )

This will receive 4 variables temp, light current and volts in ascii "XXXXX" 5 digits ...WITH pre zeros ie.. "00565" "000013" "00000" then terminated with CrLf

I'll send it via Email on monday... (I'm just going to tidy it up a bit) I also need to explain about retreiving back to digits (for datalogging)
 
Thank you so much wonderboy... i tried ur vi and it works to show waveform. but one problem... framming error occur during transfer.how to solve it???
 
Hi, framing errrors occur due to seriially transmitted data not being in a proper format(start, stop, parity bit, n.o of data bits etc). If the framing error is a constantly occuring thing, than go to the Measurement and Automation Explorer in Tools>Measurement and Automation Exlorer>My System>Devices and Interfaces>Serial and Parallel. Right click on the serial port name and click on Open VISA Test Panel. A Digalog Box will turn up. You can select the appropriate attribute and its set its current value to configure the settings. Hope it helps. If it doesn't than let me know.
 
Hi Wond3rboy,
I opened the VISA Test Panel and the attributes "serial baud rate=115200". Is that means that I need to reprogram my microcontroller to such baud rate? Or it indicates the baud rate of my microcontroller output already?
Another question is, what is the main factor that caused break condition and how to solve it so that i can receive my signal more smoothly?
I know I have made quite a lot of disturbance to you. Sorry but i really need suggestions and solutions from experts like u.
Thanks a lot really.
 
Hi Wond3rboy,
I opened the VISA Test Panel and the attributes "serial baud rate=115200". Is that means that I need to reprogram my microcontroller to such baud rate? Or it indicates the baud rate of my microcontroller output already?
Another question is, what is the main factor that caused break condition and how to solve it so that i can receive my signal more smoothly?
I know I have made quite a lot of disturbance to you. Sorry but i really need suggestions and solutions from experts like u.
Thanks a lot really.
 
Hi Wond3rboy,
I opened the VISA Test Panel and the attributes "serial baud rate=115200". Is that means that I need to reprogram my microcontroller to such baud rate? Or it indicates the baud rate of my microcontroller output already?
Another question is, what is the main factor that caused break condition and how to solve it so that i can receive my signal more smoothly?
I know I have made quite a lot of disturbance to you. Sorry but i really need suggestions and solutions from experts like u.
Thanks a lot really.
 
Hi, set the baudrate to your transmitted baudrate as well as the other parameters. Another you can do is perform read and writes to the serial port from the test panel to make sure that the there is no framing error. If the framing error problem is not consistent and is random, you can perform a retransmission or skip the data that had the error. You can also perform a flush of the data buffer when a framing error occurs. This way you wont need to close and reopen the port.
 
Last edited:
Hi Wond3rboy,
I managed to solve the framming error and get 1 waveform smoothly. Thanks a lot for your information.
Now I would like to create 3 waveforms by interfacing 3 signals through 1 pic and 1 rs232. Is it possible? How can Labview differentiate my signal since PIC18F4520 only have 1 TX line.
 
Hi Keat,

I think for this i can help you. Because currently i managed to classify the different signal coming from PIC to the LABVIEW.

You may share you C code related to your PIC so i will tell you how to do. It is simple.
Hi Wond3rboy,
I managed to solve the framming error and get 1 waveform smoothly. Thanks a lot for your information.
Now I would like to create 3 waveforms by interfacing 3 signals through 1 pic and 1 rs232. Is it possible? How can Labview differentiate my signal since PIC18F4520 only have 1 TX line.
 
Hi noel_t,

I wrote my code only using simple assembly code but not using C code. So it is only basic .asm file and here it is. Hope you can help me.
 

Attachments

  • adc+sci(08-06-1653)(good).asm
    942 bytes · Views: 157
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top