crelf Posted January 30, 2009 Report Share Posted January 30, 2009 I have a control on a FP of a running VI - I have a reference to the control - now I want to save a copy of it as a ctl file. There's no "save instrument" method for that I can see for ctl references. Anyone got any ideas? Quote Link to comment
Grampa_of_Oliva_n_Eden Posted January 30, 2009 Report Share Posted January 30, 2009 QUOTE (crelf @ Jan 29 2009, 03:47 PM) I have a control on a FP of a running VI - I have a reference to the control - now I want to save it as a ctl file. There's no "save instrument" method for that I can see for ctl references. Anyone got any ideas? I'll look again but I was sure I did a Save As for one of my VI's. Ben Quote Link to comment
LAVA 1.0 Content Posted January 30, 2009 Report Share Posted January 30, 2009 Here's what I have twittered: QUOTE Here comes the long shot... uhm twitter... Get the control ref, get the variant value, use my lava CR 'Variant to control'. Ton Quote Link to comment
MikaelH Posted January 30, 2009 Report Share Posted January 30, 2009 HI Chris You can use the scripting function Select object and the Copy it and then past in a new CTL file. But the problem is that you are not allowed to copy an object from a running VI, so you have to first take that VI and do a file-copy/"save as" of it to a new name, open that VI and then you can Copy and Past in to a typedef CTL file. //Mikael Quote Link to comment
crelf Posted January 30, 2009 Author Report Share Posted January 30, 2009 QUOTE (Ton @ Jan 29 2009, 04:00 PM) But doesn't that just create a new control with the value of the existing control? I want to save the control itself so I get to keep all the attributes (caption, colors, size, etc). QUOTE (neBulus @ Jan 29 2009, 03:49 PM) Is it possible to use that ref to drop a new control of a new VI and save it as a .ctl? I don't understand that sentance - can you please give it another go? Quote Link to comment
LAVA 1.0 Content Posted January 30, 2009 Report Share Posted January 30, 2009 QUOTE (crelf @ Jan 29 2009, 10:05 PM) But doesn't that just create a new control with the value of the existing control? I want to save the control itself so I get to keep all the attributes (caption, colors, size, etc). Yep, I get what you want. I don't think this can be done in a truly fully generic way programmitically. The routine 'Right Click->Advanced->Customize->{(Strict)TypeDef}->Save' is what you need. I've got a feeling that this is not possible. One could write xml/ini based solutions but they are tight to control types. Would make a wonderful class routine. Ton PS, learn how to ask questions on twitter in 160 characters...your initial question seemed so much simpler Quote Link to comment
Grampa_of_Oliva_n_Eden Posted January 30, 2009 Report Share Posted January 30, 2009 QUOTE (crelf @ Jan 29 2009, 04:05 PM) ....I don't understand that sentance - can you please give it another go? No, MichaelH said what I was thinking but actually knew what the complication was. I'll pretend I inspired him. Ben Quote Link to comment
Francois Normandin Posted January 30, 2009 Report Share Posted January 30, 2009 QUOTE (crelf @ Jan 29 2009, 03:47 PM) I have a control on a FP of a running VI - I have a reference to the control - now I want to save a copy of it as a ctl file. There's no "save instrument" method for that I can see for ctl references. Anyone got any ideas? http://lavag.org/old_files/monthly_01_2009/post-10515-1233264886.png' target="_blank"> EDIT: Now that I read your original post carefully... you have a reference to an existing control. I wonder if it's as easy an shown. I'll check quickly and come back. EDIT 2: OK. I should have checked Ton's VIs. Mine looks like a very rudimentary version of his. I guess if it didn't do it, I'm off too. Quote Link to comment
Norm Kirchner Posted January 30, 2009 Report Share Posted January 30, 2009 If I had to do it I would like to do it like this Quote Link to comment
Francois Normandin Posted January 30, 2009 Report Share Posted January 30, 2009 Like this perhaps? I'd just found it when I saw your post!!! It's in the Scripting Workbench for those who wonder... Quote Link to comment
crelf Posted January 30, 2009 Author Report Share Posted January 30, 2009 Once again, all the folks on LAVA prove their worth (and thanks also to those who came to my rescue through twitter!) It was the unnamed method that I was looking for: QUOTE (Ton @ Jan 29 2009, 04:09 PM) PS, learn how to ask questions on twitter in 160 characters...your initial question seemed so much simplerUnfortunately I use twitter4skype and it doesn't limit the number of chars I can type, so I often get cropped - sorry about that Quote Link to comment
Aristos Queue Posted January 30, 2009 Report Share Posted January 30, 2009 QUOTE (crelf @ Jan 29 2009, 02:47 PM) There's no "save instrument" method for that I can see for ctl references. That's because a control is not an instrument. A *control VI* is an instrument, and those you can save. To highlight the difference, let me point out that you could open a VI reference to a control VI and then get a control reference to the single control on that VI's front panel. A control reference is always to a part of a VI, which is not a file in and of itself. QUOTE (crelf @ Jan 29 2009, 04:44 PM) Once again, all the folks on LAVA prove their worth (and thanks also to those who came to my rescue through twitter!) It was the unnamed method that I was looking for: You could also use methods for Copy Selection / Paste Selection to copy the control from one VI to another blank VI and then save that blank VI. Quote Link to comment
crelf Posted January 30, 2009 Author Report Share Posted January 30, 2009 QUOTE (Aristos Queue @ Jan 29 2009, 06:06 PM) That's because a control is not an instrument. A *control VI* is an instrument, and those you can save. Right - that's what took my brain a few minutes to comprehend QUOTE (Aristos Queue @ Jan 29 2009, 06:06 PM) You could also use methods for Copy Selection / Paste Selection to copy the control from one VI to another blank VI and then save that blank VI. Someone else mentioned that (twitter conversation?) - can you throw together a quick example of using those methods if you've got the time please? PS: when are you going to get yourself on twitter? Quote Link to comment
Norm Kirchner Posted January 31, 2009 Report Share Posted January 31, 2009 Something like this Chris? Quote Link to comment
Darren Posted January 31, 2009 Report Share Posted January 31, 2009 QUOTE (crelf @ Jan 29 2009, 05:51 PM) PS: when are you going to get yourself on twitter? I tried describing Twitter to AQ at either the Norm lunch or the JKI lunch (can't remember which...they were both at the same place, with some of the same people) and I got confused looks and rolled eyes. I'm guessing we won't see him on there anytime soon... -D Quote Link to comment
crelf Posted January 31, 2009 Author Report Share Posted January 31, 2009 QUOTE (Darren @ Jan 29 2009, 10:44 PM) I tried describing Twitter to AQ... and I got confused looks and rolled eyes. I'm so despondant - I thought AQ was one of the cool kids QUOTE (Norm Kirchner @ Jan 29 2009, 10:44 PM) Something like this Chris? Oh - yeah - that was going to be my fall-back. Thanks Norm, but I'm glad that the "Create From Reference" method exists. 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.