Jump to content

mike5

Members
  • Posts

    160
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by mike5

  1. Hi all,

    I have a class that has some methods that only need to be called by unit tests. I have defined these methods to be in the community scope, and the unit tests are class friends. So far, so good.

    In another project I have a copy of the library folder (svn:externals), but the unit tests are not needed. If I run a build in this project, I get an error saying that the "unit test" vi is missing, since it is referenced by the lvclass file. And the build fails.

    Is there a way ti make this problem go away, since the class friends are really not needed for the library in question. Nor are they needed by the library consumers. Right?

    Thanks in advance and best regards, Mike

  2. Rant time... (sorry)

    Slowdowns! Damn you...

    Been tinkering away at a project for about a month now, and the IDE has just gotten slower and slower and slower... Simple wire edits take several seconds to execute. This is LV2010 SP1 32-bit on Win7 (64-bit).

    I'm also using LV2010 SP1 32-bit on Win7 64-bit. I have a project with over 500 VIs all neatly packed in lvclasses, and I'm not seeing your type of problems. The only slowdown I see is when I change targets (PC/RT), when the entire project needs to recompile. Besides that I pretty regularly use the "Save all" button on the project, and there is no slow response from that.

    Just a thought - do you "separate compiled code from source file"? I have this marked on all my files - maybe this makes a difference...

    Br, Miha

    • Like 1
  3. 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

  4. IPE may not be on that list. Doesn't look like anyone ever added scripting support for creating that node. If you want to script it, you may be able to work with having a template VI that has nothing on it except an IPE and use copy/paste to copy it to your target diagram.

    I'll file the CAR to add IPE creation support.

    As a workaround, use this:

    post-5877-0-71206200-1310047577_thumb.pn

    Gah! It's there. But yesterday Ctrl+F didn't find it. What was going on yesterday? (It's 2360 btw)

    Thanks again.

    And, for what it's worth, the Style ID for Data Value Reference Control seems to be 3476. :yes:

    Br, Mike

  5. 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

  6. If you're getting a file not found errors, it's usually because of the way relative paths are built. The easiest thing to do is to display that path where LV expects to find the file. This should help in determining why it's pointing at a location other than where the file is.

    Actually in the error I get the absolute path, and it's pointing exactly at the file I'm interested in.

    Br, Mike

  7. It should be pretty obvious by now that I'm trying to create an in-place-structure by hand. Unfortunately I don't know how to create the decomposer/recomoser pair. I found the "Add In Place Pair" method, but I don't know how to specify the type. There is some DPID input without any indication what it's value should be...

    If anyone can help, I'd be eternally grateful.

    Br, Mike

  8. Is there a searchable list somewhere? Because browsing through hundreds of then in a "drop down list" hunting for the one you need is a pain in the neck. Especially when you're starting with this and you don't know exactly what to look for...

    Br, Mike

  9. Hi all.

    I know it's not strictly scripting related, but yesterday I was working with a script which tried to create a Control VI from a template. The script worked well in my development project, but as soon as I copied that script to appropriate location for the "right click menu", I started getting "file not found". The template file was next to my "script" VI.

    Does anyone have any ideas?

    Thank you and best regards, Mike

  10. 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

  11. You can call the Move method on the new control and specify the cluster as the owner. This will move the control into the cluster.

    Do I have ti get the control onto the destination panel first? Or can I just take control from the original file (the typedef CTL file), and then move it into the "private data cluster", and it will just work?

    I don't know if I'm making myself clear....

    Br, Mike

  12. Well, the last step for this round.

    Now that I have a DVR control (in a typedef ctl file), how do I add this control to class private data.

    I've done this (the first vi is from the class.ctl):

    post-17162-0-08087100-1309940057.png

    Now what? Controls[] cannot be changed to "write". There is no method to add a new control. Will I really be forced to create a "new VI object" (as in the example) and replace it with my own control?

    Thanks again and best regards, Mike

    Anyway, I just thought I'd mention. I'm trying to do all this in memory. Nothing is saved yet. Is this even possible. So far I've had zero progress.

    Mike

  13. Well, the last step for this round.

    Now that I have a DVR control (in a typedef ctl file), how do I add this control to class private data.

    I've done this (the first vi is from the class.ctl):

    post-17162-0-08087100-1309940057.png

    Now what? Controls[] cannot be changed to "write". There is no method to add a new control. Will I really be forced to create a "new VI object" (as in the example) and replace it with my own control?

    Thanks again and best regards, Mike

    post-17162-0-08087100-1309940057_thumb.p

  14. 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

  15. Hi all,

    I'm working on some VI Scripting stuff for manipulating classes in my projects, but right at the start I'm having problems:

    how the heck do I get a refnum to a class, so that I can inspect it using properties and such? I tried with Open VI Reference, but I get Error 1059: Unexpected file type. After that I'd need to check all its members, add some new ones (maybe from a template), all such "basic" stuff :)

    I tried searching the net, checked the VI scripting examples, but I just cannot find anything.

    if anyone could help, I'd be eternally grateful.

    Thanks and br, Mike

    Oh yeah, and I'd need to get this from an existing class in file, not create a new one or something dragged on a Block Diagram.

    Mike

×
×
  • Create New...

Important Information

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