General programming practice question (possibly re: clusters)

I apologize for this probably being an old topic or something I should have found elsewhere, but I simply didn't know what to search for.
I am tackling my first labview program of significant scale, and quickly discovering that the difficulty of wiring scales exponentially with the number of things you're trying to do.  I marvel at the short and sweet pieces of code people post on here, and try my hardest to replicate the style to no avail.
If I've missed a good guide for good organizational practices when programming, please point the way!
Essentially, I'm grabbing info from a video signal via a daq card, using this to compute the location of objects in the video, and sending instructions to a robot to control its movement-- this means I have the image wires, serial wires, integer wires for pixel values, real wires for coordinates coordinates, and error wires flying around.  It's not an extraordinary amount of data but it seems to be an extraordinary amount of scooting things around to make things look pretty and/or readable, every time I make a change.
Clearly use of subVIs is the way to go for each of the tasks, but I still have several pieces of data that need to be communicated from each task to the next.
Is it common practice to cluster the data even if it's unrelated, just to simplify the wiring?  Is there significant overhead if you're unclustering and re-clustering it in each subVI?  (I tried to write a quick benchmark program but I couldn't quite figure out how to use the profiler)
Any general veteran tips would be much appreciated!

Check out the following links: -
http://www.bloomy.com/resources/index.php#pres
Specifically here the Powerpoint presentations (five_techniques_for_better_labview_code.pps)
Some additional pointers/ resources below: -
http://forums.ni.com/ni/board/message?board.id=LVETF&message.id=1
http://zone.ni.com/devzone/cda/tut/p/id/4434
http://openg.org/tiki/tiki-index.php?page=Style%20Guide
There is a host of other information out there as well, try Google and use the term 'LabView style guide'.
Hope this helps put you on the right track.

Similar Messages

  • "Good programming practice" question about writing classes

    I am taking a java class this year and my teacher has taught us to never use global variables in a class (but still private). I find it much easier to explain with a simple example. Say I have a class that looks like this:
    public class Demo
            private int int1, int2;
         public Demo()
              int1 = 1;
              int2 = 2;
         public void demoMethodOne(int int1, int int2)
              //... code using the ints passed to the method
         public void demoMethodTwo()
              //... code directly accessing the private ints of the class
            public int getInt1() { return int1; }
            public int getInt2() { return int2; }
    }My teacher says to ALWAYS use methods of the type demoMethodOne (to pass all of the variables it will use to it) and avoid using the type demoMethodTwo. But in my programming experience, I have found it very repetitive and pointless to use that method in some cases. For example if I call demoMethodOne like this:
    demoMethodOne(demo.getInt1(), demo.getInt2());
    That seems very repetitive but that is how I am told to do it. Should I program that way even if it seems very pointless or is it ok to use "public" variables like in demoMethodTwo. Thanks.

    I think you may have misunderstood your teacher.
    If your object method is doing something with the object's state, then it's perfectly appropriate to modify the object's fields, which embody the state.
    And generally it's good to adopt a functional programming approach, in which there are few side effects. This principle is sort of independent of the previous one.
    The danger is when you treat object fields as global variables (and not as the embodiment of the object's state). In this case the global variable doesn't really represent anything, it's just a place to store data temporarily to avoid designing your methods properly. So for example you'd have two methods, one sets a field and then calls another method, which reads the field; the field doesn't really mean anything to the object as a whole, it's just a lazy way to pass data between the two methods. This is asking for bugs. The correct thing would have been to pass the value as an argument to the second method.
    Also, if you have a method that doesn't really express the behavior or effect the state of an object, but is called just for its return value (like some kind of utility method), then it's pointless and dangerous to make it effect the state of an object.

  • SAP Adapter Best Practice Question for Deployment to Clustered Environment

    I have a best practices question on the iway Adapters around deployment into a clustered environment.
    According to the documentation, you are supposed to run the installer on both nodes in the cluster but configure on just the first node. See below:
    Install Oracle Application Adapters 11g Release 1 (11.1.1.3.0) on both machines.
    Configure a J2CA configuration as a database repository on the first machine.
    Perform the required changes to the ra.xml and weblogic-ra.xml files before deployment.
    This makes sense to me because once you deploy the adapter rar in the next step it the appropriate rar will get staged and deployed on both nodes in the cluster.
    What is the best practice for the 3rdParty adapter directory on the second node? The installer lays it down with the adapter rar and all. Since we only configure the adapter on node 1, the directory on node 2 will remain with the default installation files/values not the configured ones. Is it best practice to copy node 1's 3rdParty directory to node 2 once configured? If we leave node 2 with the default files/values, I suspect this will lead to confusion to someone later on who is troubleshooting because it will appear it was never configured correctly.
    What do folks typically do in this situation? Obviously everything works to leave it as is, but it seems strange to have the two nodes differ.

    What is the version of operating system. If you are any OS version lower than Windows 2012 then you need to add one more voter for quorum.
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • Good programming practice - Abstract class

    Hi all,
    I have been trying to help another soul in this forum, and came to the conclusion that I don't know good
    programming practice when it comes to abstract classes.
    Is this correct?
    You CAN implement methods in an abstract class, but it's not recommended.
    I have NEVER done this...when is there possibly a need to?
    Regards.
    / k

    Yes, absolutely, you can implement methods in an abstract class. Any method that all subclasses will perform in the same way can be implemented in the abstract base class. If subclasses perform similiar functions depending on their type you declare those as abstract in the base class. Here is a contrived example that I have seen on job interviews.
    Suppose your developing an application that draws on a panel. We want to provide some canned shapes such as a circle, a square and a triangle. We want to be able to draw the shape set or get its color and calculate its area.
    Let's define an abstract base class Shape
    public abstract class Shape{
        private Color myColor;
       //  since color has nothing to do with what kind of shape we're working with, create concrete implementation
       public Color getColor(){
            return myColor;
    public void setColor(Color newColor){
       myColor = newColor;
    // however, drawing the shape and calculation its area are depending on the actual shape.
    public abstract void draw();
    public abstract double getArea();
    // so then Square would be something like
    public class Square extends Shape{
       public double get Area()
          return sideLength * sideLength  // assumes somehow we know sideLength
    public void draw(){
                  // concrete implementation
    }we can do the same things for Circle class and Triangle class.
    And, if you think about it you'll notice that we could have made a Rectangle class and then Square would be a subclass of Rectangle where both dimensions are equal.
    I hope that somewhat strained example helps answer your question.
    DB

  • Best practice question -- copy container, assemble it, build execution plan

    So, this is a design / best practice question:
    I usually copy containers as instructed by docs
    I then set the source system parameters
    I then generate needed parameters / assemble the copied container for ALL subject areas present in the container
    I then build an execution plan JUST FOR THE 4 SUBJECT AREAS and build the execution plan and set whatever is needed before running it.
    QUESTION - When i copy the container, should i delete all not needed subject areas out of it or is it best to do this when building the execution plan? I am basically trying to simplify the container for my own sake and have the container just have few subject areas rather than wait till i build the execution plan and then focus on few subject areas.
    Your thoughts / clarifications are appreciated.
    Regards,

    Hi,
    I would suggest that you leave the subject areas and then just don't include them in the execution plan. Otherwise you have the possibility of running into the situation where you need to include another subject area in the future and you will have to go through the hassle of recreating it in your SSC.
    Regards,
    Matt

  • Best Programming Practice for CompareTo

    Hi, I am currently writing a small program that deals with an array of objects, where some of the objects can be null. I want to sort the array by a variable of the objects, so I implement compareTo(). My problem is that since some of the objects in the array can be null, when I call Arrays.sort() I get a NullPointerException.
    My question is, which is better programming practice:
    1. modify the program to make a new array containing only the non-null objects, then sort that.
    2. decide what to do with non-null objects, e.g. return -1 in the compareTo() so that the array is sorted with the nulls at the end.
    3. something else??
    Thanks for your time.

    I have an array that represents a timetable. The objects in the array are classes, so if there is no class at a particular time slot then the object is null. I then want to sort the classes by their average attendance and generate a report, so this means I don't want the null objects after sorting.
    So far my code is:
        public int compareTo(FitnessClass other) {
                     double thisAverageAttendance = this.getAverageAttendance();
                 double otherAverageAttendance = other.getAverageAttendance();
                 if(thisAverageAttendance < otherAverageAttendance){
                      return 1;
                 else if(thisAverageAttendance == otherAverageAttendance){
                      return 0;
                 else
                      return -1;
        }And the array sorting is done by:
         public FitnessClass[] getSortedClassList(){
                   //Create an array of all the non-null fitness classes.
              FitnessClass [] nonNulls = new FitnessClass[totalClasses];
              int i = 0;
              for(int index = 0; index < MAX_CLASSES; index++){
                   if(classList[index] != null){
                        nonNulls[i] = classList[index];
                        i++;
                   //Sort the array by average attendance, making use of the compareTo method from FitnessClass.
              Arrays.sort(nonNulls);
              return nonNulls;
         }And basically my question is, would this be considered to be acceptable programming practice, i.e. creating another array to get rid of the null objects? Or would I be better handling null objects in my compareTo method such that the resulting array would have all of the nulls at the end, then when it comes to creating my report I can just use the objects that are non-null.

  • Maintain the general program errors

    hi all,
    i have problem while printing the customized layout for PO with message.
    Sytem message 038 from work area SSFCOMPOSER does not exist.
    Message 038 from work area SSFCOMPOSER was not defined.
    You have to maintain this message in the system.  If you have
    authorization for Customizing, maintain the general program errors.
    Otherwise, please inform your system administrator.
    Is it possible to maintain using SE91. if not, how to free from this message.
    Thanks in advance for ur valuable time.
    Regards,
    reji.

    hi anji,
    thanks for ur reply,
    But it works fine in development client but not in test client both clients are in the same server, how this happens?
    regards,
    prabhu

  • Programming practice issues

    hi,
    i'm now working on a project that requires me to create an UI with Swing...but before i start to actually code anything...i have a small question...it is sort of a programming practice/convention question...
    my project has 2 major interfaces (or i should say 2 major "main windows" kind of thing)...the concept is...when the application runs...it first pops up a simple dialog box (could be a simple JFrame with 2 buttons)...the 2 buttons decide which of the 2 "main windows" you want to launch...let's say the 2 "main windows" are called interfaceA.java and interfaceB.java...
    my thinking is...i should create a file called launcher.java which contains just a JFrame with the 2 necessary buttons...and by clicking 1 of the buttons would launch the indicated "main window" (interfaceA or interfaceB)...
    i'm not exactly sure whether this approach is correct...because for most cases...i'd probably be writing a single "main window" and all other features like dialog boxes, menus, buttons, etc will be built on top of that main window...so the "centre" is the 1 "main window"...however...for my case...it seems to me that there'd no longer be any "centre"...the "centre" now seems to be just that simple JFrame and everything is building on top or spreading out of that JFrame...
    is this a correct approach...?
    thank you very much!

    Are these two "major interfaces" connected to each
    other at all? Will the user be able to switch from
    one to the other, and is he at all likely to do so?
    If not, then what you have is two applications, and
    each should have its own entry point. They may just
    be two shortcuts to the same program but with
    different command-line arguments, but the user
    doesn't need to be aware of that. Having them share
    the same entry point is like setting the user up for
    an ambush ("But what program did you really
    want to run?").
    Is the user much more likely to choose one interface
    over the other (e.g., "Play Game" or "Change
    Settings")? If so, then start the more likely one
    while providing the means to suspend or quit it and
    start the other.
    Finally, if there's no way for you to decide
    which interface should be the default, maybe the user
    can. In that case, go ahead and show that dialog the
    first time your app runs, but put a "Set as default"
    checkbox on it.
    </rant>hi uncle_alice,
    thanks for your reply...you've definitely mentioned something meaningful...but my situation is a little bit different from the scenarios you talked about...
    maybe i should have been a bit clearer when i first posted my question...in fact...there're 2 "major interfaces" in my project as i've said...and i would say that both interfaces are of almost equal likeliness to be used...
    here is a scenario the decribes my project...there's a computer in a kindergarten library that would be used by either a 4-year-old kid or an adult kindergarten teacher to search for books...the interface will be different for the 2 kinds of user...for the kid one...it would be an interface with some graphics and large buttons...for the adult one...it would just be an ordinary book searching utility...
    and now...what i want to do is to have a "launcher" that let the user to choose between the "kid interface" and the "adult interface"...there would be chances that a teacher would like to switch to the "kid interface" and browse around...what i planned to do is to have a "log out" button in both interfaces such that at any time if "log out" is clicked...the current interface will be dismissed and the "launcher" pops back again...

  • Good programming practices:   creating Iterator objects

    Hi,
    This is a question about Good programming practices for creating Iterator objects of ArrayList objects. The following line of code works fine in my program (as ridiculous as it may sound):
            Iterator cheesesIterator = cheeses.iterator();but I was wondering whether Java is automatically inserting the <Type> and new code to make:
            Iterator<String> cheesesIterator = new cheeses.iterator();and therefore whether it is good practice to use these everytime? Thank you. ("full" code shown below:)
    import java.util.ArrayList;
    import java.util.Iterator;
    public class DemonstrateIterator
        private ArrayList<String>  cheeses;
         * constructor:
        public DemonstrateIterator()
            cheeses = new ArrayList<String>();
            cheeses.add("Emmentaler");
            cheeses.add("Cheddar");
            cheeses.add("Stilton");
            cheeses.add("Brie");
            cheeses.add("Roquefort");
        public void listCheeses()
             //make an iterator object of the ArrayList object
            Iterator cheesesIterator = cheeses.iterator();
            while (cheesesIterator.hasNext()) {
                System.out.println(cheesesIterator.next());
            /** Exploring the toString and Super functions. **/       
            System.out.println("\na toString call to Super returns: " +
                                              super.toString() + "\n");
    }

    AJ-Phil wrote:
    Hi,
    This is a question about Good programming practices for creating Iterator objects of ArrayList objects. The following line of code works fine in my program (as ridiculous as it may sound):
            Iterator cheesesIterator = cheeses.iterator();but I was wondering whether Java is automatically inserting the <Type> and new code to make:
            Iterator<String> cheesesIterator = new cheeses.iterator();and therefore whether it is good practice to use these everytime? TFirst, new chesses.iterator() won't compile.
    iterator() is just a method that returns an iterator. It constructs an instance of a private or nested class that implements iterator, and returns a reference to it.
    As for the <T>, when you declare List<String>, that parameterizes that list with type String. The iterator() method returns Iterator<T>. You can look at the source code for yourself. It's in src.zip that came with your JDK download.
    Separate from that is your declaration of that variable as type Iterator, rather than Iterator<String>. Regardless of what you declare on the LHS, the iterator() method returns Iterator<T>. Your bare Iterator is essentially Iterator<Object> or Iterator<? extends Object> (not sure which, or what the difference is), which is assignment compatible with Iterator<T>. If you had declared it Iterator<String>, you wouldn't have to cast after calling next().
    Edited by: jverd on Nov 23, 2008 11:33 AM

  • General Adobe Acrobat questions

    Hi, just heard about this seemingly unreal program as a
    possible way to help streamline some of our office
    procedures/paperwork. Two main questions.
    1. Is Adobe designer bundled in with the Acrobat 9?
    2. Licensing -- we have a work server, is it something that
    one can be put on server and everyone access or would we need to
    buy a license for every computer. It would only need to be about 10
    users max.
    Appreciate the feedback in advance.
    Thanks, Joy

    Hello Joy1974,
    Thank you for posting!
    Allow me to inform you that these forums are specific to the
    Acrobat.com website and its set of hosted services, and do
    not relate the Acrobat family of desktop products.
    Ultimately, this question would best be asked in the Acrobat
    Forums.
    Link to
    Acrobat Forums
    Thanks, and Regards,
    Pete

  • Best Practices Question: How to send error message to SSHR web page.

    Best Practices Question: How to send error message to SSHR web page from custom PL\SQL procedure called by SSHR workflow.
    For the Manager Self-Service application we’ve copied various workflows which were modified to meet business needs. Part of this exercise was creating custom PL\SQL Package Procedures that would gather details on the WF using them on custom notification sent by the WF.
    What I’m looking for is if/when the PL\SQL procedure errors, how does one send an failure message back and display it on the SS Page?
    Writing information into a log or table at the database level works for trouble-shooting, but we’re looking for something that will provide the end-user with an intelligent message that the workflow has failed.
    Thanks ahead of time for your responses.
    Rich

    We have implemented the same kind of requirement long back.
    We have defined our PL/SQL procedures with two OUT parameters
    1) Result Type (S:Success, E:Error)
    2) Result Message
    In the PL/SQL procedure we always use below construct when we want to raise any message
    hr_utility.set_message(APPL_NO, 'FND_MESSAGE_NAME');
    hr_utility.raise_error;
    In Exception block we write below( in successful case we just set the p_result_flag := 'S';)
    EXCEPTION
    WHEN APP_EXCEPTION.APPLICATION_EXCEPTION THEN
    p_result_flag := 'E';
    p_result_message := hr_utility.get_message;
    WHEN OTHERS THEN
    p_result_flag := 'E';
    p_result_message := hr_utility.get_message;
    fnd_message.set_name('PER','FFU10_GENERAL_ORACLE_ERROR');
    fnd_message.set_token('2',substr(sqlerrm,1,200));
    fnd_msg_pub.add;
    p_result_message := fnd_msg_pub.get_detail;
    After executing the PL/SQL in java
    We have written some thing similar to
    orclStmt.execute();
    OAExceptionUtils.checkErrors (txn);
    String resultFlag = orclStmt.getString(provide the resultflag bind no);
    if ("E".equalsIgnoreCase(resultFlag)){
    String resultMessage = orclStmt.getString(provide the resultMessage bind no);
    orclStmt.close();
    throw new OAException(resultMessage, OAException.ERROR);
    It safely shows the message to the user with all the data in the page.
    We have been using this construct for a long time for all our projects. They are all working as expected.
    Regards,
    Peddi.

  • Oracle Asset (Functional) Practice Questions for Interviews and Exam

    https://www.createspace.com/3495382
    http://www.amazon.com/Functional-Questions-Interviews-Certification-Examination/dp/1456311581/ref=sr_1_4?ie=UTF8&s=books&qid=1289178586&sr=8-4
    List Price: $29.99
    Add to Cart
    Oracle Asset (Functional) Practice Questions for Interviews and Certification Examination (Release 11i and 12)
    Functional Consultant
    Authored by Erp Gold
    This book contains 150 Oracle Asset Practice Questions for functional consultants. Very useful for interviews and certification examinations.
    Publication Date:
    Oct 26 2010
    ISBN/EAN13:
    1456311581 / 9781456311582
    Page Count:
    94
    Binding Type:
    US Trade Paper
    Trim Size:
    6" x 9"
    Language:
    English
    Color:
    Black and White
    Related Categories:
    Computers / General

    Reported as spam!

  • Oracle Asset (Functional) Practice Questions for Interviews and Certificati

    https://www.createspace.com/3495382
    List Price: $29.99
    Add to Cart
    Oracle Asset (Functional) Practice Questions for Interviews and Certification Examination (Release 11i and 12)
    Functional Consultant
    Authored by Erp Gold
    This book contains 150 Oracle Asset Practice Questions for functional consultants. Very useful for interviews and certification examinations.
    Publication Date:
    Oct 26 2010
    ISBN/EAN13:
    1456311581 / 9781456311582
    Page Count:
    94
    Binding Type:
    US Trade Paper
    Trim Size:
    6" x 9"
    Language:
    English
    Color:
    Black and White
    Related Categories:
    Computers / General

    Reported as spam!

  • SAP Adapter Best Practice Question for Migration of Channels

    I have a best practice question on the SAP adapter when migrating an OSB project from one environment (DEV) to another (QA).
    If my project includes an adapter channel that (e.g., Inbound SAP Proxy listening on a channel), how do I migrate that project to another environment if the channel in the target environment is different.
    I tried using the search and replace mechanism in the sbconsole, but it doesn't find the channel name in the jca and wsdl files.
    What is the recommended way to migrate from one environment to the other when the channel name changes?

    I have a best practice question on the SAP adapter when migrating an OSB project from one environment (DEV) to another (QA).
    If my project includes an adapter channel that (e.g., Inbound SAP Proxy listening on a channel), how do I migrate that project to another environment if the channel in the target environment is different.
    I tried using the search and replace mechanism in the sbconsole, but it doesn't find the channel name in the jca and wsdl files.
    What is the recommended way to migrate from one environment to the other when the channel name changes?

  • Looking for authorized 1Z0-514 practice questions

    I'm studying for the 1Z0-514 - Oracle Database 11g Essentials exam. I have gone through all of the tutorials in the 11g 2-day DBA manual and Oracle By Example supplement. I think I'm ready but would like some practice questions to test myself. According to http://www.certguard.com/, every hit on Google for "1Z0-514" is a braindump. That site also lists a number of reputable sites for practice exams, although none of them includes 1Z0-514.
    Q1: Does anyone know of a verified source of legitimate 1Z0-514 practice questions?
    Q2: Does anyone know how relevant OCA practice exams (1Z0-052) would be for 1Z0-514? They seem to have a lot of common ground.

    Hi, I had the same problem you are having now a few months ago, after studying the 11g 2-day DBA manual I couldn't find any authorized practice questions.
    I ended up going through OCA books and practice questions. I advise you use them, the 1z0-052 and 1z0-514 exams cover very similar topics.

Maybe you are looking for

  • Can't find my overdrive audiobook on my ipad

    Hello, I'm looking for some help with a library audiobook from the Harris County Public Library.  I have an original ipad running the latest OS.  The book is WMA format, and I have it checked out until 1/27/12.  Here is what I have done so far: The m

  • FAT32 external drive keeps needing repair/restore

    Hey folks, I recently received a Samsung TV that I have been hooking an external USB drive to but it requires it be formatted in a FAT32 file system. So I do this, and copy files over from my mac and everything works fine. However, when I unplug the

  • HT201269 How can I delete all my data from former Iphone 4 for future sale on Ebay?

    Hello! I've just purchased an Iphone 5 from a new carrier. Now I should like to sell my former Iphone 4 but, obviously, removing all my personal data (contacts, photographs, etc.) .  How can I transfer the ringtones that I purchased from by Iphone 4?

  • T440s - "Incorrect AC adapter is attached" error message

    Hi I have suddenly started getting an error message saying: "Incorrect AC adapter is attached. The AC adapter may not provide enough power to your Lenovo computer. Please reconnect proper AC adapter. To buy additional AC adapter, click here" I am usi

  • BT have reset my usage monitor part way through th...

    I was posting a month or so ago similar to others, that suddenly my broadband usage had dramatically increased without me having changed what I'm doing online, so I've been monitoring it closely. I've managed to keep it down for the last few months s