LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Arrays

I have a two 1D arrays,(size for example 5elements),I hve to split each element separately and find the maximum and minimum of that element.
 
I have the fig of my program.
 
Thanks
 
 
 
0 Kudos
Message 11 of 15
(803 Views)
Hi veeru,

"split each element separately and find the maximum and minimum of that element" ???

You want to have a scalar value and get the min/max from it??? Or the min/max of the whole array? There's an "Array Min/Max" function in the array palette!
There's also a Min/Max function in the comparison palette that would simplify your attached vi a lotSmiley Wink


Message Edited by GerdW on 06-12-2008 04:37 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 12 of 15
(797 Views)
What does this have to do with the original question?

Are you trying to keep track of the min/max while the code is running, or do you just want the min/max after the fact? If you want it after the fact, just autoindex the values and use the Array Min & Max function.



To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.


Message Edited by smercurio_fc on 06-12-2008 09:39 AM
Message 13 of 15
(795 Views)


Veeru wrote:
I have a two 1D arrays,(size for example 5elements),I hve to split each element separately and find the maximum and minimum of that element.
 
I have the fig of my program.

OK, it seems you want to keep the current max and min in a shift register. You have a serious logical flaw and are also doing things way too complicated.
 
First of all, the shift registers need to be initialized with "-inf" and "inf" respectively, not zero! For example if asll your numbers are >0, your min would be stuck at 0 instead of the real min value.
 
The comparison can be done with the max&Min primitive (from the comparison palette). This is much simpler than your comparison and select constructs.
 
Here's a quick draft. Modify as needed.
 
 
Of course this kind of code is more useful if you have a while loop that runs for extended periods This way you don't need to accumulate huge arrays as would be the case in some of the other suggestions here.
 

 


Message Edited by altenbach on 06-12-2008 08:40 AM
Message 14 of 15
(772 Views)
Thanks Everyone
0 Kudos
Message 15 of 15
(743 Views)