LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is my wait time so unreliable? (sample code inside)

Please have a look at the attached VI and chart output. Can someone explain why the wait time is so unreliable and hwo to fix it?

At least I have chicken
0 Kudos
Message 1 of 6
(3,312 Views)

You are trying to get reliability on a windows PC for a loop with a 2 msec wait.  Windows is not that reliable.  It probably is going off and spending time doing other stuff.

0 Kudos
Message 2 of 6
(3,308 Views)

Welcome to windows. With such small times as 2ms there's no guarantee windows will return in time, as you notice. What are you trying to do?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 6
(3,307 Views)

i'm trying to read from an instrument as quickly as I can (and I cant just go in and get 100 pts every 100ms)

 

Any options out there for me? 

At least I have chicken
0 Kudos
Message 4 of 6
(3,304 Views)

What instrument are you trying to work with?  Are you sure it can even respond as quickly as every millisecond?

 

Can it supply multiple data points in one request?

 

The more reliable method would be to request the last 100 data points and ask for it every 100 msecs.

 

If it was a DAQ card, you'd be setting up a continuous data acquisition and would request all the data in the buffer (or a lot of data on a regular basis).  Then the timing functions of the DAQ card would guarantee all of your data is 1 millisecond apart.

0 Kudos
Message 5 of 6
(3,295 Views)

Xitron 2802. It can respond every MS...but you're right. I've been going back and fourth between using 'history' vs. real-time pinging. I guess history is the best approach - letting the instrument control its own sample rate. 

At least I have chicken
0 Kudos
Message 6 of 6
(3,288 Views)