LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Delay vs Wait

If you opened the Time Delay express vi as smercurio suggested, you would find that it contains a control for the amount of Delay Time (s) and { error in / out control / indicator which is wired directly to one another}.

 

The Delay Time (s) control is wired to a sub-vi called subTimeDelay.vi, which contains a control which multiplies the delay value by 1000 and passes it to the Wait (ms).

 

Apart from the obvious mistake of not converting a double to a U32, the only difference between the Time Delay and Wait is that the Time Delay (s) offers terminals for the error cluster and converts the seconds into milliseconds for you.  Both are convenient.  As for functionality, the end result is the same if you wire the same value to the Wait (ms) function (taking the 1000 multiplication into account).  There is no reset feature / function within this.

 

As for the comparison between the 2 methods that you showed in the original post, you would have to run the error cluster through the sequence frame to ensure that the OR is executed after the 100 ms delay in your Method 1.

Message 11 of 23
(3,346 Views)

Hi neevan,

 

There is no difference between time delay and wait.  If you look at the express code you will find:-

 

 

Time Delay Express.png

 

 

 

Which if you investigate subTimeDelay will show:-

 

subTimeDelay.png

 

Therefore Wait and Time Delay are identical except that Wait works in Integer values of milliseconds whereas Time delay works in DBL of seconds and then converts to milliseconds before calling wait.  Also the Time Delay includes Error in and Error Out nodes that can be used to force data flow.

 

Cheers

Stephen

Message 12 of 23
(3,341 Views)

Basically, Stephen & I are saying the same thing.

 

Notice how there is no reset anywhere...

0 Kudos
Message 13 of 23
(3,328 Views)

Sorry for posting in a thread about 10 years old but I still think my question is relevant to the topic.

 

I have a VI where I simply want to wait 1 ms before the data flow goes into the network ingress block. Can I then use time delay to accomplish this?

 

See the example in the image. Here I want to wait 1 ms before the data flow goes into the read block.

 

Apologies in advance on how I have drawn.

 

antje668_0-1657008873189.png

 

 

 

0 Kudos
Message 14 of 23
(2,049 Views)

Hi Antje,

 


@antje668 wrote:

I have a VI where I simply want to wait 1 ms before the data flow goes into the network ingress block. Can I then use time delay to accomplish this?


Yes, you can.

With newer LabVIEW version you can also use the StallDataflow.vim…

 


@antje668 wrote:

See the example in the image. Here I want to wait 1 ms before the data flow goes into the read block.


Be warned: on default Windows you might get a lot of jitter when waiting for just 1ms…

 

Comment: with CAN you could wait some more milliseconds as the receiver (and the driver) should buffer the most recent message of the requested ArbID…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 15 of 23
(2,043 Views)

Hello GerdW,

 

Regarding what you wrote about the CAN-frames, are there any specific rule of thumb on how many ms they should be allowed to buffer data between messages?

0 Kudos
Message 16 of 23
(2,038 Views)

Hi Antje,

 

with the CAN drivers I used to work you could configure the ArbIDs you want to receive.

The driver internally would buffer the latest message, so it doesn't matter how long you wait before reading the data (as long as you are only interested in the latest values).

 

It's different when you want to read ALL messages for one ArbID to be able to create complete logs. Do you?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 17 of 23
(2,029 Views)

Yes and no. It will work, but the timing isn't reliable on ... basically anything under 3 ms due to windows scheduling and stuff. Often that's not a big issue, but it's good to be aware of.

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 18 of 23
(2,021 Views)

@aeastet wrote:

@neevan wrote:

Hi,

 

I have very basic question. What is the main difference between Wait(ms) and Time Delay.

I want to give a delay after executing some part of the vi as showned in the diagram. Whcih method is the best?


With the wait you can not reset this so you will always wait 100ms when you run it. The time delay allows you to reset it or not so you could have a one time or sometime wait and not others. THat is the biggest difference.


Not true....

 

The Wait(mS) has an input for mS to wait and defaults to zero

waitCapture.PNG

 

The Time Delay does NOT have a reset terminal, defaults to 1 Second, and has the Error cluster built in.

tedCapture.PNG

 

In most applications the two are pretty much interchangeable. But the Time Delay Express VI has many coinvent options built in. Like the Error Cluster for for forcing sequential operation and the delay time takes a Double that allows you to work with seconds and decimals instead of milliseconds in integers.

 

========================
=== Engineer Ambiguously ===
========================
Message 19 of 23
(2,003 Views)

@RTSLVU wrote:

@aeastet wrote:

@neevan wrote:

Hi,

 

I have very basic question. What is the main difference between Wait(ms) and Time Delay.

I want to give a delay after executing some part of the vi as showned in the diagram. Whcih method is the best?


With the wait you can not reset this so you will always wait 100ms when you run it. The time delay allows you to reset it or not so you could have a one time or sometime wait and not others. THat is the biggest difference.


Not true....

 

The Wait(mS) has an input for mS to wait and defaults to zero

waitCapture.PNG

 

The Time Delay does NOT have a reset terminal, defaults to 1 Second, and has the Error cluster built in.

tedCapture.PNG

 

In most applications the two are pretty much interchangeable. But the Time Delay Express VI has many coinvent options built in. Like the Error Cluster for for forcing sequential operation and the delay time takes a Double that allows you to work with seconds and decimals instead of milliseconds in integers.

 


I use this a lot for exactly the reasons you described.  Furthermore, I also show it as an icon so it's not so unwieldy.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 20 of 23
(1,996 Views)