Saving Adquisition data into a array or matrix

Hi there,
Im trying to save from 2 Daq assistant with multiple channel to an array or a matrix. the problem is that i cant manage to find the right function to do it. right now i save the 5 channels on a matrix but i cant do an index to fill other rows with data. the daq is getting sample by request.
I gonna send the subvi. give me some exemple plz.
Attachments:
aqui_calib (SubVI).vi ‏332 KB

Hello,
I think you should have a look on the "Array" palette where you have many functions which allows you to manipulate array of data (index array, build array etc)...
You also have examples built on LabVIEW if you click on "Help" >> "Find Examples" and specify "Array" as a keyword - it will show a list of examples which might help you.
Regards,
Celine
National Instruments France
#adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
Journées Techniques LabVIEW
Du 15 octobre au 7 novembre : Strasbourg - Lyon - Lille - Toulouse - Mar...

Similar Messages

  • Need help in putting data into 2d array

    My input file :
    1 , 2 , 1
    2 , 2 , 1
    3 , 3 , 1
    4 , 2 , 2
    2 , 3 , 2I'm stuck at:
    while( reader.readLine() != null){
    String Matrix[] = line.split(",");
    }Means I only can read how many lines there. For 2d array, Matrix[i][j], is that when I count the line, the number of count will be the 'i'? How about 'j'? Am I need to count i and j before put the data into 2d array?
    Do correct me if something wrong in:
    while( reader.readLine() != null){
    String Matrix[] = line.split(",");
    } Thank you.

    gtt0402 wrote:
    while( reader.readLine() != null){
    String Matrix[] = line.split(",");
    How about:
    ArrayList<String[]> rows = new ArrayList<String[]>();
    while((line = reader.readLine()) != null) {
        rows.add(line.split(","));
    }After the loop you have a list full of String arrays and you can convert it to a 2D String array if you wish.

  • How to put data into a array element in the BPEL

    Hi,
    I have a element in the WSDL which is of type Array. (i.e accepts unlimited data for the same element). How should i put a data into a array in the BPEL.
    Example:
    The below Example gives u an idea about wht iam asking:pasting a piece of my requirement:
    <s:element minOccurs="0" maxOccurs="1" name="parameters" type="tns:ArrayOfCSParameters" />
    <s:complexType name="ArrayOfCSParameters">
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="unbounded"
    name="CSParameters" nillable="true" type="tns:CSParameters" />
    </s:sequence>
    </s:complexType>
    <s:complexType name="CSParameters">
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="RevenueItem" type="tns:RevenueItem" />
    <s:element minOccurs="0" maxOccurs="1" name="AccountURIs" type="tns:ArrayOfString" />
    <s:element minOccurs="0" maxOccurs="1" name="GroupURIs" type="tns:ArrayOfString" />
    <s:element minOccurs="1" maxOccurs="1" name="Percentage" nillable="true" type="s:decimal" />
    </s:sequence>
    <s:attribute name="Version" type="s:decimal" use="required" />
    <s:attribute name="URI" type="s:string" />
    </s:complexType>
    Any suggestion is appreciated.
    Regards
    pavan

    You have 2 options i guess.
    Use the transformation and the for-each to construct the array-list
    or like Richard said, use a loop in bpel, assign in the loop an variable of element type="CSParameters" and append this variable to your variable with accepts the arraylist.

  • (Urgent help needed) how to read txt file and store the data into 2D-array?

    Hi, I have a GUI which allow to choose file from the file chooser, and when "Read file" button is pressed, I want to show the array data into the textarea.
    The sample data is like this followed:
    -0.0007     -0.0061     0.0006
    -0.0002     0.0203     0.0066
    0     0.2317     0.008
    0.0017     0.5957     0.0008
    0.0024     1.071     0.0029
    0.0439     1.4873     -0.0003
    I want my program to scan through and store these data into 2D array.
    However for some reason, my source code issues errors, and I don't know what's wrong with it, seems to have a problem in StringTokenizer though. Can anybody help me?
    Thanks in advance.
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.StringTokenizer;
    public class FileReduction1 extends JFrame implements ActionListener{
    // GUI features
    private BufferedReader fileInput;
    private JTextArea textArea;
    private JButton openButton, readButton,processButton,saveButton;
    private JTextField textfield;
    private JPanel pnlfile;
    private JPanel buttonpnl;
    private JPanel buttonbar;
    // Other fields
    private File fileName;
    private String[][] data;
    private int numLines;
    public FileReduction1(String s) {
    super(s);
    // Content pane
         Container cp = getContentPane();
         cp.setLayout(new BorderLayout());     
    // Open button Panel
    pnlfile=new JPanel(new BorderLayout());
         textfield=new JTextField();
         openButton = new JButton("Open File");
    openButton.addActionListener(this);
    pnlfile.add(openButton,BorderLayout.WEST);
         pnlfile.add(textfield,BorderLayout.CENTER);
         readButton = new JButton("Read File");
    readButton.addActionListener(this);
         readButton.setEnabled(false);
    pnlfile.add(readButton,BorderLayout.EAST);
         cp.add(pnlfile, BorderLayout.NORTH);
         // Text area     
         textArea = new JTextArea(10, 100);
    cp.add(new JScrollPane(textArea),BorderLayout.CENTER);
    processButton = new JButton("Process");
    //processButton.addActionListener(this);
    saveButton=new JButton("Save into");
    //saveButton.addActionListener(this);
    buttonbar=new JPanel(new FlowLayout(FlowLayout.RIGHT));
    buttonpnl=new JPanel(new GridLayout(1,0));
    buttonpnl.add(processButton);
    buttonpnl.add(saveButton);
    buttonbar.add(buttonpnl);
    cp.add(buttonbar,BorderLayout.SOUTH);
    /* ACTION PERFORMED */
    public void actionPerformed(ActionEvent event) {
    if (event.getActionCommand().equals("Open File")) getFileName();
         if (event.getActionCommand().equals("Read File")) readFile();
    /* OPEN THE FILE */
    private void getFileName() {
    // Display file dialog so user can select file to open
         JFileChooser fileChooser = new JFileChooser();
         fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
         int result = fileChooser.showOpenDialog(this);
         // If cancel button selected return
         if (result == JFileChooser.CANCEL_OPTION) return;
    if (result == JFileChooser.APPROVE_OPTION)
         fileName = fileChooser.getSelectedFile();
    textfield.setText(fileName.getName());
         if (checkFileName()) {
         openButton.setEnabled(false);
         readButton.setEnabled(true);
         // Obtain selected file
    /* READ FILE */
    private void readFile() {
    // Disable read button
    readButton.setEnabled(false);
    // Dimension data structure
         getNumberOfLines();
         data = new String[numLines][];
         // Read file
         readTheFile();
         // Output to text area     
         textArea.setText(data[0][0] + "\n");
         for(int index=0;index < data.length;index++)
    for(int j=1;j<data[index].length;j++)
    textArea.append(data[index][j] + "\n");
         // Rnable open button
         openButton.setEnabled(true);
    /* GET NUMBER OF LINES */
    /* Get number of lines in file and prepare data structure. */
    private void getNumberOfLines() {
    int counter = 0;
         // Open the file
         openFile();
         // Loop through file incrementing counter
         try {
         String line = fileInput.readLine();
         while (line != null) {
         counter++;
              System.out.println("(" + counter + ") " + line);
    line = fileInput.readLine();
         numLines = counter;
    closeFile();
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile();
         System.exit(1);
    /* READ FILE */
    private void readTheFile() {
    // Open the file
    int row=0;
    int col=0;
         openFile();
    System.out.println("Read the file");     
         // Loop through file incrementing counter
         try {
    String line = fileInput.readLine();
         while (line != null)
    StringTokenizer st=new StringTokenizer(line);
    while(st.hasMoreTokens())
    data[row][col]=st.nextToken();
    System.out.println(data[row][col]);
    col++;
    row++;
    closeFile();
    catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile();
         System.exit(1);
    /* CHECK FILE NAME */
    /* Return flase if selected file is a directory, access is denied or is
    not a file name. */
    private boolean checkFileName() {
         if (fileName.exists()) {
         if (fileName.canRead()) {
              if (fileName.isFile()) return(true);
              else JOptionPane.showMessageDialog(null,
                        "ERROR 3: File is a directory");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 2: Access denied");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 1: No such file!");
         // Return
         return(false);
    /* FILE HANDLING UTILITIES */
    /* OPEN FILE */
    private void openFile() {
         try {
         // Open file
         FileReader file = new FileReader(fileName);
         fileInput = new BufferedReader(file);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
    System.out.println("File opened");
    /* CLOSE FILE */
    private void closeFile() {
    if (fileInput != null) {
         try {
              fileInput.close();
         catch (IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
    System.out.println("File closed");
    /* MAIN METHOD */
    /* MAIN METHOD */
    public static void main(String[] args) throws IOException {
         // Create instance of class FileChooser
         FileReduction1 newFile = new FileReduction1("File Reduction Program");
         // Make window vissible
         newFile.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         newFile.setSize(500,400);
    newFile.setVisible(true);
    Java.lang.NullpointException
    at FileReductoin1.readTheFile <FileReduction1.java :172>
    at FileReductoin1.readFile <FileReduction1.java :110>
    at FileReductoin1.actionPerformed <FileReduction1.java :71>
    .

    1) Next time use the CODE tags. this is way too much unreadable crap.
    2) The problem is your String[][] data.... the only place I see you do anything approching initializing it is
    data = new String[numLines][];I think you want to do this..
    data = new String[numLines][3];anyway that's why it's blowing up on the line
    data[row][col]=st.nextToken();

  • How do I put and sort string data into an array?

    I have a txt file that has the following sample data:
    Sample.txt----
    Jones Bill 12,500 Salesperson
    Adams Frank 34,980 Manager
    Adams John 23,000 Salesperson
    Thompson Joe 59,500 Trainee
    I need to incorporate each line of data into an individual array element, while using a user-defined method
    (ex. setAllValues(String last, String first, String salary, String job)
    How do I loop the data into the array to be displayed and what is the best way to do sorts on this sample data. Any code or clues would be super helpful.
    Sanctos

    If you set up an array of Strings you can use the java.util.Arrays.sort() method to sort it. If you need to sort arbitrary Objects (i.e. your 3 strings as a whole entity) your 3-way object will have to either implement Comparable or you could write a Comparitor class to do the ordering. Not much to it, though.
    Dom.

  • Saving chart data into a spreadshee​t and also displaying it onto a table

    I am having a few different problems with this VI.
    My intentions are to display incoming data from the serial port, and view it on a chart as well as the table, then I want to save the data and the time values into a text or excel file.
    Receiving data and charting it is fine but when it comes to displaying it in real time on the table it looks like the Express table seems to be duplicating some of the entries as noted in the block diagram and the regular table keeps updating the values (date/time and value) on the first entry.
    Saving the data using write to spreadsheet file. vi poses some other problems when importing the History files from the Chart. It brings in the values except the date is the default NI date which I correct before going into the loop in order to accurately plot it on the display.
    If I use the Export waveform to spreadsheet file.vi it saves the data in the text file just fine, but if I save it into an excel file the Y values and the time values are all in one column.
    PLEASE Help
    Attachments:
    Export Waveform To Spreadsheet File.vi ‏44 KB
    Testing Blocks2aexp.vi ‏138 KB
    Waveform Time to Date Time String.vi ‏10 KB

    Mrjazzitup wrote:
    I think if you go to VI properties then go under Windows Size and uncheck the "Maintain proportions of window for different monitor resolutions" you can get it to work.
    If I open your VI in LabVIEW 8.5 or 8.2, the window title bar and menu bar, widow border, and scrollbar are all outside the visible region of my monitor, so I don't have access to anything. The FP even fully covers the task bar (set to autohide) so I cannot even get to the start menu. Even if I move the mouse to the lower screen border, it remains at the LabVIEW cursor. (This might actually be something that needs to be fixed in LabVIEW so it cannot happen!)
    All I can do is ctrl+e to go to the diagram (which looked like a huge mess without a clear indication where I am supposed to look), and thus I quit the program. At least it's nice that you gave my a shiny star, even though I could not help you. Thanks!
    As Dennis said, you need to familiarize yourself with the basics of dataflow. Building a 1D array with two elements and making this into a 1x2 2D array does not magically insert history data. You need to built the 2D array in a shift register or feedback node.
    LabVIEW Champion . Do more with less code and in less time .

  • XML data into an Array

    Hey,
    I have successfully loaded an external XML data file into my
    movie. Now I would like to save the node values into an array so i
    can manipulate and call as required...Is this possible or is there
    a better way to go about this?

    Well since you have the XML object loaded, all you would need
    to do is extract the nodes and data you needed then push them onto
    the array..
    If you are not too sure how to go about this, give us the XML
    schema (xml structure) of what was loaded and what you need and we
    can shoot you some basic code to get it done.

  • How to put 58 columns of data into an array in one shot?

    I have a set of data with 58 columns and 5000 rows. However, I need to find offset for all the elements in this 5000x58 set of data. Is there an easier way to put all the data (offset) into an array in one shot other than using build array function? This is because if I use the build array function, I will need to separate all the data into 58 columns by indexing them. This is too time consuming.
    Thanks for the suggestion! Have a good day!

    VanessaWen wrote:
    I have a set of data with 58 columns and 5000 rows. However, I need to find offset for all the elements in this 5000x58 set of data. Is there an easier way to put all the data (offset) into an array in one shot other than using build array function? This is because if I use the build array function, I will need to separate all the data into 58 columns by indexing them. This is too time consuming.
    You need to explain in much more detail, because your problem is not clear.
    Is this a 2D array with 58 columns and 5000 rows?
    What is your definition of "offset"?
    Where does the offset value come from?
    Is "offset" it the same for each row (or column) or does it depend on the data?
    What is the definition of "one shot"?
    Why would you need to seperate all the data into columns in order to use build array?
    It it "too time consuming" to write the program or is the execution slower than expected?
    Is the final output a 1D or 2D array or something else?
    Please attach a VI containing a small 2D array diagram constant with typical data, then show us what kind of output you would expect after applying the described operation.
    LabVIEW Champion . Do more with less code and in less time .

  • Saving XDP data into a Distributed PDF form

    I have a distributed PDF form that I am able to save form data into.
    I also have the XDP form data that I wish to populate using a program and open in Adobe Reader.
    I need that form data to be saved into the PDF, so that I can send the PDF via email to someone, where they will fill out the rest and send it back.
    I can programmatically open the XDP with adobe reader, but the form isn't automatically saved, which means the user would have to remember to save the data when closing the window. I would rather have something that is automated.
    Is there a way to push the form data to the PDF without requiring the user to say Yes to a prompt?

    Thanks for the response George. About the same moment when I created this post, I came accross an article online which provided same solution as that which you have mentioned. So, I made the PDF form "Reader-Enabled" using Acrobat Professional. The outcome is that using "Internet Explorer", I am now able to save information I type into the the online PDF form. However it still won't work if I use "mozilla firefox".
    Do you have any idea why Mozilla firefox won't save the information typed into the online PDF form even when I have enabled reader function with Acrobat Professional?

  • Saving the data into the tab limited text file

    Dear Friends ,
    please help me at the earliest possible , i want to store the data into an text file which is tab limited ,previously i was able to the same into the excel sheet using the jakarta HSSF POI , an open source library to store the data into the EXCEL sheet , now friends please tell me whether is there any other open source to store the data into the tab limited text file what i mean by tablimited is the data is to be saved as
    Name        Email-id        phone          streeet          city
    sri            @some.com     9434           jahdui          hye
    asdf         @.com           3455           sdgsdf         retlike this so please suggest me
    thank you in advance,
    bye
    sriharsha

    Consult the docs for BufferedWriter and from there.
    regards
    Christian
    import java.io.*;
    public class Test
         public static void main(String[] args)
              BufferedWriter writer;
              String[][] s = { {"Name","Email-id","phone","streeet","city"},
                        {"sri","@some.com","9434","jahdui","hye"},
                        {"asdf","@.com","3455","sdgsdf","ret"}};
              try {
                   writer = new BufferedWriter(new FileWriter("out.txt"));
                   for (int j=0; j< s.length; j++) {
                        for (int i = 0; i < s[j].length; ++i) {
                             writer.write(s[j]+"\t");
                        writer.newLine();
                   writer.close();
              } catch (IOException e) {
                   e.printStackTrace();

  • Pasting data into TestStand arrays

    Is there really no way to cut-and-paste values from a spreadsheet (or any other source) into an array variable in TestStand? I know I can go the other direction, but that's not helping me right now.
    I really don't want to sit here and type in 148 numbers. And I don't want to write a kludgy program to do it using a SequenceFile object.
    Surely there must be a better way...

    Currently the TestStand sequence editor does not allow you to edit selected properties as you are suggesting. As you said, the only option is to enter them manually, or create a tool that operates on a sequence file and the tool must use a path to the property that you want to edit in some way. Currently the TestStand engine does not allow the sequence editor to specify what the currently selected property is creating a tool must edit the sequence file or step and you must supply the path to the property. We hope to address this in the future.
    Scott Richardson
    Scott Richardson
    National Instruments

  • Saving typed data into form

    I have done it multiple time before but today it wont let me. How do I save the data that i have entered into the downloaded form? It says that I cannot save to print document after finishing.

    What is your operating system?  What application are you using - Adobe Reader?  What version?
    What is the full and exact message you are getting?

  • Selective collection of data into an array

    Hi,
    This is another thread of a series I've made thus far to help with a java application I've been making.
    Firstly i'd just like to thank everyone for all the help they've submitted so far. I really appreciate it.
    Back to the problem at hand.
    I have a serial device shooting data at me through a serial connection. The data looks like this:
    X= 0.018 Y= 0.154 Z= 0.235
    X= 0.021 Y= 0.152 Z= 0.238
    X= 0.018 Y= 0.159 Z= 0.235
    X= 0.018 Y= 0.159 Z= 0.235
    X= 0.015 Y= 0.152 Z= 0.238
    X= 0.018 Y= 0.159 Z= 0.235
    etc...
    I want to put those X Y and Z values into 3 separate lists so i can do operations on them like finding the average value over a given range.
    The data does not stop coming in. It is a continuous stream.
    I want to do the operations on the data in real time too, so the data needs to be added to say a static list that holds 200 values. Each new value pushes the oldest one out. So its constantly updating.
    Any ideas?
    Thanks.

    Ah fantastic! Thats exactly what i need.
    I've been reading up on it, though i am still a little confused as to how i am to integrate it into my application. Could you help a little?
    My fantastically un-OO application code:
    package sensorsystem;
    import java.io.*;
    import java.util.*;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.comm.*;
    * Class declaration
    * @author
    * @version 1.8, 08/03/00
    public class Main implements Runnable, SerialPortEventListener {
        // Creating the List:
        List< String > averagerList = new ArrayList< String >();
        static CommPortIdentifier portId;
        static Enumeration           portList;
        InputStream                inputStream;
        SerialPort                serialPort;
        Thread                readThread;
         * Method declaration
         * @param args
         * @see
        public static void main(String[] args) {
        boolean                portFound = false;
        String                defaultPort = "/dev/ttyS0"; //Default port
        // If arguments supplied are larger than 0, then bind argument 0 (arg[0])
        // to defaultPort.
         if (args.length > 0) {
             defaultPort = args[0];
        // Check to see if defaultPort really exists:
         portList = CommPortIdentifier.getPortIdentifiers();
         while (portList.hasMoreElements()) {
             portId = (CommPortIdentifier) portList.nextElement();
             if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
              if (portId.getName().equals(defaultPort)) {
                  System.out.println("Found port: "+defaultPort);
                  portFound = true;
                  Main reader = new Main();
            // If the port has not been found, print Port not found!
         if (!portFound) {
             System.out.println("Port " + defaultPort + " not found!");
         * Constructor declaration
         * @see
        public Main() {
         try {
                // Opens and claims exclusive ownership of the port.
                // SensorSystem = The name of the application.
                // 2000 = Time in milliseconds waiting for port open.
             serialPort = (SerialPort) portId.open("SensorSystem", 2000);
         } catch (PortInUseException e) {}
         try {
             inputStream = serialPort.getInputStream();
         } catch (IOException e) {}
         try {
             serialPort.addEventListener(this);
         } catch (TooManyListenersException e) {}
         serialPort.notifyOnDataAvailable(true);
         try {
             serialPort.setSerialPortParams(57600, SerialPort.DATABITS_8,
                                SerialPort.STOPBITS_1,
                                SerialPort.PARITY_NONE);
         } catch (UnsupportedCommOperationException e) {}
         readThread = new Thread(this);
         readThread.start();
         * Method declaration
         * @see
        public void run() {
         try {
             Thread.sleep(20000);
         } catch (InterruptedException e) {}
         * Method declaration
         * @param event
         * @see
        public void serialEvent(SerialPortEvent event) {
         switch (event.getEventType()) {
         case SerialPortEvent.BI:
         case SerialPortEvent.OE:
         case SerialPortEvent.FE:
         case SerialPortEvent.PE:
         case SerialPortEvent.CD:
         case SerialPortEvent.CTS:
         case SerialPortEvent.DSR:
         case SerialPortEvent.RI:
         case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
             break;
         case SerialPortEvent.DATA_AVAILABLE:
             byte[] readBuffer = new byte[20];
             try {
              while (inputStream.available() > 0) {
                  int numBytes = inputStream.read(readBuffer);
                        // While the inputStream is larger than 0,
                        // do the following:
                        System.out.print(new String(readBuffer, 0, numBytes));
                        //averagerList.add(new String(readBuffer, 0, numBytes));
                        //System.out.print(averagerList);
             } catch (IOException e) {}
             break;
    }

  • Loading data into an array

    Hi,
    Suppose I have the following piece of code:
    BEGIN
    ResultSet rs = statement.executeQuery("SELECT name FROM users;");
    Vector temp = new Vector();
    while(rs.next()) {
    String name = rs.getString(1);
    temp.addElement(name);
    String[] names = new String[temp.size()];
    for(int i=0; i<names.length; i++) {
    names[i] = (String) temp.elementAt(i);
    END
    Basically the idea this: select data from the database and store it in a ResultSet. Because the length of the row is unknown I use a temporary Vector (growable array). After all rows have been read I can declare a String array with a specified length based on the size of the Vector. By using a for loop I copy the data stored in the Vector to the array.
    This works fine, but I believe this produced a lot of overhead. Is there a better/faster/smarter way to do this?
    Thanks!
    Jeroen

    insted of for loop u can use
    Vector.toArray().

  • How to take waveform chart data and put it into an array

    Hello all,
    I am new to programming in Labview, and am learning basically by watching youtube video and such. My question is how to take a set of random data that I have written code for and linked to a waveform chart, and put the data into an array so I can calculate the mean of the data set. If there is an easier way to calculate the mean of the data set I am all ears, but I need to be able to display the mean on the front panel each time the code is run. I have attached a file of my code.
    Thanks
    Attachments:
    CA1.vi ‏11 KB

    Welcome.
    If you have not done so, look at the on-line tutorials on Getting Started with LabVIEW on the NI web site.
    A chart has a property known as History which retains some previous values.  You can get access to the the History property by popping up on the block diagram terminal of the chart and selecting Create >> Property Node. Note that the history length can be set via a pop up menu.  The default length is 1024.
    Other comments: When you know the number of iteration in advance you should use a for loop rather than the while loop.
    You can also use an autoindexing tunnel at the boundary of the loop to create an array. It only contains the values from the current run, unlike the chart history which can retain values between runs (as long as the VI remains in memory). Watch the two Mean indicators as you run this VI several times.
    The error wire is to assure that the history property node runs after the loop.  Disconnect the wire and watch the Mean and Mean 2 indicators carefully.
    The Wait is to slow things down a bit so that you can see what is happening.
    Lynn
    Attachments:
    CA1.2.vi ‏11 KB

Maybe you are looking for