LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

How to get the continuous values range from a 2D array?

For a given 2D array with different values, i'm trying to get the range for which the values are continuous. However I'm just get the end values for the logic I have developed.For Example: if the input array is

Then the output string array must be

Message 1 of 12
(1,208 Views)

Re: How to get the continuous values range from a 2D array?

So your stuck.  You want your VI to behave a certain way, and it is not doing that.

Do you want us to just guess at what is going wrong?

If you want real help, then you should attach your VI so we can see what is wrong with it.

Message 2 of 12
(1,180 Views)

Re: How to get the continuous values range from a 2D array?

Hi guy,

and while you attach your VI you also should explain the "logic" behind your desired algorithm!

get the range for which the values are continuous.

- do you search for "continuously declining" numbers? Can there be "continuously rising" ranges? What about "continuously the same" ranges?

- do such "ranges" also span more than one row?

- are these integers, floats, or strings?

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
Message 3 of 12
(1,160 Views)

Re: How to get the continuous values range from a 2D array?

Hi Gerd , These values are continuously declining integers with a constant difference.I have attached the VI below which sorts the continuous values of each row into min-max ranges as described above. Since I am beginner, the code is clumsy and logic used might be tedious( Sorry for that 😞 ).Please let me know the mistakes and help me improve my knowledge. Thanks a lot!!!!
Message 4 of 12
(1,143 Views)

Re: How to get the continuous values range from a 2D array?

Hi guy,

can you please attach a downconverted version of your VI? LV2017 would be nice!

(Edit menu -> save for previous…)

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
Message 5 of 12
(1,140 Views)

Re: How to get the continuous values range from a 2D array?

Please resave your VI, but first put some values in the controls and save them as default.  Empty controls doesn't provide us any meaningful data to test you VI.

I do see a Rube Goldberg in there where you auto-index on an array, but proceed to use Index Array with the i terminal on a branch of that array to access the elements.  When you auto-index, it gives you each element one by one.  No need for the wire branch Index Array and i node.

Message 6 of 12
(1,122 Views)

Re: How to get the continuous values range from a 2D array?

@curiousguy99 wrote:

For a given 2D array with different values, i'm trying to get the range for which the values are continuous. However I'm just get the end values for the logic I have developed.

Nothing in computing is "continuous". Your array values are quantized to the limitations of I32 and their position is quantized to integer index positions. It is not obvious how your 2D array of strings related to the input array at all. Please write a full paragraph explaining what algorithm you actually want.

(And yes, fill the control with typical default data before saving and attaching. We don't want to enter values into an empty array first.)

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 7 of 12
(1,117 Views)
Solution
Accepted by topic author curiousguy99

Re: How to get the continuous values range from a 2D array?

So it seem you want to isolate ranges where the value decrements by one. Here's a very quick draft to get you started.

(For large inputs, I would only keep the max and min in the shift register, so modify if this is needed)

EDIT: slightly improved code can be found a few posts below.

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 8 of 12
(1,106 Views)

Re: How to get the continuous values range from a 2D array?

Thanks a lot for your response!!

I noticed how over complicated my code was 😞 . This was a part of code where the each bit ( from 0-31 ) were assigned a bit definition name. I had to get get the position of the bits for the selected bit definition and populate the number of bits accordingly.The 2D array was the bit definition- occurrences array for which I had to calculate the position of the bits. Moreover something like this

Message 9 of 12
(1,099 Views)

Re: How to get the continuous values range from a 2D array?

I need to get back and start working on the basics to build more efficient and simple code like you did here. Thanks a lot for putting your time and effort on this post 🙂

Message 10 of 12
(1,097 Views)