Farid2010 Posted September 1, 2010 Report Share Posted September 1, 2010 I am not proffessional in labview but trying to make an educational program. I have leaarned a lot so far from you guys in this forum. My new problem is that i have a Tab control which has differnet data in different numeric indicators. I have also 2 buttons. I want to set them as whenever i push any of these buttons, the default values in tab control changes. Could help me in that regard? Quote Link to comment
Antoine Chalons Posted September 2, 2010 Report Share Posted September 2, 2010 I am not proffessional in labview but trying to make an educational program. I have leaarned a lot so far from you guys in this forum. My new problem is that i have a Tab control which has differnet data in different numeric indicators. I have also 2 buttons. I want to set them as whenever i push any of these buttons, the default values in tab control changes. Could help me in that regard? Hi, You can't use a property node to write the default value of a control if the VI in which that control is is running, you will always get the error 1073 coming from the property node (the description is : "This property is writable only when the VI is in edit mode, or this method is available only when the VI is in edit mode."). That means that a VI can set the default value on controls of another VI only if the target VI in not running and in edit mode (not in exe). To do what you are describing you should probably concider using a config file. Hope this helps Quote Link to comment
Cat Posted September 2, 2010 Report Share Posted September 2, 2010 If setting the default value is really the only way to do what you want to do, then Antoine is right, the best way is probably to write/read it from a configuration file. But if you're not really sure, why don't you post your code that you've got already, and a description of what you want to happen when. Someone here might be able to find some other way to help you make it work. Quote Link to comment
jgcode Posted September 2, 2010 Report Share Posted September 2, 2010 Here is a quick and dirty way to do it, but it might help you get started in LabVIEW? (I tried to add this as a VI snipped and LabVIEW changed the local variable to a PN with a static reference wired to it! - Weird) Event.vi Code in LabVIEW 8.6 Quote Link to comment
Grampa_of_Oliva_n_Eden Posted September 2, 2010 Report Share Posted September 2, 2010 I'll read "default" value in a way other than the standard def in LV re:default value. If you just want to set those to a specific value when you press the button use an event case that fires from the button and then use locals or property>>> value nodes to set the value. Ben Quote Link to comment
Cat Posted September 2, 2010 Report Share Posted September 2, 2010 If you just want to set those to a specific value when you press the button use an event case that fires from the button and then use locals or property>>> value nodes to set the value. Exactly, which is why I sugested the poster send some code and description of what they wanted to happen, in case the solution is as simple as what you suggest. Quote Link to comment
jcarmody Posted September 2, 2010 Report Share Posted September 2, 2010 (edited) [...] (I tried to add this as a VI snipped and LabVIEW changed the local variable to a PN with a static reference wired to it! - Weird) [...] I don't believe that the Code Capture Tool has those problems. Edited September 2, 2010 by jcarmody Quote Link to comment
Yair Posted September 2, 2010 Report Share Posted September 2, 2010 I don't believe that the Code Capture Tool has those problems. That is correct. The CCT allows you to create snippets without having the locals converted to property nodes. Quote Link to comment
jgcode Posted September 2, 2010 Report Share Posted September 2, 2010 That is correct. The CCT allows you to create snippets without having the locals converted to property nodes. Anyone know if this is fixed in 2010? Quote Link to comment
Yair Posted September 2, 2010 Report Share Posted September 2, 2010 I seem to recall that it wasn't fixed, but that recollection may well be incorrect (whew, got through that sentence. Good thing I'm not Chinese, or I might have some trouble pronouncing that ). Quote Link to comment
Daklu Posted September 2, 2010 Report Share Posted September 2, 2010 CCT >> snippets (Admittedly they serve slightly different purposes. CCT's "auto-save in the temp directory and copy the path to the clipboard" feature is probably the best feature I've ever encountered that I didn't know I wanted.) Quote Link to comment
Ton Plomp Posted September 2, 2010 Report Share Posted September 2, 2010 CCT's "auto-save in the temp directory and copy the path to the clipboard" feature is probably the best feature I've ever encountered that I didn't know I wanted.) How about: "auto-save in the temp directory, upload to a webservice and post the URL of the image to the clipboard" function? Ton Quote Link to comment
Yair Posted September 3, 2010 Report Share Posted September 3, 2010 Anyone know if this is fixed in 2010? It's not, at least not in the RC, which is the latest version I currently have accessible, but it's safe to assume if it's not in the RC, it's not in the release either. CCT >> snippets Can't argue with that. I think the CCT is better even if you don't use its snippet feature. CCT's "auto-save in the temp directory and copy the path to the clipboard" feature is probably the best feature I've ever encountered that I didn't know I wanted I would love to take credit for that, because I agree it's the best feature of the CCT, but I'm pretty sure this existed even in CC's prehistoric version, which required you to drop one VI inside another, kill a goat and sprinkle some fairy dust in order to work. In fact, I believe this feature was the whole point of the initial version. Quote Link to comment
Daklu Posted September 3, 2010 Report Share Posted September 3, 2010 "auto-save in the temp directory, upload to a webservice and post the URL of the image to the clipboard" function? That might be good. I never post images to websites that only accept links because it is such a hassle. I'm glad Lava allows direct uploads. CCT is better even if you don't use its snippet feature. CCT does snippets? I'll have to look for that. which required you to drop one VI inside another, kill a goat and sprinkle some fairy dust in order to work. Phew, I'm glad I never had to deal with that. It sounds manageable, except for the "drop one VI inside another" step. Quote Link to comment
Yair Posted September 4, 2010 Report Share Posted September 4, 2010 CCT does snippets? I'll have to look for that. Sure does, although I definitely can't take credit for that, as I wasn't particularly interested in the feature. The CCT page has some videos demonstrating its use. You can import the snippets in any version from 7.1 or 8.2 and up using a tools menu option or an RCF plugin (respectively), but I'll let Jim point out the location, as he's a lot better at it than I am. 2009 and later let you use the native snippet import. Phew, I'm glad I never had to deal with that. It sounds manageable, except for the "drop one VI inside another" step. OK, to be fair to the original version, I looked and it didn't actually require most of the fairy dust. That came later as more options were added. You can see the process here. Quote Link to comment
Farid2010 Posted September 14, 2010 Author Report Share Posted September 14, 2010 Thank you guys for your comments and sorry for the delay. As some of you suggested to post the code of my question i attached the file. Actually i have 2 problems: 1- I want to use one tab control for numbers 4 and 5 in the listbox so when the user click any of 4 or 5 , the default values of the tab control change. 2- I couldn't make the items in listbox active so when the user click in any of them ( surview,Body,MPR,...) the related tab control shows up and the button next to that item lights up( become yellow). In my example, it only could be done by clicking on the buttons next to the items not by clicking on the written items. Thanks listbox.vi 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.