From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

"Why the 2 VIs are not same speed?"

Solved!
Go to solution

HI Fellow LabVIEW Lovers,

 

Could someone let me know why the attached 2 VIs are not running at the same speed as I would expect?

 

Thanks in advance.

Bryan

Download All
0 Kudos
Message 1 of 5
(2,412 Views)
Solution
Accepted by topic author BryanL

Inside the event, the value is only written to the value signalling event on the timeout, which is every 100 ms.

 

Outside the event, it is happening in parallel, so it writes on every iteration of the loop, and the timeout actually never occurs.

Message 2 of 5
(2,403 Views)
Thanks Ravens, but should the loop also got delayed by the same 100ms delay when the random number was outside the event structure...or did i miss something very basic here?
0 Kudos
Message 3 of 5
(2,393 Views)
Ok...I got it. Thanks.
0 Kudos
Message 4 of 5
(2,389 Views)

BryanL wrote:
Thanks Ravens, but should the loop also got delayed by the same 100ms delay when the random number was outside the event structure...or did i miss something very basic here?

 

No.  The timeout is the event that occurs if no other event occurs during the timeout period.  Outside, the event structure, the value(signalling) gets re-seeded every time it processes the event from the last iteration.  So the loop runs near instantaneously and the timeout event will never occur because the value(signalling) event is always firing off the event again.
0 Kudos
Message 5 of 5
(2,374 Views)