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.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read and display a signal from my PIC Microcontroller onto Labview

Hi,

I am doing a project on a Pulse Oximeter and i am trying to read and display the signal from my PIC Microcontroller on Labview? How do i go about doing it? I am using the PIC16F877 and also making use of the USART?
How do i implement and initialise the USART in PIC16? What are the steps to be taken, please guide me through the process? The link provides information regarding the USART connection, initialisting and stuff? Is it correct to use these codes in my program?Link: http://ww1.microchip.com/downloads/en/AppNotes/00774a.pdf
Also, i am using the RS232 serial interface to connect to the PC? The connector i am using is the DB9 Connector. Which template and VI can i use? Am i supposed to use the NI-DAQmx and VISA? Also, for my USART connection, i am using the MAX232 Driver which is applicable for my application as i am working with +5V. So far, i have been reading and trying out on Labview and the steps i have taken are:

1) Open a New VI and used the Instrument I/O(Read & Display) template?
2) How do i configure the Instrument I/O Assistant Express VI to read the info from my device connected to COM1?
3) I was reading the Labview Manual, 'Getting Started with Labview' and i was following the steps under Page 55, Communicating with an Instrument. Am i on the right track?
4) How do i check and make sure that the port settings of the I/O Assistant and my PIC Micro Match

Please help me out and guide me through the process. I am student at a polytechnic and i am very new to Labview and the software is used as a development tool for the project. I have a deadline to meet and i hope i can get a response as fast as possible. Your help will be kindly and greatly appreciated. I hope to hear from you guys soon.You can e-mail me all your answers at ashwinm@pacific.net.sg
Thank You

Best regards,

Ashwin
Ashwin Kumar Mansukhani
0 Kudos
Message 1 of 4
(6,120 Views)
Hi Ashwin,

I am not familiar with the PIC Microcontrollers, but I am assuming you mean that you have the microcontroller sending out serial data that you want to read on another computer with LabVIEW. Please let me know if this is incorrect.

What type of data is coming out of the serial port? Is it ASCII, or binary? The reason I ask this is that the serial communication in LabVIEW is done through a protocol called VISA, which uses ASCII data to send and receive. You can later convert this data into whatever form you need, but this is what it is designed to read and write.

You can check the settings such as baud rate and data bits in a configuration utility called Measurement and Automation Explorer, or MAX. When you open up the MAX interface, you can expand the Devices and Interfaces entry on the left, and then expand the Ports entry to see your serial port. When you highlight this port, select the Port Settings tab at the bottom of the window, and you can see what the current settings are, and change them if you need to. You can also set these parameters in LabVIEW using the VISA Configure Serial Port VI.

You can also test communication in MAX by right clicking on the correct port and choosing Open VISA Session. Then choose the Basic I/O light blue tab, and then go to the Read tab. When you click execute, it should read in what is coming from the serial port. This will allow you to verify that the correct information is coming in before even trying to acquire the data in the LabVIEW environment.

In LabVIEW, the best resource to use the Basic Serial Write and Read example program that ships with LabVIEW. By examining the block diagram of this program, you will be able to see the basic programming flow of serial communication in LabVIEW.

I hope this information was helpful! Please let us know if there's anything else we can help with.

john
Applications Engineer
Message 2 of 4
(6,101 Views)
Hi,

I have the same kind of requirement.

Microcontrollers typically send serial data in 8 bits binary format. (ASCII can be 7 bits or 8 bits).

If I send data from 0x00 (hex) to 0xFF, is it possible to get it in this format in Labview? I got it fine from Matlab using the fread function which reads binary data, even 16bits values.

If Labview can only read ASCII, is there a way to convert it in binary or numerical data after?

Thanks,
David
0 Kudos
Message 3 of 4
(5,966 Views)
Sorry, founds answers in these threads:

http://forums.ni.com/ni/board/message?board.id=170&message.id=112024&view=by_threading&page=2

http://forums.ni.com/ni/board/message?board.id=170&message.id=112525&view=by_threading&page=1
0 Kudos
Message 4 of 4
(5,961 Views)