LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a Global as a value change in an Event Structure

I have many events I want to react to based on Global buttons.  How do I get the Event Structure to recognize a global button value change?  This screen shot is one of my many attempts.  So far my events only change with a real button on the FP.

 

Thanks in advance,

Doug

0 Kudos
Message 1 of 9
(4,060 Views)

It should work if you use the Value (Signaling) property node.

Example_VI_BD.png

I'd use a Notifier rather than a Global and an Event Structure.

Message Edited by jcarmody on 04-21-2010 11:10 AM
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 9
(4,048 Views)

You also could use user events. You even can pass the reference of the 'global button' to the event registration and select the value change property.

 

Felix 

0 Kudos
Message 3 of 9
(4,030 Views)

Jim,

 

The Value (Signaling) does not work either.

 

I would rather not use a notifier, so maybe I need to get away from using an event structure.

 

Thanks

0 Kudos
Message 4 of 9
(4,020 Views)

nonecure wrote:

Jim,

 

The Value (Signaling) does not work either.

 

I would rather not use a notifier, so maybe I need to get away from using an event structure.

 

Thanks


It should work if your code was executing correctly. The image you posted...

 

 

may be the reason.

 

If you watch the code in execution highlighting it may help you figure what is happening.

 

1) There is no guarentee that "initialize" will be written to the local "State" before the loop starts running. Use a shift register to track your state from iteration to iteration.

 

Do you get any errors?

 

Ben 

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 9
(4,016 Views)
The code works fine as long as I use a real start button.  When I have the Start Global wired to the Value property node, the global start will not trigger that event.  When I have the Start Global wired to the Value (Signaling) property node, the Start Test event runs continuously even know the global value is not changing. 
0 Kudos
Message 6 of 9
(4,002 Views)

nonecure wrote:
The code works fine as long as I use a real start button.  When I have the Start Global wired to the Value property node, the global start will not trigger that event.  When I have the Start Global wired to the Value (Signaling) property node, the Start Test event runs continuously even know the global value is not changing. 

Thanks for the clarification. I was a little woried the event was not firing.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 9
(3,995 Views)

I can't make this work and I think it should.  I attached a small simple version to see what I am doing wrong.

 

Thanks

Download All
0 Kudos
Message 8 of 9
(3,970 Views)

Well, every time you enter the idle state, the signaling is fireing the event. I'm pretty sure that you will see the 'New val' returning a false.

The quick and dirty fix is to have a case structure around the property node, so you only fire if it is true.

 

But I really suggest you to change to some other mechanism for firing the event (user events, notifiers, not using a global variable). You might get more troubles with that design.

 

Felix

Message 9 of 9
(3,964 Views)