LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extract index given value of element in array

Solved!
Go to solution

Hi,

A similar question might have been posed before, but I couldn't find any that exactly matches what I want. Also, i'm using labview 8.5 so couldn't read most of the views which you guys attached with the other solutions. 

 

The files i'm using are attached. Test_FIFO_TimeTagging-Nov16-try1.vi is the main vi.

 

The time(ms) array gives the absolute time in miliseconds. As can be seen, it is derived from the Micro2 and Macro2 arrays. I want the user to be able to specify the time, i.e. if the current element in the time(ms) array has a value greater than the value the user entered, then I want the index of that element in time(ms) so that I can use this index to create subarrays of Micro2 and Macro2 which contain only elements from index 0 to the index that I get from time(ms).

 

I don't know how to extract the index from an array given the value of the element, so am unable to go forward.

 

Thanks,

Kaiser 

 

0 Kudos
Message 1 of 4
(3,739 Views)
Solution
Accepted by topic author Kaiser

Hi Kaiser,

 

the function you need is "Threshold 1D array". (I suppose your time values are sorted, otherwise using subarrays would be senseless...)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(3,735 Views)

Hi,

Thanx for the ultra-fast reply. Will try it out in the morning.

 

Regards,

Kaiser 

0 Kudos
Message 3 of 4
(3,710 Views)

Thanks. It worked.

 

Regards,

Kaiser 

0 Kudos
Message 4 of 4
(3,680 Views)