Jump to content

shoneill

Members
  • Posts

    867
  • Joined

  • Last visited

  • Days Won

    26

Posts posted by shoneill

  1. Hi Shoneill

    One way could be to create a constructor for the Child class that sets the data to the default values you want.

    post-10325-090679800 1280136680_thumb.pn

    Well, yeah I know (it's what I'm doing at the moment) that but it would be so nice to be able to just drop a constant on the BD and have it run from there without requiring a constructor....

    At the moment I have a function to create the object with the appropriate values being set within.

    Shane

  2. I have a LVOOP project where I have a parent class with all of the data required and many child classes which have custom accessory to this data but no data of their own (with child-relevant parsing built-in).

    When I drop a child constant, since I have no actual data within the child class, I cannot have the class default to different data than the parent and the parent always has default data. My question is how I can create a child object constant with parent data corresponding to something else than the default values?

    Shane

  3. Your questions sound like the same questions I was asking not too long ago. I'll make the huge assumption that your designs and way of thinking are similar to where I was at that point. My apologies if my assumption is wrong.

    ..........

    Your answer reflects pretty well where I am in my thinking at the moment. I had the feeling I was slowing myself down by taking the "cohesion", "coupling" and "encapsulation" ideas WAY too seriously and trying to do everything without coupling any two classes..... This obviously gets very hard very quick. Interdependency is OK as long as it serves a common purpose I suppose (coherent). So coupling is OK as long as the coupling takes place coherently?

    Shane

  4. Shane,

    I'm not sure I will quite answer your question, but I will try.

    ....

    Is this kind of what you are asking?

    Paul

    Yeah, that answers it for the example I listed. thumbup1.gif

    I'm always looking for ways to really encapsulate and abstract as much as possible and when I've got 95% of it done, hard-wiring to achieve something similar to what you were describing it seems like I'm compromising all which went before. Maybe I'm hung up a bit too much on abstracting everything. If everything has been abstracted, where do we go from there? wacko.gif

    I always tend to try to create re-usable code which is reusable without code changes whereas I'd probably most often be better off assuming that minor changes will be neccessary for minor updatesfrusty.gif. There are exceptions where a truly generic class can be created, but these are rare I think.

    Thanks

    Shane

    • Like 1
  5. I'm going to butt in here for a few questions which are occupying me at the moment. I'm not terribly qualified to actually engage in this discussion but if someone could answer a question or two for me I'd be very grateful.

    I have made some attempts into encapsulating different kinds of functionality into some of my code in the past with varying levels of success. While I'm aware of coupling and cohesion issues as well as basic data abstraction I'm not very up-to-speed with the different design patterns out there. I always run into the situation where I can do nearly everything from within a class (including display and user input by using sub-panels) but at some stage there comes a point where you need to get at the actual data. Sharing of information between different steps of a LVOOP state machine would be one example.....

    How does one go about solving this problem (Or am I wrong in even identifying this aspect of things as the problem I am having).

    When looking at the examples Paul has in his PDF linked above I am left wondering (in the case of the "Save" button push for example) where does the object gain access to the data it needs to save..... The object itself does not contain the data right? So where does the data-to-object boundary take place and how does one go about implementing it without eroding the encapsulation of the classes too much.

    The only way I can think of is hard-wiring a datatype to the entire family of obejcts (QUEUE or whatever) and retaining access to all the data internally but this seems like it's violating the encapsulation from the inside (if that makes any sense).

    Sorry if my ramblings don't make much sense, but this is simply an area where can see the benefits of LVOOP, but have problems actually envisaging the to-and-fro of data between the "Program" and "Objects".

    Shane.

    Shane.

  6. I would have to say that I like Mark's idea better in the long run

    I agree also.

    I've only wandered into XControl territory a few times but I didn't like the way indicators and controls were duplicated in order to allow for both cases. I like the idea of using a single control and "manually" updating its appearance and behaviour to match an indicator. Seems more logical to me.

  7. If the mix happens to be 0% patents, it's still could be called a mix. IP is the right term for this mix. IP also includes trade secrets.

    A mix of 100% copyright and 0% patents is not a mix.:nono:

    Trade secrets in software? Like algorithms? Sure you can protect HOW to get an end result but not the end result itself (falling back to copyright).;)

    If you don't get other protection for an algorithm (like CSS) then anyone can implement a version as long as they don't copy your code.:oops:

    And trade secrets are, by their very nature, only valid when nobody knows about them. If a second company implements something which was previously a trade secret, then it's not a secret any more is it...:frusty:

    Seriously, does anyone thing there's a relevant protection for software beyond copyright? Seriously.

    Shane.

  8. Of course it raises an ethical question, but more than that: simply copying the content of your hard drive when you leave a company is against the law of ALL countries who protect IP. The work produced for an employer is strictly its property as a business entity, and no one else's.

    I don't like the term "IP" in conjunction with software. It's copyright (which is enough as the GNU Licence has proven). There are no patents involved (outside the US).

    IP is a mix of trademarks, copyright and patents. Only copyright applies to software. Calling it "IP" implies there's more to it than that.

    Just my pet peeve.

    Shane.

  9. What is it about the Swedes and Finns that makes you LVOOP gods? worshippy.gif

    This looks really nice. Can you upload a video demonstrating the use of the tool and of the underlying architecture? Screencast seems to a popular choice for such recordings.

    Maybe a (meta)quote from the Big Lebowski might help::

    "They treat objects like women, man..."

    • Like 2
  10. Hello again.

    I have been struggling with bringing an idea to life, and I'm not even sure it is a possibility in LabView. Maybe some of you here have some insight.

    I have a vi that collects data over a period of time and spits the info onto a graph. When running the vi on it's own, I can watch this graph get drawn in real time as data is collected.

    Now, I would like to use this vi as a module in a larger circuit, but when I use it as a sub vi the module runs all the calculations internally and only gives me the data once the entire operation is complete. I would like to continue to watch the data as it comes in rather than only being able to check the final 'report' given by the sub vi.

    I have played with clocks, loops, and feedback circuits in an attempt to hack together a solution, but I am beginning to think that the basic vi structure I am dealing with is incapable of running with this behaviour. Is there something I am missing? Or is this honestly a difficult or even impossible task?

    User Events, Queues, Notifiers. These will all enable you to do what you want.

    Simply define the method you require and pass a valid reference to the sub-vi as an input. You can then put the data in the Event / Quque / Notifier int he sub-VI and it will be available to be read in your calling VI.

    It's not that difficult. Search for some examples.

    Shane.

  11. No, the other way around. During refactoring you change some VIs, remove some existing ones, things like that, and that results in a lot of broken VIs throughout the code. You slowly work your way through all the reported errors, fixing code to reflect the new API, and when you're done the App crashes. The only problem is locating the one VI that is "internally broken" (shows no errors or anything and uses only VI that you know are working).

    On a brighter note, I managed to do it this time. The trick was to instruct the LV to "send a report". This gives you the log file which you can inspect, and where it actually tells you which VI is causing the crash. I opened that VI, placed most of the code in disable structure, saved, run. Woohoo - no crash! Remove disable structure, run again and it is working.

    It only didn't occur to me how to locate the offensive VI before I posted. I guess I need more mileage.

    But it would be great if I didn't have to preform this dance and wave the dead chicken at the computer to have it working smile.gif

    Mike

    I have seen things like this before. Especially conflicts can be a real pain in the rear to fix. I often have conflicts (due to messing around in my file hierarchy) which are seemingly cyclical in nature and the IDE gives few clues as to where to start.

    I had another case today where parallel loops were (seemingly) crashing my program. Hard crashing, LV just disappeared and so on. Occasionally I would get a "not enough memory" error. I removed the parallelisation of the for loops and it started working again.

    I really really really want NI to focus more on stability.

    Shane

  12. Two things to note:

    1. The events aren't registered anywhere. They are there for future use in this framework. Even when they are used, it's only one or two at a time. Also, most are updated at 1Hz. Only a few are updated at 20Hz, and none are faster than that.

    2. The second example registers more events and fires them more rapidly than I would ever use my class for and it shows no memory increase.

    Just wanted to make sure you were aware of the queuing nature of Events and also the extra 16 Bytes baggage each and every event comes with.

    I'm also of the opinion that firing a non-registered Event (while not quite being a No-op - it needs to check if it has been registered) whould create minimal overhead and definitely not cause an increase in memory usage.

    I personally use Events a lot and find them to be cool, but could be much improved. Performance versus Queues is one thing which kind of annoys me. I've yet to hear a good reason WHY receiving an event is inherently slower than reading from a Queue for the same data size.

    Add to this various timing issues and I'd make a suggestion on the idea exchange but I'm pretty sure it'd get no support.....angry.gif

    Shane.

  13. I think your problem is almost expected behaviour.

    You say up to 500 instances at 50 times a second are being fired.

    This makes 25000 Events per second. Each user event is a minimum of 17 Bytes (See picture attached) and all events are stored in a queue. This means that if you do not PROCESS the events, then they are being stored in memory at a rate of 500 instances x 50 Hertz x 17 Bytes = 425kB per second. ALL of these events are then available to an event handler (which can lead to a huge backlog of events if not handled quickly enough).

    post-3076-12716766479_thumb.png

    It doesn't explain why you would be seeing 3MB/s increases. I'm also not sure if a User event which has not been registered should allocate memory at all either. I would have thought it would not allocate memory since with nothing to process it, it is falling on deaf ears so to speak.

    Can anyone clear up on whether a non-registered Event should be stored in memory?

    Shane

  14. If I fail to reply directly to your thoughts it is because I simply don't know the answer OR what I believe is questionable.

    Who KNOWS anything in this regard. It's mostly personal feeling and second-guessing I think.

    That's what makes it so hard.

    Shane.

  15. I feel a little slimey since I have been attempting to share my crazy ideas without offending so please excuse me if I try to slip out between the lines.

    Slimey? That I don't understand. I'd rather you discussed more rather than slip out, but it's your call.

    Please don't confuse my candid opinions with aggression or intolerance. I'm just looking for other people's takes on something which belongs to the ultimate question whose answer is 42.

    Shane.

  16. If I thought I was correct, I'd fight to make the point. But since I don't know what I'm talking about, ....

    Re: "anywhere we SHOULD be. We just are."

    Well that highlights the fact I left out a lot of ideas! maybe this belongs in another thread but I'll share just to hear if anyone else can relate. When stuying The Republic, I read about virtue and the idea that virtue is an intermediate state between two extremes. Being vituous in a cetain aspect of ones nature was a way of saying they are balanced and not to far one way or the other. The discusion in The Republic talked about the balance being struck along many possible lines "spend-thrift vs waster" Coward vs berzerker .... This lead to my own idea of a "virtue space" which has as many dimensions as there are virtues. Anyone of us can be plotted into virtue space and each of use would have a unique postition in that space. When turing my attention to the nature of the person who plots at the origin. The next step in the Saturday morning while drinking my coffee adventure lead me to think that since we all are located at different locations and our goal MAY be teh same (the origin of virtue space) then it makes sense to me that no two of us have the same path to tread. So the direction that is appropriate for me is the wrong path for others.

    So in the limited sense of my virtue-space there a place where I should move toward.

    Just my thoughts,

    Ben

    I appreciate the response, even though I won't yet claim to have understood everything yet....

    I would argue, however, that even the origin of virtue space is actually an individual trait. Everyone's virtue system is slightly different. There are no absolute scales for virtue. So it in in reality a bit more complicated because a position x,y,z in one person't virtue space will not neccessarily co-exist with position x,y,z of another person's space.

    I also find the combination of "measuring" virtue and human behaviour to be a mix which leads ultimately to some contradictory situations. Being guided largely (although not exclusively) by emotions and desires, our unwillingness to "slip down the scale" of virtue leads us to concoct some really abstract and illogical situations where something which is not inherently virtuous is deemd as being something "good" simply because of its neccessity. This can lead to a severely skewed and ultimately misleading grading of a person's actions.

    Waging war is an example. I think it's clear to everybody that war is essentially inevitable (although the arguments about when, why, how and where are endless). But does this make it virtuous? Is it a virtue to engage in extreme violent conduct in the name of one's country? In the name of anything? In any other setting it would be condemned but the neccessity for such actions (being human as we are) makes us spin a web of virtue around something which is not inherently virtuous. This is a big problem I have with any aattempts to prescribe an absolute virtue space. Due to the inevitable nature of war and the unwillingness to "slip down the scale", society moves to declare by consensus that war shouldn't be put on the negative virtue list because that would interfere with out way of doing things. This is moral relativity in it's worst form because it actually pretends to be absolute.

    Now, before I get flamed, I'm not saying that I'm totally anti-war. I believe it IS neccessary in certain conditions and is almost certainly largely unaviodable but I also believe it a folly to dress it up as being an act to be celebrated in any way. We should call it what it is.

    By relating to where a person "should" be you are automatically creating such a construct as I have outlined above where the person actually strives to climb the ladder and (being human) ends up misusing the value system to serve their own needs in an innocently selfish way. Kind of like a white lie.

    Personally, I tend to avoid absolute moral compasses. This was perhaps accelerated by coming from Ireland where the Catholic church WAS the absolute moral compass and has been involved in a serious and continuous stream of child abuse claims for the last 20 years or so. Some moral compass there. Even the current pope Mr. Ratzinger is being directly linked to the systematic cover-up which was performed by the church over the years.

    Or perhaps the ultimate christian moral compass, the decalogue, is also often conveniently ignored or bent to one's will when required. "Thou shalt not kill" seems fine, but what if someone is threatening my family's life? If I kill someone to protect my family is that a good or a bad act? For me and my family it's probably good but for the dead person it's almost certainly bad. No absolute compass to be found here. It simply does not apply in all situations.

    We all possess an inner sense of what is right and what is wrong in any given situation. This is independent of our background (although some can blend it out more than others) and is often very different in people who otherwise claim to share the same beliefs or absolute moral compass.

    To summarise, I think an moral compass can help in some situations to offer guidelines as to how to behave (and the bible offers some good examples but also some absolutely terrible examples) but regarding a sense of "absolute" good and bad, it simply does not exist and to think it does is simply fooling ourselves.

    So while you and I most likely share a very large part of our beliefs of what is right and wrong, I think we might very well give very different reasons as to WHY they might be right or wrong.

    I'd better start working otherwise my boss will point my moral compass to a state of unemployment.....

    Shane.

    • Like 1
  17. I don't know the validity. I only know that where I am is not where I should be and its up to me to decide on the direction and stick with it.

    Ben

    I'd agree with this completely with a pedantic difference that I'm not at all convinced there's anywhere we SHOULD be. We just are.

    But our responsibility to decide is (even being pedantic) correct.

    Shane.

    All anaolgies break down when stretched to far, which may be the case for every analogy applied to God since attempts by limited being to understand an unlimited simply can not work ( A set can not be prooved from within a set Goedl?).

    Without wanting to get into a nasty argument I would wager that the above statement for any other subject other than "God" would lead you to the idea that the idea at hand is flawed and most likely to be incorrect.

    Shane.

  18. So now cast yourself for the moment as God and ask yourself if you would prefer to watch eternity play out with robots that always did waht was expeted and real creatures that had the oppertunity to choose to do good of their own accord.

    Ben,

    your analogy falls hard when taking into account that "God" is supposed to be all-knowing and did actually (according to scripture) create us.

    As such it would be more analagous to the robot dog part than the "real" dog because the "real" dog would suggest that we contain unknowns and therefore could not have beenmade by "God", a theory I could wholeheartily support BTW.

    Shane.

    BTW, just for the record, some of my best friends are animals.

    I've yet to befriend a plant or a mineral.

    As such all my friends are animals.

    Shane.

    PS Except for the numerous electronic gadgets I can't live with but who sometimes unexpectedly don't return my calls.....

    I am REALLY tempted to abuse my temporary moderator privileges and kill this thread.

    No please don't.

    It'd be like taking away Pete Doherty from us parents.

    This post serves as a shining example of how NOT to engage in internet forums the same way that Pete Doherty serves as a shining example to our kids of what happens when you take copious amounts of drugs.

    Shane.

  19. I'm currently working together with a customer to get a new vision analysis system up and running.

    Having used VBAI 2009 for testing his processing we came up with the idea to implement the entire thing in VBAI. Things got a little more difficult when we started talking about motionc ontrol, buffered breakpoints and bufferd images but we reckoned we could handle all of these.

    Where things got really interesting was trying to implement a custom step in VBAI to launch a program to do the acquisition in the background and still allow us access to a set of images buffered within the application. After much blood sweat and tears I got it working.

    There seem to be many caveats about memory sharing in VBAI custom steps which (to me) seemed non-obvious. Are there any more detailed sources of information than the VBAI development manual installed with the toolkit?

    Shane.

  20. Here's an example to play with. Try changing the number of cores. Ideally the graph ont he right should show two identical lines shifted by 1 (and the array should be all 1.000) but contrary to what I expected, the array order is NOT being retained.

    For some reason, the order seems to get mixed up exiting the parallel for loop.... I thought this was supposed to retain the array order (Not the processing order) of the data.

    I think the problem is the asynchronous access via the Queue. Seems like you need to definitely incorporate some ordering information into your data so that you can reconstruct the array order afterwards.

    Shane.

    I think I understand why my example doesn't retain the array order. Seems logical once you've tortured your brain with it. frusty.gif

    Here's an example where it might work better.

    I'm creating an array of single-element queues instead of one large queue to pass the data to the parallel for loop. That way the array order is maintained. The OTHER queue (single large queue) is there only to be able to monitor the number of elements yet to be processed. It has no influence on the functionality of the VI, simply for visualisation of the enqueuing / dequeuing process (as is the bottom While-loop in its entirety).

    Shane.

    Parallel for loop.vi

×
×
  • Create New...

Important Information

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