07-21-2008 08:05 AM
Hi Jim,
As I understand Ton's example the re-registration of an event to a contant cancels the previous registration, effectivle shutting it off.
Ben
07-21-2008 08:28 AM
07-21-2008 08:38 AM
The text shown in the header of the evnt structure comes from the code that executes out to the left. In that case, (I think) Ton was creating those events and registering them against the constant so that they would not be registered initially but only registered against the actual picture control when required.
Sorry can't look at your other pictures now, gotta run!
Ben
07-21-2008 11:04 AM
08-26-2008 10:47 AM
If I build multiple references into an array, and wire that array into the dynamic event structure, how can I assign a name to the array such that the event structure can "see" it, and not have the default <?> event name.
...
Any ideas?
MikeS shows here a way to rename a wire:
Ton
08-26-2008 11:28 AM
08-26-2008 12:32 PM
No, you don't edit the values of the references, just the name of the data (wire).
This is a safe way to do so, just make sure the datatypes of the typecasted wire and the constant are the same! (can be achieved by right-click, create constant). Show the label of the constant and rename the label.
Ton
08-27-2008 07:58 AM - edited 08-27-2008 07:58 AM
I have to say I am not really following you.
In the attached picture: what if the references that are in array A change their order (for whatever reason). You would have to manually change your labels in the array constant B, and you would not even know that the refs in array A had changed their position within the array.
.Is this a method for setting the name (for even purposes) of several controls at once, or is this example only showing naming 1 control? If I try and edit the labels of an array constant if I change 1 they all change to the same thing.
(I think I am not really getting you, can you attach that VI?)
08-27-2008 09:02 AM
Hi nrp,
as far as I understand, the label is for the whole array but not the Control lable. As you experience, all elments inside the array have the same lable.
To know which one of the 4 buttons actually was pressed, the Label.Text Property of the control still can be used as normal.
All that is done and makes the code readable is the event name is defined that way.
Felix
08-27-2008 09:17 AM
I first want to say thanks TonP for this nugget!
I've finally grasped User Events and am now in the process of hugely over-using them until I realise they're not an egg-laying, woolly milk-producing pig! That's a literal translation from German where it makes more sense as "eierlegende Wollmilchsau". In other words, the solution to all problems rolled into one.
I personally like being able to change the text on the Event (or Event array) independently to the name(s) of the actual Control(s). Allows functional descriptions which come in very handy using registered events!
Shane.