LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Edge detector in Labview (6i)

I'm trying to build an edge detector SubVI. It has an input which may
go active (high) for some time. Upon the input going high, I would
like the output to go high until the next time through. I would like
to re-use the SubVI many times within the one VI.

I've tried a SubVI containing a local variable remembering the old
state of the input and comparing this to the present state. and this
works well with only one instance. There is, however, a major problem
when two instances of this SubVI exist in the same VI. Either the
entire SubVI or the local variable are shared between the two
instances of the SubVI and there are major interactions.

Can anyone throw some light on this? How do people normally
remember state in
formation in SubVI's that are instantiated many
times?

Thanks,
alfkatz@cfcl.com.au
0 Kudos
Message 1 of 3
(2,869 Views)
Never mind, I found a solution. Tick the "Reentrant Execution" box on
the "VI Properties" of the Sub VI.

Regards,
Alf Katz
alfk@cfcl.com.au

On Thu, 22 Feb 2001 05:16:24 GMT, alfk@removethis.cfcl.com.au (Alf
Katz) wrote:

>I'm trying to build an edge detector SubVI. It has an input which may
>go active (high) for some time. Upon the input going high, I would
>like the output to go high until the next time through. I would like
>to re-use the SubVI many times within the one VI.
>
>I've tried a SubVI containing a local variable remembering the old
>state of the input and comparing this to the present state. and this
>works well with only one instance. There is, however, a major problem
>when two instances of this SubVI exist in the same VI. Either the
>entire SubV
I or the local variable are shared between the two
>instances of the SubVI and there are major interactions.
>
>Can anyone throw some light on this? How do people normally
>remember state information in SubVI's that are instantiated many
>times?
>
>Thanks,
>alfkatz@cfcl.com.au
0 Kudos
Message 2 of 3
(2,869 Views)
Use reentrancy for your problem.
Even better than a local var is a while with an uninitialised shift register.
greetings from the Netherlands
0 Kudos
Message 3 of 3
(2,869 Views)