Jump to content

Grampa_of_Oliva_n_Eden

Members
  • Posts

    2,767
  • Joined

  • Last visited

  • Days Won

    17

Posts posted by Grampa_of_Oliva_n_Eden

  1. I do not have time to write a book on this topic but....

    Queues are awsome!

    They are fast and under the proper conditions, the data does not have to be copied because the the buffers used to store that data are re-used by the recipient of the queued element.

    Ben

  2. QUOTE(LV Punk @ Feb 16 2007, 07:43 AM)

    ... I've always believed that we are all equal, and thus should use technology that keeps us equal;...

    Which reminds of the quote

    "God did not make men equal, Colt did."

    Ben

  3. Works for me! What's the problem that you're seeing? What type of array constant? String, I32, DBL... Can you post a screenshot of the problem?

    LV8 changed the grab handle behaviour for a 1-d array.

    Since when it is created, it can be resized horizontally or vertically, the grab handle is in the corner.

    Once you tell LV which orientaion you want, the "grab handle" is now a dot on the side (if horizontal) or bottom (if vertical).

    Just my guess!

    Ben

  4. This bug causes typed data entered the time before last to disappear. (Does that make sense?) Here's how it works:
    1. Click on cell 1 and enter data.
    2. Click on cell 2 and enter data.
    3. Click on cell 3 enter data and then click outside of the listbox.
    4. Data in cell 2 disappears.

    To perform this magic trick, your code must have the following.

    • Set the "Edit Position" when the listbox is clicked on.
    • Trap the "Edit Cell?" event.

    I've attached a simple example (LV8.2) and cross posted to the NI forums (no CAR and no responses).

    Download File:post-151-1170292612.vi

    I requested an AE look at your post.

    If you do not see action in the next 48 hours, PM me and I will push harder.

    Ben

  5. In LabVIEW 8.2, it appears that the Delete file primitive has a nasty little bug, in that it ignores the confirm input, which is supposed to present an OK/Cancel confirmation dialog box to the end user, before deleting the file (or folder)!

    post-17-1170231427.png?width=400

    Cross-posted to ni forums, here.

    Ouch!

    This reminds of an old Dilbert cartoon. Dilbert is sitting in front of his PC and we can read the mesages on his screen.

    "Preparing to install software"

    "Clearing hard drive"

    "placing order for software updates"

    Ben

  6. I introduced Mental Prostitution in dictionary in 2003.

    Now I wrote the words for the Anthem of the Mental Prostitute:

    Viva prostitution!

    I want to be a prostitute!

    I don't want to work; I don't want to learn,

    I want the money from the government!

    Viva prostitution!

    I will watch others, I will watch my family!

    I will lie about honest people,

    I will spread rumors about them!

    Viva prostitution!

    The world is ours

  7. Well as far as C) is concerned: LabVIEW is smarter than that since I think at least 3.0. Since Array Size is a function that does not (re)use the array ever, LabVIEW always attempts to schedule this call before any other functions that use the branched array, in order to avoid unnecessary buffer copies.

    Good point, thank you. That was one of the reasons I selected this node to force the wire branch. i was somewhat suprised to still see the buffer copy.

    All this shows that analyzing for optimization is a difficult thing to do.

    I'd say! At first glance I'd say the array size was a NO-OP and toss it in about two seconds. I wonder if the VIA would say anything about the construct.

    post-29-1170002051.png?width=400

    I'm also sure the entire story would look again different if you would add a shift register to the loop and pass the array into this, feeding it inside the loop from the left to the right shift register terminal. While this code may look useless it almost always helps LabVIEW to optimize the code in the best possible way, as the LabVIEW optimizer has some very smart shift register optimization rules.

    This part tricked me too! It appears tht the buffer must be in the wire feeding the lopp (SR or not) for it to be re-used.

    post-29-1170002077.png?width=400

    Ben

  8. It would be interesting if you could scan through the code and detect a "code sequence" that you use in multiple places -- something that could be made into a subVI...

    .... So that would involve scanning through all of the branches of all of the widgets hanging from the BD reference and matchinging up identicle branches... hmmm... but when i create sub-VI I think about what they do when creating the names and icons. I could see the utility finding common code snippets and expecting me to name them! I do not know if that would be much fun.

    Re: Jims Q

    Well Darren has shown that you can quntify bad stuff. Would a neatly laid-out Rube Goldberg machine implemented in LV count as "Good Code"?

    The only indicator I have found for good LV applications is the (brace yourself) aspect ratio of the VI Hierarchy screen. Somewhere around 3:4 seems to be a good balance between complexity of code and use of sub-VI's. I t seems the worst VI I have seem are either very flat (all code in top level, ussually the rsult of over-using wizards) or very deep, which are the result of very good ex-C developers.

    Ben

  9. Sorry about my fool, but it's very difficult to understand.

    why tunnel of the loop use the buffer allocated by the initialize array, and subVI use the buffer allocated by the indicator, how labview allot to each other. why loop tunnel doesn't use the array subset buffer, this kind buffer allocate is a common sense to you all?

    I agree with most of what are saying yao.

    Please see attached image for how I "interpret the entrails" :P

    post-29-1169924529.png?width=400

    A) a buffer is allocated of the size you specify and is filled in with 0's lets call it Buffer_A.

    B) A branched wire has to be handled delicately since all of the sinks want to see an un-mollested "copy" of the buffer produced by the source (in the case the the Buffer A).

    C) The array size shown by C has to match that of Buffer_A. We can not predict if it runs before or after the Array Subset runs.

    D) Since the output of the Array Subest function can change the size of the buffer it is passed, and since its source wire branches, the Array subset function will place a copy of the dat from Buffer_A in a new buffer Buffer_D.

    E) a buffer is allocated of the size you specify and is filled in with 0's Buffer_E.

    F) See D above. The Array subset function will under the proper conditions, not create a new buffer but will re-use the buffer it has been passed. In this case Buffer_E just has to have some pointer updated to reflect the subset. It simply passes the pointers along. But in-so doing, it appears to mask the buffer it recieved from down-wire enties.

    G) I am not sure why Buffer_E can't be re-used by the sub-VI call. Maybe its "to far away" for the buffer re-use logic to "see it" so a copy is passed via a new buffer. I believe this to be a complication of using the "Array Subset.

    H) Since the Buffer_D is the input to the sub-VI call can simply pass the refence Buffer_D since it "knows' about it.

    So I suspect there is something in the fine print of the array subset functin that is coming into play.

    All of the above is just my speculation about what is really happening. :oops: If I have mis-represented any of the above please correct me. :thumbup:

    Ben

    Download File:post-29-1169924586.zip

  10. Thanks! I checked the RGB values of your color map against what I'd generated. Your map matches what I'd found, but you indeed have extra colors (a total of 256). It appears from a quick comparison that the extra colors come from:

    (1) A few extra shades of grey.

    (2) The same few extra shades of each "pure" channel (e.g. RGB (136,0,0) -- a darkish red).

    However, if you actually try to locate any of those colors in the Icon Editor color picker, you can't find them! Additionally, if you manually enter the RGB values into the color picker fields, the Icon Editor substitutes a different color to the one you picked! (It looks like it picks the closest one it can find.) This leads me to believe that your palette is the "correct" one, but that for some reason LabVIEW is restricting us to the smaller set of colors 221 colors I originally found.

    I even checked this programmatically. I created a rectange of (136,0,0) and set a target VI's icon to that (via property node). When I open the VI's icon in the Icon Editor, however, the rectangle's color isn't (136,0,0), it's (153,0,0)!

    It's all kind of weird.

    EDIT: Here are the colors that you have in your map, but that you can't actually use in VI icons:

    (Note that the last 5 elements of the last row are black and shouldn't really be there. They're just an artifact of resizing the array so it's prettier. There are 35 extra colors total.)

    post-2992-1169666303.png?width=400

    I do not have any more answers but another Q

    The non-0 and 255 values are factors of 51.

    THe 256 color values must also map to the 16 color version.

    Like I said, more Q's an A's.

    Ben

  11. I'm learning physics Quantum mechanics, Quantum field theory now.

    I'm trying to apply Mathematics and Physics to "Spirituality"; very difficult stuff.

    Hi Alfa,

    I had the opertunity to watch "What the 'bleep' do we know" this week-end and it made me think of you.

    The "plot" was sorta lame but the interviews by the scientist were very interesting.

    If any of you are open for a mind bending experience (that is not demonstrated on spiders) give that film a listen.

    Warning: If you are comforatable with your view of the world, then do NOT watch that flick.

    Alfa,

    I'm sure you would say "See what I was talking about!"

    Take care all,

    Ben

×
×
  • Create New...

Important Information

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