LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Link FFT with ADXL345 error "you have connected two terminals of different types"

Hi,

when i tried to link the output of (READ) ADXL345 to FFT VI i got an error "you have connected two terminals of different types" 

an advice please ?

 

0 Kudos
Message 1 of 15
(2,678 Views)

You don't give sufficient information.

 

Most are probably not familiar with your driver. What is the datatype of the output?

What is the exact full message if you hover over the broken wire with the mouse?

0 Kudos
Message 2 of 15
(2,622 Views)

As you probably know, LabVIEW is a "Data-Flow" language, and this is graphically expressed by "wires" that you use to connect an output from a Control or a Function/structure to an input to an Indicator or Function.  When you first attach a wire to an output terminal, the wire "adapts" to match the type of data present on the output -- the color of the Wire indicates if the contents are numeric (orange = floats, blue = integer), boolean (green), the thickness whether the wire is a scalar (thin), 1-D Array (thicker), higher-dimension (double lines), or more complex structures (typically a "patterned" wire).  Sometimes you can attach a wire to one kind of output (say, an integer) to an input that wants a slightly different type (say, a Float), and LabVIEW will "coerce" the data and allow the connection.  But if you try to attach, say, an Array to an input that wants a simple Boolean, LabVIEW can't "read your mind and know what you meant to do", and says "You have connected two terminals of different types".

 

Do you know how to use the LabVIEW Help?  If you type ^H, you can turn Help "on", and hover your mouse over the error, and often will get an explanation.  Another thing that would allow us to explain your error would be for you to attach your code.

 

Note that you probably have numeric data coming from the ADXL345 (but how you are getting the data from this chip into LabVIEW is not explained).  LabVIEW has a variety of functions that can do FFTs -- some take numeric arrays, some take a Waveform, a LabVIEW data type that is designed for sampled data.  If you wire the data type for one function into a function that requires an alternate data type, you'll get your Error.

 

I recommend you play around with the LabVIEW Help, and figure this out for yourself.

 

Bob Schor

0 Kudos
Message 3 of 15
(2,608 Views)

Thank you for the feedback and explanations find attached files my code and the two elements that’s I want to connect ,as you said I’m trying to connect an array to vector in this cast I should to make same conversion to do it have you any idea to make it right ?ADXL345-FFT.pngError.png

0 Kudos
Message 4 of 15
(2,586 Views)

another thing I'm using Arduino also .. 

0 Kudos
Message 5 of 15
(2,584 Views)

Well, you have a cluster of three points (x, y, z) and trying to do a FFT makes absolutely no sense, since you don't have any values as a function of time. Maybe you can take a step back and explain what you are trying to do and why you think an FFT would help? An FFT of a single point (x, y, or z) is very uninteresting!

 

You could collect, x,y,z data over time and do an FFT of each (given dt) or you could unbundle and do a ptpypt FFT for each dimension. Since you seem to use a chart, that's probably what you want. (Similar to the history buffer of the chart you a re using, a ptbypt FFT will take one point at a time and accumulate sufficient data in an internal buffer and do an FFT of the last N points seen.

 

Just blindly throwing functions at random data is just plain silly! Do you know what FFT actually does? What result are you trying to get out of all this (Frequency? Phase? Magnitude?) and how will you interpret it as a useful result relating to your measurements?

0 Kudos
Message 6 of 15
(2,573 Views)

Hi, I want to analyse the result of my ADXL345 as Frequency and Magnitude with FFT to do a speculative treatment something like :

 

https://www.youtube.com/watch?v=AYvhTv3bsPI

 

0 Kudos
Message 7 of 15
(2,538 Views)

@Louay02 wrote:

Hi, I want to analyse the result of my ADXL345 as Frequency and Magnitude with FFT to do a speculative treatment something like :

 

https://www.youtube.com/watch?v=AYvhTv3bsPI


First, that isn't how you should program LabVIEW (sequences and locals).

 

Second, notice at 1m22, how the cluster of x, y, z, is 'reduced' to either x, y or z.

Message 8 of 15
(2,528 Views)

Your "picture" that shows the Error Message also explains it.  The sink is a 1D Array of Dbl.  The Source, therefore, must also be a 1D Array of Dbl.  Is it?  No, it is a Cluster.

 

Do you have enough knowledge of LabVIEW to have encountered Clusters?  Your particular Cluster is made up of three parts, X Axis, Y Axis, and Z Axis, each of which is a 1D Array of Dbl.  Can you see how you might use this knowledge to fix your "Wiring" problem?  If not, go learn about Clusters.

 

Bob Schor

0 Kudos
Message 9 of 15
(2,513 Views)

wiebe@CARYA wrote:

@Louay02 wrote:

Hi, I want to analyse the result of my ADXL345 as Frequency and Magnitude with FFT to do a speculative treatment something like :

 

https://www.youtube.com/watch?v=AYvhTv3bsPI


First, that isn't how you should program LabVIEW (sequences and locals).

 

Second, notice at 1m22, how the cluster of x, y, z, is 'reduced' to either x, y or z.


BTW. I'm no vibration expert, but analyzing the X, Y or Z (or even X, Y and Z) as individual component has always seem arbitrary to me. I've seen it before, though.

 

I don't have an alternative either. I'd assume you would want to find the direction with the largest vector, and that probably isn't X, Y or Z.

0 Kudos
Message 10 of 15
(2,500 Views)