LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure not detecting the Indicators

Hello,

While practicing Event Structure, I did a simple thing to detect the change in the state of a Boolean Indicator which was connected to a Boolean Control.

I made the event which was responsible to detect the change in state of that indicator, but the Structure don't detect its change, while when did with the same thing with the Boolean control, it detected it and comes out of the event.

So pls guide how could I detect the change in the state of an indicator

Regards

0 Kudos
Message 1 of 12
(4,012 Views)

Event structures are for user iteractions. They don't react to indicator changes or when a control or indicator is changed via a value property node or local variable. To trigger a value change event, you need to write to a "value (sgnl)" property.

 

Note that writing to a value(sgnl) property fires the event unconditionally, even if the new and old value is the same.

Message 2 of 12
(4,007 Views)

As far as I know, it will never work that way unless you use the 'value signalling' property of your boolean indicator.

It will write a certain value to your indicator AND fire a user event.  You can catch this change event of your indicator with your event structure by using 'value changed' of that indicator

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 3 of 12
(4,005 Views)

Thanks very much altenbach

So how could we then detect the change in the value of an indicator. With Event Structure and without Event Structure

0 Kudos
Message 4 of 12
(3,997 Views)

Well, in your particular program, you would use an event case for the switch instead.

 

In you are interested in the change of a wire value, use a feedback node and compare current and previous values with a "not equal" the output will be true whenever the value changes.

 

What are you actually trying to achieve with all that. Maybe you are searching for a solution that is better handled in a completely different way.

0 Kudos
Message 5 of 12
(3,987 Views)

Thanks once again

You wrote

/In you are interested in the change of a wire value, use a feedback node and compare current and previous values with a "not equal" the output will be true whenever the value changes./

 

But how when we are unable to detect the change of state of an indicator? So how to materialize it.

 

Sir actually i was practincg labivew with some mathematical tasks and so wanted to add the prime numbers, in the detection of prime numbers i placed a checked =0 there after dividing each number and so placed an indicator to see when the division result is not equal to zero and so that not a prime number.

Here i placed that indicator in an event structure and wanted to have a check on the change of its state.

I might not be using the event structure for the correct purpose but i wanna practice the event structure too.

So how could this be created using the Event structure.

 

Thanks

0 Kudos
Message 6 of 12
(3,961 Views)
An indicator is meant to show the value of a signal, it's the signal and its change you're interested in.
/Y
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 12
(3,953 Views)

Are you using a state machine?

If so, when you connect the output of your =0 to the property node 'value (sign)' of your boolean indicator, LabVIEW will fire a user event => value change of that boolean indicator.

If afterwards  you're checking your event structure, it will execute whatever is in that state of the event structure.

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 8 of 12
(3,952 Views)

Why are you using an event structure?  Just use a case structure after your check for prime.  Then you don't need the indicator.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 12
(3,940 Views)

@Abuzar wrote:

Thanks once again

You wrote

/In you are interested in the change of a wire value, use a feedback node and compare current and previous values with a "not equal" the output will be true whenever the value changes./

 

But how when we are unable to detect the change of state of an indicator? So how to materialize it.

 

Sir actually i was practincg labivew with some mathematical tasks and so wanted to add the prime numbers, in the detection of prime numbers i placed a checked =0 there after dividing each number and so placed an indicator to see when the division result is not equal to zero and so that not a prime number.

Here i placed that indicator in an event structure and wanted to have a check on the change of its state.

I might not be using the event structure for the correct purpose but i wanna practice the event structure too.

So how could this be created using the Event structure.


As others have already said, your thinking is backwards here. The data primarily lives in the wire, an indicator just brings it into a readable form for the operator. This is secondary.

 

If you are interested if the remainder is =0 and want to communicate that fact to the user, just wire the output if this function to a LED. This is a direct result and does not depend on the previous state of the indicator, so no feedback node is needed. You are interested in the result itself, not the change in state.

 

Dataflow dictates that this =0 function gets evaluated whenever a earlier computation completes and that's the only time the value could change.

 

Feel free to show us your prime algorithm. Maybe we can give you some hints how to improve it. 😉

Message 10 of 12
(3,918 Views)