LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How make for loop with min max value ina Array

You are a student, so learn:

http://www.ni.com/getting-started/labview-basics/shift-registers

We are not going to do your homework.

 

edit: First try to write down on a paper how you would do this task, if you have for example 4 numbers. You have to do < and > comparisons, I do not see anything like these in your block diagram.

 

First understand what you want to do, write a pseudo code:

 

http://www.stoimen.com/blog/2012/05/21/computer-algorithms-minimum-and-maximum/

http://www.dreamincode.net/forums/topic/206002-finding-min-and-max-numbers-in-an-array/

0 Kudos
Message 11 of 55
(2,229 Views)

I just need to know where in shift register is array[0] and array[1].

0 Kudos
Message 12 of 55
(2,218 Views)

that is the point 🙂 Nowhere 🙂 Did you try to understand what a shif register "does"? If you feed a value into the shift register (at the right side of the loop), the same value will "come out" and the NEXT iteration of your loop.

0 Kudos
Message 13 of 55
(2,210 Views)

so how it works? i try to do something 5-6h and i have nothing. This is not to understand.

0 Kudos
Message 14 of 55
(2,205 Views)

Create this example VI, and turn on the "highlight execution" (little light bulb at the top of the block diagram). Study what kind of values you see "on" the wires, and appearing at the indicators during execution. The highlight execution slows down the code, so you can see how it works.

 

Example_VI_BD.png

 

Edit: here are some links where you can learn LabVIEW:

 

NI Learning Center

NI Getting Started

Learn NI Training Resource Videos

3 Hour LabVIEW Introduction

6 Hour LabVIEW Introduction
Self Paced training for students

 

Do some effort please...

 

0 Kudos
Message 15 of 55
(2,199 Views)

Ok. now i understand in numeric i have last value, in numeric2 i have i-1(last value is i) in numeric3 is i-2 and in numeric4   i-3. But i dont understand why doesnt matter i enter "0", "30" or "100" in shift registers on left site in loop.

0 Kudos
Message 16 of 55
(2,187 Views)

This is way too basic what you ask about, so even if I tell you something, you will not understand. You cannot learn LabVIEW in a few minutes. Do effort, and take first the tutorials...

 

 

0 Kudos
Message 17 of 55
(2,179 Views)

I have this now, i know is bad, but maybe is closer? Maybe shift register is good?

0 Kudos
Message 18 of 55
(2,165 Views)

@crisdragon wrote:

I have this now, i know is bad, but maybe is closer? Maybe shift register is good?


Don't just randomly connect things without thinking first. Get code that is not broken and tweak it until you get the correct result.

How is the output array supposed to look like? Two elements, one the min and one the max in that order?

0 Kudos
Message 19 of 55
(2,154 Views)

It can be two numeric indicators in output. All time i try everything but is not easy convert from C to VI. 

0 Kudos
Message 20 of 55
(2,142 Views)