LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RT timing

Solved!
Go to solution

Good morning, my question is as follows.

I'm trying to log the minimum mV value for various mV adapters. My issue arises when I'm logging data, I'm using a deterministic loop to sample and acquire the signal, then i build an array with all the values captured within a minute (at 200mS sampling rate). Then at the time of logging I need to log the time of the minimum value calculation, BUT I always seem to get a 1 second lag respect the previous log.

This way if i logged data let's say at 12:40:06, my next log entry appears at 12:41:07. There's been periods of time when all logs occur at the exact same second and other where every log is at 1 second ahead.

Any toughts or ideas,

Regards.

 

ER

 

0 Kudos
Message 1 of 4
(2,542 Views)

This sounds like an issue of time creep. The problem may be the amount of time to process the data. It takes a few ms longer and they add up after a while. This will add a second to the recorded time. Where are you getting the timestamp from that you are recording with the data? I do not see a timestamp being generated in the diagram that you supplied.

 

You may need to post your code to let us see where the "extra" time is generated.

 

Rob

0 Kudos
Message 2 of 4
(2,539 Views)

The thing is, I'm only using this loop to generate the data, the timestamp I'm getting it from another VI which calculates the minimun value of the data array.

Im guessing you're right, since i've already checked the amount of time the cRIO takes to read up all 32 differential inputs, it takes less than 200mS, so im guessing hardware performance is not an issue.

0 Kudos
Message 3 of 4
(2,537 Views)
Solution
Accepted by topic author elmer85002

No, hardware is not an issue here. cRIO can work MUCH faster than that. It does look like you are having an issue with processing time to run through your loop and sequence structure. Some of this can be obviated using a parallel structure for saving the data and have it run on an interval (every 200ms or every second or as needed).

 

You can speed thing up a bit using the built in Array Max & Min VI: Array Min Max.PNG

I'm not going to get too deep into removing as many local variables as you can. Wires work so much better and can even remove the need for sequence structures.

 

Rob

0 Kudos
Message 4 of 4
(2,524 Views)