11-06-2013 02:06 AM
Hi friends,
I`m trying to get the value of radio button reference in a subVI connected in form of cluster. When I try to run it I`m getting an object reference error. I`ve attached the snippet of my VI`s. Guide me in resolving it.
Regards Ganesh
11-06-2013 03:19 AM - edited 11-06-2013 03:20 AM
You may get the object reference error when you pass a Null reference. Check whether you have connected the reference and passing it properly. At the place where you are getting the error you can probe the reference and check it is not equal to 0. You can always use the function "Not a Number/Path/Refnum?" to check for valid reference.
11-06-2013 10:37 PM
I hope then i`m going wrong in creating the refnum of the radio button in the sub VI. I used control refnum right click select VI server class-> Generic-> GObject-> control->cluster->radio buttons is this correct way to create the reference control in a subVI.
11-06-2013 10:49 PM
Generally the best way to create a control refnum constant is directly from the control itself. Right-click the control and create a reference, then right-click the reference and create a constant from it.
11-07-2013 02:50 AM - edited 11-07-2013 02:51 AM
Hi Nanthand,
Yeah i`ve created the same way as you described and made into cluster. In a SubVI we need to create a Control Refnum to pass the reference from the MainVI. I created that as I discussed in my
@nathand wrote:
Generally the best way to create a control refnum constant is directly from the control itself. Right-click the control and create a reference, then right-click the reference and create a constant from it.
previous post.
11-07-2013 11:29 AM
You should create the control the same way you created the constant, directly from a reference to the original control, or by taking a copy of the constant and changing it to a control.
11-08-2013 06:46 AM
This way it works, but is it correct way of programming?
11-08-2013 11:35 AM
@gnshmrthy wrote:
This way it works, but is it correct way of programming?
Not really. Replace the Build Array with Bundle so you'll have a cluster instead of an array, and remove the other cluster constant input.
11-12-2013 10:17 AM
Yeah I did that as suggested at LAVA http://lavag.org/topic/17705-radio-button-refnum/ thanks for the support. Kudos for the slution & support.