09-04-2014 11:30 AM
I have a large number of controls on a front pannel. I'm using a event structure that triggers the motion of a given motor when the corresponding control is pressed. However, I would like to avoid creating N mostly identical events, so I was planning on using a mouse down event on the front pannel, then retrieve the control reference using the Ctlref node (with gives "Reference to the control on which the event occurred" according to labview manual) and scan a array of references to find out which motor is supposed to move. However, it seems that this node does not appear (contrary to what the manual says).
I have found other ways to do what I need (I was thinking of using an array containing the coordinates of my controls and the coords node of the event structure), but I wanted to know why I can not find that node (which appears for "value change" event for instance). I'm using Labview 2013.
Solved! Go to Solution.
09-04-2014 12:44 PM
It's there for me. Can you give a stripped down example of your code that shows the problem?
09-04-2014 12:51 PM
CtrlRef nodes do not always appear by default but, you can always resize the node or select item (just like unbundle by name elements)
09-04-2014 01:04 PM
In LV2013 it did show up on default for me, when using more than one Boolean control for the same event case, as to be seen in the attached VI
09-04-2014 01:16 PM
@comrade wrote:
In LV2013 it did show up on default for me, when using more than one Boolean control for the same event case, as to be seen in the attached VI
Interesting. Every once in a while I run into things that behave "Strangely" on those data nodes. I've never really known all the "Rules"
e.g. if an existing case with data nodes modified by the developer and wired to other nodes is edited or copied should (do) the default nodes appear and potentially break the case? Its probably some undocumented rule like that why it was not seen in that instance.
On a side note: if you don't replace all of the code in that case (The loop, and the case structure) with a Search 1D Array primitive you may find that code featured on the Rube Goldberg thread
09-04-2014 02:15 PM
Oh - the 1D Array search
Of course - I forgot. usually I employ variant attributes for keeping references...
09-05-2014 03:12 AM
Thank you all for your answer. Actually, I can find the Ctlref node when using a mouse down event on a control as in some of your examples. But here I am using a mouse down envent on the front panel, and while the coords node gives me the mouse coordinate, I cannot find the Ctlred node. Here is a image of that part of the vi (with a French version of Labview, sorry).
09-05-2014 03:23 AM - edited 09-05-2014 03:24 AM
Bad luck for you. Mouse down on panel does not have the control refnum as it is not operating on a control. Mouse down on a control does have it and since you can configure mouse down events on several controls in the same event case, it provides also a control refnum so that you can still operate on the control in question.
This is probably also the issue Jeff might have seen. When configuring multiple events for the same frame LabVIEW will only show the event terminal that are present in all of those events. Terminals that don't exist in at least one specific event of the multiple events for that frame are not selectable anymore.
09-05-2014 03:36 AM
09-05-2014 06:29 AM
Here without the tremendously Goldbergish code...I'm still ashamed...