Jump to content

Darren

NI
  • Posts

    622
  • Joined

  • Last visited

  • Days Won

    66

Posts posted by Darren

  1. If you read the VI Name property of a subVI and it returns error 1099, then it's a missing subVI. At that point, you could read the Label.Text property of the subVI to get the name of the missing VI being referenced. To my knowledge, there is no way to retrieve the fully qualified name of a missing subVI.

  2. Darren, it's a shame the 'Read Icon Data from VI.vi' is password protected, as I'd like this functionality for LV 2010 onwards (as well as the corresponding 'Write Icon Data to Vi.vi' of course :-).

     

    There were changes made to the Icon Editor in LabVIEW 2012 to facilitate the addition of the LabVIEW Icon API. Thus, I don't suspect the shipping API in 2012 could be easily ported to past LabVIEW versions. Instead, you can check out the community version of the Icon Editor API here.

  3. If I need the *value* of the variant, and I know it's an arbitrary simple numeric type, I'll always just cast it to an EXT with Variant to Data and go on my way, because I don't really care what specific numeric type it is. But if I need the *type* of the variant, I'll use the VariantDataType VIs (located in vi.lib\Utility\VariantDataType) because they give me that handy type enum. Since I've long-established that dichotomy for about a decade now, I guess that's why I never thought to do the error cluster type check your way.

  4. This seems like a good CAR to file. Filed as CAR #377978.

    Thanks for filing the CAR, Stephen...this thread fell off my radar.

    Is this a CAR for the Delete From Array? I sure wish we had visibility into the CAR database...

    Yes, Stephen CARed the Delete From Array performance issue.

  5. > ...I once needed to know if the output terminal of a compound arithmetic node was inverted, a small oversight in the scripting properties...

    For those that are curious, this scripting deficiency has been reported to R&D as CAR 197239, and is slated to be fixed in the next LabVIEW release.

  6. I have no current plans to write such a wizard. But if the demand is there, we'll look into it further. A few weeks ago I created a new sample project for a colleague as a proof-of-concept, and it only took me a couple of minutes to construct the XML for it. Since I didn't need to customize the second page of the wizard, that's all I needed to do. Granted, I'm already familiar with the XML tags, so I understand it might take a bit more work for someone creating content for the first time.

    I do recognize, though, that creating a customized second page is non-trivial. Our working assumption so far has been that customizing the second page is not something people will be doing that often. If it turns out to be a much more common use case, then I agree we will probably need something more automated, or perhaps a more documented template, to start that process. The current approach is to read the webpage you mentioned, and use the Actor Framework's custom second page code as a starting point.

  7. If you already have a project that you want to appear in the dialog, and you don't need to customize the second page of the wizard, then the XML is all you need, and you can start with one of the shipping XML files in [LabVIEW]\ProjectTemplates\MetaData and modify your copy with your project's specific information. If you do need to customize the second page, then yes, there is more work to be done, but you can start with the Actor Framework's customized second page code (referenced on that webpage) and modify it for your project.

  8. 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
  9. 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

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

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

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

×
×
  • Create New...

Important Information

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