LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How make for loop with min max value ina Array


@crisdragon wrote:

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


You don't need to convert anything. Just think from first principles.

 

You also need some minimal knowledge about LabVIEW, of course. That's why you got the link to tutorials earlier. You cannot translate into a language that you are not familiar with.

0 Kudos
Message 21 of 55
(2,104 Views)

One array, comprare t[i]>=t[i+1], t[i]>=t[i+1] etc. if true t[i+1]= t[i] and its all, why i cant do this?

 

It is possible to do this without shift registers?

0 Kudos
Message 22 of 55
(2,097 Views)

@crisdragon wrote:

... why i cant do this?


Because you haven't done any basic LabVIEW tutorials. 😄

 

If this is for school, maybe you missed a few days of lessons? Ask your classmates for the class notes and study materials.

0 Kudos
Message 23 of 55
(2,092 Views)

@crisdragon wrote:

It is possible to do this without shift registers?


Earlier, you said that you can't use array min&max. Now you don't want to use shift registers?

 

Is this now an additional hard requirement or just an irrational fear of the unknown? 😮

 

A shift register (or feedback node) is a central and one of the most important features of LabVIEW. For a scalable solution with input arrays of any size, you most likely need a shift register to keep the currently largest and smallest element found (Of course you could use local variables, but let's not uglyfy the code even more so don't do that!). Make sure to initialize the largest with -inf and the smallest with +inf.

0 Kudos
Message 24 of 55
(2,088 Views)

I think Shift Registers are strange and freaky. I think i am on good way but i dont know how write MAX value (is in the case) to array[i+1] because MAX value is indicator and Array is Control 😕

 

I know you are all laughing for me. This is easy but i am very very new and i try to understand everything.

0 Kudos
Message 25 of 55
(2,079 Views)

A scalar shift register represents a single persistent memory location where you can read the content at the beginning and write to at the end of each iteration. Nothing freaky about it at all.

 

Did you ask your classmates about the lecture notes you missed?

0 Kudos
Message 26 of 55
(2,055 Views)

I think i have all notes but i dont know how take advantage for them. OK I give up, i need to watch some tutorials. But this what i add below is closer end or start or looks like "shi*"?

 

PS. LabWindows is simpler

0 Kudos
Message 27 of 55
(2,045 Views)

You think Labwindows is simpler because it is text based like C is.

 

Quit thinking of shift registeras and associating it with the array and as T(i) and T(i+1).  You don't even have to worry about the indexing of the array because it will happen automatically for you with auto-indexing tunnels.

 

You need to worry about the memory location that stores the MIN value, and the memory  that stores the MAX value.  Those are scalars and the ones you store, each one has its own shift register.

0 Kudos
Message 28 of 55
(2,029 Views)

I try do only MAX and i cant. 😕 I have no more ideas

0 Kudos
Message 29 of 55
(2,020 Views)

I have no more ideas on how to explain it to you without actually doing your homework for you.

 

Sorry.

 

Take the tutorials.

0 Kudos
Message 30 of 55
(2,013 Views)