Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 69263

LabVIEW array question

$
0
0

Hi NI Community,

 

I'm trying to write a simple code to detect a transient duration. I figured out the logic but trying to work with array in LabVIEW. 

 

For example:

 

We have a DAQ collecting voltage and here is the array of voltage measurements:  00002220000 where the numbers of 1 second apart from each other (1 sample per second) so that is a total of 11 seconds because there are 11 measurements made in the DAQ. We want to know how long the signal is above 0, so we set a trigger level if the measure goes above 1 and when it comes back down to 1. Then timestamp those 2 points and subtract them from each other to get the total duration of how long the signal is above 0V. In this case, how do we utilize array index to do this in LabVIEW? I'm trying to do this real time as the DAQ is collecting data. 

 

Here is the logic

if array[i] >= 1 and array[i -1] <1:

timestamp1

if array[i] <=1 and array[i-1] > 1:

timestamp2

 

I think a way I want to do it is below but I'm not sure how to implement it

 

while DAQ collecting data real time:

- create a temporary array of 10 samples from the data DAQ is acquiring

- compare the data inside that temporary array with the logic above

 

 

Thank you


Viewing all articles
Browse latest Browse all 69263

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>