LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array

helle.   my problem is i have an array 2 D (x,y)i look for the first positive value in x.  . and after recovering  the part of my array (X,Y )from this positive value to. the rest of the array  with the corresponding Y .                       thank you 

0 Kudos
Message 1 of 7
(1,939 Views)

Hi srh,

 

please provide an example VI with example data…

 


@srh92 wrote:

helle.   my problem is i have an array 2 D (x,y)i look for the first positive value in x.  . and after recovering  the part of my array (X,Y )from this positive value to. the rest of the array  with the corresponding Y


A 2D array Z[X, Y] is using X and Y as indices - and those indices are ALWAYS positive numbers.

According to this fact the "first positive value in x" is the element [0, 0]…

 

Again: provide example data and also provide the expected result!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(1,936 Views)

This sounds like homework. If that's the case, you should know that no one on this forum is just going to give you the answer.

 

Attach the code you've got so far, along with an explanation of specifically where you are stuck and what you've tried.

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

Message 3 of 7
(1,921 Views)

Seems like you have a 2D array with either 2 rows or two columns, one for x and one for y. So do the x-values start negative? Seems trivial to find the first  non-negative value. What have you tried?

Message 4 of 7
(1,877 Views)

thank youy for your answer. it's not a home work  and i'm not a student.

  i'm learning by my self labview for my progress at  work.

i did the program but i felt that it's so long. I want to know if there is a labview function that i have not seen and that summarize this. 

i shood found the max of the  second derivate for positive value of X and found the correspond X for max Y.

0 Kudos
Message 5 of 7
(1,860 Views)

Hi srh,

 

why don't you clean up your VI block diagram?

After cleaning up the code is much more readable:

Unfortunately you forgot to supply some default data in your "appended array" so we can only guess which data you need to work with!

 

Using "Search1DArray" is most probably wrong for this use case: comparing floats for equality is most often senseless. Additionally you want to search for "any positive" value, nut just exactly zero…

 

Again: please provide example data (as asked yesterday)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(1,855 Views)

@srh92 wrote:

i shood found the max of the  second derivate for positive value of X and found the correspond X for max Y.


 

To find the first nonnegative value of a 1D array, use "threshold 1D array".

 

All this should fit on a postage stamp.

 

The x-values seem to be spaced equally, because you can calculate dx. No need for xy graphs. ALso the zero crossing can be calculated from x0,dx directly.

 

"Delete from array" is not the correct function to take a subset.

 

As requested already, please attach a VI containing data and describe the expected result. Run your Vi until the controls contain data, then do a "menu...edit...make current values default". Save under a new name and attach it.

 

Note that your VI has a glaring race condition due the use of a local variable. Most likely your "max index(es) 2" local variable gets read way before the indicator is update with the new value, resulting in the use of a stale value form a previous run. Use a wire!

Message 7 of 7
(1,818 Views)