Showing results for 
Search instead for 
Did you mean: 

Using LabVIEW with Accelerometers and Order Analysis

I need some help in writing code in LabVIEW for 2 accelerometers using order analysis. I have been given a sound and vibration toolkit provided by my professor and it only seems to have tachometers. How would I use this to sense accelerometers or if there is another way please help.  We need the code to display a Amplitude vs. Frequency and a Acceleration vs. Time.  One per accelerometer.


This is what I have so far attached.

0 Kudos
Message 1 of 7

I don't understand to your question. There's a lot of subVIs in palette: Sound and Vibration which should be helpfull for you.

I'll need more informations to help you.

0 Kudos
Message 2 of 7

Not helpful sending a "broken" Project (before attaching a Project, open it and be sure all the referenced VIs are present, and haven't been renamed by adding FraserNewman_ before the Main or SubVI name).


You don't say anything about the accelerometers.  Do you know how to read accelerometers into LabVIEW?  Once you have sampled data, you should be able to use routines in either "vanilla LabVIEW" or in the Sound/Vibration Toolkit (which I haven't installed) to do the analysis your Professor wants.


Why don't you try to just write a VI that takes, say, a second of accelerometer data (how many axes does the accelerometer have?  Are you supposed to get 1 number or a 3D vector?) and plot it.  If you can plot it, you can analyze it (it seems to me) ...


Bob Schor

0 Kudos
Message 3 of 7

Hi simyfren,

Thank you for your feedback.  What other information do you need to know?

Thank You

0 Kudos
Message 4 of 7

Hello Bob_Schor,

Thank you for your feedback.  We have used accelerometers to display data.  Using order analysis technique is the tricky part.  I must have forgotten some pieces in the zip folder. 


From what I have gathered we need to display a 1D array per graph on each PCB accelerometer sensor.  

0 Kudos
Message 5 of 7

Here is my completed VI with all running SubVIs.  Sorry for the confusion.


0 Kudos
Message 6 of 7

Thanks for attaching your VIs.  I'm starting to look at MachineTest_1.  Am I correct that you want to sample 2 channels of Analog signals (presumably corresponding to acceleration values from two accelerometers), reading 1000 samples at 1 KHz (which takes 1 second of time) and then doing some sort of processing of these data before taking another sample?  I'm going to assume this is true and say the following:

  • The Channel Shift Register input on the While Loop is unwired!  Your Channel Wire goes to an "ordinary tunnel" that is hidden by the Shift Register.  It may not matter to the code, but it is a "wiring error".
  • Your loop takes a minimum of 1 second (to collect the 1000 samples), so there is no sense putting a 0.01 second delay into the loop -- it will be effectively ignored.
  • Your Chart X Scale properties show a maximum of 1 second (good) but every point represents 1 second (bad), so you'll only see a straight line connecting the last two points.  Try creating a For Loop with a Count of 1000 containing a Random Number function to generate an array of 1000 random numbers between 0 and 1 (a very noisy sample).  Wire this to a Waveform Chart.  Do you see a straight line?  Play with the X Scale properties, paying attention to X Maximum and X Multiplier until you understand how to "get what you want to see".
  • Use the NI-recommended Default Connector Scheme for your sub-VIs -- 4-2-2-4 pattern, Error In/Error Out in lower corners, things like Ref In and Ref Out in upper corners, and parameters (like "Input Cluster") in remaining left input connectors.
  • Why is BPFO EQ a sub-VI?  Are you dynamically changing its inputs?  If the inputs don't change, the output won't change, either.  Instead of 5 (mysterious-to-me) inputs, why not build them into a cluster and have a single Wire input?  Be sure the sub-VI has Error In and Error Out in the lower corners.
  • Try to keep your wires straight, and your diagram more compact.
  • If we ignore the presence of a Header, you could replace "Write Data" with a simple Write Delimited Spreadsheet function (much simpler).
  • Do you have an example of how the output file should look?  The Header will be different from the data columns, and If I make the operator "Bob", and call the Channels A and B, it gives the following string:
    Sat, Dec 9, 2017 1:58 PM
    Operator Name(s):Bob
    A B
  • There is no hint in this routine what you plan for "Order Analysis", nor what data you plan to use.  I thought that was the "Main Idea" here.

Bob Schor



0 Kudos