LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find velocity using a displacement sensor

Actually, what is happening is pretty straight-forward. I assume that the squarewave generator is simulating your displacement input. Now that data is being differentiated once to give you velocity and a second time to give you acceleration - just like the books say.

 

Now your formula node... It looks like you actually want to be performing that calculation for each value in the output array. There are two ways of accomplishing that:

 

1: You can simply put the formula node inside a loop, set the dynamic data conversion back to returning an array of values and let the data autoindex going in and out of the loop to return arrays of B and Y values.

 

2: There is an array syntax for formula node where you can code the loop inside the formula node. If that sounds interesting check out the documentation. Personally I never use it because option 1 is easier for me.

 

Now in terms of getting your data into the loop, look at the code that gets generated by the original DAQ express VI. Put the code that initializes the DAQ task outside the loop to the left, the VI that acquires the data inside the loop as the source of the data and the code for clearing the DAQ task outside the loop to the right. Now wire-up your refnums and error clusters and you should be just about ready to go.

 

Mike...

 

PS: Neatness counts. Messy wires can make things appear more confusing than they really are.


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
0 Kudos
Message 11 of 11
(482 Views)