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: 

Event structure challenge Please help.

I have this bug that is driving me crazy. Spent 2 day's and still no where.
I won't ask why the most simple things are the hardest with labview becuase
that
will just open a can of worms. Anyway, here is what I can't figure out.

I have an ok button that is activated through a AI channel. When high
the button goes on as is should on the front panel. What I need to do
is have an event occur only when the button is back off when the signal goes
low. The problem is that events only handle mouse or keyboard movement.
They do handle value change but no good becuase you can't specify
from on to off or off to on. The second problem is I need nothing to happen
when the button is activted only when it goes from on to back off.
Sounds simple enough but it's not. When the AI signal goes low and button
is
false I need that to trigger a timer for given amount. I am no slouch with
labview
but this one has me puzzled. Any suggestions are badly needed here!

Thanks in advance.

Bob


0 Kudos
Message 1 of 10
(2,903 Views)
Why not put a case structure within the value change event? If the value changed, thus firing the event, check if the new value is true or false. If its false, you know it was true before. If it is true, you know it was false before(once again because the value change event was fired). Then inside the case structure, put what you want to happen.
Message 2 of 10
(2,899 Views)

You can trigger a normal event by using the "value Signalling" method on the control you have the event registered against.

 

In that event place a case struture that read the value from the control and in the appropriate case place your code.

 

Is that sounding right for your need?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 10
(2,899 Views)

Ben wrote:

You can trigger a normal event by using the "value Signalling" method on the control you have the event registered against.

 

In that event place a case struture that read the value from the control and in the appropriate case place your code.

 

Is that sounding right for your need?

 

Ben


I WIN!

Message 4 of 10
(2,895 Views)
Thanks for the replies. It alomost works except the new problem is
that it only works with the mouse. When triggered by the AI
nothing happens becuase the event structer hangs the loop.
Nothing executes with the AI.
Any ideas?

"Bob" <Nospam@noreply.com> wrote in message
news:hli6v5$kmu$1@news.eternal-september.org...
>I have this bug that is driving me crazy. Spent 2 day's and still no where.
> I won't ask why the most simple things are the hardest with labview
> becuase that
> will just open a can of worms. Anyway, here is what I can't figure out.
>
> I have an ok button that is activated through a AI channel. When high
> the button goes on as is should on the front panel. What I need to do
> is have an event occur only when the button is back off when the signal
> goes low. The problem is that events only handle mouse or keyboard
> movement.
> They do handle value change but no good becuase you can't specify
> from on to off or off to on. The second problem is I need nothing to
> happen when the button is activted only when it goes from on to back off.
> Sounds simple enough but it's not. When the AI signal goes low and
> button is
> false I need that to trigger a timer for given amount. I am no slouch with
> labview
> but this one has me puzzled. Any suggestions are badly needed here!
>
> Thanks in advance.
>
> Bob
>


0 Kudos
Message 5 of 10
(2,847 Views)

How many loops do you have?  One or two?  Is the data acquisition in the same loop as your event structure?

 

Show us the code.Smiley Wink

0 Kudos
Message 6 of 10
(2,833 Views)
Will try to post code. I have 2 loops. The event is in it's own loop.
Still don't understand why value change is not value change.
Seems labview is quite dumb in this regard. The value is being changed
through AI on one loop passed through local varibale to the event loop.
as I said, When you change value with the mouse I get desired result
but when triggered though local varibale or property node the event is not
detected even though the button does change on the FP. It's probably a
simple fix but I guess I don't know enough. This almost seems like a bug. As
I said.
I recall in past versions that no matter how you changed the value it was
detected.
I can't put the event in the AI loop as it has sound incorperated. what
happend then is the loop is frozen as the even structure is waiting.



"Bob" <Nospam@noreply.com> wrote in message
news:hlkn46$2qt$1@news.eternal-september.org...
> Thanks for the replies. It alomost works except the new problem is
> that it only works with the mouse. When triggered by the AI
> nothing happens becuase the event structer hangs the loop.
> Nothing executes with the AI.
> Any ideas?
>
> "Bob" <Nospam@noreply.com> wrote in message
> news:hli6v5$kmu$1@news.eternal-september.org...
>>I have this bug that is driving me crazy. Spent 2 day's and still no
>>where.
>> I won't ask why the most simple things are the hardest with labview
>> becuase that
>> will just open a can of worms. Anyway, here is what I can't figure out.
>>
>> I have an ok button that is activated through a AI channel. When high
>> the button goes on as is should on the front panel. What I need to do
>> is have an event occur only when the button is back off when the signal
>> goes low. The problem is that events only handle mouse or keyboard
>> movement.
>> They do handle value change but no good becuase you can't specify
>> from on to off or off to on. The second problem is I need nothing to
>> happen when the button is activted only when it goes from on to back off.
>> Sounds simple enough but it's not. When the AI signal goes low and
>> button is
>> false I need that to trigger a timer for given amount. I am no slouch
>> with labview
>> but this one has me puzzled. Any suggestions are badly needed here!
>>
>> Thanks in advance.
>>
>> Bob
>>
>
>


0 Kudos
Message 7 of 10
(2,800 Views)

Which property node are you using?

 

Writing to a local variable does not trigger the value change event.

Writing to the Value property node does not trigger the value change event.

Writing to the Value (Signalling) property node will trigger the value change event.

 

Which past versions are you thinking of?  I know this is the behavior since at least as far back as 7.1.

0 Kudos
Message 8 of 10
(2,798 Views)

Are you using "Value Singalling" ?

 

That is the only way to programatically fire the event (in older version anyway).

 

Before you get frustrated over this please post some code images so we can take a look.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 10
(2,790 Views)
On Feb 20, 12:13 am, "Bob" <Nos...@noreply.com> wrote:
> Will try to post code. I have 2 loops. The event is in it's own loop.
> Still don't understand why value change is not value change.
> Seems labview is quite dumb in this regard. The value is being changed
> through AI on one loop  passed through local varibale to the event loop..
> as I said, When you change value with the mouse I get desired result
> but when triggered though local varibale or property node the event is  not
> detected even though the button does change on the FP. It's probably a
> simple fix but I guess I don't know enough. This almost seems like a bug. As
> I said.
> I recall in past versions that no matter how you changed the value it was
> detected.
> I can't put the event in the AI loop as it has sound incorperated. what
> happend then is the loop is frozen as the even structure is waiting.
>
> "Bob" <Nos...@noreply.com> wrote in message
>
> news:hlkn46$2qt$1@news.eternal-september.org...
>
>
>
> > Thanks for the replies. It alomost works except the new problem is
> > that it only works with the mouse. When triggered by the AI
> > nothing happens becuase the event structer hangs the loop.
> > Nothing executes with the AI.
> > Any ideas?
>
> > "Bob" <Nos...@noreply.com> wrote in message
> >news:hli6v5$kmu$1@news.eternal-september.org...
> >>I have this bug that is driving me crazy. Spent 2 day's and still no
> >>where.
> >> I won't ask why the most simple things are the hardest with labview
> >> becuase that
> >> will just open a can of worms. Anyway, here is what I can't figure out..
>
> >> I have an ok button that is activated through a AI channel. When high
> >> the button goes on as is should on the front panel. What I need to do
> >> is have an event occur only when the button is back off when the signal
> >> goes low.  The problem is that events only handle mouse or keyboard
> >> movement.
> >> They do handle value change but no good becuase you can't specify
> >> from on to off or off to on. The second problem is I need nothing to
> >> happen when the button is activted only when it goes from on to back off.
> >> Sounds simple enough but it's not.   When the AI signal goes low and
> >> button is
> >> false I need that to trigger a timer for given amount. I am no slouch
> >> with labview
> >> but this one has me puzzled. Any suggestions are badly needed here!
>
> >> Thanks in advance.
>
> >> Bob

a screenshot would be nice 😉
0 Kudos
Message 10 of 10
(2,754 Views)