LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino Interfacing with Labview

Hi guys/girls,

 

I'm a new user of Labview. Never used it before. Just started to learn the basic things in it for a project I'm doing. Just need some help.....

 

I have a Arduino that is connected to a Accelerometer. I have the data from the sensor being sent over the serial in the form of a string with the end character "/n".

 

This is the form of the string:   xxx,xxx,xxx,xxx,xxx,xxx,xxx,x.xx,x.xx,x.xx,x.xx     

 

The "xxx" represent sensor raw values and "x.xx" represent voltage values.

 

I want to display these values in Labview application. Eventually these will be graphed in Labview as well. I can figure that bit my self.

 

I'm stuck of getting these values to display. I know you have to use the NI-VISA interface and I have had a look at he advance serial example and I can see the string that is being sent by the arduino in it. But cant figure out how to get it to work for my application.

 

I'm not sure if these values can be graphed in real time as they come in in Labview or do they need to be stored and then graphed?

 

The interface only needs comport selection and baud rate selection. And only thelast three values need to be graphed, they range from 0v to 5v. The rest just need to be displayed on screen.

 

Any Help will be much appriciated.

 

 

Thanks,

Vijay

 

Message Edited by silverzed on 05-08-2010 06:58 PM
0 Kudos
Message 1 of 7
(7,084 Views)

Hi Vijay,

 

The first thing that you are going to need to do is parse through the string to get the parts you need.

 

"I'm not sure if these values can be graphed in real time as they come in in Labview or do they need to be stored and then graphed?"

You can do both.  You could send the data to a chart as soon as you read it, or you could build it into an array of strings as you go and send it to a graph or file when you are done collecting the data.

 

If you have any specific questions on implementing this please let us know.

Justin Parker
National Instruments
Product Support Engineer
0 Kudos
Message 2 of 7
(7,040 Views)

 

 Hey Vijay,

 

This is an example of parsing through a string.

 

 

parsestring.png

 

 

 Let me know if you have any questions.

Justin Parker
National Instruments
Product Support Engineer
Message 3 of 7
(7,031 Views)

Justin_P wrote: 

 Hey Vijay,

This is an example of parsing through a string.

 Let me know if you have any questions.


Justin in such cases I often use spreadsheet string to array function for parsing the string. Just a tip;) It is not prboblem set up this function to create an array of say strings.



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 4 of 7
(7,019 Views)

Vijay,

 

You should listen to Coq Rouge, his method is the clean way of doing it Smiley Happy.

 

parsestring[1].png

Justin Parker
National Instruments
Product Support Engineer
Message 5 of 7
(7,013 Views)

Hi Justin,

 

Thanks for the solutions....

 

I got it working using the method below. It's a bit slow, so I might try it using the methods shown above and see the result.

 

 

 

 

Message Edited by silverzed on 05-11-2010 01:28 AM
Download All
0 Kudos
Message 6 of 7
(6,985 Views)
Three different people, doing the same thing, three different ways... I guess that's programming.
Justin Parker
National Instruments
Product Support Engineer
0 Kudos
Message 7 of 7
(6,950 Views)