Jump to content

ShaunR

Members
  • Posts

    4,855
  • Joined

  • Days Won

    293

Posts posted by ShaunR

  1. You're assuming the random code would not be the equivalent of a creature with a super-critical mass of fissile material somewhere in its body (e.g. a Delete primitive with "C:\Program Files" wired into the path and a T wired into the recursive input).

    Isn't that the pinacle of evolution? A creature that goes around trashing its environment :rolleyes:

    • Like 1
  2. I think he said:

    "a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will almost surely type a given text, such as the complete works of William Shakespeare."

    Some LV code I saw today would have taken 1 monkey a couple of minutes :cool:

  3. Ok I have another idea for you. You need to invite Mr D and your boss out for a drink after work. Go to the bar and keep feeding Mr D shots but try not to get too drunk yourself. Once he gets good and drunk, start talking about politics and/or religion. See which topic gets him all worked up and calmly keep bringing it up, picking at him till he gets so mad he makes a fool of himself in front of the boss. Call Mr D's wife to come pick him up from the bar - tell her he is all drunk and making a scene and she needs to come get him. Tell your boss you cant work with this guy.

    Devious :ph34r:

    I like it :P

  4. Mr.D wife: GSR, you are working so hard and make "Mr.D" seem do nothing

    Me: I am working so hard, because I always make mistake, so I need to fix them ( :frusty: I am too nice to her)

    Wrong answer.

    "What do you mean "seem"? is the right answer.

    Mr.D wife: Do you mean "Mr.D" does not work?

    Me: NoNoNo! I just mean Mr.D never makes mistake ( :frusty: Right, he never, because he never work. OR I need to stand behind him when he works)

    Wrong answer.

    He works here? is the right answer.

    Does anyone else find it a bit strange that

    a) The wife is at work.

    b) Shes very confrontational.

  5. I thought about something similar a while back (in a different langauge with a compiler). I don't think you really need batch files and projects, you can do just fine with a "clone" vi.

    A slight modification to your premis means that you can "grow" more and more complex "creatrures" and see evolution (in theory at least).

    Rather than "spawn" the children and hope that one of them may survive, you can use your DNA program (Prime Mover?) to create a vi that has the DNA code + 1 random function. It continues to do that UNTIL something compiles and runs. Now you have DNA and DNA+1 in the primeordial computer soup and each continues to try and create a better "self" until it runs out of functions to try. At which point it becomes "Extinct".

    Of course. If nothing compiles and runs then it proves you are a crap God :P

    And, by the way, we all know the answer for a computer is not 42......it 10 :)

    • Like 1
  6. No, probably not, in which case yours is the simpler solution. I would agree based on the question that is the more likely scenario. But it could also possibly be that he is monitoring multiple controls for value change in the same event case, which starts to favor a producer-consumer or some similar design.

    Well. If that is the case then there should be an event case for each control or set of dependent controls. Still don't see the need to complicate it further.

    And it's a personal preference of mine that I try to avoid using timeouts in the event structure unless really necessary. There are times when it makes sense, and it's still superior to polling. But it still *feels* like I'm resorting to polling before we got the event structure. Man, doesn't that seem like ages ago.

    Me too. and re-reading what I posted I did say they should be checked there. What I was really getting at was to add a timeout so that his vi doesn't "hang". I think once he posts more, we will probably see that his issue is understanding how and why an event structure works the way it does rather than a design implementation. After all there are a few unintuitive things like having the control inside the event case.

  7. Yes you can.

    What do you have so far? If you post your vi, we can see the direction you are taking and advise better.

    In my opinion, the best way to approach long term graphing is to continuously log the data and provide "views" of that data. To prevent files getting too large (and therfore taking ages to load in the views), you can save the data log in a number of files (either using the date in the filename, or directory name). This would give you a file (or set of files) for each day or month which can be loaded "raw" and processed to provide whatever analysis you require.

  8. Why would you say that? I think Mark's proposal is valid, as is yours. When I first read the question, the first thoughts that came to my mind were both of your solutions. Ultimately, it is a design decision for the developer to make and he doesn't offer up enough additional information to make a choice.

    -Scott

    My reply wasn't a design proposal. It was to get his events working properly. Like you said. theres not a lot of detail, but its likely its a control with a couple of cases checking a value. Do you really need a Consumer-Producer design pattern with state machines to see if a value is higher or lower than zero for example?

  9. It sounds like your application could benefit from using a producer consumer architecture. Use a single event structure in one while loop that will detect the value change and have the event notify the consumer of the new value. A state machine in the consumer could process the data as required and if necessary repeat over the action until a new value is detected.

    A bit excessive dont ya think?

  10. Hi,

    I am having a bit of a problem getting my program to work properly. As I have it set up right now, I have a while loop as the outer-most structure. Inside the while loop, I have an event structure (on Value Change). Inside the event structure I have a case structure. The different cases in the case structure correspond to the possible value changes that the event structure detects.

    Is there any way to constantly repeat events in a certain case structure until the event structure detects a different value (a value change)? I tried putting a while loop inside one of the case structures, but the program just waits in the while loop and ignores any input that is supposed to cause the event structure to detect a value change (and thus execute events inside a different case). I also tried having an external boolean wired to the stop button of the while loop inside a certain case but that did not seem to work either.

    Any ideas are greatly appreciated. Thanks!

    Well a Value Change(signl) property node will programmatically fire an event but you can end up with race conditions. You ought to be wiring a timeout to the event case (say 100ms the, default is -1....wait indefinately) and checking the controls in the timeout case.

    If you are seeing the event execute only once, then it is likely that you do not have the control inside that event case. This is required for the control to be "reset".

  11. Why would it? This is a patch, made to fix relatively urgent bugs. If NI's schedule of recent years is indicative (and it should be, according to NI) you can probably expect the minor release around January or February.

    Don't see why it couldn't have been included. They realesed F1 just to fix 1 minor bug that very few people would have suffered from. I've actually given up using probes now and just create indicators on the front panel 'cos its such a pain.

  12. I'm not following. Why would you send a User Event Refnum from the caller to the xctl if the goal is simply to get a cluster of the xctl's User Events? I don't want the xctl to control when the calling code registers for events.

    I was referring to the Option B where a create method was used. It is identical the what ShaunH describes (using the bundle to integrate events) but from within the control instead of external.

×
×
  • Create New...

Important Information

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