Jump to content

Yair

Members
  • Posts

    2,869
  • Joined

  • Last visited

  • Days Won

    44

Posts posted by Yair

  1. I just want to confirm, when I used Yen's method, my output file is not black-and-white, instead, it is made up of 2 colors. The .bmp file can be red with blue or yellow with green or green with white or etc.... And everytime I run the program, it will get different combinations.

    I wonder if anyone is seeing this too? Is there anyway I can do so that I will always get black and white ONLY in my .bmp file?

    If you read the help for the function, you will see that the colors of the boolean array are determined by the first 2 elements of the Colors[] array. All you need to do is drop a couple of color box constants (from the Numeric>>Constants palette) in a constant array and set them to be white and black and wire that constant in as the colors.
  2. I'm fairly certain you won't find any image either. The Get Term Image method will work on all controls, but since controls inside a cluster don't have a terminal of their own, the image for it can't be returned. What you will probably need to do (and what NI probably does) is to hold a small bank of images for all the data types and use those images for controls inside clusters. Getting the images using scripting should not be all that hard.

    Another option would be to write a simple piece of code which will copy the cluster's controls into a new VI and then use the Get Term Image to get their images. This should have the advantage of being more general and probably faster to code.

  3. Error 1 means invalid input (as the description should tell you). This probably means you typed your path into the path control and something about it is invalid. It would be better if you use the browse button to select the file you want.

    If you want to create a new file, you should right click the path control and change the browsing options to a new file. Also, since your files have a specific extension, you can configure that in the browsing options as well.

  4. This can also be done with the standard picture VIs (which ship with most versions of LV) and can be found (at least before LV 8.0) in the Graphics & Sound palette.

    You basically need to use Flatten Pixmap and wire the result into Write BMP file. You will also need to convert your array into a boolean array, which you can do by wiring it into a Not Equal to Zero? node.

    post-1431-1151940891.png?width=400

  5. The Open/Create/Replace VI has a File Path input. All you have to do is wire a file path into it and you won't get the dialog. To get the actual paths you can use the File Dialog VI from the File I/O>Advanced palette for one file and then strip the extension and use the same name for the other file.

    To write a file without saving simply wire a path into the File Path input.

    In general, your program would probably be better off with an event structure and less locals and sequence structures. I suggest you go searching for some LV tutorials to learn more.

  6. And what would be the way of dealing with timestamp in text format?
    If you mean that your timestamps are in strings, then you will need to convert them to LV timestamps by breaking the strings into their different parts, converting those parts to numbers, wiring those numbers into a date/time cluster and converting that cluster to a timestamp. The basic VIs can be found in the Time & Dialog palette. A nice example of how this can be done can be found here.
  7. The strings are to insure a minimum requirement and give the committee a standard interface to use for testing. They do not have to define the Functionality of the API. It is not required that the string outputs be the only way that the API transmits it's information. The string outputs must be a part of the API.
    That's what I wanted to hear. Thanks.

    P.S. I missed some words in my reference to 6.1 - I meant to say that there is no way to make it truly independent from the calling VI and portable without writing external code and compiling it for every target (at least none that I could think of, which isn't to say that there isn't).

  8. ...we felt that placing this limit on entries allows us all to have a baseline - a frame of reference - to assess your entries on. For your entry to be valid, it must work with the template API...
    Does that mean that the only way for me to output the results to my application (not to the test VI) is through those 2 strings? Can't I use anything else?

    I suppose I could output those strings to a mediator and use that to generate what I want, but that seems rather ridiculous. I would really rather add more options into my interface now (while still keeping the stings, of course) because I haven't managed to find an application where this will really be useful yet and I don't know if I'll use this after the challenge.

  9. Great challenge, and I'm happy to say that I've completed the basic part of my API and am thinking of some cool apps, but I do have a couple of questions.

    1. The challenge states that my application HAS to use the same API as the test VI. This strikes me as very limited. I would much rather extend my API and use more powerful features in my application. Is this not a possiblity?

    2. Both dynamic events and the mouse input VIs were not available in 6.1, so obviously there's no way to make it really portable in 6.1 without writing some external code (which is not allowed by the rules :nono: :laugh: ). Did you include the 6.1 template on purpose or was that just an oversight?

  10. I think that the top loop is the most likely to be the trouble-maker, but I can't find other ways to take advantage of mouse scrolling in LabVIEW 8. Please let me know if you know LabVIEW 8 has native support to mouse scrolling.
    If you suspect this is the source of the problem, you can simply remove that loop and see if this keeps happening. The message queue VIs use a reentrant DLL, so I don't think that it should lock the UI thread in any way, but it is easy to check.

    LV has support for mouse scrolling (although unfortunately not in the event strucutre) if you go to the Advanced>Input palette (not sure where it is in 8). I think it was Jean-Pierre Drolet who once posted an example showing this here. Try searching for it.

  11. wasn't it in "demolition man" where sly gets a rat-burger in the former severs of the city? :D
    Indeed it was, and to quote his response when he finds out - "Best burger I've had in years". :D

    And it also had a good call on "the Schwartzenegger presidential library"...

    Fun movie... :yes:

  12. 1850 (or was that 1940?).
    Now there's a true dyslexic. :book:
    as a physicist, I like a metre to be a metre
    Or maybe a meter, as your current environment would spell it? ;)
    Looks like not only your mutiple "arse"s made it through the filter, but your single "######" did too.
    That's because y'all are Premium Members, and can cuss all you like (even though "######" has already been official cleared as a legitimate word by the highest authority (American TV). :D
    God Evolutionist: I'm evolving towards my highest limit
    So, you're going with the "Thou art god" vibe. I grok that (or maybe I Grok Spock? :blink: ).
  13. I thought my movie blurbs were pretty funny (apparently I'm the only one :embarassed:).
    It was a general advice, not meant specifically as a reply.
    How you can see everybody lie to sell their products today

    ...

    And you'll not take the animal products with you, only the knowledge and the experience from I AM CREATING GOD.

    I don't suppose these two sentences can be connected in any way, can they?
    the 97.7% are so primitive that they think with them will end the world ...They waited in the year 1000, now big hopes for the year 2012( the end of the Maya calendar)...
    OK, Someone has been watching "The X-Files" just a little bit too much. :blink:
  14. I'm inclined to think he's a bot... they're not very coherent.
    Not a bot, just someone who's trying to promote his book in as many avenues as possible. Either make a good joke about the posts or ignore them.
  15. ...and the sounds of battle were really really quiet - I appreciate that sort of detail.
    You guys should consider watching Firefly, a short lived series which was aired at 2002. It focused more on humor and action (although it did have some good drama) and it employed such devices as cool photography (stuff like doing zooms in space), no SFX in space, no aliens, Chinese as well as English and a huge set for the ship which really made it look real. This was also much less "technical" sci-fi than other stuff and more sci-fi in the concept of creating another environment for our own stories.

    The series was canceled after half a season, but a movie ("Serenity") was released last year to finish the basic story (with a great scene at the beginning which had two shots going for almost 10 minutes).

  16. ...in this case, using the third method in 7.0 with an array of 10,000 elements leaves 1300-1400 of the elements in their original locations, which is a rather large margin of error (13 percent). Since this method is based on the random number generator and the number is around this range every time I run the VI it seems reasonable to assume that this is a property of the random number generation which is reflected through using this method.
    I asked the cryptographer friend I mentioned about this and he provided me an explanation which shows that this is not LV's fault. He said that we can discard the number of times an element is switched more than once back to its original position as statistically insignificant and just look at the number of elements which were never moved.

    Then, he said that the formula for calculating the chance of an element not being chosen was defined as

    post-1431-1150122432.png?width=400

    which means that the larger n gets, the closer the result is to e^-1. Then, he said that the chance of a single element of our array NOT being chosen is ((x-1)/x)^2x (it can be chosen once in each selection and we select 2x numbers because we select 2 random elements in each iteration.

    He also said that the formula shown earlier only gets to e at infinity, but it gets very close to e at a very early stage, so basically that equation will be very close to e for any number above a certain number (let's say 20 or 30). With some simple power math he showed that the expression I wrote is equal to e to the power of -2 which comes out to 0.136, which is the result I got and means that LV's random function is now cleared.

  17. That's why they sell it in Germany as "Fosters - Famous Australian Beer". Nobody want's to drink it @ home => they have to sell it somewhere else.
    I once saw a German wine expert tell Jeremy Clarkson the same thing about Blue Nun wine - no one in Germany likes it, so they send it all to the UK.
    I had read the term years ago in the novel "The Moon Is A Harsh Mistress" by Heinlein (one of the best scifi novels of all time in my opinion.)
    Amen to that (although I can't say I read that novel). I could see how someone going through the various LL books would resort to drinking a lot of beer as a solution, though. :( Those books can be extremely hard to follow properly. It's almost like a space (soap) opera.
  18. Why this option of using some other compiler instead of LabWindows CVI couldn't be possible. All it requires is will from NI to put some effort on it. There could be a new High Performance LabVIEW toolkit that would use high performance compilers from other vendors. Of course it can be that LabVIEW generates code that is far from ANSI C and only LabWindows could be used to compile it.
    I believe you've misunderstood Rolf on this point.

    LV does not generate C code, but machine code. There are some exceptions (like LV embedded or (I think) the PDA module), but not the PC version.

    If I understand Rolf's explanation correctly, he meant that if you build your VI as a DLL instead of an EXE, LV will use the CVI RTE to generate parts of the DLL. At no time is the LV code translated to C.

×
×
  • Create New...

Important Information

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