Aaron Posted September 12, 2007 Report Share Posted September 12, 2007 Hello All, I am using LabView 8.2 and am using the method control val. get and set a lot. This works great for getting and setting values of controls and indicators in other vi's. I was wondering if anyone knew a similar way to get and set properties of a control or indicator. Specifically I am wanting to trigger and event case in another vi (value signaling) as well as setting the string values in a ring control. Any help would be appreciated. Thanks. Quote Link to comment
Grampa_of_Oliva_n_Eden Posted September 12, 2007 Report Share Posted September 12, 2007 QUOTE(Aaron @ Sep 11 2007, 03:25 PM) Hello All,I am using LabView 8.2 and am using the method control val. get and set a lot. This works great for getting and setting values of controls and indicators in other vi's. I was wondering if anyone knew a similar way to get and set properties of a control or indicator. Specifically I am wanting to trigger and event case in another vi (value signaling) as well as setting the string values in a ring control. Any help would be appreciated. Thanks. Hi Aaron, Could you elaborate on what you have tried and exactly what you want. It just sounds like you have answered your own question. Ben Edit: After reading raglefrocks follow-up posting, Ben slaps his frohead and utters "Doh". Quote Link to comment
ragglefrock Posted September 12, 2007 Report Share Posted September 12, 2007 QUOTE(Aaron @ Sep 11 2007, 02:25 PM) Hello All,I am using LabView 8.2 and am using the method control val. get and set a lot. This works great for getting and setting values of controls and indicators in other vi's. I was wondering if anyone knew a similar way to get and set properties of a control or indicator. Specifically I am wanting to trigger and event case in another vi (value signaling) as well as setting the string values in a ring control. Any help would be appreciated. Thanks. If you have a reference to the other VI that's running, you can wire that VI reference into a property node to get a reference to the Panel. Then wire the Panel reference into another property node and get a reference to all the controls (Controls[ ]) on the panel. You might have to loop through those controls looking for the right label, and then cast it from a generic control reference into the desired type (ring, slider, etc.). Quote Link to comment
Aaron Posted September 12, 2007 Author Report Share Posted September 12, 2007 QUOTE(Ben @ Sep 11 2007, 02:40 PM) Hi Aaron,Could you elaborate on what you have tried and exactly what you want. It just sounds like you have answered your own question. Ben Sure, Lets say I have a ring control in one vi and I want to change the text in that ring or enum control from another. When I use the set or get control method, I would only get or set the index as that control is a number. I would like to update the text it displays which is a property of the control. Another example is if I have a boolean control in one vi I can get and set its value from another but that will not trigger an event case. I would have to use the property value signal. I need to know if there is a want to set the properties of a control instead of setting its value from another vi. Aaron Quote Link to comment
Grampa_of_Oliva_n_Eden Posted September 12, 2007 Report Share Posted September 12, 2007 QUOTE(Aaron @ Sep 11 2007, 03:54 PM) Sure,Lets say I have a ring control in one vi and I want to change the text in that ring or enum control from another. When I use the set or get control method, I would only get or set the index as that control is a number. I would like to update the text it displays which is a property of the control. Another example is if I have a boolean control in one vi I can get and set its value from another but that will not trigger an event case. I would have to use the property value signal. I need to know if there is a want to set the properties of a control instead of setting its value from another vi. Aaron The ring is easy, just use the "Strings" property to write a new array of strings. The enum is another story. the strings associated with an enum are imbedded in the data type so they can not be changed at run time. I am recovering from my first reply? Ben Quote Link to comment
JDave Posted September 12, 2007 Report Share Posted September 12, 2007 QUOTE(Ben @ Sep 11 2007, 12:59 PM) The ring is easy, just use the "Strings" property to write a new array of strings.The enum is another story. the strings associated with an enum are imbedded in the data type so they can not be changed at run time. I am recovering from my first reply? Ben I think the issue is using the VI Method to set control values by name, versus using the control properties to change value or other properties. To do what you want to do, you need to access the control by reference. You can pass the reference around, or you can get the control references from the VI in question (VI >> Panel >> All Controls) and search for it by name. If you are already using the VI ref only, this would be the easiest transition. Just be aware that if you have any nested controls (clusters, tabs, etc.) you will need to recursively search through these. Quote Link to comment
Aaron Posted September 12, 2007 Author Report Share Posted September 12, 2007 QUOTE(Ben @ Sep 11 2007, 02:59 PM) The ring is easy, just use the "Strings" property to write a new array of strings.The enum is another story. the strings associated with an enum are imbedded in the data type so they can not be changed at run time.I am recovering from my first reply?Ben Ok, Maybe this would be better. I am attaching 2 vi's. From vi1 I would like to get and set the string values in vi2's ring.AaronQUOTE(Aaron @ Sep 11 2007, 03:19 PM) Ok, Maybe this would be better. I am attaching 2 vi's. From vi1 I would like to get and set the string values in vi2's ring.Aaron Update, By using the front panel and controls reference I can do value signaling to the other vi. But it does not seem I have access to all properties just some default properties. For example I do not see the strings[] property for this control using this method.Aaron Quote Link to comment
Grampa_of_Oliva_n_Eden Posted September 12, 2007 Report Share Posted September 12, 2007 QUOTE(Aaron @ Sep 11 2007, 04:29 PM) Ok, Maybe this would be better. I am attaching 2 vi's. From vi1 I would like to get and set the string values in vi2's ring.AaronUpdate, By using the front panel and controls reference I can do value signaling to the other vi. But it does not seem I have access to all properties just some default properties. For example I do not see the strings[] property for this control using this method.Aaron Add ing dsaunders reply... You have mentioned the invoke nodes but only alluded to the property nodes. The propertyies you are after are only exposed for cirtain control types. To get at those properties you need to make sure the control reference you are using is of the approriate type. The "To more Specific" node will help with that. See http://forums.ni.com/ni/board/message?board.id=170&message.id=267659' target="_blank">this Nugget where I offered some ideas on how to handle control refences. Ben Quote Link to comment
Aaron Posted September 12, 2007 Author Report Share Posted September 12, 2007 QUOTE(Ben @ Sep 11 2007, 03:59 PM) Add ing dsaunders reply...You have mentioned the invoke nodes but only alluded to the property nodes. The propertyies you are after are only exposed for cirtain control types. To get at those properties you need to make sure the control reference you are using is of the approriate type. The "To more Specific" node will help with that. See http://forums.ni.com/ni/board/message?board.id=170&message.id=267659' target="_blank">this Nugget where I offered some ideas on how to handle control refences. Ben Wow!! That works and solves all my current issues. Thanks to all for the help! Aaron Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.