Jump to content

Darren

NI
  • Content Count

    579
  • Joined

  • Last visited

  • Days Won

    48

Posts posted by Darren

  1. Eek! I really hope this isn't true anymore.

    Crap, it looks like it is. :( In my benchmarks in LabVIEW 2012, it looks like the Delete From Array "trick" is about 30 times slower than using Index Array.

    Oh well, I guess I won't use that trick anymore. Thankfully, Jarrod's Create Place VI Contents VI shortcut for Quick Drop made it really easy for me to add a shortcut to drop this code snippet instead:

    post-4441-0-72857800-1349730963.png

    • Like 1
  2. The method I always used to get the last element in an array is the "Delete Element From Array". If you don't wire anything to the index, or length, you get a scalar of the last element in the array as the "Deleted Portion".

    As you mention, it is in the online help for the function. We also try to indicate this behavior in the Context Help for Delete From Array:

    post-4441-0-58210100-1349719267.png

    The fact that "last elem" is in parenthesis indicates that this is the behavior when you leave the index input unwired. If this isn't discoverable enough (which I'm thinking may be the case if people are writing VIs to do it), then how could we make it more obvious? I use this behavior of Delete From Array all the time...in fact, I may use Delete From Array just to get the last element of a 1D array more than I use it to delete stuff... :P

  3. Also check out this VI.

    <LabVIEW Dir>\vi.lib\Utility\traverseref.llb\Traverse for GObjects.vi

    Traverse for GObjects.vi is available in Quick Drop/the palettes, so it's documented. It helps you find all the objects of a particular class within an arbitrarily nested panel, diagram, or object. As for finding a specific object with a specific label, there's a VI for that too, although it's not documented...check out <LabVIEW Dir>\vi.lib\Utility\traverseref.llb\TRef Find Object By Label.vi. This VI wraps Traverse for GObjects.vi with extra code to do the label matching. Let me know if y'all have any questions about either of these VIs (or any of the other goodies in traverseref.llb, for that matter).

  4. The only way I was able to get the "strict" control references was to create a control reference control, right-click it and choose "Include Data Type", then create a constant from that strictly-typed control. In general, I only use "include data type" when I'm dealing with a control that can have different data types (like a listbox, which can be a scalar or an array), and I want to make sure that the VIs I have that may operate on the value of that control will only accept a strictly-typed reference.

    I should also point out that the easiest way to get a control reference control of the correct type is to drop a Control Reference from Quick Drop/the palettes, then drag a control into the control reference to define its type. I'm pretty sure that's how I created the control references for the QMH template.

  5. The risk with a system like this is that it is very easy to end up with the queue communications embedded within your code modules. This can reduce the reusability and scalability of your application so I prefer wiring the reference, especially as 3 of your functions just wrap queue primitives anyway.

    Yeah, what he said.

  6. Remove Frame is a method of the MultiFrameStructure class. Since there's currently no mechanism in VI Server to hide parent methods in child classes that don't implement them, we see it in the list, but get an error that it doesn't work.

    I've complained about the lack of scripting support for the Event Structure for years. Everybody reading this thread really needs to go kudo this idea.

  7. I never noticed the Defer Drawing before, but I have an educated guess as to its purpose - the FP has a defer updates property which is useful when you want to make a lot of updates in sequence, but have them appear as a single update, either for speed or for elegance. I'm assuming this is a parallel property which was designed for scripting - if you want to make a lot of scripting operations, you don't want to waste time on drawing all the intermediate steps.

    I'm not sure why this is in the Application class and not in the Top Level Diagram class, but that's possibly because it's expected you would edit more than one VI or because of implementation details or because it's for something else entirely.

    There's already a private 'Defer Diagram Updates' property on the TopLevelDiagram class. I have no idea what the App.Defer Drawing property is used for.

  8. Could you post a screenshot of the menu or whatever else it is you use to customize that? It's not like it would give us access to any features NI doesn't want us to have, just satisfy my curiosity about that kind of thing.

    No, I can't post a screenshot. Your curiosity will have to be satisfied with "a certain way we can configure the UI to make controls generic". :)

    • Like 1
  9. The "wider LabVIEW audience" doesn't include all the l33t h4xx0rz talk on this thread, so don't expect any of the DFIR compilation or Licensing stuff to ever become public. :) Keep in mind we need to run any public/scripting VI Server stuff through rigorous documentation and testing before releasing it to a wider audience. As has been mentioned multiple times by myself and AQ in the past, something is private usually because it's been designed and used for one specific use case, with no other cases really documented or tested.

    Now, Get Shell Icon of File, on the other hand, I could see being useful to the general public. I'll put that on my list to advocate for LabVIEW 2013.

  10. You can right-click on the top-level project item and choose "Find Items with No Callers". This should generally do what you want, with a couple of caveats:

    1. Your top-level application VI(s) will be listed, so ignore those.

    2. Items in Dependencies will be listed. "How is something with no callers in my Dependencies list?", you may ask. Well, unfortunately, if there is a library in your Dependencies, then any VI in that library that you don't call in your code will be listed in the "Find Items with No Callers" results. I've been meaning to add an option to that dialog to ignore Dependencies for years, but I haven't gotten around to it.

×
×
  • Create New...

Important Information

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