LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use derivative block to derivative a signal?

Solved!
Go to solution

@RavensFan wrote:

No, the use of those functions is not correct.

 

Wiring in a 1 set the timer to wait 1 millisecond. 

The output of that function returns the time in milliseconds of the overall PC timer.  Basically the number of milliseconds since the PC booted up.  Put a probe on that wire and see how large that number is.  And be sure to read the help file on that function like was mentioned earlier.

 

I have yet to see a use for the output of the timer unless you are using it to compare different times to see how much has elapsed between two iterations of a for loop by taking the difference between those values.  And when I want to do that, I just use the Tick Count function.

 

I think you need to have a little talk with your "senior" and clue her in.

 


Usually I put only one Wait for each loop that acts as a delay between iterations. However, as I said I just refer blindly to my "senior's" coding  as shown in Figure below, she put wait function for every derivative or integrator block. This is why I don't understand. I could not manage to ask her as she already graduated and fly back to her country. Figure 1.PNG

and yes, you're correct to use Tick Count function to see how much has elapsed between two iterations of a for loop. 

0 Kudos
Message 11 of 20
(1,495 Views)

Hi mansamewoi,

 


I just follow people's work blindly. What should it be?

Following other people blindly will not make you a good programmer…

 


@mansamewoi wrote:

Is there any example for the correct one please? 

Please:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 12 of 20
(1,495 Views)

 

 


@GerdW wrote:

Hi mansamewoi,

 


I just follow people's work blindly. What should it be?

Following other people blindly will not make you a good programmer…

 


@mansamewoi wrote:

Is there any example for the correct one please? 

Please:

check.png


I am trying to do as yours, but I have got broken wires since there are two different data type. 

figure 2 (without conversion).PNG

 

Then, I keep the datatype as before : 

figure 2.PNG

I'm trying to run, unfortunately the reading is still zero at the output of derivative block  (Vib (mm) 4). Then, I I removed the LPF, the results are still the same as 

Charts.PNG

 

0 Kudos
Message 13 of 20
(1,484 Views)
Solution
Accepted by topic author mansamewoi

GerdW has used the point by point differential block 

Niatross_0-1582799274180.png

 

 

Message 14 of 20
(1,481 Views)
Solution
Accepted by topic author mansamewoi

Hi mansamewoi,

 


@mansamewoi wrote:
I am trying to do as yours, but I have got broken wires since there are two different data type.

No, you don't do as me: I used Pt-By-Pt functions from signal processing -> Point-by-Point palette…

(Do you see that red arrow in their icon?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 15 of 20
(1,479 Views)

@GerdW wrote:

Hi mansamewoi,

 


@mansamewoi wrote:
I am trying to do as yours, but I have got broken wires since there are two different data type.

No, you don't do as me: I used Pt-By-Pt functions from signal processing -> Point-by-Point palette…

(Do you see that red arrow in their icon?)


Sorry, my bad. I just knew there still have another blocks for integration/derivative. BTW, why do we need to divide by 1000? what does it mean? 

 

another thing, I also try to use another continuous derivative block as here as

figure 3.PNG

and I've got the same pattern of the chart with different values of y-axis as

figure 3 results.PNG

How to use continuous derivative block?

 

0 Kudos
Message 16 of 20
(1,470 Views)

The /1000 is converting milliseconds to seconds. This will result in your output having the units of  change in value/second. (V/s for example)

 

I've not seen that second block you have added before, but it looks like an express VI and I am guessing that it is giving you an output which is change in value/millisecond (e.g V/ms) seeing as the y axis is 1000 times smaller

Message 17 of 20
(1,467 Views)

@Niatross wrote:

The /1000 is converting milliseconds to seconds. This will result in your output having the units of  change in value/second. (V/s for example)


Is it a must to divide by 1000 or depends?

 


I've not seen that second block you have added before, but it looks like an express VI and I am guessing that it is giving you an output which is change in value/millisecond (e.g V/ms) seeing as the y axis is 1000 times smaller


Yes, you're correct. 

0 Kudos
Message 18 of 20
(1,461 Views)

It is up to you. It depends upon what you want your output units to be.

 

In the detailed help it gives the equation for the maths which is going on. When you wire the dT terminal you are just supplying a value to use as dT in that equation. if that is in seconds and you measurement is in volts your output units will be V/s, if you put milliseconds into the dT terminal your output units will be V/ms.

Niatross_0-1582808762553.png

 

Message 19 of 20
(1,454 Views)

@GerdW wrote:

Hi RavensFan,

 


@RavensFan wrote:

I have yet to see a use for the output of the timer unless you are using it to compare different times to see how much has elapsed between two iterations of a for loop by taking the difference between those values.  And when I want to do that, I just use the Tick Count function.


I use that quite often: have a loop wait for a certain amount of time AND calculate the elapsed time for the last loop iteration. Why use two functions (Wait + TickCount) when one (Wait) provides all needed inputs/outputs?


I've never felt the need to do both things in the same loop.

I only want to time the loops that I have no idea how long they take, and then only for troubleshooting purposes.

 

If I'm trying to control the loop iteration time with a wait function, it's because I'm sure the other code is going to run fast than that anyway, so the iteration time is usually the same as the wait time.

 

If I do want to do both, like for troubleshooting, then I wind up adding separate timing functions for that because I want something to be able to easily remove later.

0 Kudos
Message 20 of 20
(1,451 Views)