Creating multiple instances of a class in LabVIEW object-oriented programming

How do you create multiple instances of a class in a loop?  Or am I thinking about this all wrong?
For instance, I read in a file containing this information:
Person Name #1
Person Age #1
Hobby #1
Hobby #2
Hobby #3
Person Name #2
Person Age #2
Hobby #1
Hobby #2
Hobby #3
Person Name #3
Person Age #3
Hobby #1
Hobby #2
Hobby #3
If I define a Person class with name, age, and an array of strings (for the hobbies), how can I create several new Person instances in a loop while reading through the text file?
FYI, new to LabVIEW OOP but familiar with Java OOP.  Thank you!

First of all, let's get your terminology correct.  You are not creating multiple instances of a class.  You are creating Objects of the class.
Use autoindexing to create an array of your class type.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • Video - LabVIEW Object-Oriented Programming Introductory Walktrough

    LabVIEW Object-Oriented
    Programming, or LVOOP for short, has been around for about a year now.
    Have you had time to take a look at it? If not, it's about the time. I
    made you a short video on the very basics of LVOOP development process.
    It doesn't go into details of inheritance and all that but it gives you
    and idea on how to get started.
    LabVIEW Object-Oriented Programming Introductory Walktrough
    Tomi Maila

    The video was offline for a while as I accidentally modified YouTube video properties inproperly. The video is online again.
    p.s. If you like the video, don't  forget to press the digg button below the article to submit the article to digg.com
    Tomi Maila

  • Create multiple instances of same class but with unique names

    Hi,
    I'm creating an IM application in Java.
    So far I can click on a user and create a chat session, using my chatWindow class. But this means I can only create one chatWindow class, called 'chat'. How can I get the application to dynamically make new instances of this class with unique names, for examples chatWindowUser1, chatWindowUser2.
    Below is some code utlising the Openfire Smack API but hopefully the principle is the clear.
        private void chatButtonActionPerformed(java.awt.event.ActionEvent evt) {                                          
            int selectedUserIndex = rosterList.getSelectedIndex();
            String selectedUser = rostAry[selectedUserIndex].getUser();
            System.out.println("Chat with: " + selectedUser);
            if (chatBox == null) {
                JFrame mainFrame = CommsTestApp.getApplication().getMainFrame();
                chatBox = new CommsTestChatBox(mainFrame,conn,selectedUser);
                chatBox.setLocationRelativeTo(mainFrame);
            CommsTestApp.getApplication().show(chatBox);
    }  

    yes, an array would work fine, just realize that by using an array, you're setting an upper bound on the number of windows you can have open.
    As for unique names, if you mean unique variable name, you don't need one. The array index serves to uniquely identify each instance. If you mean unique title for the window, set that however you want (username, index in array, randomly generated string, etc.). It's just a property of the window object.

  • LabVIEW Object-Oriented Programming - Tutorial

    Hi,
    Does any one have LVOOP tutorial Manual? I am looking for a tutorial just like LabVIEW Basics-I and II which explains from basics
    phani srikanth
    Solved!
    Go to Solution.

    There are LVOOP classes -- I mean real classes, not LVOOP classes -- wait a minute, those are LVOOP classes too...
    Tell you what, check out this link, while I sort out the linguistics...
    Lets see, they are LVOOP classes, but would that make them class classes? Let me start over... My head hurts, I'll get back with you.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Multiple instance of a class

    I have written a class, called Board. In my program, I need to create multiple instances of this class. e.g. Board1, Board2, Board3 etc.
    Board Board2 = new Board();
    Board2 = Board1;
    However, when I change some parameters in Board1, the parameters in Board2 also get changed. Is there a way to prevent this?
    I tried using the Object.clone() method, but I can't seem to invoke it due to its protected nature. If this is indeed the solution, does anybody know how to invoke it? Thanks!
    Perd

    I am interested in your alternative solution of
    implementing clone() as a public method. However, I
    don't really understand what do you mean by that.
    I tried something like this:
    class Board extends Cloneable
    but it still doesn't work.
    Can you please explain in greater detail what do you
    mean? thanks!Read this: http://java.sun.com/docs/books/tutorial/java/javaOO/objectclass.html

  • Can I create multiple instances of  realplayer plug-in in one jsp page?

    I want to play meny video files in one jsp web page, these video files are to be played with the embeded plug-in of realplayer, each plug-in was linked(use its SRC property) a different video file. But, to my surprise, when I press the play button, every player played the same video file,not its specified file.
    I have no idea why it did so and what can I do?
    Whether can I create multiple instances of realplayer plug-in in one jsp page, that is to say, each instance is independent of others?
    thanks in advance!

    Generally speaking, Internet Explorer tries not to launch multiple versions of a plug-in. So what's happening is that you load the first video clip, and then before it has a chance to play, you load the second video clip into the same window. (It's like changing songs in WMA.)
    In some cases - this may not work for Real Player, but it's worth trying - if you spawn a new window through a hypertext link and then launch the plug-in in that window, IE will treat it separately. Otherwise, you could not, for example, run two Macromedia Flash applications from different web sites at the same time.
    Keep in mind that only one program can access the soundcard at a time, so Real Player may purposely "pause" or "cancel" other video streams until the active one finishes. If you were using the desktop version, selecting another video by any means aborts the currently running video (i.e., RP won't let you create a separate instance of it).
    The easiest solution is to create a wrapper JSP file that takes the name of the video clip, and plays it. Call that JSP and specify that it should be opened in a new window via the TARGET keyword in the anchor tag. Then hopefully RP itself won't block a second window from running.

  • How to create multiple instance on same database

    Hi ,
    I would like to know how to create multiple instance on same database . I know that some people use database configuration assistant to do this but i could not figure out how they did it.
    Any how if some one can help me with this and can give me links of this it would be great help for me.
    Thank you for reading my problem and helping me !
    Amil
    please if possible mail me on [email protected]

    How to create multiple instance?????Do you mean multiple instances on the same database, or multiple databases on the same machine ?
    I m new to this field....
    Willin to learn a lot about oracle....Then it wouldn't be bad reading a bit of Database Concepts

  • Creating multiple instances for a single file in B2B

    Hi,
    I have a requirement to read the camt.053 file from the remote partner using Oracle B2B and send the file to oracle AIA and insert the data in the ERP database tables. I am able to read the file successfully through B2B using listening channel and send the data to AIA and insert the data in ERP tables but, if there is any error occured while inserting the data in the ERP tables it is creating multiple instances(6 message count) for the same file in B2B reports. where as it is creating only one entry in reports in case of successful insertion. I have not given any retry count in listening channel nor in the database adapter in SOA/AIA composite. I am confused from where B2B is retrying the message ? Do i need to set any system properties? Could you please guide me to resolve this issue?
    Regards,
    Nishanth.

    App message delivery is not retried in B2B, rather failed messages are delivered to the IP_IN_QUEUE. Please enable the logging for B2B engine in TRACE 32 mode and run a test to reproduce the behaviour. Post the log here or mail across to my id (in my profile).
    Regards,
    Anuj

  • Create an instance of my class variable

    Hello all,
    I'm a newbie to iPhone/iPad programming and am having some trouble, I believe the issue is that I'm not creating an instance of my class variable.  I've got a class that has a setter and a getter, I know about properties but am using setters and getters for the time being.  I've created this class in a View-based application, when I build the program in XCode 3.2.6 everything builds fine.  When I step through the code with the debugger there are no errors but the setters are not storing any values and thus the getters are always returning 0 (it's returning an int value).  I've produced some of the code involved and I was hoping someone could point out to me where my issue is, and if I'm correct about not instantiating my variable, where I should do that.  Thanks so much in advance.
    <p>
    Selection.h
    @interface Selection : NSObject {
      int _choice;
    //Getters
    -(int) Choice;
    //Setters
    -(void) setChoice:(int) input;
    Selection.m
    #import "Selection.h"
    @implementation Selection
    //Getters
    -(int)Choice {
      return _choice;
    //Setter
    -(void)setChoice:(int)input{
              _choice = input;
    RockPaperScissorsViewController.m
    #import "RockPaperScissorsViewController.h"
    @implementation RockPaperScissorsViewController
    @synthesize rockButton, paperButton, scissorsButton, label;
    //@synthesize humanChoice, computerChoice;
    -(void)SetLabel:(NSString *)selection{
              label.text = selection;
    -(IBAction)rockButtonSelected {
    //          [self SetLabel:@"Rock"];
              [humanChoice setChoice:1];
    </p>
    So in the above code it's the [humanChoice setChoice:1] that is not working.  When I step through that portion with the debugger I get no errors but when I call humanChoice.Choice later on in the code I get a zero.
    -NifflerX

    It worked, thank you so much.  I put
    humanChoice = [[Selection alloc]init];
    In viewDidLoad and it worked like a charm.  Thank you again.
    -NifflerX

  • How to create an instance of a class which is stored in a String?

    I've class name stored in a String Object.
    now i've to create an instance of that class name.
    How?

    This is very dangerous ground because you give up compile-time safety, but you can get a Class object using Class.forName(String). Then you can use methods of the class Class to operate on it (including creating an instance).

  • How can I force TestStand to create multiple instance of an activex server instead of share the same reference?

    Hi, All:
         I am trying to migrate a application coded by VC++ to TestStand+CVI. This application opens multiple serial com ports and send commands to test targets, and get responses from these targets. The VC++ application creates multiple thread, and every thread create an activeX server instance which is responsible for opening serial port,sending test commands ,and getting response. It works fine as every thread has itsown activeX instance, so data and commands can be handled in the right serial port successfully.
         Yet when I works on TestStand, I got problems. I choose parallel model as the process model. I create a activeX object reference with AxtiveX/COM Adapter, and store the reference in a sequence local varialbe. If there is only 1 testsocket, It is OK. But if there are multiple test sockets, and communication between the application and test targets will be directly to the last test target. I try to popup a message within a execution to indicate the value of the activeX object reference, and all of them are identical. But this is not the behavior I want.
        So, is it possible to force TestStand to create independent instances of an activeX server? How can I make it work?
    Thanks

    Thanks for your comment, Dan.
          Yet I do get problems as none of us know how to program an activeX server so that it can be forced to be a single-instance or multiple-instance.
    As I mentioned earlier, there is existing application which is written by VC++ can create multiple instances of this activeX server, all I have to do is to create multiple threads, and initiate an instance of this server to contrl multiple test targets.
         My colleague said he creates the server with VC++ ATL, and cofigure it to be dual-interface and STA. And in the VC++ application side(client side), I use smart-pointer in threads to create an instance of the server:
     IMySerialServer pIMySerialServer;
      HRESULT hr = pIMySerialServer.CreateInstance("UUTCmd.MySerialServer");
      if(FAILED(hr))
       AfxMessageBox("Fail to create instance.");
    And then I got multple instances of the activeX server. Every thread can have itsown com port, can send/receive commands indepently. I have no idea how can I make it work on TestStand. Would you show me some reference documents or sample codes?
    Thank you
    Cipher

  • How to create multiple instance of Jboss with different  port number

    Hi all
    Please tell me steps to create multiple instance of Jboss with diffrent port number.
    I tried with this steps, but it does not work for me.
    In conf/jboss-service you will find the binding manager.
       <mbean code="org.jboss.services.binding.ServiceBindingManager"
         name="jboss.system:service=ServiceBindingManager">
         <attribute name="ServerName">ports-01</attribute>
         <attribute name="StoreURL">../docs/examples/binding-manager/sample-bindings.xml</attribute>
         <attribute name="StoreFactoryClassName">
           org.jboss.services.binding.XMLServicesStoreFactory
         </attribute>
       </mbean>Please help me on this.
    Thanks in advance

    It is the name of the website for JBoss. That seems rather obvious to me, and you would have found out for yourself if you had tried it.
    Your question is not a Java question and doesn't belong in these forums. It is a JBoss question and you should ask there, or more probably have a look at the JBoss documentation first.

  • How to create an instance of a class?

    how do you create sn instance of a class, and how do you call a method from another class?

    You may need to read thru the information provided on this page to understand how to create objects: http://java.sun.com/docs/books/tutorial/java/data/objectcreation.html
    I'd also suggest you read the tutorial available at: http://java.sun.com/docs/books/tutorial/java/index.html
    Regarding how you call a method belonging to another class you could do it in the foll. ways depending on whether the method is static or not - a static method may be called using the class name followed by a dot and the static method name while a non-static method would require you to create an instance of the class and then use that instance name followed by a dot and the method name. All said and done i'd still suggest you read thru the complete Java programming tutorial to get a good grounding on all these concepts and fundamentals of the language if you are looking to master the technology.
    Thanks
    John Morrison

  • Creating multiple instances of JTextField

    Hy, I have a JtextField and a JButton. Depending on the
    value inserted in the JtextField, when I click on the JButton,
    I want a new window to open and create multiple instances of
    JTextField.
    I tried to use a for loop, but how do I differentiate among
    the different JTextField
    thanks

    Just put the JTextField instances in an array.see below:
    int NumOfJTextFiled=10;
    JTextField jtextfieldArray[]=new JTextField[NumOfJTextFiled]
    for(int i=0;i<NumOfJTextFiled;i++)
    jtextfieldArray=new JTextField();

  • Create multiple instance in a database

    is it possible to create multiple instance in a database.if possible then is it possible to activate many instance at a time.(in personal edition)

    Instance in Oracle refers to the Oracle database "engine" - a collection of processes using a shared memory area, accessing a physical Oracle database.
    Multiple instances are possible on the same platform for different physical databases. But not a Good Idea..
    Multiple instances on different platforms are for the same physical database using Oracle Real Application Clusters, aka Oracle RAC.
    Thus your question does not make a lot of sense. My guess is that you are in fact refering to an Oracle session instead as this is "in the database" as you refered to.
    Each client that connect to Oracle, creates/establishes an Oracle session. A single client uses one (usually the default) or more sessions (usually used by a multi-threading client).
    By default, the Oracle Instance supports multiple Oracle (client) sessions. Including Personal Oracle. In the past, Personal Oracle limited (via the Listener) the number of remote clients (i.e. clients on other platforms) that can connect. I would assume that this is still the case. I however do not recall that there were a limit imposed on the number of local sessions that could be created - the limiting factor here is afterall the power and resources available by the PC. It's very unlikely that a common PC will be able to support a Personal Edition Oracle instance and 100's of local client sessions at the same time.
    If you do mean instance as per the strict Oracle definition - why would you want to create two Oracle instances (each with its own physical database) on a PC? That does not make sense on a large db server platform. It makes even less sense on a small PC platform.
    Each Oracle instance has overheads (processing and memory). Each physical Oracle database has overheads (system space, temp space, redo, logs, etc). Why duplicate these overheads?
    On a single platform - what can two Oracle instances (less capable because of reduced resources availability) do what a single Oracle instance cannot do faster and better and more effectively? Thus is it not a Good Idea to run multiple instances on a single platform. (exceptions acknowledged)

Maybe you are looking for