From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

looking for a particular vlaue in a id array

i have a program which generates me 1000000 sample values ie a array of 1 million values.in this 0ne million values i need to look for a particular range of values ie allthe values in the array are 4 and then they ia a value like say 10 and some more values. i need to detect the values greeater than four and then take the 20 values from the index where it is detected. i may have hundered of this pattern in the million samples.
0 Kudos
Message 1 of 6
(2,225 Views)
____________



Hi,

Use the 'Search 1D Array' function and look for the "4". This will give you the index where it is found first. Using this index, read the next 20 elements using the 'Array Subset' function.

Then, pass the resulting index as the 'Start index' to the 'Search 1D array' again and repeat this process.

Hope this helps.

Rgds,

Khalid 🙂



____________
0 Kudos
Message 2 of 6
(2,225 Views)
Thanks for the idea , but is it possible to get a general value like, say i have more than 4 just not 4 then can i get the subset of 20 elemnts later.
0 Kudos
Message 3 of 6
(2,225 Views)
_______

I am attaching a VI which does what you want. The diagram is pretty straight-forward. Let me know if you don't understand anything.

Regards,

Khalid 🙂


______
0 Kudos
Message 4 of 6
(2,225 Views)
thanks again
but if you could do it in labVIEW6i it would work
i am working on 6i version, also
i used a fromulae node and it works pretty good and what i need. Thanks ne way. it owuld be great if the version u solved it in was 6i.
krish
0 Kudos
Message 5 of 6
(2,225 Views)
_____



Here's the 6i version ..



_____
0 Kudos
Message 6 of 6
(2,225 Views)