mike5 Posted July 5, 2011 Report Share Posted July 5, 2011 I'd like to create a typedef control, which contains a data-value-reference of a chosen typedef control. I', still searching through the enum for "New VI Object", but I have a feeling it's not "easy as pie".... Thanks again, Mike5 Quote Link to comment
Francois Normandin Posted July 5, 2011 Report Share Posted July 5, 2011 It is not in the list. You can use the "Create from Reference" method to generate a DVR of generic datatype, then replace the element to the desired datatype. From your previous question on LVCLass, I assume you need a DVR from a class... Quote Link to comment
mike5 Posted July 6, 2011 Author Report Share Posted July 6, 2011 Thanks. While waiting for an answer I tried another approach - a Control template with a DVR inside. Then I replace the datatype as well. And to answer your other question - not a DVR to a class, but a class has "private data" cluster, and I need a reference to that, so that I don't end up with multiple disjoint versions of a single object. And since creating a DVR by hand is quite a pain, I needed to come up with some scripting. Now comes the fun part - creating getters and setter to access the members of "private data". I also intend to do that with templates, unless someone has a better idea... Br, Mike Quote Link to comment
Francois Normandin Posted July 6, 2011 Report Share Posted July 6, 2011 Now comes the fun part - creating getters and setter to access the members of "private data". I also intend to do that with templates, unless someone has a better idea... Br, Mike Actually, I might have something for you as well... lava_lib_lvclass_api-2.0.0.15.vip Try this version of LVClass API. It is not for immediate release to the CR because I haven't had time to fully test it myself (especially the "Copy Library" function), but the basic functions are stable. Check the "Private Data" Subpalette. Quote Link to comment
mike5 Posted July 6, 2011 Author Report Share Posted July 6, 2011 Thanks. I'll check it out. It seems like I finally got it working with your code for "create" DVR from VI control. Then I create a "new VI object" in the private data control and "replace" it with my new control. I am forced to save everything in the process, but I think that is alright. Anyhow, I'll probably not touch it (if it works, don't fix it ), unless I find something really attractive in your code... Thanks foir your help anyhow. Mike Quote Link to comment
Aristos Queue Posted July 8, 2011 Report Share Posted July 8, 2011 Ever get the sense that the scripting API is a hodge-podge of features that we built as we needed them for our own internal needs and then released to the public because users said having it was better than nothing? If you do, that's an accurate feeling. :-) If it's any consolation, we have a couple guys who have been spending the last couple years polishing on it, and they continue to work on it more. Quote Link to comment
mike5 Posted July 8, 2011 Author Report Share Posted July 8, 2011 Ever get the sense that the scripting API is a hodge-podge of features that we built as we needed them for our own internal needs and then released to the public because users said having it was better than nothing? If you do, that's an accurate feeling. :-) If it's any consolation, we have a couple guys who have been spending the last couple years polishing on it, and they continue to work on it more. Oh, I know all that. What's frustrating is, that you know you should be able to do something, but to actually accomplish it Sometimes it feels like it's been designed by a blind fellow (no insult to visually impaired intended), or by a genetic algorithm, or by throwing darts... At least to someone fairly new to it, like me. Mike Quote Link to comment
Black Pearl Posted July 8, 2011 Report Share Posted July 8, 2011 Now comes the fun part - creating getters and setter to access the members of "private data". I also intend to do that with templates, unless someone has a better idea... I'd say templates are the way to go with VI scripting. And copy/replace operations. If you need to create things completely by code, you need to write a lot of code. And most of the time 'useless' code just to make the created code look nice (minimizing wire bends). You can take a look at my latest project here. I think about 50% of the scripting-related code is just to get the wires redrawn as they were before. Felix Quote Link to comment
mike5 Posted July 8, 2011 Author Report Share Posted July 8, 2011 I'd say templates are the way to go with VI scripting. And copy/replace operations. If you need to create things completely by code, you need to write a lot of code. And most of the time 'useless' code just to make the created code look nice (minimizing wire bends). You can take a look at my latest project here. I think about 50% of the scripting-related code is just to get the wires redrawn as they were before. Felix Yeah, thanks. I had some unfathomable issues with creating stuff from templates, but it works now. So now I am writing the code the way you are suggesting. Br, Mike 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.