LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
MarcoMauri

Wait (ms) with error pass-through

Hi!

Maybe this has been already requested elsewhere and I'm missing it....

but it would be useful to have a Wait (ms) with connectors for error in and out.

This can help keeping the BD clean...

Marco

18613iCF039EA34765F743

60 Comments
Dennis_Knutson
Knight of NI

This is the code for the Time Delay. There is really nothing bulky or slow. It is in fact what this suggestion is asking for - minus the skip on error.

 

21746i7C8692C7C222763E

elecengineer
Member

thanks, good to know. maybe i will replace my custom function with this built in one for portability

JÞB
Knight of NI

This idea finally convinced me to share my primary wait routine from my reuse library.  http://decibel.ni.com/content/docs/DOC-13048

and cross-linked back to this discussion.  Please enjoy

21858i11D0AC0763C5425E

 


"Should be" isn't "Is" -Jay
JackDunaway
Trusted Enthusiast

Jeff - you've got me stumped with this one. Why not just use the "Wait (ms)" primitive??

JÞB
Knight of NI

Good question Jack-

First,  Wait (ms).vi has no error in/out.  Wait +(ms).vi From the counter palatte does use Error correctly however if either function is called during a ms timer rollover the routine never returns.  Additionally, I avoid the U32 limit on the max wait limit an lastly my routine behaves the same on Windows and RT

"Note  The Wait (ms) function behaves differently on Windows and the LabVIEW Real-Time Module. On Windows, the Wait (ms) function waits up to the value specified in the milliseconds to wait input. On the RT Module, the Wait (ms) function waits at least the value specified in the milliseconds to wait input. The Wait (ms) function has a margin of error of plus or minus one millisecond. "


"Should be" isn't "Is" -Jay
Ray.R
Knight of NI

I was looking at some code that someone posted and saw the Sequence Frame with the error cluster running through it with the Wait (ms) inside the S.F.  Classic implementation.  Then figured.. "hey, why not have the error in / out available directly on the Wait (ms).vi"..  Did a search, found this thread.  Kudos!

 

This is something that should have been done a long time ago.

 

Whether you want the SW to have or not have a delay is debatable.  Maybe a boolean to select.  I see cases where you would want a delay even if there is an error (which might be handled after the delay) or some cases where you just want to steam ahead to end the errored software.

 

 

MCKman
Member

This is a variation made into a VI that I often use. A typical application is in a loop with a long delay between iterations. I often don't want to w..a..i..t..... for the loop to exit when an error occurs.

 

 

Error Controlled Millisecond Timer.png

 

 

akeister
Member

I've long preferred wait functions that I can interrupt. Here are my attempts to produce an interruptible timed wait.

 


Timed Wait.png

 

Then you have the Stop Timed Wait.vi here:

 

Stop Timed Wait.png

 

I've written my own merge errors VI, so you might have to replace that with the built-in LabVIEW primitive (which I don't like because it causes superfluous wire bends) in order to be able to run it.

Adrian C. Keister, Ph.D.

Certified LabVIEW Architect
Certified Professional Instructor

B.S. in Applied Physics/Computer Hardware and Software Systems, Mathematics, 2001, Grove City College.
M.S. in Mathematical Physics, 2004, Virginia Polytechnic Institute and State University.
Ph.D. in Mathematical Physics, 2007, Virginia Polytechnic Institute and State University.
Dennis_Knutson
Knight of NI

For an interuptable wait, it's pretty simple to just use the Wait On Notifier or Wait On Occurence. The Wait On Notifier has the error in/error out connections.

SteenSchmidt
Trusted Enthusiast

The 'wait on occurrence' technique is exactly what the Wait function from the GPower Timing toolset uses for premature abort of the wait:

 

Wait.png

CLA, CTA, CLED & LabVIEW Champion