LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Event Registration Error

Hi,

 

I'm getting to grips with Dynamic events in LabVIEW. However, I've encountered an issue i'm not sure on. When I try to register a cluster of control refs to the Register for Events function I get an error.. See Dynamic Event Registration.vi for small vi highlighting the issue.

 

Thoughts?

 

Strokes 

0 Kudos
Message 1 of 14
(4,226 Views)

Hi,

 

You can't connect the control directly, but a reference of that control, then you will be able to select the type of event you want to catch.

To create a reference on your cluster, right clic on it and select "create" >> "reference"

 

Hope this helps


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 2 of 14
(4,216 Views)

You can wire a reference or an array of references to register for events. Of course you probably already know that you have to wire the output of register for events to the dynamic registration terminal of the event structure.

 

 

Dyanmic Event Registration Error-1.png

=====================
LabVIEW 2012


Message 3 of 14
(4,209 Views)

@Steve Chandler wrote:

You can wire a reference or an array of references to register for events. Of course you probably already know that you have to wire the output of register for events to the dynamic registration terminal of the event structure.

 

 

Dyanmic Event Registration Error-1.png



@Steve Chandler wrote:

You can wire a reference or an array of references to register for events. Of course you probably already know that you have to wire the output of register for events to the dynamic registration terminal of the event structure.

 

 

Dyanmic Event Registration Error-1.png


That helped me somewhat, however, I'm still experiencing problems. My events seem to be registering correctly but don't seem to generate when I trigger them. I've configured the event structure to execute should one of the controls in my cluster change value. However, the only event case that get's executed is the timeout case.

 

I've attached a vi highlighting my problem named Dynamic Event Problem.vi. My real vi is much larger and contains many sub vis so hopefully what I've attached suffices..

 

 

Download All
0 Kudos
Message 4 of 14
(4,191 Views)

It is missing a subVI. Also the control is part of a library that is not attached. Can you zip the whole library and attach that?

=====================
LabVIEW 2012


Message 5 of 14
(4,189 Views)

@Steve Chandler wrote:

It is missing a subVI. Also the control is part of a library that is not attached. Can you zip the whole library and attach that?


My bad... I did up the question in a rush before clocking off time. It'll be tomorrow before I get a chance to upload the missing vi.

 

Apologies,

 

Strokes

 

EDIT: Any ideas off the top of your head..? I'm fairly sure the events are registered correctly, the timeout case executes every when no event is detected on a loop iteration but required event i.e. control value change never fires? Maybe I should just wait for tomorrow... it's bugging me though..

0 Kudos
Message 6 of 14
(4,181 Views)
How are you changing the value? The event will only fire if a user actively changes the value of a control and not by programatically changing the value. If you want to do that you need to wire to the Val(Signalling) property.
=====================
LabVIEW 2012


0 Kudos
Message 7 of 14
(4,173 Views)

I'm changing the values of the contents of the clusters by pressing booleans, changing menu rings etc. on the top level applications front panel. I've grouped all of the controls in a cluster for convenience and registered this cluster for value change events where I understand each element can fire the event should a value change...

0 Kudos
Message 8 of 14
(4,167 Views)

@Steve Chandler wrote:
How are you changing the value? The event will only fire if a user actively changes the value of a control and not by programatically changing the value. If you want to do that you need to wire to the Val(Signalling) property.

I'm not really in the position to upload the entire library I think I've simulated my problem in the attached vi. I'm assuming that once the value of a control changes (e.g. boolean button goes from false to true) that the reference to this control changes also and hence an event sure fire if configured correctly. However, this doesn't seem to be the case.

 

I'd appreciate it if you could have a quick look.

 

Strokes

0 Kudos
Message 9 of 14
(4,149 Views)

Try using an array of references instead of a cluster. See the attached example.

 

About your example:

 

Place the Register for Events node outside your While Loop. That way it only runs once without extra code.

There is rarely a reason to use a "Wait Until Next Multiple" function with an Event Structure.

 

steve

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
Message 10 of 14
(4,133 Views)