Store generating numbers as 2D arrays

Hi,
I am getting voltage and position of a PZT as numbers which are changing continuously. Now my question is that how can I store these numbers (marked in the image by red circle) as 2D arrays?
thank you in advance.
Solved!
Go to Solution.
Attachments:
position-voltage.png ‏20 KB

Hello again Optic,
Now at this point I have to admit that I don't know exactly what you are aiming for in your final array layout, but I do notice a couple of things in your diagram that are interesting.
One is you are building a 3-dimensional array in the outer loop, inserting each consecutive 2D array into the master array along one dimension.  Also, you seem to be doing this upside down from what I'm used to seeing; usually the parent array is the first parameter of the build array VI, and the insertion is below it.
I would think you would want the new data to be appended onto the existing data, not inserted along a new dimension?  There is a on option on the build array VI called "concatenate inputs" that you can find by right-clicking on it.  I have this option set true on the build array VI in the top-right of this new VI picture.
I cleverly made my test VI in a released version of LabVIEW so code is attached as well as the image.
Edwin!
Attachments:
arrays2.jpg ‏26 KB
array2.vi ‏12 KB

Similar Messages

  • ERROR: jbd can only store block numbers in 32 bits.

    I am running Oracle VM Server 2.2.1. When trying to format the following partition, an error is raised.
    [root@vmserver08 ~]# cat /proc/partitions
    major minor #blocks name
    8 0 143247360 sda
    8 1 104391 sda1
    8 2 10482412 sda2
    8 3 2096482 sda3
    8 4 1 sda4
    8 5 130560223 sda5
    8 16 593755238301696 sdb
    8 17 593755238301662 sdb1
    [root@vmserver08 ~]# mkfs.ocfs2 -F -b 4k -C 32K -Tdatafiles -N10 /dev/sdb1
    mkfs.ocfs2 1.4.3
    Cluster stack: classic o2cb
    Filesystem Type of datafiles
    Filesystem label=
    Block size=4096 (bits=12)
    Cluster size=32768 (bits=15)
    Volume size=19414325854208 (592478206 clusters) (4739825648 blocks)
    18368 cluster groups (tail covers 32254 clusters, rest cover 32256 clusters)
    Journal size=33554432
    Initial number of node slots: 10
    ERROR: jbd can only store block numbers in 32 bits. /dev/sdb1 can hold 4739825648 blocks which overflows this limit. If you have a new enough Ocfs2 with JBD2 support, you can try formatting with the "-Jblock64" option to turn on support for this size block device.
    Otherwise, consider increasing the block size or decreasing the device size.
    If I add the -Jblock64 option works, but dunno how can affect the performance of the cluster disk. By the way, block Size cannot be increased since 4096 is the maximum allowed.
    [root@vmserver08 ~]# mkfs.ocfs2 -F -b 16k -Tdatafiles -N10 /dev/sdb1
    mkfs.ocfs2: Specify a blocksize between 512 and 4096 in powers of 2
    As far as I know, by default with block size = 4K you should be able to format a 16TB partition, am I wrong?
    Any ideas?
    Best regards,
    Marc Caubet

    Marc Caubet wrote:
    8 16 593755238301696 sdbYeesh. I want your storage arrays. :) The biggest I've ever managed to see on my OVM installs is 8TB for a single partition.

  • (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 to store logical operator in an array in java

    how to store logical operator in an array in java.
    Array should not be String type if i pass an element of that array it should be considered as logical operator

    my exact requirment is like this, i need some logic
    to convert string like this "2 Equals 3 AND 4 greater
    than 7" to condition like this
    2 == 3 && 4 >7 which i can pass to if
    condition.So you want to create an expression parser?
    No need for something as ugly as what you think you need, a simple nested conditional will do it for just the few logical operations.

  • How to store spry data in php array

    I am trying to store spry data in php array like this:
    <? $foo= array();?>
      <div spry:region="dsCALC">
        <div spry:repeat="dsCALC">
          <?php
    $foo[]='{dsCALC::DataPrice}';
    ?>
          </div>
      </div>
    <?var_dump($foo);?>
    Outputs:
    Array (     [0] => {dsCALC::DataPrice} )
    If I tried a variable, it works ok... The array, not... Any ideas?

    Outputs:
    Array (     [0] => {dsCALC::DataPrice} )
    And so it should, because that is what you told the PHP-script to do in the following line of code.
    $foo[]='{dsCALC::DataPrice}';
    Please remember that PHP code is handled on the server, whereas JavaScript (Spry) is handeld on the client (browser) end. JavaScript cannot be handeld by PHP nor can JavaScript handel PHP.
    My question to you is, why do you want to store the data in a PHP-array and how is the Spry data obtained?
    Ben

  • I recently noticed that my Macbook Pro is making copies of Mac App Store Preview (Numbers

    I recently noticed that my Macbook Pro is making copies of Mac App Store Previews (Numbers & Pages).  Can anyone tell me what's going on and how to "fix" this?  These copies are being sent to my download file.

    Abdussalam.A,
    you mentioned that Terminal does not work at all for your MacBook Pro. What currently happens when you run Terminal? In what way does it not work?

  • Search numbers from an array

    Hai
         Pls help me how to do this,
    My read CAN data is like this
           First frame -10 11 58 05 52 35 F1 52
    Conse. frame 1 -21 04 E8 52 10 E8 56 11
    Conse. frame 2 -22 E4 56 12 E4 62 11 E4
     i want to extract the red coloured numbers from the array.
    Thanks
    sk
    I am using LabVIEW 7.1 & NI PCMCIA CAN card
    Attachments:
    tttttt.vi ‏82 KB

    If instead you want to extract certain data bytes from each message, you should use the 'Index Array' function from the Array palette.
    This will extract individual elements from the array as specified by the connected Index inputs. The image below shows the setup needed to get the elements for your First Frame.
    Ed
    Message Edited by Ed Dickens on 01-18-2007 07:57 AM
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    Index Array.gif ‏13 KB

  • Feeding numbers into an Array

    Hi, I want to feed numbers into an array but its only using the first element. In my vi users can enter a number and this number needs to be then stored in an array. Any help would be welcome. Thanks

    like this maybe?
    Of course you would replace the random number with a control and use an event structure to spin the loop only if the input is changed by the user, for example.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    AddNumbers.png ‏2 KB

  • Converting a string of numbers into an array of booleans

    For a homework assignment, I need to convert a string of numbers into an array of booleans.  The string is a bunch of random numbers (0-9) in sequence, with no spaces.  It looks something like this: 0123452348949230740329817438120947392147809231419.  I need to make it so that each even number represents a "True" boolean and so that each odd number represents a "False" boolean.  I think that I first need to convert each element of the string into a number, and then use a case structure (or something) to say, for each element of the array, "If even, then true.  If odd, then false," but I could be wrong.  Any suggestions?

    billko wrote:
    Hooovahh wrote:
    billko wrote:
    Sounds reasonable.  Think about the definition of "odd" and "even" and it will make life a lot easier. 
    I know you are trying to be vague but I'd like to give a key hint.  Use the Quotient and Remainder function.
    LOL maybe that was one of the objectives of the homework. 
    To be fair it sounds like there is more work that is needed.  A new user of LabVIEW will have a hard time figuring out how to process each character one at a time when it isn't in an array.  
    It's just that most people (me at least) stopped thinking about division with quotient and remainder after basic algebra.  I then of course changed my way of thinking when I used LabVIEW.  Still most of the time when you use division you want to know the fractional part as a decimal.  Thinking this way makes the problem more difficult then it needs to be.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Store data in a String array getting from access table

    Hai all,
    i an new to java.
    i have a problem regarding database connectivity, in my bean class i have written code to retrieving data from a access table. It is successfully retrieving data as System.out.println(rs.getString(rows)) is working fine but i want to store the data in String array
    My code is like follows
    String[ ] listTitle;
    rs.next();
    for(int i;i<8;i++)
         rows="F"+i;
         System.out.println(rs.getString(rows));
         listTitle=rs.getString(rows);
    when control coming to
    listTitle[i]=rs.getString(rows);
    it is giving some error like :::: No data found.
    how to solve this any one??

    Hi,
    U r trying to get the value two times. To avoid this store the value in variable, then manipulate.
    Try this,
    String[ ] listTitle;
    String temp;  
    rs.next();
    for(int i;i<8;i++)
         rows="F"+i;
        temp = rs.getString(rows);
        System.out.println(temp);
        listTitle =temp;
    Regards,
    Ram.

  • Find unique numbers in an array.

    How would I find unique numbers in an array by using only one array?

    At the above codes, I use the String representation of the number that I want to find. I know that it is an easy example but it can give you an idea that how Hash works in Java.
    Give symbols(aliases) to your numbers which helps you to remember the each specific number, so you can find specific number by only using its symbol(nickname) instead of using its location which is more difficult to remember.
    import java.util.*;
    * ...Hashdescription...
    * @author  ...yourname...
    * @version 1.00, 2006/05/19
    public class Hash
         // properties
         ArrayList keys;
         ArrayList values;
         // constructors
         public Hash(){
              keys = new ArrayList();
              values = new ArrayList();
         // methods
         public void add(int val){
              values.add(new Integer( val));
              keys.add("" + val);
         public int get(String key){
              int index = keys.indexOf(key);
              return ((Integer)(values.get(index )) ). intValue();
         public static void main( String[] args)
              Hash list = new Hash();
              list.add(1);
              list.add(2);
              list.add(3);
              list.add(4);     
              list.add(5);
              list.add(6);
              list.add(7);
              list.add(8);
              list.add(9);
              System.out.println(list.get("3"));
    } // end of class Hash

  • How do I get a sub-array of even numbers from an array?

    I have a simple VI..
    First generate a 2D random numbers array. From this 2D array I have to show only the even numbers in a 1D array.
    I will thank you a lot!
    Solved!
    Go to Solution.

    take a look to what I've done.. I got a conflict with the case structure I used, this is, when the remainder is 0 then, store in an array, but if it's false(by default because in tru case is just wired) then store a zero.. My conflict was that I finally got an array of even numbers and zeros as the quantity of odd numbers.
    What I've done is resize the 2D array into a 1D and then sort it, then reverse the order so that the zeros of the array are all after the even numbers, then I used 'delete from array' from the index that zeros start, finally I got an array with only the even numbers, I have no problem with the result because the excercise asks me a range of random numbers from 13 to 69... but if it was from 0 to x all what I've done is no more efficient because I'd need the possible zeros that would appear by random generating.. I don't dominate arrays in labview, surely you have a completely more efficient solution to what I want
    Attachments:
    practica before exam.vi ‏15 KB

  • Php to generate numbers spreadsheet

    there is a pear package (http://pear.php.net/package/SpreadsheetExcelWriter) that uses php to generate excel spreadsheets. could this be done with numbers? anyone have any idea what would have to change to use numbers instead of excel?

    that explains quite a bit, thanks.
    this could be worth my while though. i've never used numbers and rarely use excel. is anyone aware of any obvious reasons that using numbers for this purpose might be better?
    i have modified a version of the spreadsheet excel writer and making graphs is possible but very tedious and extremely limited, could it be that numbers make it easier to do this?
    also excel is tricky with the way it stores dates and some of it's formatting information, and a wild little conversion process as to take place to convert from mysql format to a format excel will display properly. maybe numbers might improve this?
    finally, the only way i've discovered to effectively upload information from an excel spreadsheet is to first export it to csv (mostly because of this date and formatting issues) then upload it. obviously it'd make more sense to an end-user not have to export a file to a different format. i was hoping numbers might be able to keep a consistent file format instead.
    like you said, the structure is not documented, so i doubt you'd know the answers here for sure. but do have any incline at all that any of these points would be improved by using numbers?
    thanks again for your time

  • Random numbers from an array?

    Hello everyone!
    I have this array: private int[] possibilities = {4151, 6570}; And I want the Random class to take one of these numbers, and store it in an int called 'requirement'.
    Like this: int requirement = random.nextInt(...); I know that this is possible because I did it before. I just can't remember what I used to put inside: random.nextInt(...); - As it's around a year ago I did it.
    So can someone PLEASE help me? :)

    int index = random.nextInt(posibilities.length);
    int requirement = posibilities[index];(Edit: Made more general).

  • Generate numbers in incremental order, the number of times condition met?

    I have tried explaining my problem here also.
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=31&t=007531&p=1
    But trying to put in other words now.
    I have a NO tag which appears many times in xml. and alwyas have some random numbers displaying.
    output looks something similar to this
    something......<NO>1</NO>
    something......<NO>1</NO>
    something......<NO>2</NO>
    something......<NO>1</NO>
    something......<NO>3</NO>
    something......<NO>1</NO>
    something......<NO>5</NO>
    something......<NO>1</NO>
    something......<NO>1</NO>
    something...... & so on.
    Now instead of these numbers coming in this order i prefer to display in final output file as
    1 2 3 4 5 .................... n
    Is it possible in any ways using xslt.
    DO we need to ignore the values given in input file and then generate output values for same.
    it can be like the number of times NO tag appears in xml, it should start from 1 and keep increasing value by 1, until NO tag finishes appearance.
    But next time when other xml transforms it again should be able to start from 1 till n.
    is there a possibility of using java code for this situation or xslt is capaable enough to handle this.
    Thanks
    VJ

    I'm guessing you are looking for something like this. I used a pull approach but it could be done with a push (xsl:for-each).
    Sample XML
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
         <NO>1</NO>
         <NO>1</NO>
         <NO>2</NO>
         <NO>1</NO>
         <NO>3</NO>
         <NO>1</NO>
         <NO>5</NO>
         <NO>1</NO>
         <NO>1</NO>
    </root>
    Sample XSLT
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:output method="xml" version="1.0" omit-xml-declaration="yes" encoding="UTF-8" indent="yes"/>
         <xsl:template match="root">
              <output>
                   <xsl:apply-templates select="NO"/>
              </output>
         </xsl:template>
         <xsl:template match="NO">
              <row>
                   <xsl:value-of select="position()"/>
              </row>
         </xsl:template>
    </xsl:stylesheet>
    Sample Output
    <output>
         <row>1</row>
         <row>2</row>
         <row>3</row>
         <row>4</row>
         <row>5</row>
         <row>6</row>
         <row>7</row>
         <row>8</row>
         <row>9</row>
    </output>

Maybe you are looking for

  • How do I upgrade my OSX Snow Leopard to Lion?

    I have Snow Leopard on my MacBook (bought 2009). I have been unable to get it onto Lion as I could not access the app store (software error, now fixed). I believe I have to from Snow Leopard to Lion to get to Mountain Lion. Thing is I cannot find Lio

  • MHKIM:AP PAYMENT TYPE인 QUICK(약식)과 MANUAL(수동)의 차이점

    제품: FIN_AP 작성날짜 : 2006-10-17 AP PAYMENT TYPE인 QUICK(약식)과 MANUAL(수동)의 차이점 =========================================== PURPOSE Payment Type에서 QUICK(약식)과 MANUAL(수동)의 차이가 무엇인가요? Explanation 두 type간의 차이는 infra의 차이라고 말씀드릴 수 있겠습니다. 일반적으로 지급을 하면, 승인을 하고, For

  • Why is my itunes trying to update my iphone and its not connected to the computer?

    This would be more for the technical side of the house, but why would the system try to update my iPhone and its not connected to the computer? is there a bug in the system?

  • Product cost v/s Production Order cost

    Hi all Guru's,                         Can any one help me in understanding difference between product cost and production order cost in SAP. Will give full marks for helpful answer. Thanks, Abhishek Edited by: ABHISHEK AGRAWAL on Jan 29, 2008 9:46 A

  • Failed to unload classloader once loaded dll.

    This is yet another 'unload dll' topic. I badly need unload a dll. As adviced by many threads, i created custom classloader - once it is gc-ed it should unload it's native libs. Classloader works fine and is gc-ed fine - as long i do not call a metho