LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph data coming from an ADXL345 Accelerometer in LabView

Hi,

 

I have an ADXL345 Accelerometer. I want to graph data in LabView. How do I do that?

 

I already  installed the Arduino Interface in my LabView. I've fixed my NI-VISA. My only problem is I do not know the proper wiring of the blocks as this is not just a simple AnalogRead.

0 Kudos
Message 1 of 7
(4,161 Views)
It sounds like you could use going through the tutorials.

Can you read in the data?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 7
(4,131 Views)

Hi, what tutorial should I be looking at?

 

What do you mean by "read in the data?"

 

snippet.png

 

that's the snippet I followed but that's not complete. Honestly, I do not know if that's going to work. Don't mind the Waveform Graph.

0 Kudos
Message 3 of 7
(4,119 Views)

BTW, I am using this code:

 

https://gist.github.com/e-Gizmo/7818304

0 Kudos
Message 4 of 7
(4,100 Views)

Hi Jose,

 

it seems you send the measurement data from Arduino to serial port.

 

Just connect the Arduino to your PC and read the data from (PCs) serial port using VISA functions. Use the "Basic serial read and write" example VI as a starting point in LabVIEW!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 7
(4,089 Views)

I think he is referring to some basic LabVIEW tutorials. There are many free training resources which are linked to under 'looking for free training' on this page.

 

The screenshot you posted was way too small to see what you are doing. Post a larger screenshot or upload your VI so we can open it.

 

You will probably need to modify your Arduino code to output the accelerometer data over serial and then use NI-VISA to read the data in LabVIEW, decode the string containing your accelerometer values and then write them to a waveform chart.

 

If you really want to use the Arduino interface - 

http://digital.ni.com/public.nsf/allkb/872C9DBFAB5F805C86257885005D2AC3

https://www.labviewmakerhub.com/doku.php?id=learn:tutorials:libraries:linx:misc:adding_custom_comman...


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 6 of 7
(4,082 Views)

Hi, I forgot to mention that I changed something on the code that I posted.

 

Instead of:

 

const byte  spiclk=17;    // connect to ADXL CLK
const byte  spimiso=16;  // connect to ADXL DO
const byte spimosi=15;  // connect to ADXL DI
const byte spics=14;    // connect to ADXL CS

I change the pin assignment to anaog.

 

const byte  spiclk=A0;    // connect to ADXL CLK
const byte  spimiso=A1;  // connect to ADXL DO
const byte spimosi=A2;  // connect to ADXL DI
const byte spics=A3;    // connect to ADXL CS

I don't know if this means something aside from the pin assignment. I just thought that you need to know.

 

Thanks for all your replies. I will try what you suggest GerdW. Sam_Sharp, I will read them. Thanks! 🙂

0 Kudos
Message 7 of 7
(4,069 Views)