06-25-2012 09:01 AM - edited 06-25-2012 09:06 AM
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.
06-25-2012 09:06 AM
Hi neevan,
There is no difference between time delay and wait. If you look at the express code you will find:-
Which if you investigate subTimeDelay will show:-
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
06-25-2012 09:42 AM
Basically, Stephen & I are saying the same thing.
Notice how there is no reset anywhere...
07-05-2022 03:14 AM
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.
07-05-2022 04:10 AM
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…
07-05-2022 06:41 AM
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?
07-05-2022 07:15 AM
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?
07-05-2022 08:04 AM
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.
07-05-2022 10:46 AM - edited 07-05-2022 10:47 AM
@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
The Time Delay does NOT have a reset terminal, defaults to 1 Second, and has the Error cluster built in.
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.
07-05-2022 11:57 AM
@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
The Time Delay does NOT have a reset terminal, defaults to 1 Second, and has the Error cluster built in.
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.