Jump to content

jdunham

Members
  • Posts

    625
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by jdunham

  1. QUOTE (labviewnoob @ May 19 2009, 06:20 PM)

    Is there any better method for it? any graphical help would be welcomed. many thanks.

    Make sure you learn about auto-indexing of FOR and WHILE loops.

    There should be plenty of examples in the LabVIEW Examples folder.

  2. QUOTE (shoneill @ May 19 2009, 03:19 AM)

    Has this been fined as a bug? I see it as a major problem as it makes LVOOP and XControls almost mutually exclusive whereas they shoiuld really be a perfect match.

    I also have to pipe up and say that some of this wouldn't be needed if the default probe information shown on an object's wire could be made visible on the VIs front panel. The relative difficulty of debugging is a serious barrier to adoption of LVOOP.

  3. QUOTE (Gary Rubin @ May 18 2009, 09:35 AM)

    According to the documentation for the Boolean Color property, the order of the color pairs is Foreground, then background. This seems to be the opposite of the way it works (see attached).

    If you use the color picker tool, and type "F" you change the foreground color only, and then press "B" you will change the background color only. Those give the same behavior as your posted vi. I agree that what NI defines as "foreground" and what they call "background" is not intuitive, especially for booleans, but it has always been like this.

  4. You could also use use a subpanel control sized to fit the pane to the left of your splitter. Then make a new VI with the controls on the left side and put that VI into the subpanel. Then when you want to print, just print the new subvi rather than the main VI. You probably have to move some or all of your block diagram code into your new subvi, so this only works if your code is modular enough to change the block diagrams.

  5. QUOTE (Michael Malak @ May 14 2009, 02:57 PM)

    http://forums.lavag.org/Instantiate-WaveGr...aded#entry62912

    In a nutshell, I need 12 WaveGraphs, independently controlled (including zoom), yet treatable as an array. So I am using an array of 12 references to 12 independent WaveGraphs. The attached diagram shows my current solution, which is to wire the array of references directly to where it is needed in the event loop.

    One thing no one suggested was subpanels. It's kind of an advanced LabVIEW topic, and I wouldn't normally recommend it for a self-proclaimed new user, but I think it gets you closest to what you need. You can't have an array of subpanels, but you can drop 12 of them on your panel. First I would try it with two and see if it's feasible.

    Here's what you could do:

    1. Drop the Subpanel controls on your front panel and arrange them.

    2. Make a new VI with your graph on the front panel, and select Fit Control to Pane by right-clicking on the graph.

    3. Make this VI reentrant in the VI Properties -> Execution. This will enable you to create clones of your panel.

    4. Run Open VI Reference with Options = "8" once for each graph you need, and then pipe those references into the SubPanel nodes on your diagram.

    5. Figure out some way to get the data into your cloned panels (there are lots of ways). You could use notifiers named for each clone name, or else you could obtain the control references for each with a few VI server calls and then send data into the Value property of those control refs.

    Oh curse the day I read your post, Michael Malak!

    It was an interesting problem, so I had to code it up. I didn't close any references (probably doesn't matter), nor handle any errors (there are none), and I only added comments where the code was completely obscure.

  6. QUOTE (angel_22 @ May 14 2009, 05:40 PM)

    i want you check and there is some wrongs..

    Well it looks correct to me, but it's just kind of unfinished. Though maybe you want the dehumidifier ON when humidity is high.

    So isn't there anyone at the university who is paid to help you figure out your homework project, like a Teaching Assistant? I'm not sure this board is the right place to get all the support you need.

  7. QUOTE (Aristos Queue @ May 7 2009, 12:16 PM)

    Because most people want double type for the numeric. But it is really nice on the BD constant to drop it and then, if you need floating point, to type in a value using a decimal point and the constant will automatically change to double type. If it dropped as double by default, if you typed 3, we wouldn't be able to assume that meant you wanted an integer.

    We'd probably do the same thing on the FP except that most people never type into the thing that drops onto the FP... they just leave the value as zero (and you wouldn't want it coercing to a new type everytime you typed a value into it while you were debugging!).

    This has been bugging me lately and I finally put my finger on it. The autoconversion is neat, but really, 100% of the time, I know exactly whether I want a float or an integer, and it would be so much easier to have both on the FP and BD palettes rather than trying to trick LV into giving me the right choice. I'm not saying that you have to put all the possible numeric types on the palette, but putting all the most commonly used ones on (both of them!) would have been awesome. Trying to hide that stuff and be clever about automatic conversions is not that valuable to me.

    I think LV suffers from a bit too much of this in a 'don't scare the newbie' philosophy. Maybe it needs to be that way, but it would be great if there were more ways to get past that and end up with advanced palettes with more useful stuff for the advanced users.

    While we're waxing philosophical, why do the time formats always default to AM/PM? Who finds that useful?

  8. QUOTE (Aristos Queue @ May 8 2009, 12:01 PM)

    But that doesn't work. If the STOP test returns false, the answer is off by one.

    Incrementing 'i' is easier.

    post-1764-1241816980.png?width=400

    I knew you couldn't trust the "N" terminal any more (found out the hard way) but I figured that was by design.

    QUOTE (Black Pearl @ May 8 2009, 09:18 AM)

    I'm shocked that only happened to you once. It's a huge problem and we make sure during code reviews that the error cluster and any refnums ALWAYS go through a shift register unless there is a commented reason. Often I don't take refnums out of for loops because its so unsafe. I just fork the wire before the loop.

    QUOTE (Gavin Burnell @ May 8 2009, 02:06 PM)

    Attached below is an XNode (
    LV
    8.5.1) that implements this for all numeric types and also when the A input is an array.

    Part of me wants to say hooray! and part of me wants to cry. The latter part is the part that tries to defend LabVIEW as a 'real' programming language. Thanks for submitting!

  9. QUOTE (Yair @ May 8 2009, 12:33 AM)

    QUOTE (TobyD @ May 8 2009, 07:17 AM)

    You could submit this as an
    .

    Well the problem is I need it compatible with DBLs, I32s, I16s, Complex DBLs, XY points, and XYZ points, and arrays and clusters of all of those. It's easier to just do it with the plus and minus functions, but it can really make a mess. Obviously LabVIEW should allow functions with true polymorphic inputs, but while I'm waiting for that, I thought maybe they could throw in the PlusAndMinus for me.

  10. QUOTE (Neville D @ May 7 2009, 12:19 PM)

    Thanks, I knew about that. But what I really want is this... (And I've already suggested it to NI, but you never hear back about that kind of thing).

    post-1764-1241729121.png?width=400

    This construction comes up all the time if you use picture controls, or you do GUI arrangements, any kind of 2D coordinate stuff, or histogram bins, or limit testing... I know it sounds like feature bloat, but having a native function for this would lead to much cleaner diagrams.

  11. QUOTE (Gary Rubin @ May 7 2009, 10:09 AM)

    I remember changing the constant in front of someone who had used LV for several years, and he exclaimed ,"I never knew you could do that! I always put a NOT function after it." Maybe he wasn't the sharpest tool in the shed, but I'll wager he wasn't alone, so NI put both of them in the palette (in the old days there was only the False constant).

    QUOTE (neBulus @ May 7 2009, 10:30 AM)

    When we wire a error cluster to a case it puts the code in the No Error Case

    When we create an sub-VI with an error cluster the error in is optional while all other inputs are required.

    Insert node on a reference wires to the refence input instead of the error cluster...

    I thought these all got fixed from earlier versions when they were much more annoying, but I would agree, the changes were welcome.

    I wish that when replacing Multiply (for example) with Compound Arithmetic, then the multiply option would automatically be chosen.

    I also wish that when using Create SubVI... that the Error In and Error Out terminals would be named correctly.

    I wish there was a simpler Array Size primitive that just resized itself for the number of dimensions.

    I wish there was a simple PlusAndMinus primitive with two inputs and two outputs.

    I wish that Merge Errors.vi was a resizable primitive.

  12. QUOTE (Black Pearl @ May 5 2009, 12:17 PM)

    @Paul: Enterprise Architect looks good. Any experience to share about uml and LV (propably we'd go for a new thread for this, but I'm eager on that one)? I'll sign up for a trial as time will permit.

    To go further: After some reading, I see that there are several ways to 'do agile developement'. Can you share any experience of which concepts work well with LV and which don't? (so I don't see any reason to do 'nightly builts').

    It's my opinion that UML doesn't add much to LabVIEW development, but maybe I haven't given it a fair shake. While I realize LabVIEW and UML have different purposes, I feel I can design well enough in LabVIEW that I don't need to waste engineering resources (i.e. my time) on a second set of graphical program expressions.

    You may be right that you don't need to build your labview nightly, since it compiles all the time. But the underlying tenet is that you try to make sure your code (at least the trunk version) is nearly always in a state where it could be released, perhaps with many features missing, rather than getting into a pit where it is broken for weeks at a time. On our project we build an EXE, so we do have a nightly process to build it if there have been any SVN checkins. Ideally you will have automated tests running against the nightly version while you sleep. (Still working on that!)

  13. Hey Cousin Pete:

    QUOTE (pete_dunham @ May 6 2009, 09:44 PM)

    First of all, you should generally use the conversion functions shown in place of a typecast.

    post-1764-1241676263.png?width=400

    QUOTE (pete_dunham)

    2)The same code as 1) but as a SubVI. This initially works...UNTIL I update the TypeDef. This results in a broken arrow

    ...

    So I infer from this code that the control reference is a static reference that is not dynamically linked to the control? Is this correct?

    This seems like a limitation from passing type def. control references through subVIs...as the Control Ref is not dynamically updated (the subVI sink is looking for a different source if type def updated).

    What you want to do is change the subvi control reference input to a more generic class:

    post-1764-1241676555.png?width=400

    Then you can pass any data type in there, and just check at runtime to see whether it contains any booleans.

  14. It seems like the VI Analyzer will make short work of your attempts to hide code, so personally I would choose a different approach for keeping secrets secret. At the very least make sure there is lots of other stuff on the diagram, but in general, steganography is never as secure as cryptography.

  15. QUOTE (ShaunR)

    Ummm. Are you referring to spawning multiple (200+) threads like in the BT client? I don't think that is possible. Especially if you can only have cores x 4 threads.

    I don't know all the details of LabVIEW threading, but I learned a lot from these forum discussions:

    http://forums.lavag.org/Parallel-execution-t10870.html

    http://forums.lavag.org/Templates-t13200.html

    QUOTE (ShaunR)

    Indeed. From this thread I have gleaned that UI events (and indeed labview events in their entirety) aren't really have what I would consider "proper" events. My definition would be that defined by NI VISA as the callback event.

    QUOTE (http://www.ni.com/support/visa/vevents.pdf)

    It is important to note that because of the dataflow programming structure of

    LabVIEW it is not possible to use the callback mechanism of event handling in

    LabVIEW.

    That's an interesting quote. I think just shows that the NI VISA team is not on the forefront of LabVIEW development (to be fair, I don't know how old that doc is). Their API could easily accept a VI reference and invoke VI.Run on it when the event happens. They could also accept an occurence or a queue refnum, but I think it would make more sense to do the VI reference. Then inside that VI you could invoke whichever queues or notifiers or occurrences (or polled globals) you need to interact with your running processes. LabVIEW with a callback (which you can also implement in your own code with a private notifier or a VI reference) is no less event-driven than C code with a callback.

    Jason

  16. QUOTE (manojba @ Apr 29 2009, 03:45 AM)

    Thanks everyone actually I had used open Url in default browser vi and to trigger it I used Flat square button in front panel with color of background so that it was not visible but i had problem with it whenever user clicks on text the button is not pressed as it is behind text but if user clicks area behind text it works but it is not working as i need it bcoz its difficult to press the button you will come to know by seeing the following fig

    Then i changed to event structure though its working fine but it would have been nice if it worked on clicking text and not whole panel.

    1) It's better to make the boolean transparent instead of matching the background. Then if you are using system color or if you change the background, it will always work

    2) Use the boolean's "Boolean Text" property rather than just a string overlaid on your boolean. Then the whole thing will be clickable.

  17. Here are two other ideas:

    One is to enable "update while typing" on the string control. Then you will get the value changed event after the first letter. Maybe not quite what you want but easy to do.

    The other is to cover the string with a transparent boolean. When the user clicks the boolean (thinking they will click into the string underneath), you hide the boolean (visible=F), set the string's Key Focus to true, and then show the virtualkeyboard. Whenever the virtual keyboard goes away, you make the transparent boolean 'visible' again.

×
×
  • Create New...

Important Information

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