Jump to content

jcarmody

Members
  • Posts

    947
  • Joined

  • Last visited

  • Days Won

    39

Posts posted by jcarmody

  1. I'm intrigued by a few discussions we've had recently and am here to ask what architecture y'all use when writing a program to implement a long test procedure.  Here's the first discussion, and here's the second.

    Here's the scenario:

    I have two test procedures for a product I need to test: an MTP (Manufacturing Test Procedure) and ATP (Acceptance Test Procedure).  Each procedure contains a dozen or more individual tests (some are common between the two), each test requires configuring and reading a few IO devices and the application must have a reasonably functional user interface that allows automatic testing as well as permit a Technician to debug the UUT.  My approach has been to write a JKI State Machine with states to control the hardware and macros to sequence the tests; this results in a long list of states.  Several respectable LAVA contributors in the aforementioned discussions eschew this design, so my question is: what architecture can perform all my tests without using the kind of State Machine I've described?

  2. The Code Capture Tool rocks. :thumbup1: I love it. :wub:.  The video was a great touch, too.

    Just to be clear (because I can't test it) folks will be able to drag a snippet made with the CCT in LV 8.6 to a LV 2009 BD?  I'm wondering when CCT 3.0 will come out, with the ability to extract the code from a snippet in pre-2009 versions...  :unsure:

  3. [...]However if you don't use any of his techniques the while loops will run in parallel.

    But, one of them will start first.  No?  And which one does is indeterminate and unreliable.  If you have a producer and a consumer loop, and the consumer is set to stop when the queue it's consuming is empty, you want to make sure the producer starts first. That's what I was going for.  If it happens to start in the proper order in development (giving you a false sense of confidence in your code) you won't be able to count on it working as an executable or on another target.  I think.

    See attached example.

    I have an alternative to your forth example.   ;)  (Don't look under the hood, it has a sequence structure.)

    Wait_(ms).png 

  4. [...] If I drop two independent while loops into a VI, independent in the sense that neither while loop requires any information from the other to proceed to some conclusion, in what order will they execute? How can I control this order?

    1) They'll execute when all of their inputs are satisfied; if nothing forces one to start first then it's up to the Operating System to decide.  Although I believe the winner is (practically) arbitrary and you can't depend on the order.  You're better off forcing an order if it's important to you.

    2) If you want to force one of them to run after the other you need to force a data dependency between the two of them, or you can throw style to the wind :lol:  and use a Sequence Structure :nono:.

    post-7534-125953923904_thumb.png

    One advantage to the first option is that the error cluster is passed throughout the program.  You are passing your error cluster throughout your program, right?

  5. [...]Well this starts to snowball into a bigger issue when someone decides that they just don't want to execute that one event state, but rather I need 4 states executed and I want that state to always be the second of the 4. What typically happens, is that the end user just starts stringing together multiple Val(signaling) properties for multiple controls to call multiple event states. This is particularly bad because there is no guarantee that as you string together Val(signaling) properties that they'll execute in that order, so you've just introduced potential bad logic in your vi.

    I did not know that.  Thanks.

  6. [...]Please keep your recommendations based in science and provable facts.

    Here's an article related to your condition, but it's not going to recommend a drug or medical procedure in the end. The article refers to many scientific works from such "reputable" sources as Circulation (AMA), The Journal of the American College of Cardiology, The American Journal of Medicine and the Journal of the American Medical Association.

    Remember that GIGO applies to our bodies as well as it does to the programs we write. I'm not sure how you'll feel about this, but it's worth mentioning because the world needs all the LabVIEW Architects it can get. Good luck. thumbup1.gif

    Three quotes for those TL/DR-type readers:

    Although angioplasty has been performed for nearly 3 decades and over one million procedures are done annually, you should be astonished to learn this fact: Angioplasty has never been shown to save the lives of patients who are treated for chronic heart blockages.3,4
    The only indication for angioplasty is to relieve incapacitating chest pain—since this surgery has not been shown to save lives.3,4,7,9,13,14 To use the promise of prolonging lives as the sales pitch is dishonest.
    I have studied heart disease for the past 35 years, and everything I know about angioplasties and bypass surgery makes me want to stay clear of these businesses unless there is absolutely no other alternative. The real alternative that too few people take advantage of is prevention: A low-fat, plant-food based diet, exercise, and clean habits will prevent this disease. Once the disease has started it can be stopped and in most cases reversed with this lifestyle medicine.18
  7. [...]And also can you give me some more info about the other methods you propose?

    The first thought I had when reading your original post was to use a User Event.  These are events similar to Front Panel object events, but you determine the data type and you write code to trigger them wherever you want.  In your case, you'd trigger it when you get the xFF from the microcontroller and your Event Structure will respond.

    Here's an example.

    post-7534-125937227704_thumb.jpg

    UsrEvent.vi

    • Like 1
  8. I just tried Install Code Capture Tool.vi on 8.2 without success.  I've attached a screen capture of the result.  A small window flashes after a slight pause, before the error message comes up.  Perhaps that's a clue to what's happening?

    I tried the version you sent privately, but it didn't change anything.  Perhaps I'll wait a few days to see if other folks with XP have the same trouble I'm having.  I'd hate to have you spend time fixing something that isn't broken on your end.

    Thanks.

    cct.swf

  9. There has been some discussion about managing a large number of states in a state machine neatly.

    Jim Carmody came up with this brilliant solution.

       Stop. :wub: You're embarrassing me... 
    [...] If a group of states (e.g. UI) gets too large, I will move all UI states to their own case (owned by the separator case).

    This seems to be neater and easy to read then having to scroll the state drop down menu when the number of states starts getting large.

    I addressed this issue (to my satisfaction) in the CaseSelect RCF plugin by using a tree with collapsible branches.  The context menu lets you collapse or expand them all at once so you don't need to scroll past a long list. 

    I like the work you did, however I almost got my feelings hurt in another thread that suggested *gasp* that a State Machine should never have as many states as I use.  One thing I got out of that discussion got me thinking of my habit of using macros.  I make a macro to perform a complicated function, but the steps of that function are all exposed as well.  It's not so much trouble for me to maintain the software, but someone else after me may not recognize the utility of the macro and either miss some necessary steps or waste time redeveloping it.  I'm thinking that I need to use sub-VIs rather than more sections in my State Machine. (Encapsulation?)

    Jim

  10. post-7534-125871832611_thumb.png

    You were correct to use a loop, but a For Loop isn't correct unless you know exactly how many times the substring exists in the main string.  I used a While Loop with the 'offset past match' to detect when to stop (it'll be -1 if the search string isn't found).  I'm not sure what you mean about storing "that substring into an array", but you can wire the 'match substring' of the Search function to an indexing tunnel and you'll get an array of the substring with as many elements as there are occurrences.

  11. I know what you mean. I look at some of the old code that I wrote that I thought was pretty good when I wrote it and I cringe now. [...]

    I look at some of the stuff I wrote last year and cringe, although it's not as bad as stuff I wrote three years ago (when I started programming in LabVIEW and when I passed CLD & CPI).  I give a lot of credit for my improvement (such as it is) to this forum (and JKI's and NI's).  I can't say "thank you" enough to people that spend considerable time helping strangers.

    I have a long way to go before I will call myself an "advanced virtual architect".  In the meantime, I'll just continue to frequent these forums. 

×
×
  • Create New...

Important Information

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