06-08-2011 03:18 PM
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
06-08-2011 03:42 PM
@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...
06-08-2011 03:52 PM
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
06-08-2011 04:04 PM
@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?
06-09-2011 12:38 AM
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
06-09-2011 10:13 AM
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)
07-24-2013 03:36 AM
hello,
Can you sax\ve this VI for LV2009 please, cannot open it.
thanks