LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the most memory efficient way of waiting a certain amount of time?

Between my Senior Test Engineer and I we use way too many methods of waiting a predetermined amount of time. Is there a "best" (with regard to memory efficiency) way to wait a predetermined amount of time?
0 Kudos
Message 1 of 9
(3,371 Views)
I have to ask: What's wrong with the Wait function?
Message 2 of 9
(3,367 Views)

I also think about 'memory efficient'. I can't imagine a way to wait that takes more than a few bytes.

 

Felix 

0 Kudos
Message 3 of 9
(3,362 Views)

smercurio_fc wrote:
I have to ask: What's wrong with the Wait function?

 

Short of inhibiting the CPU clock the Wait function is the best method of waiting.

 

 

Bracing for a re-wording of the Q,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 9
(3,359 Views)

Ben wrote:

smercurio_fc wrote:
I have to ask: What's wrong with the Wait function?

 

Short of inhibiting the CPU clock the Wait function is the best method of waiting.

 

 

Bracing for a re-wording of the Q,

 

Ben


Depending on how long you need to wait and whether or not you have the requirement to abort the wait early a queue or notifier with a timeout is also a good way of waiting. This gives you the ability to abort early if necessary. This is handy if you have long wait times.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 5 of 9
(3,342 Views)

Mark Yedinak wrote:

Depending on how long you need to wait and whether or not you have the requirement to abort the wait early a queue or notifier with a timeout is also a good way of waiting. This gives you the ability to abort early if necessary. This is handy if you have long wait times.


I never really thought about using a queue in that way before.  You have a dequeue element with a timeout.  When it times out, your time is up.  If you want to stop the timer early, then you place an element in the queue from anywhere else in the code. You don't even care about the data in it and wouldn't have to wire it up at all.  You have an output that tells you whether it timed out or not and can be used as a decision on whether to continue with the code normally or to stop the loop.

 

I like it.  I'll have to keep it in mind for the future.

 

Now if you have a situation where you don't want your loop to hold waiting for the time, but perhaps doing certain things when the time is not up and something else when the time is up, then the elapsed time Express VI works well for that.

0 Kudos
Message 6 of 9
(3,328 Views)

"Depending on how long you need to wait and whether or not you have the requirement to abort the wait early a queue or notifier with a timeout is also a good way of waiting"

 

priceless!

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 7 of 9
(3,297 Views)

chrisger wrote:

"Depending on how long you need to wait and whether or not you have the requirement to abort the wait early a queue or notifier with a timeout is also a good way of waiting"

 

priceless!


And I wasn't even using a Visa card.

 

Thanks.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 8 of 9
(3,288 Views)
i lol'd
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 9 of 9
(3,261 Views)