Jump to content

Norm Kirchner

NI
  • Posts

    823
  • Joined

  • Last visited

  • Days Won

    25

Posts posted by Norm Kirchner

  1. When working with code that uses LVOOP property nodes, debugging becomes difficult because there is no easy way to go to the accessor code that runs when the property node executes.

    So in order to alleviate this I created the Property Popper.

    1. Run this floater helper VI (leave running during development)
    2. When you want to get to an accessor, select the property node
    3. Click 'Get Properties' on Pop Property.vi
    4. Double click on the property you want to get accessor access to

    Enjoy

    ~,~ The Captain was here

    See Video Detailing this

    <!-- copy and paste. Modify height and width if desired. -->

    <object id="scPlayer" width="892" height="708" type="application/x-shockwave-flash" data="http://content.screencast.com/users/NJKirchner/folders/Jing/media/e7471e93-bf0b-4801-b050-8e7c58d7a0fc/jingh264player.swf" >

    <param name="movie" value="http://content.screencast.com/users/NJKirchner/folders/Jing/media/e7471e93-bf0b-4801-b050-8e7c58d7a0fc/jingh264player.swf" />

    <param name="quality" value="high" />

    <param name="bgcolor" value="#FFFFFF" />

    <param name="flashVars" value="thumb=http://content.screencast.com/users/NJKirchner/folders/Jing/media/e7471e93-bf0b-4801-b050-8e7c58d7a0fc/FirstFrame.jpg&containerwidth=892&containerheight=708&content=http://content.screencast.com/users/NJKirchner/folders/Jing/media/e7471e93-bf0b-4801-b050-8e7c58d7a0fc/2012-01-10_1033.mp4&blurover=false" />

    <param name="allowFullScreen" value="true" />

    <param name="scale" value="showall" />

    <param name="allowScriptAccess" value="always" />

    <param name="base" value="http://content.screencast.com/users/NJKirchner/folders/Jing/media/e7471e93-bf0b-4801-b050-8e7c58d7a0fc/" />

    <iframe type="text/html" frameborder="0" scrolling="no" style="overflow:hidden;" src="http://www.screencast.com/users/NJKirchner/folders/Jing/media/e7471e93-bf0b-4801-b050-8e7c58d7a0fc/embed" height="708" width="892" ></iframe>

    </object>

    pop property.vi

    • Like 2
  2. John,

    I'm glad that you are questioning this methodology.

    First I would strongly recommend that you review this well written Field Architect blog about this very topic.

    There are many many skilled LV developers that have either based their entire architecture on this tactic or used it as a staple of their programs.

    These are actively running programs, and I would say there is no doubt as to the validity of this approach.

    However! There are many drawbacks and caveats and I truly believe that this practice of coding represents a style which in the future we'll look back like we look back at finger paintings from grade school (cute, simplistic and far from a desirable design)

    Personally speaking, I was bitten VERY recently when another developer used LV2 style globals and never took into consideration the idea of needing two of the same thing.

    What ended up happening when another of the same thing was needed, was that a developer just copied 'all VI' and appended a '2' to the end of the file names so that he could have 2 of the same thing. If chills didn't just run down your spine....you may want to think about that implication in a very large application.

    I'll avoid putting all my comments from the blog into this reply, but long story short, there are emerging ideas/techniques/frameworks that will help you accomplish your large application with a much more Scaleable, Modular, Reuseable, Extensible and Simple (SMoRES) .

    If you have the chance to start a design from scratch and don't need to inherit someone else's choices, I would highly recommend taking this chance to implement a LV2-Global free design and move to LV 2011 instead of '2'

    • Like 1
  3. WARNING! With regards to placing an event registration node inside of a sub-vi or saving the reference in a class.

    An event registration reference can be used once and only once. Also I wouldn't put too much untested faith in the idea that each time a sub-vi runs w/an event reg node in it, that the executions of that node will be wholly unrelated.

    Although not the vector of this thread I felt it critical to mention at this juncture. I'm not saying don't do it, just test it thoroughly.

    And for my 2cents on the topic, since most destroy typed ref methods spit out a data type of that type, the destroy method on a non scope allowed vi on a class should cause a broken arrow.

  4. *Disclaimer* So far from a full implementation, but I wanted to get this into the wild to let you all have fun with it.

    I ran into a situation that pissed me off recently.

    I had a tab control that had a different graph on each tab. This tab was in a pane that I wanted to be re-size-able.

    Since LabVIEW does such a shitty job at helping us with this, I made a 'Brat VI' to help me with the process.

    Attached you will find the Brat and a piece of demo code.

    Basic assumption and requirements

    *Tab is not set to auto-grow (I don't handle shrinking tab and auto grown will cause tab to not maintain size w/ pane)

    *Tab is set to size with pane

    * Types of controls that are resized are currently limited, string, graphs, sub-panels, decorations, boolean (because I use the 'Many Cast' design pattern, adding more is not a difficult task)

    * Because this maintained sizing will only work while the VI is running, the Brat is bi-modal in a "Use cached Margins" or "use Saved margins" mode (see video for rational)

    ============

    Basic operation and program flow ---> http://screencast.com/t/jqxWeqwxHcY

    Beyond getting started & caveats ---> http://screencast.com/t/iCDdQgPhJuDs

    How it would look & more features ---> http://screencast.com/t/S7Pm47JiD

    More features and use cases ---> http://screencast.com/t/W4uhAQY4HpbE

    How to start from scratch ---> http://screencast.com/t/JVOrc503

    Tab Resize Tool (2).zip

    ============

    Comments and ideas are welcome (but only if they come w/ good suggestions as well)

    ~The Captain Was Here

    PS ManyCast Design Pattern (used within) http://lavag.org/top...sts/#entry77999

  5. Is this a situation in which you only ever want to call the parent VI?

    If so, then just don't make that VI for the child.

    If, as you state " I want to force the child to call the parent method"

    Assuming that you want to selectively call the parent or the child, then you need to have and input to the VI that declares which one to call.

    Then from within that VI, take that input and either exectute what the child has for code in one case, or within the other case call the parent function using the 'Call parent method' primitive.

    This will give you exacly the type of behavior that your wanting, you just need to add an input to the function, or add a piece of private data to the parent and then call a function that sets that value, then within the function your trying to selectively choose, read that value and do the same kind of selective execution of code as mentioned above.

    Best

    ~,~

    • Like 1
  6. Thanks for the help, everybody. I got it working

    Dachenday,

    As a very appropriate thank you and smart thing to do, (if it's within the terms of the agreement between you and the company) would be to share your code here or on NI.com so that any other people like yourself that need this information don't have to go through the same pain you did.

    my $0.02

    ~,~

  7. If you have USB serial converter pop up, it sounds likely that you have a COM port show up on your system as well.

    Download a program like Serial Monitor to see what traffic might be going through your PC or how the port is setup for the device.

    http://www.hhdsoftware.com/

    Not sure if it's still free but I have an old version I could post if need be.

    Once you get the settings you might be able to sniff enough shit off of it to figure out what it ate last night.

    Good luck,

    ~,~

  8. If you have USB serial converter pop up, it sounds likely that you have a COM port show up on your system as well.

    Download a program like Serial Monitor to see what traffic might be going through your PC or how the port is setup for the device.

    http://www.hhdsoftware.com/

    Not sure if it's still free but I have an old version I could post if need be.

    Once you get the settings you might be able to sniff enough shit off of it to figure out what it ate last night.

    Good luck,

    ~,~

  9. PreReply note, don't presume that the people reading will have the driver or the knowledge of how the driver operates.

    That being said, are you sure that you can run 2 at the same time with that driver?

    Sure you might be able to code it up, but sometimes people don't think about the obvious, like doing the same thing in parallel.

    And to your point of it looking like your controlling both, when I look at the code, I see you controlling each independently. the only thing tying both together is the SetPositionOffset method.

    And if I presume anything about that method and the behavior that your describing, then it's not the method you need to be calling.

    Perhaps if you want to call both at once you need to use the GetPosition method on the second one.

    <a href="http://content.screencast.com/users/NJKirchner/folders/Jing/media/ddc19c30-b098-4476-9f00-17066785f95f/2011-07-29_1531.png"><img'>http://content.screencast.com/users/NJKirchner/folders/Jing/media/ddc19c30-b098-4476-9f00-17066785f95f/2011-07-29_1531.png"><img class="embeddedObject" src="http://content.screencast.com/users/NJKirchner/folders/Jing/media/ddc19c30-b098-4476-9f00-17066785f95f/2011-07-29_1531.png" width="660" height="502" border="0" /></a>

    Good luck

    ~,~

    The Captain

  10. If memory serves correct, the only control type you can drop into, from windows, into a running front panel, is a path control.

    I have heard stories and done a quick POC that will allow you to use an invisible path control brought up in front of the thing you want to drop into, catch the drop into the path, then modify the thing that you wanted to have effected by the drop.

    So it's a little hook and crook, but I know it's been done in a variety of very well done front panels.

    I think the guys @ JKI do that w/ VIPM

    ~,~

    The Captain

  11. I'm taking recommendations for clean and dirty LV limericks.

    Somewhere there is a video from last year and that list.

    I doubt i'll be able to outdo that list so I'm counting on you guys to, if not give full limericks, then at least give me a few boiler plate ideas. PM me so we all don't see them ahead of time.

    <object width="640" height="390"><param name="movie" value="

    name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="
    type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"></embed></object>
  12. other than the code may not be very professional looking.

    It's not all about the professionalism of things (although that is part of it in certain cases). Sometimes, most times, they are accessing some of these hidden properties or methods or even calling into custom made dll that were created for a very very unique case but could be ab-used.

    Don't get me wrong, I would love to open it all up, I've even been known to blurt out things that might or might not sound like passwords in the middle of the NI-week BBQ, but I also know the AE's that would need to help someone like GB119 who isn't as understanding and blames LV for things crashing when it's really something they've caused.

    Personally I'd rather have the AE's limited bandwidth dedicated to learning RF ;)

  13. I'm afraid you're at the mercy of the company and their response.

    Assuming you still want to work with the loadcell wirelessly, then unless the company made an API to work with their transceiver (which sounds doubtful at this point) you're out of luck.

    It sounds like your only hope would be if the company designed the transceiver to look like a COM port to the PC.

    What do you see show up in device manager when you plug it in?

    ~,~

    Norm Kirchner

    The Captain

  14. I don't know exactly how this works.

    Well, I would recommend checking out ni.com/jobs for starters wink.gif

    There was a good reason scripting wasn't released for a long while (and some not so good).

    But the basic premise is that if we let loose all the hidden stuff, the likelyhood of you shooting yourself in the foot would increase drastically and even if that wasn't the case we would have to support you through trying to figure it out or unfiguring out how to do something.

    I know this my not be NI's official response, but I've never been very official anyway.

    There are things, to get access to all the passwords and hidden stuff, you need to be in the tower.

    Until then, it's up to the community to figure out how to hack into hidden/non-released features as possible and in doing so, support themselves. IMO it's a good natural filter.

    So to answer your question better, there is no magic key, and your best bet is to keep a close eye on LAVA

    Best,

    ~,~

    Norm Kirchner

  15. Yep, so there is 2 conditions for a character to be replaced with * :

    - 5 seconds without activity (the parallel timer vi deals with that)

    - a new character is entered (the facade vi would then stop the timer vi via dyn event or occurrence or notifier or whatever)

    Cheers

    Gentlemen, don't be fooled into thinking that process will be easy.

    Unfortunately there is no easy way to kick an XControl alive to receive an event without interacting w/ it's front panel interactively somehow.

    Technically the XCtl code goes practically idle until one of the 'Official' XCtl events gets fired.

    You can register user events into the panel till you're blue in the face, but the facade won't wake up untill there is some other kind of interaction w/ the panel.

    And even then the panel won't be registered for the events that were already fired because the Event Registration Refnum will have gone invalid.

    fwiw, I hope you prove me wrong, but that's just one of those rough edges to the XCtl

    ~,~

  16. Count me in, and I guess I'm being DNatt's ticket gofer and +1 him too.

    Same place again eh? We starting a tradition or getting lazy?

    ~,~

    US Fed gov't shutdown. But, there's yet another Continuing Resolution, so I have a paycheck for at least another week.

    Otherwise I'd be traveling to Michigan looking for a LV job. :P

    Michigan??!!! Pfffft, Austin baby, Austin

  17. but my fabulous search skills turned up zero.

    Lava Search sucks

    Can you give me a two sentence overview of what it does?

    LVx provides a pipe into any LV program (LV EXE, Async Component, Subpanel VI, etc) for which a command can be sent and a response given.

    If I'm understanding correctly that sounds similar to MVC implementations I've done in the past.

    This isn't quite an MVC implementation because of the reasons you've highlighted

    The basic idea is that you make a program. Which has both FP and BD which runs whatever functionality you desire. This can stand alone. But then you make an API to extend the functionality of that program (FP and BD). So in a sense, the M & the V are the FP and BD, and the C is the 'whatever else' that calls that API

    So no components are really throw away, but at the same time, all parts are not fully modularized (can't take off the FP, but you can just not show it which gives the same feel)

    So headless in LV world is a mis-normer :P

    Any VI that is running has a Head.... it's just a matter of if you show it or not.

  18. Hey Norm,

    Lately I've been reviewing some of the publically available implementation patterns. I primarily use a bottom-up dev process. As I combine lower level components into higher level components, I want to be able to test out the component as though it were an application in and of itself. (Yes, I know I should be unit testing instead... corporate inertia is tough to overcome.) Once I've tested it adequately I want to convert it to headless operation and incorporate it programmatically into some higher level component.

    How would you go about converting an app based on this template to a headless component?

    -Dave

    Well.... the way I do it currently is through LVx, which has become a bit of a black mark on my name here on LAVA because I still have never compiled it into a full package w/ some damn documentation.

    What that Acutally means, is that I create an API for the panel. That API enables remote control of a 'Top Level' component.

    The idea works very very well, enabling both interactive manual control / headless automated control (for example through TestStand) / and a mixture of both for debug.

    But as with regards to the implementation, it has it's pro's and con's.

    The biggest con, being that I have not released the proper documentation or tools to debug and create new commands. If you're willing to climb up the learning curve w/ out them, then I'll pass along the most recent version if you setup a time in the evening that we can teleconf and I can walk you through .

  19. Hello Norm,

    today I worked with the TLB template for the first time and I want to ask two questions.

    1. Why did you use a LV object as user event data typ for the exit event?

    2. The AMC library from NI has an "AMC Destroy Message Queue" VI, which is not used in TLB template. Why don't you destroy the queue?

    Uli

    Uli,

    Thanks for giving the TLB a go.

    1. I didn't have a good definition of data that I might like to be sent along with an exit request, so I put the most powerful / flexible data type as the definition of the event. IOW the LV Object

    The idea is that if you have async running processes, that the event ref would be shared amongst all, so although in the template, there is no use for the data, the other components added to the system may add value by using the data space of the exit event.

    2. Simple oversight. I'm working on the next revision of the template (1 bug fix and some other additions). I'll be sure to add that in.

    Keep the feedback coming. And don't forget that this is good for both very simple & moderately involved UI

  20. Mike,

    Which version of windows are you running?

    I'll have to validate it on my install of 2010.

    Give me a few days, and be sure to reply w/ the windows version.

    Rex,

    I'm sorry I've neglected your post.

    Most of the commands I've thought of, and you could implement easily as well.

    Have you seen the option under the tools>>quick edit>>create new plugin...

    I personally don't mind still using keys for anything that my left hand can do by itself. Most of my commands for shortcuts were motivated by needing to remove my hand from my mouse. (Including freaking fast drop)

    I'll check back in soon w/ some updates (I hope)

    ~,~

×
×
  • Create New...

Important Information

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