Jump to content

Create Data Value Reference control


mike5

Recommended Posts

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

Link to comment

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

Link to comment

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.

2011-07-06_0821.png

Link to comment

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

Link to comment

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.

Link to comment

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 :blink: 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

Link to comment

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

Link to comment

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.