From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Wait for less than 1ms.

Solved!
Go to solution

Yes, I did the search on the forum prior I posted it. I have a general opinion which I get from the posts read.

 

However the posts are a bit old.

 

So, I'm asking the question again hoping something has been changed in the meantime.

 

I need to wait 50 microseconds to let the voltage settle prior I take the reading. I do a lot of readings. I don't want to wait more I need to.

 

Can I do this in LV without  busy loop nor LV RT solutions?

 

Kamil

0 Kudos
Message 1 of 19
(7,217 Views)

Not at all possible with LabVIEW running on Windows.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 2 of 19
(7,202 Views)

If you specified what measurement device you're using, it would help folks answer your question.

If you specified what STARTs the wait, it would help folks answer your question.

 

One thing you might consider is using the sampling clock of your measuring device.

Sample every 10 uSec.

Start your trigger (T=0)

Throw away the first 5 samples (T=0..T=40) and use the sixth one (T=50)

 

If you ask a better question, you might get a better answer.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 19
(7,195 Views)

How are you reading the voltage?  50 microseconds is very fast.  Without RT or FPGA I can't believe you'll be able to guarantee (or trust) that timing.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 4 of 19
(7,176 Views)
Solution
Accepted by MimiKLM

@jcarmody wrote:

How are you reading the voltage?  50 microseconds is very fast.  Without RT or FPGA I can't believe you'll be able to guarantee (or trust) that timing.


This is only 20KHz right?  There aren't that many NI AI devices that have a maximum sampling rate less than that.  But I agree that if you really want set a value, then wait 50 microseconds, then take an AI then you'll need RT or FPGA.  If you can setting for at least wait 50 microseconds, then setup a task to read two samples at 20KHz, then throw away the first sample.  You could possible use a trigger on the channel to start when the output changes.  

 

But what I think is more likely here is you are setting an output, then you know it takes at least 50us to settle, so you want to wait that long or more before taking the reading.  Attatched is a quick VI that performs a 50us wait, but then checks to see how long it actually took.  Then it performs that 50us wait another 999 times, and sees the total time it took to execute which should be close to 50ms but will likely be more.  Windows is non-deterministic so you can't rely on this technique to be accurate.  All you can say is the wait will be 50us or greater.  How much greater?  Well that depends is Windows performing a defrag?  Or a virus scan?  Or are you calculating pi to the trillionth decimal place?

 

EDIT:  And surprisingly enough for me the VI I posted would wait roughtly 50ms +/- 1.  Again your results may vary.

Message 5 of 19
(7,152 Views)

I agree with Hooovah, take 2 samles at 20kHz and ditch the first.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 19
(7,123 Views)

@Hooovahh wrote:

@jcarmody wrote:

How are you reading the voltage?  50 microseconds is very fast.  Without RT or FPGA I can't believe you'll be able to guarantee (or trust) that timing.


 

 

EDIT:  And surprisingly enough for me the VI I posted would wait roughtly 50ms +/- 1.  Again your results may vary.


That is the way to go about the task.

 

Most modern PCs do support a high resolution clock and High resolution Relative seconds will expose that clock.  There is even a nugget that goes into some detail on what you need to watch out for attempting to use that function.

 

Now what is going to bite you?  

  • Precision the tick count of the timer is dependant on 

"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 19
(7,114 Views)

Thanks Hooovahh,

 

In the fact of the lack of the wait function for intervals less than 1ms in the LV primitives collection, your solution is the best one.

 

Thanks for pointig to the High Resoulution utility VI.

 

Application for this 50 microsecond delay is that the voltage source sets the voltage asked. However it doesn't wait the voltage to settle, as it enables the GPIB bus immediatelly after consumes the SCPI command. In the spec the tettle time is 50 microsecond and that I need to secure this.

 

Thanks a lot.

 

K

 

 

 

0 Kudos
Message 8 of 19
(7,051 Views)
I think you are making a mountain out of a molehill. I can't believe you will see any impart of you use 1 ms wait. A minimum settling time does mean you can't wait a little bit longer.
0 Kudos
Message 9 of 19
(7,037 Views)

Let me quote - from top of my head - one of the statements from NI AT Summit last year:

 

"(...) it does not matter to it <the test> with or without the NI. It does matter to do it right(...)"

 

To do it right means do not waste the more time than is really needed.

 

I want to make my test right, and not compromise it with something only because the mimimum delay I can put in LV is 1ms. 

 

1ms reflects 1kHz signal and really NI could do better nowadays. without pushing to buy RT licence.

 

At the end I have to underline that that delay should be accounted into the lag of the  *OPC? command for the device I use.

 

Hooovahh, thanks again for pointing to this High resolution VI.

0 Kudos
Message 10 of 19
(6,983 Views)