LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Error while dynamically registering events for another VI

I'm getting error while using "Register for Event" node for dynamically registering the events for controls of another VI. But when I use the same method and gives reference of controls of current VI to Register for Event" node, I don't get any error.

I pass the reference of controls of current VI or another VI, to "Register for Event" node by using following method,

Open VI reference, pass it to property node and select property "Front Panel", and then pass this Front Panel Reference to another Property node and select "Controls[]" property for getting an array of references to all controls, filter the reference u want or use complete array of references and pass to "Register for Event node".

When the path of current VI is given to "Open VI reference" function, there is no error and the events are registered for those controls. But when path of another VI is given to same "Open VI reference" function for registeration of controls of another VI, the "Register for Events" node gives an error with error code 1011.

Can any body guide me, whats the problem.

0 Kudos
Message 1 of 5
(2,959 Views)
What events are you registring? Maybe you want to register an event that can't be registered for a generic control so you should typecast it to the right control. Could you give some code?

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 5
(2,946 Views)

The attached Example.zip contains three VIs. HomeForDynamicEvents is the main VI which load other two VIs (Meter.vi and Sum.vi) in its subPanel. All these three VIs have "Click" button control. A Ring Control "Monitor Click on Click button of:" let the user select the VI whose click button control will be registered for mouse up event. When the mouse up action is done on any click button, the program is coded to popup a message saying that Click button in the respective VI is clicked.

When this VI is selected from "Monitor Click on Click button of:" ring control before running VI, the registeration of mouse up event for "Click" button is done perfectely alright and the "Register Events" node donot give any error in "error out (Register Events)" error cluster. But when "Meter VI" or "Sum VI" is selected from "Monitor Click on Click button of:" ring control before running VI, the registeration of mouse up event for "Click" button of the selected VI donot take place and the "Register Events" node gives an error message "Register For Events in HomeForDynamicEvents.vi" with error code number 1011 in "error out (Register Events)" cluster. The registeration process is same for controls of other VIs, so whats the problem, if u could please guide.

0 Kudos
Message 3 of 5
(2,939 Views)
Hello Anderomeda,

two things were missing. You can only register for events when the front panel is open and the vi is running (this kind of events, i think mouse over is less strict).
If you had looked at the erro you would have found out. To look at the erros right-click on the border of the error and select explain error:

Ton

Message Edited by TonP on 09-04-2006 04:25 PM

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 4 of 5
(2,936 Views)
Thanks alot ..  The issue has been resolved and its a nice tip for getting explanation of the errror. Now before registeration I opened the front panel of other VI in the subpanel and using RunVI method, ensured its running state, so the event got registered.
0 Kudos
Message 5 of 5
(2,928 Views)