LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array processing

How can I process some elements of an array in the first frame of sequential structure then process the rest of the elements in the next frame?

0 Kudos
Message 1 of 20
(3,977 Views)

Use Index Array to get elements out of an array.

Is there a reason you are using a sequence structure?  They are rarely needed in LabVIEW.  And the presence of a sequence structure really shouldn't affect how you work with an array.  If it does, then please post some code demonstrating what you are trying to do.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

0 Kudos
Message 2 of 20
(3,972 Views)

Thank you for your fast reply. For example, I have an array which contains sinusoid data. I start to read the array from the first element. When any member is more than a certain value (Threshold), I store the index then pass all values which are more than the threshold. The sinusoid data would be again below than the threshold. If it crosses (going from below of the threshold to above of that) again I should store the index. I do not know how can I track the indices of an array to know how much of that is processed.

0 Kudos
Message 3 of 20
(3,959 Views)

It sounds like you should be doing all of this inside a loop.

 

You should learn about shift registers which work with loops to be able to store data from one iteration to the next such as building an array of indices that meet your conditions.

0 Kudos
Message 4 of 20
(3,954 Views)

Try working on examples based on arrays and shift registers and avoid using Sequence Structure unnecessarily.

 

Sharing the developed code will help others to help you in your problem.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 20
(3,919 Views)
@Mmehrabin wrote:

How can I process some elements of an array in the first frame of sequential structure then process the rest of the elements in the next frame?

Use the "in place element structure" with index array terminals.

Use a FOR loop with the array in a shift register if "some" is more than a few. Are the replaced array elements adjacent to each other? Where is the information that decides what to replace coming from. 

 


@Mmehrabin wrote:

Thank you for your fast reply. For example, I have an array which contains sinusoid data. I start to read the array from the first element. When any member is more than a certain value (Threshold), I store the index then pass all values which are more than the threshold. The sinusoid data would be again below than the threshold. If it crosses (going from below of the threshold to above of that) again I should store the index. I do not know how can I track the indices of an array to know how much of that is processed.


This now seems a completely different problem. How does it relate to your original question?

Originally, you wanted to replace elements, now you want to store indices. Where and how do you want to "store" the indices?

 

I think we need significantly more information before we can suggest a solution. Can you show us a typical array and explain what result do expect. Maybe show us your (incomplete) code.

 

0 Kudos
Message 6 of 20
(3,900 Views)

My code has not prepared yet because I have no idea. I just want to know how can I track the elements are processed to process the rest of them later. For example, the array has 100 elements. I processed 10 of them then by sequential structure I do something else then I want to have a calculation on the rest elements of the array. 

0 Kudos
Message 7 of 20
(3,873 Views)

Why would you need a sequence structure? if the array wire goes through the operations in order, they will automatically occur in sequence.

0 Kudos
Message 8 of 20
(3,870 Views)
So are you actually doing "something else" with the array in-between the two operations or do you just want to process elements according to the index? To do that, you would just autoindex in and out of a FOR loop containing a case structure wired to [I].
0 Kudos
Message 9 of 20
(3,861 Views)

If you are talking 100 elements,  it sounds like you are trying to force your code into something that will have about 100 sequence frames.

 

You really don't want to do that.

 

Until you have an idea on what you want to do and prepare some code, then we can't help you much other than provide some general guidance.

 

I guarantee you don't need a sequence structure.  I guarantee you are going to need to use a loop to process those 100 elements depending on exactly what you mean by "process".

0 Kudos
Message 10 of 20
(3,860 Views)