12-09-2015 03:14 PM
12-09-2015 03:18 PM - edited 12-09-2015 03:21 PM
@crisdragon wrote:
Xd now you tell me is min max function, thanxxxx
Well, I assume that one is allowed, just not "Array Min&Max". Who knows? 😄
Make sure to show us the final code so we can comment.
12-09-2015 03:51 PM
@altenbach wrote:
@crisdragon wrote:
Xd now you tell me is min max function, thanxxxxWell, I assume that one is allowed, just not "Array Min&Max". Who knows? 😄
Make sure to show us the final code so we can comment.
I had assumed that one was NOT allowed. That the problem was taking Array Min & Max and duplicating with the most basic of LabVIEW functions. Min/Max is great in that it actually eliminates a comparison and a select function. Or comparison and a case structure.
12-09-2015 03:59 PM
Almost done, i think is last problem, why i cant ad wire from max in place after index array - the wire connects more than one data source 😕
12-09-2015 04:41 PM
Your code is not comparing the CURRENT Max or the CURRENT Min. Your C based code isn't even accurate. Think of shift registers as Integers initialized in separate functions. In C based code, in order to keep track of who the Max and Min are, you would set up Ints Max and Min, yes? Then, when a value has been determined to be less than or greater than either, the corresponding values are updated. Think of a shift register like that. That's why everyone has been saying 2 shift registers. Your indicators are not the same as integers. They are value displays. They do nothing else but display whatever the current value is, and your code is updating them incorrectly. Someone mentioned using Local Variables... but no. Data flow goes from left to right. Once you've gone as far right as you can go, what has to happen? You have to start from the left again. Which is why loops are circles. Then you start over left to right. Where does the Max value come from? Who is the max value being compared to? Same with the Min? Ask these questions when programming.
12-09-2015 04:42 PM
Ok its done, but i think this looks not good. Anyone can rate this?
12-09-2015 04:44 PM - edited 12-09-2015 04:46 PM
What's the task again? To simply find the single max and min elements of an array or to put them in order?
12-09-2015 04:48 PM - edited 12-09-2015 04:55 PM
@crisdragon wrote:
Ok its done, but i think this looks not good. Anyone can rate this?
You are ignoring the first element. Min and Max should be scalars, not arrays. indicators belong after the loop. No need to update them every nanosecond with uninteresting intermediary values.
Here is some simple code to get the max, see if you can expand it for the full problem 😉
12-09-2015 04:48 PM - edited 12-09-2015 04:57 PM
Your code is awesome but i dont understand -infinity.
12-09-2015 04:53 PM - edited 12-09-2015 04:53 PM
@crisdragon wrote:
Simply find max and min without using MIN & MAX Array. But this work good, what i should change?
Define "works"! Define "this"! (it has been a long thread!)
If you want us to verify the code, attach the actual VI!