LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

areaundercurve

Solved!
Go to solution

Well i did not change much in the code, its just the Integral built-in Vi instead of what you had for multiplying with the dt value.

 

I just simplified it a bit to understand your program and just added the program for above Area only.

 

 I dont know of other ways to exclude the errors shown in order to run the VI therefore i have a weird code construct.

 

What i mean by reset is that how to reset the integral function after the values for Above and Below areas have been taken ONCE.

When i retake the values for the second time by changing the slider position, the new values SHOULD NOT add with the previous values.
They should start  from zero.

Please let me know if you still dont understand the question.

 

Thanks a lot

 

 

0 Kudos
Message 31 of 37
(796 Views)

@weeke wrote:

Well i did not change much in the code, its just the Integral built-in Vi instead of what you had for multiplying with the dt value.


That's not the same!

 


weeke wrote:

What i mean by reset is that how to reset the integral function after the values for Above and Below areas have been taken ONCE.

When i retake the values for the second time by changing the slider position, the new values SHOULD NOT add with the previous values.  They should start  from zero. 


See if this works...

0 Kudos
Message 32 of 37
(788 Views)

 

Altenbach

 

Thanks a lot

 

This is what i actually meant by reset the values.

This is exactly what i needed.


I was unable to understand 1 thing in your program. When you use a Bundle Array function for 1,-1 in case structure, why do you wire the values up side down.

 

Shouldnt the way of wiring the signals effect the output of the build array.

 

 

Thanks a lot for your help

 

Cheers

0 Kudos
Message 33 of 37
(786 Views)

@weeke wrote:

 I was unable to understand 1 thing in your program. When you use a Bundle Array function for 1,-1 in case structure, why do you wire the values up side down.



I think you are talking about the "built array" nodes. Depending in the data state, we only add to either the positive or negative number, leaving the other value in the array untouched. Thus we built an array of two elements, one with the current data and one with zero (adding zero does not change the array sum, right). Depending on the state, one or the other needs to be zero. All clear?

 

 

 

 

0 Kudos
Message 34 of 37
(779 Views)

Whats the purpose of wiring build array function like this.

 

If i wire both in the similar manner it wouldnot work

 

Why do interchange the integral function and zero for the second build array

Download All
0 Kudos
Message 35 of 37
(768 Views)

weeke wrote:

If i wire both in the similar manner it wouldnot work



Well, in programming, "similar" is not the same. 😄

There are millions of ways to do it similar, but only a handful of ways to do it right. Unless you tell us what you actually did, we cannot tell why it did not work.

 

The shift register contains an array of exactly two values. One accumulating the area above, and one accumulating the area below.

 

If the data is above, we add an array containing [new value; 0] and if we are below, we add [0; new value]. In the first case, element 0 gets incremented and in the second case, element 1 gets incremented. The "other" element remains invariant, because adding zero does nothing.

 

Make sure you fully understand all aspects of the code!

 

(There are of course many other ways to do all this (e.g. using the in "place element structure", or "index array" followed by "add" and "replace array subset"). You are encouraged to play around a try to do the same in a few different ways. A great learning experience! :D)

 

 

0 Kudos
Message 36 of 37
(752 Views)

hello,

Can you sax\ve this VI for LV2009 please, cannot open it.

thanks

0 Kudos
Message 37 of 37
(686 Views)