Jump to content

Darin

Members
  • Posts

    282
  • Joined

  • Last visited

  • Days Won

    37

Posts posted by Darin

  1. Clearly the fact that Shaun's code stubs the TypedefInfo Constant into the first Case Structure makes a huge speed impact. :cool:

    Actually, the two things that jump out at me are that the LV version stubs the variant as opposed to passing it through with the control and indicator on the root diagram like Shaun does (doubt it makes a difference on small items though), and that Shaun configures the CLFN to use any thread, perhaps the LV one uses the UI thread and this takes its toll (pesky default behavior).

  2. Ah ha! I had a quick look for that event, came up empty, and went home confused. Thanks for the clarification.

    Most of the time the Context Help says PRIVATE: blah blah blah, but not in this case. I'd be (even further) into hack-town if it weren't for a few of those events.

    So, I can make a change to the ini file, and that event will become available in the menu? What's strange is that the mod worked in my version without me doing any hacking.

    Yes, kind of funny that way. A lot of built-in stuff uses those methods and events, and with some of this power comes great responsibility. You could try using Dynamic Event Registration, wrap the Reg Events Node inside a locked subVI, and then feed the refnums into the Event Structure. This would give access to the Event on any machine while sequestering the private bit.

    post-26690-0-68435900-1326318864.png

    Then clean up the names a bit using a bundle function:

    post-26690-0-04018900-1326318985.png

    • Like 1
  3. My reply on the "dark side" accidentally pointed you towards a "super secret" private event that seems to do the job with minimal hacking. To learn more about them I suggest you read the pinned post in the Lava Scripting page, and then read about the required ini key here:

    http://labviewwiki.org/LabVIEW_configuration_file/Miscellaneous

    Some properties and events are private for very good reasons, others for more mysterious reasons. I would use them with caution, but I have not had problems with this particular one.

    Disclaimer: If your computer catches fire, you didn't hear about this from me.

  4. I am hesitant to use the DDS in situations involving optimization. For reasons beknownst to NI it imposes artificial dataflow and the form factor of the different cases seldom lines up giving me awkward looking code.

    During the trial and error phases, the DDS is invaluable, no need to leave evidence of my mistakes. I do like to use it to hold code used to generate lookup tables though. Of course in this case the G code serves as a comment, a nice graphical comment as nature intended.

  5. Two separate issues here. In the Trim Whitespace example, the documentation for the user is excellent IMO. The comments for the code are what I was referring to. Sometimes it is hard to appreciate that certain things are done deliberately, such as Reverse Array on the root diagram, or in ShaunR's version the constants being inside the Loop and not outside. Optimization and obfuscation are often close cousins in LV.

    As to reading G I suggest some immersion therapy. I find text distracting outside of terminal labels. A good way I find to achieve immersion is to be too lazy to add text comments.

  6. Wow, I head slapped myself silly after seeing that image, especially since that little piece of code was my modest contribution. I completely agree about OpenG showing best practice and all, I strongly disagree that this level of documentation is best practice.

    Looking at the original thread, the first suggested code was slightly more complex. I thought I would see if it was faster than the completely obvious method. It turns out no. Had the more complex code been faster, as it often can be, that would have been worth a comment.

    My usual philosophy is that well-written G is self-documenting, and adding text comments is like writing the letters of the notes on sheet music, unnecessary and redundant. A picture is worth a thousand words, this makes it seem like a picture requires a thousand words.

    If I were to add a comment, it would be that I benchmarked and the simple code turned out the fastest with quick descriptions of the alternative. If I see code like that, I don't question what it is doing, I usually want to know why. If I comment "slightly faster than byte array method", that could save my future self more time than "looping over characters in the input string".

    Again I agree with the spirit of Jim's comment, I'd simply look for a better example. I know that I am text-averse on my BD so my code is fertile ground for lessons in commenting. I'd suggest my Trim Whitespace code as needing a few more sticky notes and not this one.

    • Like 1
  7. Just make darn sure that the grounds are isolated from the computer/USB ground. And if you are using it on a laptop which is not plugged in, make sure you know what you are connecting to.

    Other than that, I look to get as much bandwidth and as many bits as I can afford. I have looked into the BitScopes before and they would have been my choice at the time.

  8. Of course the sample questions are skewed and slightly screwed up to begin with. Let's add a philosophical question. Assume you know the truly correct answer, and that it is different than the one you assume NI is looking for. Do you mark the correct answer on principle and lose the points, or do you choose the answer NI is looking for?

    I usually choose the former, but I am also inclined to rouse rabble. (If I ever found myself taking the CLAD I'd also like to think that one or two questions would not be making a difference).

  9. I should probably have mentioned since I often forget that I did not have to buy my iPad. Having used it and enjoyed it for a long time now, my original sentiment still applies, I would not have paid for one then and I still would not. It is at least twice the price that feels right for its functionality. Cost aside, it does not disappoint, however.

  10. iPad/iPhone owner:

    * No Flash support

    Is this really a problem, how much do people miss it, I suspect I will not be able to see NI live webcasts, but could I see the playbacks and the other good stuff NI put out. How about VI shots.

    If you have very specific sites in mind, this could be a pain. Much of the web has now acquiesced to Apple and provides iPad specific sites or iPad compatible content. Plenty of Flash-free content out there. A big exception used to be the NI forums, but you can now reply without resorting to raw html. Missing Flash is like missing .NET functions in LV for the Mac. Potentially nice and useful and all that, but there are usually better and more platform agnostic ways to go. I must be drinking the Kool-Aid since I consider "Flash Content" to be an oxymoron. Skyfire provides a kludge to handle some Flash video content if you are truly desperate.

    As for VI shots, I have not tried, but he calls it a Podcast so I'd suggest a gentle flogging if it did not work on the iPad.

    * No separate users accounts

    Whatever I get, I know I will not be able to keep it to myself, both wife and daughter will want to use as well, however I will have work related documents emails etc., and there seems no easy way separate this stuff.

    By all means let your wife and kids play with it. Soon enough they will want their own. Just give them a page or two to fill with Word World apps and what-not. You can separate email accounts, but not really prevent access. My wife is happy to use a Web interface to get her email, secure and easy on the iPad. You can easily skip the Mail app if you'd like. For document management I use DropBox, it is password protected and easy to keep in sync.

    Finally is the Ipad2 OK with pdf

    Built in functionality works for me, Avagadro's Number of apps available if necessary.

  11. It's Friday, so what the heck? Without taking up that much more space (in most cases) than the icon view you can give me some really useful information and capabilities on the BD. Certainly clears up the FP/BD relationship. I would use this in a lot of subVIs and totally bag the FP. Drop an indicator, choose the Control view and forget about probes.

    post-26690-0-89577500-1319825582.png

    • Like 2
  12. There is a way, I'll post my code later when I get to my machine. The steps I take are as follows: Save a VI which contains only a simple placeholder PNG image. I use this as a template, and with some vi.lib gems I replace the MNGI block with new PNG data. Conventional scripting fixes the size of the decoration leaving a subVI with the desired PNG on the BD. I then place this SubVI on the target BD and inline it. Easy peasey. Attempts to paste images conventionally result in bitmaps.

  13. I always enjoy this discussion. First of all, no need to feel bad for James. If you follow the other discussions, you know if anything happens he will have the last laugh.

    If you have OCOOD (obsessive compulsive OO disorder), then it is likely you also suffer from I-have-two-primitives-wired-together-here-better-create-a-subVI syndrome. This results in a lot of time spent with the icon editor and plenty of whitespace to fill with terminals. I do not mind the iconified terminals so much in that case.

    Most times I worry more about blazing speed than reuse, so I have a dense coding style. My biggest problem with the icon view is that they take a lot of space and give little information back in return. Do I really need to see a little stop button icon when I am wiring to a boolean labelled Stop?. The exceptions are XControls, Graphs and Charts, I tolerate icons for those (when I give a darn, which is not often).

    I don't use express VIs often, but when I do I always change them to the icon view and remove the caption. Probably to save on block diagram space.

    I once submitted an idea to provide an option to de-Expressify the Express VIs so I could drop them in peace (no popup, icon view, no caption) but it was shot down in flames. Fortunately I only use two of them so I settle for Merge VIs on the palettes.

    Speaking of Express VIs, I will say that I see more use in the Block Node View of SubVIs than I do in the Icon View of terminals. Of course by that I mean epsilon > 0.

×
×
  • Create New...

Important Information

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