Jump to content

ShaunR

Members
  • Posts

    4,942
  • Joined

  • Days Won

    308

Posts posted by ShaunR

  1. A state machine "should" (with a captial SH) be used to allow branching and "break" dataflow, not enforce it (dataflow does that implicitly). And you "SHould" only break dataflowas a last resort (it is after all LV biggest asset). A sequential statemachine is no different from a stacked sequence (in fact it is worse since it is more complicated). A procedural state machine not only flattens the hierarchy reducing abstraction and code re-use. It also hides functionality (making reading more difficult), is more difficult to debug and prone to transitional errors. Used sparingly, it is a powerful tool. Used excessively, well, you might as well write C.

    With the exception of message handlers, I've yet to come accross a state machine that requires more than 10 states. I have however seen many with 30+. (In fact, the last time I saw that many I made him re-write it in 5....lol)

    The readablilty issue is clear (as it applies to stacked sequences).

    Here is a dataflow implementation:

    Same thing written as a state machine:

    • Like 1
  2. I've just added menu support for Passa Mak. It works fine, but it 'aint pretty. The main reason being I can't find a way to get a top level vis menu reference. The menu seems to be the only FP functionality that doesn't have a reference thats exposed. Theres the vi menu ref (that only works within the current vi) and you can get it in an event structure (but can't programtically generate the event to execute the case). Anyone have any ideas?

  3. When I chimed in on the QD-SM, I was referring to the JKI String-Based Queued State Machine. I'm not sure how to avoid having many states if my ATE performs many functions using many devices. One thing I'm avoiding (like the plague H1N1 FUD virus) is making one state perform multiple functions. Each state does one thing and I call it wherever I need that function (using Macros). This results in a long list. What else can I do? However, I must say, that the CaseSelect RCF plugin makes it a piece of cake.

    Jim

    PS - Ben, I've read enough of your posts to put the best possible construction on anything you write. :thumbup1:

    The JKI State Machine Plugin........

    The quickest way to turn a dataflow language into a procedural one :P

  4. Congrats ShaunR! At this rate you'll catch crelf by the spring. :yes:

    Gary

    Ta very muchly :)

    You are averaging 2 per day. Shaun's at 2.4. If I wasn't so lazy, I could write a VI to predict when he'll surpass you. Or I could be like a textbook author and just state that the exercise is left to the reader.

    EDIT: To whomever is currently writing this VI (I'm sure someone must be), we'll all be really impressed if it automatically updates based on current post count and post rate :worshippy:

    I doubt it would be that soon. I'm off on holiday for quite a while soon:) And I've lost my momentum now I know I can't change my title at 500 :P

  5. The subtle one.

    So subtle, I never saw it before :P

    To be fair, the term "pun" isn't really accurate in this case, but I think it should be fairly obvious from the context of my previous post if you look in the right place.

    Indeed. I don't think a speech impedement qualifies as a "pun" :)

  6. Hmmm.

    I've rewritten this post several times now, because there are so many aspects to what you are trying to acheive, I don't know where to start!. :blink:

    The first point that strikes me is that you are a victim of your own success. You have made yourself a "keyman" - an indispensible resource without whom projects cannot succeed. Whilst this is desirable from a job security point of view, when successful, you inevitably run out of resource (you). You obviously realise this and take the next logical decision to obtain more resource. so far so good. :thumbup1:

    So you have identified some more resource.....students :D They will make the bits you need to make the projects. Sounds good, but is it?

    If it were a sub-contract software house or highly skilled, experienced engineering team, then yes, it would work since they know thier onoins and you can decide the granularity of the sub-components dependent on how much you want (or how much time you have) to be involved in the detail. Effectively, you would be recinding your "keyman" status and moving from a sole "deveoper" to a "team leader/manager". You could distribute small functions right up to complete applications dependent on your loading all under the watchful eye of your experience. and guide the project through to completion.

    But you have students (lots of 'ology' students at that, by the sounds of it). Inexperienced, un-trained, possibly un-receptive but none-the less cheap :P In addition to deveoping the projects, you will also have to teach, correct and probably re-write a whole shedload of code adding to your loading rather than alleviating it. Effectively you are still the "keyman". You have relinquished a bit of the boring stuff that would take you 1 day, in exchange for using resource that will use (say) 5 days of training, 2 days of correcting and a further day to write it the way it should have been :D Sure in 3 months time, they might (if thay stick at it) actually be contributing usefully to your project, but you didn't have enough time for one day to begin with.:(

    So is it a hopeless cause? Should we never train anyone because its always easier to do it ourselves? Not even close! We have access to resource :yes: And we can always use resource :P We just have to be intelligent about where we get it and how we use it........even if it means losing our "keyman" status".

    It sounds to me like you are making the transition from deveoper to manager (whether you like it or not), but can't quite let go. I can understand why, because you are the only expertise and a student is never going to be able to do what you do in the limited time available. And although this maybe true, maybe its not necessarily the coding you need to offload first, but the training. A few, cherry picked individuals, the chosen few (we used to call them "Prefects" at school) with an aptitude and eagerness for programming that can impart thier knowledge to lesser mortals and answer the inevitable time wasting questions so you don't have to. It means your time is well spent in training (they want to learn and are pretty good at it) and you can offload more and more of your key skills (well, always keep one or two, eh? :) ) whilst still delivering projects in the interim.

    If I'm barking up the wrong tree, I'm sure you'll let me know. I have a few further ideas if its worth persuing this direction.

  7. Yep - you can customize your text once you get to 1000:

    post-181-125692704619_thumb.png

    I've updated the post to reflect the correct number.

    Yep - we usually change it based on how many posts you've made - when you get to around 98% of the target, we double the target. So, all you need to do is post enough to get through that last 2% *really* quickly and you'll beat us to it :D

    Many thanks. That list might be worth pinning.

    Now, wheres my PHP editor so that I can write a Post Daemon :P One reply to all posts might just do it.

    Ooooh. Did I write that out loud :D:oops:

  8. Without getting into gradients, this is a quick and dirty example of extracting data over a threshold level directly into a 2D array, where each row represents each waveform above the threshold. Because LV uses square arrays, when you process each row, you will have to truncate the data where the zeros start.

  9. Hmmm, I see some advantages to using references, but I'm not sure how you use this to get a multi-column listbox to word wrap. How do you get the reference to a particular cell?

    Bruce

    You would have to coerce the refnum to a more specific class to make the properties for that type available.

  10. To a reasonably educated individual, the common conceptual base which underlies virtually all programming is more important than the specific language a person learns first.

    I sort of semi-agree with this. With text based languages, its much of a muchness. With functional languages (lets forget OOP for now) like c, pascal, java script, VB, PHP et al, only the syntax really changes (pascal uses the asignment ":=" as opposed to "=" for C for example). Once you learn one its just a case of learning the IDE and syntax and away yoiu go :) But changing between paradigms is a bit different. Its much more difficult to change from C to Prolog for example even though they are both text based. Couple changing paradigms with changing from text to graphical just compunds the leap.

    Anybody with an open mind to new concepts will readily embrace them regardless of age or prior experience; prior programming will give them a solid foundation to build upon.

    Indeed. But the problem I come accross time and time again, is that many people are not open minded, or they've been doing it for so long in one way, that it takes great effort to join the synapses in a different configuration.

  11. Could you post a snippet from Passa Mak (or, a few) to show how you're finding all of the

    I don't have LabVIEW 2009.

    It grabs all controls from a FP. Then extracts the labels and text dependent on the control type. PM Get Control Text.vi uses recursion so it will drill down into nested clusters.

    Passa Mak creates a list to save to a file since the save and load are separate, but for a regex replacement you could put a write node immediately after the read node in the PM Get Control Text.vi and modify the string in between.

    • Like 1
×
×
  • Create New...

Important Information

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