Jump to content

Justin Goeres

Members
  • Posts

    691
  • Joined

  • Last visited

  • Days Won

    10

Posts posted by Justin Goeres

  1. Didn't we just cover this in another thread a few days ago?

    EDIT: Oh, look! We did! And the original topic starter was sahara that time, too. The problem wasn't exactly the same, but it was close enough that I'd think anybody who solved that problem (or used the pointers we provided) would be able to solve this one.

  2. QUOTE(Norm @ Oct 29 2007, 08:05 AM)

    Take a look at Join Numbers. It will turn your 2 U8s into a single U16. You'll find it in Numeric >> Data Manipulation.

    Actually, another option might be to just Type Cast your "array of two U8s" to a single U16. I forget whether that works or not (and using Join Number is probably more readable), but it feels familiar. It's in Numeric >> Data Manipulation, too.

    This is all stuff I usually just end up working out on the fly for any given situation. Once you start to get comfortable in the Data Manipulation palette the sky is kinda the limit :ninja: .

  3. QUOTE(Norm @ Oct 28 2007, 10:47 PM)

    I see what you mean. I'd never noticed that behavior.

    Just to clarify what Norm is saying, here's a snippet that illustrates it. Basically, the Scan From String function skips over carriage returns (0x0A):

    post-2992-1193663477.png?width=400

    That feels like a bug to me. Why would a function that scans data out of an input string respect newlines? Doesn't that make it impossible to use with a multi-line input string (if you care about the newlines)? Does anybody else have a grip on that rationale that I'm just missing?

    EDIT: There's also no mention of this behavior in the LabVIEW Help. The closest it gets is "A space in format string matches any amount of white space, such as spaces, tabs, linefeeds, and form feeds," but the format string in my example doesn't have any spaces in it.

    QUOTE(Norm @ Oct 28 2007, 06:37 PM)

    And to move on to your actual problem... :)

    Since you're dealing with a binary protocol, I would convert the incoming string to an array of bytes before doing the parsing. That will give you the actual numeric value of each byte as an array of integers. Just use the http://zone.ni.com/reference/en-XX/help/371361D-01/glang/string_to_byte_array/' target="_blank">String to Byte Array function. It's in your palettes, under String >> String/Array/Path Conversion.

    Once you've got your incoming data as an array of integers, you can use a For Loop, Array functions, and whatever Numeric functions you need to get you home.

  4. QUOTE(Norm Kirchner @ Oct 26 2007, 09:19 AM)

    Justin, who killed your cat and made you so pissy? "kitty cat... i'm a kitty cat.. kitty cat"

    I'm not pissy, I just suggested that instead of whining in multiple threads about how no one was coming to his rescue, he should flesh out his questions more. As a side note, we've PM'd about it now and it's all cool :thumbup: .

  5. QUOTE(Yen @ Oct 26 2007, 04:34 AM)

    Hmm, for some reason I was under the impression that I did test this once on 8.x and that it did work, but I guess that impression was wrong. :oops:

    I was thinking exactly the same thing :wacko: . I know I had detachable event data terminals working at one point (either 8.0 or 7.1.1), and I could've sworn it was with an INI key. I remember using it, disliking it, and turning it back off. Apparently in the process I also purged my brain of how to do it :).

    What I'm really still dying to know is how the Required Outputs happened. Michael is being awfully coy about that. OK, Mike, how many IOU A BEER AT NIWEEKs is it going to take to get you to reveal your little secret? I'm in for 1. :beer:

  6. QUOTE(stamatios @ Oct 25 2007, 03:51 PM)

    I am not going to bother any more with you . My post is refered to ppl that can help me and not finish my "homework". stop being a Smartas* and stop posting rubish on my threat. go and play somewhere else!!!

    Fair enough, although I'm sorry you feel that way. Good luck with your project.

  7. Replying to your other post in a completely different thread...

    QUOTE(stamatios)

    I would like someone to help me, i posted 2 days ago 135 ppl view my problem and noone gave me answer :wacko: ..is there anyone who can help me plz..

    Thnx a lot...

    I am not a vision expert, but I would guess that no one is helping you because your questions are far too broad for anyone to be bothered to deal with.

    For instance:

    QUOTE

    As u will see in the word document that i have in the ZIP file

    I didn't see that. I saw a .docx file, and when I forced Word to open it, it just displayed a bunch of garbage. Maybe that's my fault (or my version of Word's fault), but I gave up right there. Two of the other files in your ZIP are just pictures of eyes with no annotations or anything. I understand that these are probably your source images, but without being able to view the .docx I don't have time to figure out from scratch what it is you're trying to accomplish.

    QUOTE

    Did i use wrong filters

    Maybe.

    QUOTE

    or do i have to change something?

    If your code is not working correctly, then yes, you probably have to change something.

    QUOTE

    If u can plz show me the correct filters

    Why not just say, "Can someone please do my homework for me?"

    If you can give a more detailed description of what, exactly, you've tried so far, and maybe some screenshots of the results you've gotten, maybe someone can help you. Until then, I fear you may just find yourself screaming into the void around here.

  8. QUOTE(CamilloN @ Oct 24 2007, 12:34 AM)

    I have made pictures of my signal, perhaps you will

    understand my problem better.

    It sounds like you're looking for some single built-in LabVIEW function that just doesn't exist. You can certainly write code to do what you want, but you'll have to build it from the functions you have available. Yen's suggestion to take a look at In Range & Coerce sounds like a good one to me.

    Note, also, that as NevilleD pointed out, Threshold 1D Array only works with increasing data. If you've got noise in your signal (which it looks like you do) that might prevent the threshold function from doing anything useful.

  9. QUOTE(silmaril @ Oct 24 2007, 01:49 AM)

    I wouldn't want any automatic function to mess with VI or tunnel positions that I have chosen carefully before. :thumbdown:

    So I'd prefer a function that only changes the size of structures, i.e. the bottom left corner, but doesn't move anything.

    In my opinion, it shouldn't touch any parent or child structures as well. I expect this would only lead to diagramms on which you can invest hours to bring them back to a decent coding style. :blink:

    I agree. My sort of off-the-cuff brainstorming about it imagines that it would take into account

    • the positions of all the nodes inside the structure, and
    • the positions of all the tunnels on the strucure

    and resize the frame so that none of those move relative to the main root of the diagram. If I'm not mistaken, I think that would (in principle) allow resizing from all 4 corners without disturbing the structure contents. (Actually, not quite -- it would still have to consider the extents of wires going from node to node to truly do a good job.)

    As JDave & crelf pointed out, though, resizing from anything but the bottom-right might require some gymnastics. Specifically, it would mean moving the objects around on the diagram inside the structure. It's not clear to me (in my head, at least) if that part would be practical.

  10. I like my block diagrams small, but that means that I frequently have to expand a Case Structure or For Loop or Event Structure or whatever to add new functionality to it. I usually do this by making the structure bigger than it needs to be, and then re-sizing it back down when I clean the code up.

    I wish there was an easier way to shrink the structures. For instance, if I could right-click on the structure and select Shrink to Contents from the context menu, that would be a time-saver. I don't need the structure to auto-shrink by itself -- I'd be happy if it was just something I could fire off as needed. Of course, there should be a buffer of a few pixels (configurable with an INI key? :P) around the contents for aesthetics.

    As a side note, could this be accomplished with Scripting? How hard would it be to get the extents of the contents of the selected structure, and resize it accordingly?

  11. QUOTE(sahara agrasen @ Oct 19 2007, 09:23 AM)

    2. In which i would like to generate Prime Number in range of 0-500 and set that numbers in one array whose answer is 100 when i multiplicate that prime number using 3...

    for example...If i get 37 as a prime number than it will set in 1 index bz its multiplication with 3 gives me more than 100 number....

    Isn't that a lot like just finding all the prime numbers between 33 and 500? Am I misunderstanding something? :wacko:

    I'd do something like this (assuming you can't just start with a pre-cooked list of primes, which would kind of defeat the purpose):

    1. Initialize an empty array, which we'll call "Known Primes"
    2. For each i from 2 to 500 (because i=0 and i=1 are degenerate)
    3. Divide i by each element of "Known Primes" which is less than or equal to sqrt(i). If none of the results are integer values, then i must be prime, so add it to the "Known Primes" list. If any of the results is an integer, then i is not prime, so don't add it to the "Known Primes".

    I'm not totally sure that will work, but I think it should. I'm not going to test it for you. You're already lucky enough that I like prime numbers.

  12. QUOTE(vinayk @ Oct 19 2007, 06:18 AM)

    I have a VI with tasks that need to be running continuously no matter what as these tasks control the valves on a machine. But when I try to open a sub-VI to show the status of all the components on the machine, my main VI tasks were paused until I close the sub-VI window which hinders my application purpose. So I set the main VI priority to 'Time Critical' and the sub-VI to 'Background' but still doesn't work, moreover LabVIEW hung up on me when I called the sub-VI. Then I noticed in the help file this quote: "If another VI with higher priority calls this VI, the priority of this VI rises to match the priority of the calling VI." So when I called the sub-VI its priority is also raised to 'time critical' as that of the main VI.

    How else can I call sub-VIs without pausing the tasks in the calling VI?

    You've got a couple misconceptions that are common among beginners.

    First, setting the priority of a VI or subVI doesn't work the way you think it does. A VI's priority refers (basically) to its execution priority relative to other VIs/subVIs when those other pieces of code are executing in parallel with it. In general, the execution model of LabVIEW is pretty good at doling out execution time, and I find myself changing a VI's priority only in very specific cases. In your example, there's no need to mess with the priorities of the various subVIs, and you should probably set them all back to Normal.

    Second, the reason your code seems to "pause" when the dialog opens is because you've got a dataflow dependency between the code that does the "counting" and the code that does the "dialog". The While loop can only iterate when all the code inside it has finished executing. But the dialog subVI doesn't finish executing until you close the dialog. That blocks the While loop from finishing its iteration. What you need to do is restructure the code so that the "count" loop doesn't depend directly on the dialog.

    Here's a very simple example of one way you could refactor your code:

    post-2992-1192804907.png?width=400

    Notice that the two loops (the count loop and the dialog loop) are now completely independent of each other. Information (like "count" and "stop") is passed from the bottom loop to the top loop using Local Variables. This allows the dialog box to be displayed without blocking the execution of the count loop.

    NOTE 1: There are about 1000 ways to skin this particular cat, and the example above is one of the simplest. The above example may work well in a very small application, but for anything more serious you will find that it may not scale well. There are more advanced techniques that are necessary for bigger applications.

    EDIT: The other posts above this one touch on some of those techniques...

    NOTE 2: I suspect this is your first exposure to Local Variables. PLEASE DO NOT FALL IN LOVE WITH LOCAL VARIABLES. They're going to seem like the solution to all your problems, but they're not. The excessive use of Local Variables is considered poor style and their use in large or complicated VIs can make the code buggy, unreliable, and (most importantly) almost impossible to debug.

    Attached Example: Download File:post-2992-1192804918.vi

  13. QUOTE(Mache @ Oct 18 2007, 07:24 PM)

    But more about LabVIEW. If I ask a few engineers, who have just heard about LabVIEW and have not dabbled with it a lot, they will say "LabVIEW is a programming language more suited towards controlling machines and sensors". In fact this is how it is described to the management gurus in the MegaCompany where I am at present. In fact that is how it is sold and accepted into many work places. This perception needs to change and NI is the only one who can change it.

    As I was reading that my mind floated back to some of the demos in the LabVIEW Zone at NIWeek. My recollection (and anyone can feel free to correct me on this) from the 2 NIWeeks I've been to is that the applications that are on demo on the LabVIEW Zone are basically confined to two categories:

    • Applications that do really neat things with NI hardware, even if they're not "industrial" applications (like the DDR machine or the Beatbox demo (which I guess wasn't in the LabVIEW Zone, but you know what I mean)), and...
    • Little games and toys put together (from the rumors I've heard) by AEs. (which, if you'll excuse my condescension, are not always that impressive.)

    What I would love to see in the LabVIEW Zone is, for instance, an image-editing program, or an MP3-playing app with playlist management, written in 100% pure G and running as a compiled, standalone executable (with the source code on the machine, too, so we can see under the hood :ninja: ). Something that would make people who see it say, "There's no way that's done in LabVIEW." I'm not saying that NI needs to build and support an image editing app just to prove a point, but the fact is the most of us have never seen any "mainstream"-style applications written in LabVIEW, even though we're the ones who are already drinking the Kool-Aid.

    Of course, this is the kind of thing that could come from the community, as well. Is it time for those of us who want to see mainstream applications in LabVIEW to step up to the plate? (with all that spare time we've all got on our hands, of course. ;) )

  14. QUOTE(TG @ Oct 17 2007, 07:36 PM)

    QUOTE(crelf @ Oct 18 2007, 04:50 AM)

    IMHO, you should post your thoughts and ideas, rather than just posting that you have them.

    "This post is not executable. The full development version of LAVA is required to fix the errors. This post is not executable. The full development version of LAVA is required to fix the errors.This post is not executable. The full development version of LAVA is required to fix the errors.This post is not executable. The full development version of LAVA is required to fix the errors.This post is not executable. The full development version of LAVA is required to fix the errors.This post is not executable. The full development version of LAVA is required to fix the errors.This post is not executable. The full development version of LAVA is required to fix the errors.This post is not executable. The full development version of LAVA is required to fix the errors.This post is not executable. The full development version of LAVA is required to fix the errors...." :blink:

    I dunno, that's just what came to my mind :P. I also agree, though. Dish the dirt!

  15. QUOTE(NIBC @ Oct 16 2007, 10:50 PM)

    I had another problem. I try to use the Advanced Serial Write and Read subvi in new blank vi (Try_Serial.vi). When i simulate using lookback test, try type something in the 'string to write' but it wouldn't display back on the 'read string' Try_Serial.vi. It just display on Advanced Serial Write and Read(M).vi. It couln't pass out the string.

    I would like to know why the Try_Serial.vi can't display out the string while i type something in string to write box? How to solve this problem?

    My initial guess would be that you're just misunderstanding the Advanced Serial Write and Read.vi example slightly. Notice that the example (which you're using as a subVI) has a While loop inside it. When your code runs that VI as a subVI, the execution will get "stuck" in the subVI because that While loop will just keep running over and over. The read string won't get passed out until that While loop stops. (You can check this by running your code, then opening the subVI's front panel and clicking the Stop button in the lower left.)

    If you're looking for example code to edit for use in an application, I would advise you to take a look at the Basic Serial Write and Read.vi, as well. It executes once and exits, which is more likely to suit your purposes for a subVI.

  16. QUOTE(vinayk @ Oct 17 2007, 05:39 AM)

    Welcome to the board!

    What you're talking about is definitely possible. The complexity of what you can do is really limited only by how much time you have/want to put into it :).

    QUOTE

    If you want a modal screen (i.e. one that, when it appears, prevents you from switching to any other windows until you close it), an easy way to get started is to use the Dialog template (File >> New... >> Dialog Using Events). You can use the resulting VI as a subVI in your code, and when it executes it will display its front panel to the user.

    Note that you can also make any VI behave this way by setting its Window Properties (File >> VI Properties... >> Window Appearance >> "Dialog" or "Customize").

    QUOTE

    This is more of an application design question. Again, it's completely possible to do what you want to do, but in this case there's no "canned" solution. You will need to become familiar with property nodes (see also here), especially the "Disabled" and "Visible" properties.

  17. QUOTE(Val Brown @ Oct 16 2007, 03:56 PM)

    Nor am I, but I think that's slightly tangential to the question of how to increase LabVIEW's mainstream acceptance. There are hordes of people (kids and adults) out there who cut their teeth in programming on whatever they can get for free. Heck, I didn't even (directly) pay for my initial LabVIEW exposure years ago -- it was just part of the curriculum in a lab course I taught.

    I don't think LabVIEW will ever be "free" (beer or speech), and FWIW I don't think it necessarily ever needs to be. But the fact is that you can learn a tremendous amount of C/C++/Java/PHP/Perl/god-knows-what-else without shelling out any extra money*. For LabVIEW, the barrier to entry starts in the $1200 range and goes up from there. For those of us who use it as a professional tool, the value is apparent. But for the kind of people who should be being taught to think in G (to coin a phrase), that's a gigantic difference.

    QUOTE(neB @ Oct 16 2007, 02:42 PM)

    Making
    LV
    mainstream is a lot like "fixing the world", the first step begins with ourselves. Continue participation in forums, start or attend user group meetings...

    ...and pimp LabVIEW to all your friends who live in other languages. Show them an application you've done, and what dataflow really is. Everyone I've ever shown LabVIEW to comes away from the demo thinking, "Wow! That's really cool!" (They also come away thinking that they still don't understand where variables are defined, but after another couple of beers it all starts to make sense.)

    *Beyond the cost of your computer and your internet connection, which are practically like air and water for geeks ;) .

  18. QUOTE(NIBC @ Oct 16 2007, 07:47 PM)

    Oddly, Error -1073807202 (0xBFFF009E) doesn't appear in the http://zone.ni.com/reference/en-XX/help/371361D-01/lverror/visa_error_codes/' target="_blank">VISA Error Codes page of the LabVIEW 8.5 Help, but inputting the code into Help >> Explain Error... returns the following:

    Possible reason(s):

    LabVIEW: (Hex 0xBFFF009E) VISA or a code library required by VISA could not be located or loaded. This is usually due to a required driver not being installed on the system.

    =========================

    VISA: (Hex 0xBFFF009E) A code library required by VISA could not be located or loaded.

    I'm guessing that there's a problem with your VISA installation. It's probably nothing you're actually doing wrong in LabVIEW itself.

×
×
  • Create New...

Important Information

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