08-12-2010 10:48 AM - edited 08-12-2010 10:50 AM
I am using dynamic event registration to handle events from my UI in another VI. Whenever I add a new event, the event registration refnum breaks and I have to recursively go through the code and replace all instances. Is there a method of passing event registration refnums so that this does not happen? Should these be made a strict type def?
Solved! Go to Solution.
08-12-2010 11:16 AM
Right click on the wire out of the Registration node, select create indicator.
Go to the front panel, right click on the reference control, select ->Advanced->Customize. A control editor will appear, select in the upper bar in the ring 'Typedef' instead of 'Control'. Save the control.
Now in every VI you use the reference you need to replace the control. Check the help window for every wire if it's linked to the typedef control.
Now to see if it has worked, alter your registration, everything should break.
Create a control (of the new ref), and replace the old typedef control (in the .ctl file) with the new reference control. Automagically everything should update and work again.
Ton
08-12-2010 11:32 AM
Thanks!
01-12-2012 06:46 AM
Hello,
I have the same problem, but i have no solution...
Why it don't works? I added an examble...
I created a Cluster with an enum an variant. I edit the enum with a second item, then the wire brakes.
But it is a type def.
Can anyone help me?
01-12-2012 07:51 AM
Did you follow Ton's sugestion?
THe event reg wire content will automaticly change when you change the reg node. YOu can see this by turning on your floating help then float over the wire with the wire tool selected.
Ton's approach accepts this fact and suggests how you can "roll-with-the-punches" and mangae that behaviour.
In my case I avoid wiring the event reg wire into sub-VI and put the reg node and the event structure on the same diagram. For me this is a plus since I can easily view what events are being handled by the idagram I am viewing and I don't have to dig and probe.
This image is typical of how I do it.
Ben
01-12-2012 08:08 AM
Hi Ben,
thank you for your answer.
Yes, as you can see in my examples, I followed Ton's sugestion. But what is the problem?
I can't find it.
01-24-2012 03:04 AM
Can anyone help me? Thank you very much
01-24-2012 03:17 AM
The problem is that the event thread is changed, type def'd control or not. You'll need to recreate the controls/indicators.
/Y
01-24-2012 03:58 AM
Thank you. I there an other way to solve this. I don`t want to to recreate the controls/indicators.
I like programming e.g. with type def...
01-24-2012 04:40 AM
I dont think there currently is any way around it.
/Y