05-08-2010 06:54 PM - edited 05-08-2010 06:58 PM
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
05-10-2010 11:45 AM
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.
05-10-2010 12:20 PM
Hey Vijay,
This is an example of parsing through a string.
Let me know if you have any questions.
05-10-2010 03:20 PM
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.
05-10-2010 03:43 PM
Vijay,
You should listen to Coq Rouge, his method is the clean way of doing it .
05-11-2010 01:27 AM - edited 05-11-2010 01:28 AM
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.
05-11-2010 11:37 AM