Jump to content

Justin Goeres

Members
  • Posts

    691
  • Joined

  • Last visited

  • Days Won

    10

Posts posted by Justin Goeres

  1. QUOTE(crelf @ Nov 7 2007, 06:04 PM)

    I would be interested in getting a cantankerous Aussie's take on this scandal:

    (via http://en.wikipedia.org/wiki/Victoria_Bitter' target="_blank">Wikipedia)

    QUOTE(Wikipedia)

    In 2007, The Foster's Group who make Victoria Bitter are planning to change the strength of the beer from 4.9% ABV to 4.8% ABV to cut the amount of excise Foster's pays on the beer it brews.

  2. QUOTE(Mads @ Nov 8 2007, 03:32 AM)

    In the app builder of LV8.5 you can add a folder to the source list. I have several folders where I store plug-in VIs and tools (VIs or libraries) so it would be nice if I could add those to the source list and specify that their diagrams should be removed...however even though you actually add a folder it will not add a folder - it will just take the content of that folder and place it in a directory which is limited to be either the support folder, the exe folder or the folder of the caller....

    If I understand you correctly, this is all available in the App Builder.

    Go to the Destinations pane. You will see (by default) two options: <YourApplication>.exe and Support Directory. Click the '+' button to add a new destination directory. Set up its label, path, etc. on the right side of the pane.

    Now go to the Source File Settings pane, find one of your manually included files in the Project Files tree, and select it. In the Destination pulldown on the right side, the new destination(s) you previously created will be available for you to select.

    Note that you can also set the destination for all the included items in a particular source folder, as well.

  3. I'm really of two minds about this. The core of your question, I think, comes from the experience we've all had of creating a control on subVI A that we're just going to wire to a terminal on the parent VI B. If A is required, and you want B to be required, it takes what, like like four extra operations to set that behavior??? That's pretty poor usability for an operation some of us have probably done hundreds of thousands of times.

    But making required inputs on a subVI automatically drop as required inputs on a parent VI really just trades one side of the problem for the other side. I can't say for sure how often I want those parent inputs to be Required. I'd guess it's more than 50% of the time, but I dunno if it's as high as 75%. The other 25-50% of the time, I probably want them not to be Required. :)

    So I would probably lean toward saying in your scenario they should be "Required," but I certainly can see other people coming down on the other side of the fence.

    Wouldn't it be nice is the whole "connecting terminals to the connector pane and setting their attributes" process was easier in the first place, given that it's kind of a core concept of the language? :P

  4. QUOTE(Rimmergogo @ Nov 7 2007, 07:52 AM)

    I'm not totally sure I understand exactly what you're doing, so forgive me if I'm way off-base.

    If you were using LV8.2 or greater, I would suggest my LVOOP Imagemagick library :P. But even though you're on LV7, you can still use ImageMagick directly to do what you want. Check out the convert utility, especially the density and/or resample operators.

    What you can do is build your command-line string in LabVIEW, execute it with the System Exec.vi function, and then load the resulting output file as a PNG/TIFF/whatever. ImageMagick usually involves a bit of trial and error, but it's a terrifically powerful toolkit.

    Finally, if you're messing around trying to see if your operations are taking effect, you might find the identify utility will save you from having to actually open & display your output files.

  5. I've always liked the Paste Special... function in Excel that lets you choose what you want to paste.

    For LabVIEW, I can immediately think of a few things a dialog like that could handle for control/indicator pasting:

    • Value
    • Display Format
    • Colors
    • Control Size

    and more. Of course, I'm sure this would probably be wickedly complicated on the back end, to handle all the different datatypes in anything approaching a sane way. But I can dream... :)

  6. QUOTE(Zeclark @ Nov 4 2007, 01:31 PM)

    When I use "Read JPEG File.vi" without path, I can paste the http address in the dialogbox to successfully display the image..

    However, if I use the same address as a path or string constant in the block diagram, the program corrupts the link by adding a "\" and can't access the image:

    http:\//192.168.1.128/484833/productXX.jpg

    I know that I can display the image with the http address, but how can I use it in the block diagram without having it corrupted.

    The reason that you can paste the URL into the file browser when you leave the path input unwired is because Windows understands what a URL means in the file browser. In fact, I would bet that what's actually happening is that Windows (probably through IE?) is downloading the image from the URL to a temp file, then returning the path to that temp file to the Read JPEG File.vi VI. You just never see any of this happening because it's buried inside the VI and hidden by Windows.

    But that's different from passing a URL into a subVI via a path control. So Ton is right about the '\' character being added, but it actually doesn't matter because Read JPEG File.vi doesn't take a URL at its path input to begin with.

    The bottom line is that I don't think you can use Read JPEG File.vi to do what you want to do, unless you download the source image to your computer first and load it from there. But it sounds like that poses a speed problem for you :(.

    Maybe you could streamline the process by implementing the communications manually, i.e. manage a single TCP/IP connection in your program, do the transactions in raw form (so the data comes straight to your app rather than to the disk), and then convert the raw data you receive to something suitable for your picture control. But that's a fair bit of trouble to go through. You might also be able to display the picture in some sort of special ActiveX control, but I'm the wrong person to ask about that ;).

  7. Settle down, everyone. I already talked to Mr. Sango and told him I can definitely help him out. Sorry to lock you all out of such a once-in-a-lifetime opportunity like this, but unfortunately there's only room for one person to make off with all this loot. But don't worry, I won't forget all my favorite LAVA members, and I'll probably keep my Premium Membership up, at least for another year or two until the construction of my own personal castle in Dubai is complete.

  8. Actually, that's a decent design problem. Kudos to your teacher for giving you a relatively practical assignment.

    As tcplomp pointed out, we're not going to do your homework for you. However, if you have specific questions about code you've written (why it's slow, what an error message means, etc.) you'll find people here who are happy to help. And when you have a question, posting sample code along with it so we can see what you're doing is invaluable.

    Welcome to the board, and good luck with your assignment.

  9. QUOTE(Norm Kirchner @ Nov 2 2007, 07:04 PM)

    We need an audible warning for questions like this that make the screen flash and scream really loud "HOMEWORK ALERT!!!" BTW, Search the LV help for RGB and you should find information about converting.

    As crass as this sounds, I would be more inclined to answer homework questions if the people asking them would buy Premium Memberships first :P.

  10. QUOTE(Aristos Queue @ Nov 2 2007, 02:37 PM)

    Just in case of what? If I have 2^15 x 2^15, I get 2^30 as my maximum bound. It can't exceed I32, much less U32. I only went to U32 because an area should never be negative.

    I was thinking of the case where you have enough obscenely large block diagrams to roll over that U32 when you start adding all their areas up. But I guess you could coerce that value later, eh? :P

  11. QUOTE(Norm Kirchner @ Nov 2 2007, 08:08 AM)

    Well this brings up a good philosophical point.

    Each of us on the forum, use it to help answer questions we have on our jobs (aside from the lounge)

    So does that mean that students shouldn't use us as resources for their questions? I mean, a question like "what is the output of an ADC or how does resolution play into full scale gain" is fair no? Where else would they get the answer? Text book, sure, but so could we for some of our questions. Google or online(other than a forum)? sure but its just easier to ask a group of people interested in helping.

    Also isn't it better to get someone involved in the forums early on, and have them come back when they have a really cool discovery and share it(and the royalties )w/ all of us?

    I was actually discussing almost exactly that with someone the other day. With all the homework questions around here lately, it's actually starting to make me paranoid about answering simple newbie questions from non-homework-hustlers. While I can't be anyone's private tutor (unless I'm on the clock ;) ), people who are real, interested novices should definitely feel comfortable asking what are, to some people, stupid questions :P. For that matter, there's plenty that I don't know, and that I would have to start out by asking some pretty inane questions about. I wouldn't want to look like a hypocrite by coming down hard on a n00b, then turning around and asking a question that looks equally stupid to someone else.

    However (like in the above case, for instance), when someone comes here asking for fundamental definitions of basic instrumentation concepts, they have to be satisfied with a simple link back to another reference site. ;)

  12. QUOTE(Popatlal @ Nov 1 2007, 08:11 PM)

    1. Dictionary.com

    2. It depends completely on the characteristics of your ADC. Wikipedia might shed some light on the subject, but I didn't read the article.

    3. See #2.

    4. Wikipedia.

    5. Resolution means slightly different things in different contexts. Since you're talking about ADCs, I'm guessing that for you resolution means the smallest analog voltage signal change that causes a change in the digital output of the ADC. For instance if you've got a 10-bit ADC working in a 0-5V range, the resolution of your ADC will be something like 5 V / 210 = 0.00488 V = 4.88 mV. The Wikipedia article in #2 covers this, as well.

    6. I'm confused a bit by this one. For sampling rate, see #4. Number of samples is just the number of samples acquired during a data acquistion. Generally speaking, Number Of Samples = sampling rate x amount of time you spent acquiring data.

  13. QUOTE(Ascen @ Nov 2 2007, 04:08 AM)

    The odd data structure and by-reference usage stems from several user requirements that all need to be met:

    * The system as a whole is to be a software based simulation platform, that in time might be extended to

    also interface with DAQ equipment and controllers.

    * The system needs to be extendable controller- and process-wise, the same simulator engine should be possible

    to use without changes when different controller schemes are implemented.

    Now, for the current design choices made:

    1. By-reference:

    I use by-reference because I need to have at least three separate parts that each have different timing and all use parts of the same data:

    a: Process simulation, which runs at around 50/s frequency at its fastest, and 1/s at slowest.

    b: Process measurement display, needs only to update around 4/s frequency

    c: Event (Button pressed) handling part that only proceeds on events fired by GUI buttons that

    either update the process parameters or are used for navigating the multiple-screens-done-with-tabs GUI.

    By-value implementation would lead to separate copies of the data, which would not fulfill

    the purpose of being able to access the same data across the functional parts of the program.

    What you're building is a fairly complicated system. I think you're on the right track with a by-reference implementation rather than by-value, but the problem is that you're trying to get the best of by-value objects, but trying to access them by-reference (more specifically, you're trying to access them using a reference to a front panel control that happens to contain them as data.)

    I suspect that what you may need is actual by-reference objects, which are not the same as making a cluster of some data and just getting a reference to it (as you've found :) ). There are several different ways to do by-reference objects in LabVIEW. At the risk of seeming unhelpful, though, I'm going to pass those recommendations off for other people to handle. Through some quirks of nature I've fallen a ways behind on by-reference objects since LV82 -- I play more in by-value objects lately so I'm not up-to-date on all the strengths & weaknesses of the various options.

    QUOTE

    Is there a proven solution for using by-value on a branching program?

    I don't mean to be snarky, but yes, it's possible to do very complex things with by-value objects. You do have to design the system, however, around the limitations imposed by their by-value nature. Some of the stuff that's easy with by-reference access to an object is either hard or impossible with by-value out of the box. But I find that by-value objects force me to really enforce better encapsulation and looser coupling on my data (which is, of course, the point of objects in general).

    Notwithstanding what I just said, though, your situation sounds like a pretty good case for actual by-reference objects.

    QUOTE

    2. The cluster-array-cluster-array-class -structure

    This stems from both my ignorance and from the requirements that this system reproduce some of the

    behaviour the older system had. Let us call them (1.cluster-2.array-3.cluster-4.array)

    a. Use of classes for controllers. As extendability is required, classes provide a perfect container that each

    contain their own internal data. Classes also can be cast as Parent Controller Class that defines interface methods

    for each Child Controller Class to implement. With these overriding methods it is possible to simply go through a array of controllers

    and have each execute the appropriate method.

    b. What I am trying to accomplish with the 1.c-2.a-3.c-4.a-class -structure is:

    1. cluster is just a container for all the operating data needed in the whole system.

    2. array is a array of "controller slots" - in a real system these controller slots would each correspond to one

    5mA-20mA output channel. In software implementation this will be imitated by having each correspond with

    a given index of an array of output values.

    3. cluster is there to contain information about this "controller slot". As of now, it contains an controller object array and

    a numerical field that indicates the index of the array that contains the selected controller object for this "slot".

    4. array of possible options (controller objects) for this (2. array) "controller slot". The reason why there are

    initialized controller objects in the array (thus leading to N * M initialized controller objects of which only N will be used),

    is that the previous system would save the controller configuration info even if another type of controller

    was selected for the slot. And also because I could not think of a better way to do this.

    That's ambitious (and I mean that in a good way!). I'm afraid your problem is much larger than what you're going to find a pat answer for on a forum like this, but let's see what we can all come up with to kick you in the right direction (so you can at least stop getting stupefying error messages if nothing else ;) ).

    I'm reminded of something that a LabVIEW R&D person said to me once (it might've been AQ, but I forget): "If it's in a cluster, you should put it in a class." If you're interested in using the features of LVOOP, I'd put everything in your list above into a tree of classes. That means starting with AppData.lvclass and working down from there (although in practice, I'd start at the bottom of your array-cluster thing and work outward). At each level, think about exactly what each class represents in your physical system, and try to avoid putting apples & oranges in the same class. And remember, it's OK for classes to contain other classes instead of inheriting to them. Membership and inheritance are complementary, but not identical, things.

    Now, the problem is that once you've done that you've created a big ol' by-value representation of your system, which doesn't match up with your by-reference access goals. Yeah, that sucks :P. However, this gives you an object framework to work with. What you need is something to manage those objects. What I might do in a situation like this is create a sort of traffic-cop loop that keeps the AppData in a shift register. It's responsible for doling out individual components of the AppData to other loops that manage those objects. When one of those slave loops needs to update the value of an object, I would provide a messaging framework for it to do so by communicating back to the traffic cop (via queue/notifier/whatever). This is actually not as hard as it sounds, although by-reference may still be the answer for you.

    Another semi-random point: Instead of keeping an array of all the Controllers and indexing them with SelectedController, why not have one element called ActiveController and an array called InactiveControllers? That gives you the ability to index them in and out of "Active" status by their InstanceName, without the hassle of having to index/replace in the array every time you want to access the active controller.

    Sorry this is all kind of scattershot. You've got a fairly wide-ranging design goal, so there are lots of ways to skin it :).

    QUOTE

    Thanks for the opinion about the Error 53 being a red herring, I've been dumbfounded trying to figure it out.

    And please don't get me wrong for snipping your code out from there - I'll have to try out your tricks on my

    code before I can comment more on this.

    No problem. I'd still love to hear exactly where that error is coming from, but I think only NI could tell us. Which reminds me, you could call them and ask them ;).

  14. Well, Norm's comments motivated me to take a look, I'll tell you that :). I certainly can't tell you what Error 53 means in that context. The fact that it resolves to a networking error code looks like a red herring to me.

    Norm is right, you're doing some pretty funky stuff combining references and objects like that. My initial wild-###### guess would be that the problem might stem from the fact that you have your objects buried way down inside a pile of array/cluster relationships that you're accessing via a strict reference. Maybe when the cluster reference is being created (in your sub_InitCtrlArray_test1.vi), the strict reference is incorporating type information about the .lvclass buried down inside of it, in a way that breaks when you get the Value property of that reference later and the type of the .lvclass objects has changed in the meantime?

    post-2992-1193959274.png?width=400

    Hey, check this out... If you change the cluster reference to a non-strict one (i.e. set the Application Data Output indicator in sub_InitCtrlArray_test1.vi to NOT Include Data Type) the error no longer occurs! That gives me more confidence that it's a strict/non-strict reference typing problem. It's still a bit odd, though, that the Variant value of the cluster doesn't seem to include anything about the Controller Selection Array. Or maybe I'm missing something. I'm certainly blowing through this quickly.

    post-2992-1193959911.png?width=400

    My advice? Refactor your code so it's more, um, kosher ;).

    EDIT: Nevermind, the Variant actually does at least have the size of the array, so there's something in there. I just misread the indicator. My other points still stand, though :P

  15. QUOTE(neB @ Oct 31 2007, 01:09 PM)

    Use the 3d Picture control to develop a robotic frame that can be outfit with user designed weapons and armor and who's motion and behaviour are offered as services that a user specified VI can utilize to control the motion and behaviour.

    As long as we're brainstorming...

    I propose Scripting Fight. A reference to a blank VI is passed to two different VIs running in parallel. These two VIs (each written by a different individual) should compete to accomplish some block diagram goal while preventing the other VI from accomplishing the same goal. The "winner" is the VI that, after a certain time period or number of nodes, is closer to the goal by some metric (functionality, aesthetics, etc.).

×
×
  • Create New...

Important Information

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