How do I build this array?

I have a vi that generates two time intervals in ms. One interval is between the time a light turns on and button 1 is released (time 1). The other interval is the time between the same release and the press of button 2 (time 2).
The vi loops through the light flashing/button press sequence until the number of set trials equals
the number of correct trials.
I want to build an array that records time 1 and time 2 for each trial. Something like this
0.1200 1.3123
0.2400 1.8979
0.3423 2.4567
etc.
The way I've got it, the array ends up being just time 1 and time 2 from the last trial.
0.3423 2.4567
How do I set this up to do what I want.
My vi is attached.
Attachments:
newredconstant.vi ‏99 KB

Hope this help!
Cheers!
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010
依恩与LabVIEW
LVVILIB.blogspot.com
Attachments:
Array.vi ‏26 KB

Similar Messages

  • I linux inode which contains 13 member array wich stores the actual block address of data .Similarly in windows how data is managed in disk ?. How many members in this array ?

    I linux inode which contains 13 member array wich stores the actual block address of data .Similarly in windows how data is managed in disk ?. How many members in this array ?

    Hello Vijay Nerkar,
    Your question is not related to Windows Forms General. What is the data you mean and also what is that array?
    If you are looking for something related to Windows File System, see some words here:
    http://en.wikipedia.org/wiki/File_system
    For example
    "Windows makes use of the
    FAT, NTFS,
    exFAT and ReFS file systems (the last of these is only supported and usable in
    Windows Server 2012; Windows cannot boot from it).
    Windows uses a drive letter abstraction at the user level to distinguish one disk or partition from another. For example, the
    path <tt>C:\WINDOWS</tt> represents a directory <tt>WINDOWS</tt> on the partition represented by the letter C. Drive C: is most commonly used for the primary hard disk partition, on which Windows is usually installed and from which it boots. This "tradition"
    has become so firmly ingrained that bugs exist in many applications which make assumptions that the drive that the operating system is installed on is C. The use of drive letters, and the tradition of using "C" as the drive letter for the primary hard disk
    partition, can be traced to
    MS-DOS, where the letters A and B were reserved for up to two floppy disk drives. This in turn derived from
    CP/M in the 1970s, and ultimately from IBM's
    CP/CMS of 1967.
    For more details, consider consult on MS Answers:
    http://answers.microsoft.com/en-us/windows
    Regards,
    Barry Wang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can I build an array not knowing final size at startup?

    Hi,
    I need to be able to build an array with a certain number of rows but that number is not known at runtime. Instead it can't exceed 5 in a certain time period. So my question is: every 20 seconds I need to send out the 5 row array but if lets say 10 rows of data come in in 20 seconds I am not sure how to handle the data to have it build 2 arrays and send them out one after another at the elapse of the 20 seconds as opposed to just sending an array with 10 rows and losing half the data on the receiving side. Please any help will be appreciated,
    Alex

    I understand that you have to send a least a message every 20 seconds (could be empty ?), but can you send more messages if you get more data (e.g. 3 message of 5 rows in 20 sec) ?
    If you can, then all you have to do is to trigger the sending of a message each time the array size reaches 5, or if 20s ellapsed since last sent message.
    Here is an example, using shift registers. there is a random data generation so that you can see it working (if you set the time between data long enough, then you will see the data sent after 20 sec. Well not exactly 20 sec, but i guess you can figure this out later by yourself...)
    I hope this will be of any help
    Attachments:
    dynamic_array.vi ‏36 KB

  • How do i impliment this array

    Hey everyone, just came across this forum looks quite good so I'll give it a go smile.gif
    Just working through a book called 'Objects First with Java' and I'm stuck on exercise 4.31.
    This is about a small auction program that has 4 classes - auction, bid, lot and person.
    Here's the code:
    Auction:
    import java.util.ArrayList;
    import java.util.Iterator;
    * A simple model of an auction.
    * The auction maintains a list of lots of arbitrary length.
    * @author David J. Barnes and Michael Kolling.
    * @version 2008.03.30
    public class Auction
        // The list of Lots in this auction.
        private ArrayList<Lot> lots;
        // The number that will be given to the next lot entered
        // into this auction.
        private int nextLotNumber;
        private Lot selectedLot;
         * Create a new auction.
        public Auction()
            lots = new ArrayList<Lot>();
            nextLotNumber = 1;
         * Enter a new lot into the auction.
         * @param description A description of the lot.
        public void enterLot(String description)
            lots.add(new Lot(nextLotNumber, description));
            nextLotNumber++;
         * Show the full list of lots in this auction.
        public void showLots()
            for(Lot lot : lots) {
                System.out.println(lot.toString());
         * Bid for a lot.
         * A message indicating whether the bid is successful or not
         * is printed.
         * @param number The lot number being bid for.
         * @param bidder The person bidding for the lot.
         * @param value  The value of the bid.
        public void bidFor(int lotNumber, Person bidder, long value)
            selectedLot = getLot(lotNumber);
            if(selectedLot != null) {
                boolean successful = selectedLot.bidFor(new Bid(bidder, value));
                if(successful) {
                    System.out.println("The bid for lot number " +
                                       lotNumber + " was successful.");
                else {
                    // Report which bid is higher.
                    Bid highestBid = selectedLot.getHighestBid();
                    System.out.println("Lot number: " + lotNumber +
                                       " already has a bid of: " +
                                       highestBid.getValue());
         * Return the lot with the given number. Return null
         * if a lot with this number does not exist.
         * @param lotNumber The number of the lot to return.
        public Lot getLot(int lotNumber){
            if((lotNumber >= 1) && (lotNumber < nextLotNumber)) {
                // The number seems to be reasonable.
                Lot selectedLot = lots.get(lotNumber - 1);
                // Include a confidence check to be sure we have the
                // right lot.
                if(selectedLot.getNumber() != lotNumber) {
                    System.out.println("Internal error: Lot number " +
                                       selectedLot.getNumber() +
                                       " was returned instead of " +
                                       lotNumber);
                    // Don't return an invalid lot.
                    selectedLot = null;
                return selectedLot;
            else {
                System.out.println("Lot number: " + lotNumber +
                                   " does not exist.");
                return null;
        public void close() {
            for(Lot lot : lots){
                Bid highestBid=lot.getHighestBid();
                Person person=highestBid.getBidder();
                String personName=person.getName();
                String number = "" + lot.getNumber();
                if(lot.getHighestBid() == null) {
                    System.out.println(number + ": " + lot.getDescription()+" has *not* been sold");
                else {
                    System.out.println(lot.getDescription()+" has been sold to " );
        // Creates a new array list and stores all unsold items into notSold.
        // Returns all items in the new list.
       /* public ArrayList<Lot> getUnsold;
            ArrayList<String> notSold;
            Integer numberList = 1;
            notSold = new ArrayList<String>(); // Creates new array
            for(Lot lot : lots){ // Although it compiles, when I create an auction object
                                 // it returns 'null pointer exception' here, any suggestions?
                if(lot.getHighestBid() == null)
                    notSold.add(lot.getDescription());
                    for(String unsold : notSold){
                        System.out.println(numberList + ": " + unsold);
                        System.out.println();
                        numberList++;
    }        There are a few random things in there, just from me mucking around in other exercises.
    Lot:
    * A class to model an item (or set of items) in an
    * auction: a lot.
    * @author David J. Barnes and Michael Kolling.
    * @version 2008.03.30
    public class Lot
        // A unique identifying number.
        private final int number;
        // A description of the lot.
        private String description;
        // The current highest bid for this lot.
        private Bid highestBid;
         * Construct a Lot, setting its number and description.
         * @param number The lot number.
         * @param description A description of this lot.
        public Lot(int number, String description)
            this.number = number;
            this.description = description;
         * Attempt to bid for this lot. A successful bid
         * must have a value higher than any existing bid.
         * @param bid A new bid.
         * @return true if successful, false otherwise
        public boolean bidFor(Bid bid)
            if((highestBid == null) ||
                   (bid.getValue() > highestBid.getValue())) {
                // This bid is the best so far.
                highestBid = bid;
                return true;
            else {
                return false;
         * @return A string representation of this lot's details.
        public String toString()
            String details = number + ": " + description;
            if(highestBid != null) {
                details += "    Bid: " +
                           highestBid.getValue();
            else {
                details += "    (No bid)";
            return details;
         * @return The lot's number.
        public int getNumber()
            return number;
         * @return The lot's description.
        public String getDescription()
            return description;
         * @return The highest bid for this lot.
         *         This could be null if there is
         *         no current bid.
        public Bid getHighestBid()
            return highestBid;
    }Bid:
    * A class that models an auction bid.
    * It contains a reference to the Person bidding and the amount bid.
    * @author David J. Barnes and Michael Kolling.
    * @version 2008.03.30
    public class Bid
        // The person making the bid.
        private final Person bidder;
        // The value of the bid. This could be a large number so
        // the long type has been used.
        private final long value;
         * Create a bid.
         * @param bidder Who is bidding for the lot.
         * @param value The value of the bid.
        public Bid(Person bidder, long value)
            this.bidder = bidder;
            this.value = value;
         * @return The bidder.
        public Person getBidder()
            return bidder;
         * @return The value of the bid.
        public long getValue()
            return value;
    }Person:
    public class Person
        // The name of this person.
        private final String name;
         * Create a new person with the given name.
         * @param name The person's name.
        public Person(String name)
            this.name = name;
         * @return The person's name.
        public String getName()
            return name;
    }Question: Rewrite getLot so that it does not rely on a lot with a particular number being stored at index (number-1) in the collection. For instance, if lot number 2 has been removed, then lot number 3 will have been moved from index 2 to index 1, and all higher lot numbers will also have been moved by one index position. You may assume that lots are always stored in increasing order of their lot number.
    So I know it's talking about an arraylist but I can't think how to implement it, I have tried a number of ways but can't seem to get my head round it. After I couldn't work out how to rewrite just the getLot I started spreading out and trying to add new arraylists in different classes and calling them but it ultimately just failed so now I was just wanting to get some ideas from people.

    @ The OP....
    Word of advice. Posting pages of code that are provided for YOU are not gonna be welcome on these forums. You can however take snippets of code and post them here and in turn ask a more precise question. For example....
    I modified this method..
    *post code
    and get the following error in compiler
    *post error                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How do I build this gallery?

    Hi,
    I am trying to build a gallery for myself, and as a beginner,
    I pretty much have no idea what I am doing.
    I want there to be a large image, below that a menu bar, and
    in the middle of that a few thumbnails. I want buttons to make the
    thumbnails slide along to the next set. (so, 1-5, then 6-10, etc.
    The link below has what I am trying to achieve (go into site,
    then into a gallery)
    Gallery Example
    Can anyone point me in the right direction? I would really
    appreciate it.
    Thanks,
    Hugh

    Hope this help!
    Cheers!
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com
    Attachments:
    Array.vi ‏26 KB

  • How can I build this in Flash?

    I am trying to figure out how to build the scrolling sideshow
    navigation on the
    Washington Post.com
    homepage.
    It's Right below "Diversions" and right above "Ways You Can
    Get Us". Currently it has a picture of Imus on the pane. I like how
    three pictures are shown with captions and a link as well as the
    data looks like it's pulled from an XML file.
    Any pointers to tutorials or commercial products like it
    would be appreciated.
    Thanks,
    Bob

    For the moving things with the mouse side of things, look
    into startDrag() and stopDrag().
    For the motion of things relative to the mouse, you need to
    have code that continuously monitors the position of the mouse (x
    and y values) and adjusts the positions of an object (or in your
    example, several of them). For the continuous montioring you would
    use some form of an onEnterFrame code (AS version dependent). What
    this does is continuously fire at the frame rate of the movie in
    the frame that it is assigned.
    Specific answers to your questions depend on which version of
    actionscript you are using, but if you do a search in Google for
    the terms I've used here (startDrag, mouseX, onEnterFrame, etc)
    prefixed with the version of actionscript you plan to use, then you
    should find plenty of info to review (example: search Google for
    "AS3 startDrag").
    I'd say search the Flash help docs, but they are usually only
    good if you know the correct name of properties/methods before you
    search, which change between AS versions. For instance, if you
    serached the AS3 help docs for onEnterFrame, you'd end up finding
    something like what you would want, but that's only because they
    happened to have an example where they created a function by that
    name. The actual monitoring is done using an event listener with
    Event.ENTER_FRAME as the event type. In AS2, onEnterFrame is a
    genuine language element... a method of the MovieClip class.

  • How Do I Build This in the Portal?

    I am a new to SAP Enterprise Portal and have some little Java development experience. I have built a Java system using Sun One Studio and Tomcat that includes the following:
    1. A JSP that presents a table of customers to a sales rep, allowing them to search on customer name, city, state and/or zip code.
    2. A Java module to act as controller, receiving the JSP as input, passing the selection parms to the XML module, receiving an ArrayList of customer objects in return and then re-displaying the JSP.
    3. A Java XML module that uses the SAX classes to read through an XML file, selecting customers based on the specified criteria.
    4. A helper class that creates customer objects passed in the ArrayList.
    I have searched through SDN and have read a lot of material, and am now asking for some advice. How should this be designed and programmed so that it will execute within SAP Enterprise Portal 6.0? Is NetWeaver Developer Studio the proper tool to use?
    I can provide more information, if necessary.
    Any help you give me would be greatly appreciated!

    Thanks for your reply!
    I've already down-loaded NWDS and have built two applications - one launches iNotes (Notes WebMail) and the other applies an XSLT against an XML file (an adaptation of one of the entries in SDN).
    But with regard to the design - what approach should I use? Based on what I described above (experience with JSP and servlets) creating an Abstract Portal Component doesn't seem right, and neither does creating a Dynpro app.
    Anybody else have any ideas? Is there any rough equivalent to the JSP/servlet design?
    Much appreciated!

  • How can I build this cluster? I don't like the one I have created (too big)

    Hi everybody, I'm working with a Vision VI and the trouble is that I need to create a cluster to connect it to a terminal called Settings of the Vision VI (IMAQ Count objects). These settings includes booleans, long and unsigned word type values. I've seen this one in a pdf document:
    I like how it looks because it's in a reduced space.
    This is the one I've created:
    (Please ignore the red numbers 1 and 2)
    And the block diagram looks like this:
    If someone knows how make a VI as the first image, please post it.
    Thank you so much for your answers and comments.
    P.S. I use LabView 2009, maybe some features are not availables in newers versions.
    Impossible is nothing
    Solved!
    Go to Solution.

    You did not create a cluster, just some individual controls that you are bundling in the code. that's not the same!
    I would recommend a combination approach from what we heard so far.
    First, create a control on the subVI input. Now we know it has the correct type.
    Right-click each control you don't like and replace it with one from a different palette (modern, classic, system), making sure you keep the same datatype. Keep the wire connected to the subVI. If the wire breaks, you picked a wrong datatype. simply undo and try again. (This way, the cluster order should not change).
    Now rearrange the controls the way you want.
    Here's are two quick examples I just made from scratch.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Settings.PNG ‏17 KB

  • How 2 better build this Expression?

    As you can see in the code below a null means don't use this object in the criteria. Conditionally building an Expression like this is rather cumbersome. There has got to be a better way to do this!
    ExpressionBuilder builder = new ExpressionBuilder();
    Expression expression = null;
    if (name != null) {
    expression = builder.get("name").equal(name);
    if (age != null) {
    if (expression == null) {
    expression = builder.get("age").equal(age);
    else {
    expression = expression.and(builder.get("age").equal(age));
    Collection persons = null;
    if (expression == null) {
    session.readAllObjects(Person.class);
    else {
    session.readAllObjects(Person.class, expression);

    One thing that may help is that expression.and will allow you to pass in null (just returns the expression).
    So...&gt;&gt;
    ExpressionBuilder builder = new ExpressionBuilder();
    Expression expression = null;
    if (name != null) {
    expression = builder.get("name").equal(name);
    if (age != null) {
    expression = (builder.get("age").equal(age)).and(expression);
    Collection persons = session.readAllObjects(Person.class, expression);
    You can also use query by example, which makes simple queries much simpler.

  • How do I build this applet?

    I want to put a drag and drop design interface on my site like this one:
    http://www.ezbeads.com/cgi-bin/design.htm
    I am new to Java. What is the best way to create something like this? Is it easily learned? Or is there an applet out there that might work?
    Thanks,
    DC

    What is your goal ? If you need to develope using a secure tool then you should begin using C++ for basic trainment and as a second step begin to develope small applications on JAVA.
    In the site http://www.sun.com you maybe find tutorial for use and learn Java. Java is easy if you know oriented objects model.
    Good luck. Every people begin with the same question "Is Java easy to learn ...?"

  • How to build an array using incoming stream of data?

    I am programming in VBAI but use LV as my Inspection Interface. The VBAI program will go in a finite loop (1000x) and feed the numeric indicator with dbl vaule in the front panel of LV. So the dbl value is in sequence.
    In LV, how do I build an array (index 0 - 999) with this stream of data?
    Solved!
    Go to Solution.

    altenbach wrote:
    You can eliminate that useless FOR loop by using a globally initialized feedback node instead of a shift register.
    You also need a mechanism to reset the shift register contents.
    What are you doing up at this hour?  Don't you sleep?  Per your advice.  The OP will still need to code in an initial state for the array.
    Reese, (former CLAD, future CLD)
    Some people call me the Space Cowboy!
    Some call me the gangster of love.
    Some people call me MoReese!
    ...I'm right here baby, right here, right here, right here at home

  • I have a Build Array function within a case structure. This array gets populated properly but I am unable to pass this array out of the case structure.

    I'm including a .png file that shows how I've coded this array.  This is part of a subvi.  Do arrays/loops behave differently in subvi's than in vi's?
    Attachments:
    arrays and loops.png ‏29 KB

    Can you attach your actual VI?
    I think there are a few more problem areas, for example:
    Why are you reading "time Stamp 3" from a value property node with each iteration of the loop? Due to the speed of the loop is very unlikely that that value changes between iterations (and if it would, it would give unpredictable results!). Thus you should read that value once before the loop or better just wire from the actual terminal. Property nodes force synchronous execution and are several orders of magnitude slower than any other method of data transfer.
    LabVIEW Champion . Do more with less code and in less time .

  • Building an array

    me again. how do i build an array in sqlplus or pl/sql that gives me a list of all my sql scripts and i can enter the number beside the script and it will run and then return to my menu?
    Thanks,
    Lorenzo

    Looks like you've resolved this issue in this thread:
    http://forums.ni.com/ni/board/message?board.id=170​&message.id=169645

  • How do I convert an array of BYTES (where each BYTE represents a bit) into a single Hex number?

    I am reading a signal from a USB-8451. This signal is stored as an array where each element represents a bit in the signal, but is stored in the array as a byte. How do I convert this array into a single Hex number. I attatched what I have so far, there are a few extra things to help me see what ia going on. One code uses Queue and the other uses arrays, let me know if you can help.
    Attachments:
    845x_EEPROMarrays.vi ‏27 KB
    845x_EEPROM.vi ‏26 KB

    mkssnwbrd wrote:
    ... so we can't introduce any other forms of signals or power into the circuit other than what the circuit already has. Trithfully I don't really know how I2C devices work, but my mentor here says that we can't use an I2C method becuase it will introduce voltage into the circuit and may damage out TCON chip.
    That makes absolutely no sense. What do you think is happening when you write the digital lines? You're setting a pin high. That voltage is being generated by the 8451x. I think you're not understanding what your mentor is saying. If it's an I2C device then you should be able to use the I2C function to simply talk to it. You still have not indicated what the device is, so there's little more I can say about that aspect of it.
    As far as the conversion is concerned, you basically need loop through your array of "bits", taking 16 at time since you said you have 16-bit values. It's not clear from your code whether your eventual goal is to get a numeric value or a string. This does not appear to be a subVI, so a simply numeric indicator formatted to display in hex format should be quite adequate. The array you are generating is an array of rings, whose datatype is I32, but they will have values of 0 or 1. You can use the example just posted, or you can use the attached variation.
    Attachments:
    Bits to Hex 2.vi ‏17 KB

  • Best Way To Build An Array Of Many Elements

    Simple question for you LabVIEW experts: I want to build an array of many element for use in my code.  The problem is I have 20 elements I need to insert into the "Build Array Function."  This takes up much code space and is really not that clean.  I was thinking of using a For Loop and use the iteration terminal as the index for each element.  The For Loop would then use auto indexing and build this array for me.
    Is there a more efficient way to do this?  Thanks!

    hobby1 wrote:
    Crossrulz, I was planning on handling it like this: 
    I have a total of 17 element I need to build an array from.  Each case would include another element to be written to the array.  Is this the correct way to handle this?
    Thats one way to do it.  Not nearly as efficient as using the Build Array, but it will work.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for

  • ASA 5505 ICMP Deny

    Hi I am facing a problem with icmp in ASA 5505, i want to block the icmp from inside to outside , but outside to inside icmp should work, here the configuration. ASA Version 8.0(5) interface Vlan1  nameif inside  security-level 100  ip address 192.16

  • How do I render a JCheckBox to an image without ever showing it on screen?

    I'm interested in Painting a JCheckBox to a BufferedImage without ever displaying the JCheckBox on-screen. Here is what I've got so far //new checkbox JCheckBox box = new JCheckBox(); //I just want the box, no padding/borders/etc... box.setBorder(Bor

  • InDesign Mail Merge troubleshooting...just hangs.

    Using US Postal Service Postal One to create a CSV file for mail merge. ID5.5 on a PC. Worked for 5 months, now just hangs.  Gets 90% done then does not finish. 350 newsletters with 4 merge fields. Single Record, overset text NOT checked. Suggestions

  • What are these new network interfaces?

    Recently I've noticed a few additions to the standard net interfaces (are they called interfaces or adapters?). Tertiary (en2) Quaternary (en3) IP over Firewire (fw0) IP over Firewire (fw1)

  • Versions in ilife '05

    Would someone please give me a link to find out what versions were supplied in the original iLife 05 release - thanks.