LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean pulse generator

For the benefit of current or future readers (and writers), I'd also point out that the use of Local Variables to "set the algorithm apart" (translated online) is not a wise choice in general.

 

With local variables it is important to ensure the execution order relative to other reads and writes, and in the given code (as altenbach's posts explained) there are several potentially problematic race conditions. 

 

Malkheir, if the use of the "highlight execution" changes the behaviour of your code (or almost any non-time based code) this is a clear indication of a race condition. I make the exception regarding timing because in even valid code, highlight execution has the potential to cause problems there... Apologies that this is not a clear guideline...


GCentral
0 Kudos
Message 11 of 13
(1,622 Views)

If we eliminate the race condition, x=y and the code reduces to this (fully tested!):

 

altenbach_0-1581701866254.png

 

😄

 

0 Kudos
Message 12 of 13
(1,618 Views)

I concur.

Frozen_0-1581705531201.png

Also, do *not* use the code on the left!

 

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
0 Kudos
Message 13 of 13
(1,604 Views)