Reading Serial Port Data using VISA in Labview

September 10, 2009

I had been feeling so sleepy today that I wanted to try VISA (Virtual Instrumentation Software Architecture) to read the data from my PIC16F877A microcontroller using the LabVIEW software. Well I did it in a whopping 5 minutes!

Well, the data that is being read is shown in the snapshot below:

LAbview serial port communication

The number of bytes to be read is controlled by the user. However, the data that is being read is displayed in a marquee sequence.

For e.g: When you choose to read a 4 byte data, the fourth byte of data is replaced by a byte with a  shift towards the right when the latest byte of  data arrives at the first bit (left side).

So your data hello would be read as : h –> he –> hel —> and so on. I captured a snapshot when the indicator read ‘hello’ 😉

However, my reading process was interrupted by an error log created everytime. I added an error out constant which made things smooth!

Woohoo!

I shall try adding some features to this VI in future.