Question-Creatin array from a large # of scalars

Hello
I am developing LV code, where a large number of calculations are being done
in various ways as scalars. I would like to assemble these (say about 200
such) into a 1D array. I want to avoid using Build Array with 200 element
inputs. Also, these are not being generated within a For-Next loop to be
able to use the auto-indexing function or shift-registers.
Is there a relatively simpler way to create a 1D array from a large number
of scalars?
Reason I want to do this, is to make it easy to pass this array to other
vi's via a connector output or store to like a spreadsheet or send to a
printer.
TIA
Khan Kabir
Xerox Corp.

Hi Khan,
you can use Vi-Server to automatically build an array of values contained in controls or indicators of your front panel.
I attach a vi in LV6 that:
- Creates an array of references of all the front panel controls and indicators
- Extracts the values of a determined number of controls/indicators
- Converts each value in a DBL format (of course it can be changed)
- Builds an array of values extracted
N.B. the order of the references array refers to the order of the controls/indicators on your panel. It's important that you set correctly the panel order to make this vi build an array of the wanted controls/indicators; to access panel order: Edit - Set Tabbing Order. If for instance you want to make an array of 5 controls but in your panel you have a boolean at
order #3 you will get an error ( you can't convert a boolean to DBL...)
Let me know if you need more help.
good luck,
Alberto
Attachments:
building_controls_array.vi ‏35 KB

Similar Messages

  • How can i get a array from a JSP ?

    Hi all,
    i have a STORED PROCEDURE like this:
    static public void getMyArray(double [] xx) {
    for (int i=0; i<myarr.length;i++){
    myarr=3.145*i;
    xx=myarr;
    return ;
    how can i get the array with XSQL and transform with a XSL ?
    Is this at all possible?
    Thanks for any help.
    Achim

    u r asking how ca u get array from jsp?
    and u r asking xsql ...some stuff i couldnot understand .can u repeat the question properly?
    null

  • How do I copy an array from a website to Excel using Firefox

    Was running Firefox on Windows Vista. I could copy an array from finance.yahoo.com into an Excel spreadsheet by selecting the array with control key down then clicking on edit - copy selected cells, then pasting into an Excel sheet. I only had to tell it the upper left cell and the whole array went in properly
    Now trying to do the same thing on a new machine running Windows 7, but the "copy selected cells" option is not available in the edit menu. Is there a way to copy an array with Firefox and Windows 7? These are big arrays. One cell at a time is out of the question.

    Try this Add-on --> https://addons.mozilla.org/en-US/firefox/addon/dafizilla-table2clipboard/
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You may need to update some plug-ins. Check your plug-ins and update as necessary:
    *Plug-in check --> http://www.mozilla.org/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.org/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *'''''Adobe PDF Plug-In For Firefox and Netscape''''': [https://support.mozilla.org/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.org/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.org/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • Subtract a workpath selection from a larger workpath

    my job prohibits me from sharing images so if needed i can make a quick sketch if i can't get my question across clear enough.
    here is what i have.
    the image is a stack of objects and i have made a work path of all the objects (one large selection labeled "All" around all objects to isolate away from background), then i have another work path of just the bottom object (labeled "Bottom").
    my goal.
    i do this quite often, so i'd like to be able to just subtract the "bottom" work path selection from the larger "All" work path selection.
    Thanks
    p.s. i tried all the FAQ and search before posting.

    Thanks, I knew there was a quick command for that, I searched and searched and couldn't find it.. I have done it before too, just not in a while. As for the deleting layer content, i agree for the most part but in this case it doesn't matter in this case since I only end up with one (all original from the photographer) layer at the end and don't save in a format that supports masks.
    Thanks for your quick response and helping me make an easy and more accurate work path!

  • Retrieve data from a large table from ORACLE 10g

    I am working with a Microsoft Visual Studio Project that requires to retrieve data from a large table from Oracle 10g database and export the data into the hard drive.
    The problem here is that I am not able to connect to the database directly because of license issue but I can use a third party API to retrieve data from the database. This API has sufficient previllege/license permission on to the database to perform retrieval of data. So, I am not able to use DTS/SSIS or other tool to import data from the database directly connecting to it.
    Here my approach is...first retrieve the data using the API into a .net DataTable and then dump the records from it into the hard drive in a specific format (might be in Excel file/ another SQL server database).
    When I try to retrieve the data from a large table having over 13 lacs records (3-4 GB) in a data table using the visual studio project, I get an Out of memory exception.
    But is there any better way to retrieve the records chunk by chunk and do the export without loosing the state of the data in the table?
    Any help on this problem will be highly appriciated.
    Thanks in advance...
    -Jahedur Rahman
    Edited by: Jahedur on May 16, 2010 11:42 PM

    Girish...Thanks for your reply...But I am sorry for the confusions. Let me explain that...
    1."export the data into another media into the hard drive."
    What does it mean by this line i.e. another media into hard drive???
    ANS: Sorry...I just want to write the data in a file or in a table in SQL server database.
    2."I am not able to connect to the database directly because of license issue"
    huh?? I never heard this question that a user is not able to connect the db because of license. What error / message you are getting?
    ANS: My company uses a 3rd party application that uses ORACLE 10g. And my compnay is licensed to use the 3rd party application (APP+Database is a package) and did not purchased ORACLE license to use directly. So I will not connect to the database directly.
    3.I am not sure which API is you are talking about, but i am running an application of the visual studio data grid or similar kind of controls; in which i can select (select query) as many rows as i needed; no issue.
    ANS: This API is provided by the 3rd party application vendor. I can pass a query to it and it returns a datatable.
    4."better way to retrieve the records chunk by chunk and do the export without loosing the state of the data in the table?"
    ANS: As I get a system error (out of memory) when I select all rows in a datatable at a time, I wanted to retrieve the data in multiple phases.
    E.g: 1 to 20,000 records in 1st phase
    20,001 to 40,000 records in 2nd phase
    40,001 to ...... records in 3nd phase
    and so on...
    Please let me know if this does not clarify your confusions... :)
    Thanks...
    -Jahedur Rahman
    Edited by: user13114507 on May 12, 2010 11:28 PM

  • [Solved] Move Software RAID 5 Array From NAS To Arch

    Edit: I probably never had a problem at all, the error in dmesg probably just scared me, because after I disconnected it I noticed that /dev/d127 was 8.1 TB, the exact size of my RAID array node in my NAS which was /dev/md0, I just overlooked it. I reconnected it to my pc and mounted /dev/md127 to /mnt/raid and got this wonderful sight!
    [bran@ra ~]$ ls /mnt/raid
    data lost+found meta sys
    [bran@ra ~]$ ls /mnt/raid/data/
    data ftproot module _NAS_Media _NAS_Piczza_ _NAS_Recycle_RAID _P2P_DownLoad_ stackable _SYS_TMP TV USBHDD
    download htdocs Movies _NAS_NFS_Exports_ NAS_Public nzbget-downloads PLEX_CONFIG sys tmp USBCopy
    I bought a Thecus N4520 a few months ago and it's ok but programs crash a lot and they're hard to debug, apps have to be updated manually and the whole thing is moderately underpowered. I'm trying to move the software RAID 5 array from the NAS to my desktop, the kernel seems to detect that there is a RAID array but all these drives aren't part of it. I'm pretty new to RAID and I'm just getting my feet wet with it.
    When I try to assemble the RAID array, it just tells me that it isn't an md array. How can I get it to build my array?
    [bran@ra ~]$ sudo mdadm --assemble /dev/sdb /dev/sdc /dev/sdd /dev/sde
    mdadm: device /dev/sdb exists but is not an md array.
    Found this little chunk of info in dmesg, it says that the md devices have unknown partition tables.
    [ 3.262225] md: raid1 personality registered for level 1
    [ 3.262483] iTCO_wdt: Intel TCO WatchDog Timer Driver v1.10
    [ 3.262508] iTCO_wdt: Found a Patsburg TCO device (Version=2, TCOBASE=0x0460)
    [ 3.262585] iTCO_wdt: initialized. heartbeat=30 sec (nowayout=0)
    [ 3.262933] md/raid1:md126: active with 4 out of 4 mirrors
    [ 3.262961] md126: detected capacity change from 0 to 536850432
    [ 3.263272] RAID1 conf printout:
    [ 3.263274] --- wd:4 rd:4
    [ 3.263276] disk 0, wo:0, o:1, dev:sdc3
    [ 3.263276] disk 1, wo:0, o:1, dev:sdb3
    [ 3.263277] disk 2, wo:0, o:1, dev:sdd3
    [ 3.263278] disk 3, wo:0, o:1, dev:sde3
    [ 3.263501] md: bind<sde4>
    [ 3.264810] md: bind<sdb2>
    [ 3.268262] async_tx: api initialized (async)
    [ 3.272632] md: raid6 personality registered for level 6
    [ 3.272636] md: raid5 personality registered for level 5
    [ 3.272637] md: raid4 personality registered for level 4
    [ 3.272905] md/raid:md127: device sdb2 operational as raid disk 1
    [ 3.272908] md/raid:md127: device sde2 operational as raid disk 3
    [ 3.272910] md/raid:md127: device sdd2 operational as raid disk 2
    [ 3.272911] md/raid:md127: device sdc2 operational as raid disk 0
    [ 3.273211] md/raid:md127: allocated 0kB
    [ 3.273241] md/raid:md127: raid level 5 active with 4 out of 4 devices, algorithm 2
    [ 3.273243] RAID conf printout:
    [ 3.273244] --- level:5 rd:4 wd:4
    [ 3.273245] disk 0, o:1, dev:sdc2
    [ 3.273246] disk 1, o:1, dev:sdb2
    [ 3.273247] disk 2, o:1, dev:sdd2
    [ 3.273248] disk 3, o:1, dev:sde2
    [ 3.273273] md127: detected capacity change from 0 to 8929230716928
    [ 3.273322] RAID conf printout:
    [ 3.273326] --- level:5 rd:4 wd:4
    [ 3.273329] disk 0, o:1, dev:sdc2
    [ 3.273331] disk 1, o:1, dev:sdb2
    [ 3.273332] disk 2, o:1, dev:sdd2
    [ 3.273360] disk 3, o:1, dev:sde2
    [ 3.283617] md126: unknown partition table
    [ 3.309239] md127: unknown partition table
    [ 3.312660] md: bind<sdb4>
    [ 3.318291] md/raid1:md124: not clean -- starting background reconstruction
    [ 3.318296] md/raid1:md124: active with 4 out of 4 mirrors
    [ 3.318333] md124: detected capacity change from 0 to 10736291840
    [ 3.318385] RAID1 conf printout:
    [ 3.318391] --- wd:4 rd:4
    [ 3.318395] disk 0, wo:0, o:1, dev:sdc4
    [ 3.318398] disk 1, wo:0, o:1, dev:sdb4
    [ 3.318402] disk 2, wo:0, o:1, dev:sdd4
    [ 3.318405] disk 3, wo:0, o:1, dev:sde4
    [ 3.319890] md124: unknown partition table
    [ 3.323462] md: bind<sde1>
    [ 3.338094] md/raid1:md125: active with 4 out of 4 mirrors
    [ 3.338225] md125: detected capacity change from 0 to 2146414592
    [ 3.338253] RAID1 conf printout:
    [ 3.338258] --- wd:4 rd:4
    [ 3.338262] disk 0, wo:0, o:1, dev:sdc1
    [ 3.338266] disk 1, wo:0, o:1, dev:sdb1
    [ 3.338268] disk 2, wo:0, o:1, dev:sdd1
    [ 3.338271] disk 3, wo:0, o:1, dev:sde1
    Here's my full dmesg
    mdadm.conf
    # The designation "partitions" will scan all partitions found in /proc/partitions
    DEVICE partitions
    ARRAY /dev/md127 metadata=1.2 name=(none):0 UUID=d1d14afc:23490940:a0f7f996:d7b87dfb
    ARRAY /dev/md126 metadata=1.2 name=(none):50 UUID=d43d5dd6:9446766e:1a7486f4:b811e16d
    ARRAY /dev/md125 metadata=1.2 name=(none):10 UUID=f502437a:d27d335a:d11578d5:6e119d58
    ARRAY /dev/md124 metadata=1.2 name=(none):70 UUID=ea980643:5c1b79e8:64f1b4cb:2462799b
    Last edited by brando56894 (2014-04-21 22:51:01)

    Sorry I numbered them to show the flow of information, this was also just a place for me to store info as I worked through it. I managed to get it to work by creating a partition that takes up the whole drive and is actually 22 GB larger than all the other drives (since I found out that the had root, swap and home partitions that are no longer needed).
    I should be able to resize the other partitions without a problem, correct? They're EXT4. Should I unmount the raid array and do them individually, remount the array, let it sync and do the next? Or just unmount the array, resize all of them, mount it and let it sync?

  • One last question about capturing from tape

    I have a box full of family VHS tapes that I will be capturing into the computer to digitally archive. However, I want to make sure I am doing it the best possible way. These are the two things most important to me:
    1. Quality
    2. Longevity
    1. Quality
    I have a VHS/MiniDV JVC SR-VS30 deck connected via firewire into my 2014 iMac. I know that firewire is typically the best option when capturing DV footage into the computer. However, is this still true for VHS and other forms of old tape. I can hook anything up to this deck via composite/s-video in and go out through the firewire connection. However, I wasn't sure if firewire was the best coming from a VHS tape. I also have an old video capture card that has a straight s-video/composite input. Which would be more native to the VHS/analog tapes as far as keeping original quality and the best possible image?
    When I use the JVC deck, some programs will capture the vhs tapes and others won't because they won't recognize unless I'm using the DV side. For example, FCPX recognizes the deck, but when I go to import unless it's a dv, it will say "no tape" and I cannot capture anything. iMovie will capture files as .DV. Quicktime will also recognize the deck and capture files as apple prores MOV files. When I compare the QT and iMovie, the QT files look better in my opinion, though I don't know if they truly are. The iMovie dv files have jagged edges like tv lines or something during quick movement and like others say about firewire it looks a little "milky" (though I know this isn't necessarily a bad thing). The QT clips don't necessarily look sharper, but they don't have the hideous jagged edges.
    So my question before I start this large project is:
    Which capture methods above would you use, or what else would you recommend for best quality?
    2. Longevity
    Which file format would you recommend saving these files (or just keeping them as they are at capture) for long term storage? When I come back to these files in 10 years and need to convert them to something new, I want them to have the greatest chance of being compatible with whatever lies ahead. There are so many different file formats.
    Many thanks for any help along this long process

    I want to make sure I am doing it the best possible way.
    I have done lots of that.
    For maximum quality here is my procedure:  ADVC300 > iMovie 06 > iDVD 09/11. 
    To get your VHS video into iMovie, use the Grassvalley ADVC300 .  With the ADVC300 Audio and Video go in, FireWire comes out. It also comes with a nice Macintosh application that works flawlessly with iMovie 06 and iDVD 09/11 (I have used it a few times with iMovie 11).
    The ADVC300 has been discontinued by the manufacturer. The included software (which is not really necessary but does enhance performance) is not compatible with OS 10.7 or newer.  You can still find the ADVC300 for sale in a few outlets as well as eBay. It will sell between 50% and 100% ABOVE its retail price. Yes, it's that good.
    If you can’t find the ADVC300, use the Grassvalley ADVC110.
    I have a drawer full of analog-to-digital converters.   After using the Grass Valley ADVC300 I find nothing else acceptable.
    The program that comes with the ADVC300 has some nice filters that can improve video and audio of the source material. The ADVC300 will take Audio and Video from any source (VCR, Tivo, Satellite Receiver) and convert it to FireWire (iMovie will treat it like a camera).
    I would use iMovie 06 with iDVD 09/11, why?
    iMovie 09, 11, and 13 uses 'single field processing' meaning every other horizontal line of the video is thrown out, which reduces the sharpness of the footage. iMovie 06 uses ALL of the image to form the video.  (Also the latest iMovie CANNOT set Chapeters !)
    After lots of experimenting I get the best results using OS 10.6, iMovie 06, and iDVD 09/11.  My movies look just like Hollywood!
    My primary computer is a Mac Pro, so I just use one of the four hard drives and boot OS 10.6. You can also partition a single hard drive to achieve the same results.
    This may seem like more trouble than you want to go through.  However, I find the superior quality to be well worth it.

  • Question about arrays

    I have a question regarding arrays. I have a contact class and two classes that extend from it a SchoolContact class and FamilyContact class. Right now as my code is I have three diffrernt arrays to hold all the info. Is there a way to store all this info into one array and print out only the School contacts at one time if the user enters that option or print out all the options at one time if the user selects that? my code is below
    //The imports below are for I/O
    import java.util.*;
    import java.io.*;
    // Declare a public class
    public class CodeExample {
         public static void main(String[] args) {
              // Create scanner
              Scanner sc = new Scanner(System.in);
              //Declare array to hold school contact
              SchoolContact[] schoolContactInfo = new SchoolContact[10];
              FamilyContact[] familyContactInfo = new FamilyContact[10];
              Contact [] contactInfo = new Contact [10];
              // Declare variables
              int menuOption, creditHours, area, prefix, suffix, studentId, studentContactsSoFar = 0, familyContactsSoFar = 0, contactsSoFar = 0;
              double gpa;
              char studentData, familyRelationOption;
              String menuOption2, menuOption3;
              // Get menu to display
              do {
                   System.out.println("-----MENU-----");
                   System.out.println("1) Enter a Student Contact");
                   System.out.println("2) Enter a Family Contact");
                   System.out.println("3) Enter a Contact");
                   System.out.println("4) Display Student Contacts");
                   System.out.println("5) Display Family Contacts");
                   System.out.println("6) Display Contacts");
                   System.out.println("7) Display All Contacts");
                   System.out.println("8) Quit");
                   System.out.println("Selection:");
                   menuOption = sc.nextInt();
                   SchoolContact schoolContact = new SchoolContact();
                   FamilyContact familyContact = new FamilyContact();
                   Contact contact = new Contact();
                   // Implement switch statement to
                   switch (menuOption) {
                   // If user enters 1 to create contact this will be displayed to user
                   case 1:
                        System.out.println("Enter The First Name of The Student");
                        schoolContact.setFirstName(sc.next());     
                        System.out.println("Enter The Last Name of The Student");
                        schoolContact.setLastName(sc.next());
                        System.out.println("Enter the Student ID of this person: 900");
                        schoolContact.setStudentId(Integer.parseInt("900" + sc.next()));
                        System.out.println("G)Enter The GPA For This Student");
                        System.out.println("H)Enter The Number Of Completed Credit Hours");
                        menuOption2 = sc.next().toUpperCase();
                        studentData = menuOption2.charAt(0);
                        // Prompts the user for the next choice
                        if (studentData == 'G') {
                             System.out.println("GPA: ");
                             gpa = sc.nextDouble();
                             //create the Data object
                             Data data = new Data();
                             data.setStudentGPA(gpa);
                             //add it to the contact
                             schoolContact.setData(data);
                             else if (studentData == 'H') {
                                  System.out.println("Hours: ");
                                  creditHours = sc.nextInt();
                                  //create the Data object
                                  Data data = new Data();
                                  data.setStudentCreditHours(creditHours);
                                  //add it to the schoolcontact
                                  schoolContact.setData(data);
                                  else {
                                       System.out.println("Invalid Entry");
                        System.out.println("Enter The Phone Number of This Student");
                        System.out.println("(###)-###-####: ");
                        area = sc.nextInt();
                        prefix = sc.nextInt();
                        suffix = sc.nextInt();
                        //create the phone object
                        Phone_Number studentPhone = new Phone_Number(area, prefix,     suffix);
                        //add it to the Schoolcontact
                        schoolContact.setPhone(studentPhone);
                        //store info in an array
                        schoolContactInfo[ studentContactsSoFar ] = schoolContact;
                        //increase the counter to point to the next free location (if any)
                        studentContactsSoFar++;
                        break;
                   case 2:
                        System.out.println("Enter the First Name of The Contact");
                        familyContact.setFirstName(sc.next());     
                        System.out.println("Enter The Last Name of The Student");
                        familyContact.setLastName(sc.next());
                        System.out.println("Enter The Relationship of This Contact");
                        System.out.println("A) SISTER");
                        System.out.println("B) BROTHER");
                        System.out.println("C) MOTHER");
                        System.out.println("D) FATHER");
                        System.out.println("E) OTHER");
                        menuOption3 = sc.next();
                        familyRelationOption = menuOption3.charAt(0);
                        if (familyRelationOption == 'A') {
                             System.out.println("Relationship: SISTER ");
                             familyContact.setRelationType(FamilyContact.RelationType.SISTER);
                             else if (familyRelationOption == 'B') {
                             System.out.println("Relationship: BROTHER ");
                             familyContact.setRelationType(FamilyContact.RelationType.BROTHER);
                                  else if (familyRelationOption == 'C') {
                                       System.out.println("Relationship: MOTHER ");
                                       familyContact.setRelationType(FamilyContact.RelationType.MOTHER);
                                       else if (familyRelationOption == 'D') {
                                            System.out.println("Relationship: FATHER ");
                                            familyContact.setRelationType(FamilyContact.RelationType.FATHER);
                                            else if (familyRelationOption == 'E') {
                                                 System.out.println("Relationship: OTHER ");
                                                 familyContact.setRelationType(FamilyContact.RelationType.OTHER);
                        System.out.println("Enter The Phone Number of This Contact");
                        System.out.println("(###)-###-####: ");
                        area = sc.nextInt();
                        prefix = sc.nextInt();
                        suffix = sc.nextInt();
                        //create the phone object
                        Phone_Number familyContactNumber = new Phone_Number(area, prefix,     suffix);
                        //add it to the familyContact
                        familyContact.setPhone(familyContactNumber);
                        //store info in an array
                        familyContactInfo[ familyContactsSoFar ] = familyContact;
                        //increase the counter to point to the next free location (if any)
                        familyContactsSoFar++;
                        break;
                   case 3:
                        System.out.println("Enter The First Name of The Contact");
                        contact.setFirstName(sc.next());     
                        System.out.println("Enter The Last Name of The Contact");
                        contact.setLastName(sc.next());
                        System.out.println("Enter The Phone Number of This Contact");
                        System.out.println("(###)-###-####: ");
                        area = sc.nextInt();
                        prefix = sc.nextInt();
                        suffix = sc.nextInt();
                        //create the phone object
                        Phone_Number contactNumber = new Phone_Number(area, prefix,     suffix);
                        //add it to the contact
                        contact.setPhone(contactNumber);
                        //store info in an array
                        contactInfo[ contactsSoFar ] = contact;
                        //increase the counter to point to the next free location (if any)
                        contactsSoFar++;
                        break;
                   case 4:
                        System.out.println("-----Student Contacts-----");
                        //print each stored contact
                        for( int i = 0 ; i < studentContactsSoFar ; i++ )
                             System.out.println( (i+1) + ". " + schoolContactInfo.toString() + "\n");
                        break;
                   case 5:
                        System.out.println("-----Family Contacts-----");
                        //prints each stored contact
                        for( int i = 0 ; i < familyContactsSoFar ; i++ )
                             System.out.println( (i+1) + ". " + familyContactInfo[i].toString() + "\n");
                        break;
                   case 6:
                        System.out.println("-----Contacts-----");
                        //prints each stored contact
                        for( int i = 0 ; i < contactsSoFar ; i++ )
                             System.out.println( (i+1) + ". " + contactInfo[i].toString() + "\n");
                        break;
                   case 7:
                        System.out.println("Calling Case 7");
                        for( int i = 0 ; i < contactsSoFar ; i++ )
                             System.out.println( (i+1) + ". " + contactInfo[i].toString() + "\n");
                        break;
                   case 8:
                        System.out.println("Program Ended");
                        break;
              } while (menuOption != 8);

    how would I go in printing the contacts from one array, then the next array and so on?
    case 7:
        System.out.println("Calling Case 7");
        for( int i = 0 ; i < studentContactsSoFar ; i++ ) {
            System.out.println( (i+1) + ". " + schoolContactInfo.toString() + "\n");
    for( int i = 0 ; i < familyContactsSoFar ; i++ ) {
    System.out.println( (i+1) + ". " + familyContactInfo[i].toString() + "\n");
    for( int i = 0 ; i < contactsSoFar ; i++ ) {
    System.out.println( (i+1) + ". " + contactInfo[i].toString() + "\n");
    break;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Programmatically create array from common cluster items inside array of clusters

    I have seen many questions and responses on dealing with arrays of clusters, but none that discuss quite what I am looking for. I am trying to programmatically create an array from common cluster items inside array of clusters. I have a working solution but looking for a cleaner approach.  I have an array of clusters representing channels of data.  Each cluster contains a mixture of control data types, i.e.. names, types, range, values, units, etc. The entire cluster is a typedef made up of other typedefs such as the type, range and units and native controls like numeric and boolean. One array is a “block” or module. One cluster is a channel of data. I wrote a small vi to extract all the data with the same units and “pipe” them into another array so that I can process all the data from all the channels of the same units together.  It consists of a loop to iterate through the array, in which there is an unbundle by name and a case structure with a case for each unit.  Within a specific case, there is a build array for that unit and all the other non-relevant shift registers pass through.  As you can see from the attached snapshots, the effort to add an additional unit grows as each non-relevant case must be wired through.  It is important to note that there is no default case.  My question:  Is there a cleaner, more efficient and elegant way to do this?
    Thanks in advance!
    Solved!
    Go to Solution.
    Attachments:
    NI_Chan units to array_1.png ‏35 KB
    NI_Chan units to array_2.png ‏50 KB

    nathand wrote:
    Your comments made me curious, so I put together a quick test. Maybe there's an error in the code (below as a snippet, and attached as a VI) or maybe it's been fixed in LabVIEW 2013, but I'm consistently getting faster times from the IPE (2-3 ms versus 5-6ms for unbundle/index). See if you get the same results. For fun I flipped the order of the test and got the same results (this is why the snippet and the VI execute the tests in opposite order).
    This seems like a poster child for using the IPES!  We can look at the index array + replace subset and recognize that it is in place, but the compiler is not so clever (yet!).  The bundle/unbundle is a well-known "magic pattern" so it should be roughly equivalent to the IPES, with a tiny penalty due to overhead.
    Replace only the array operation with an IPES and leave the bundle/unbundle alone and I wager the times will be roughly the same as using the nested IPES.  Maybe even a slight lean toward the magic pattern now if I recall correctly.
    If you instantly recognize all combinations which the compiler will optimize and not optimize, or you want to exhaustively benchmark all of your code then pick and choose between the two to avoid the slight overhead.  Otherwise I think the IPES looks better, at best works MUCH better, and at worst works ever-so-slightly worse.  And as a not-so-gentle reminder to all:  if you really care about performance at this level of detail: TURN OFF DEBUGGING!

  • Loading 7831R memory with contents of Array from Host VI?

    Hi,
    Can anyone help - how can I load the contents of an array in the
    labview Host VI into the memory of the FPGA on the 7831 board? When I
    try to do this in a FOR loop, and index each element, it says that the
    array must be a fixed size for this target. How do I do this? I
    initialise the array in an earlier sequence frame, and am reading from
    a local variable.
    Thanks for any advice,
    Joe.

    In LabVIEW FPGA all arrays must have a fixed size, because they are allocated as static memory on the FPGA. As much as possible you should avoid allocating (large) arrays in your LabVIEW FPGA diagram since this will use a lot of FPGA space; about 1% of the FPGA for every 4 bytes of array data.
    Instead of using an array in your diagram you can use the Memory Read and Write functions which provide access to 16kB of memory which is separate from the FPGA.
    If you want to use an array as you described, you should create an array constant in your diagram or an array control on your front panel. To set the size, right click on the array index display and select 'Set Dimension Size'. Select the fixed size and specify the number of elements in the array.
    T
    o pass values to an array on the diagram use the 'Array Replace Subset' function on the existing array.
    If you have an array control on your front panel you can directly pass the whole array from your host application to the FPGA VI and do not need to pass individual array elements.
    Christian L
    NI Consulting Services
    Christian Loew, CLA
    Principal Systems Engineer, National Instruments
    Please tip your answer providers with kudos.
    Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
    or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
    to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

  • Return an array from dll to labview

    Hello,
    I am using "Call Library Function" where I call a C function from Labview.
    Now .. I want to return an 1 dimensional array from C DLL back to Labview.
    Can someone provide an example code how to do it.
    When I configure parameter, there are options "Array Data Pointer", "Array Handle" and "Array Handle Pointer".
    When I take the first (the simple one), so there is no way labview can know how many items are in the array.
    But what is the right to take?
    Thanks in advance
    Kind Regards

    You would run into the same problem calling a function that returns an array in C, because you cannot determine the number of items in an array in C solely from the pointer value that a function returns.  Also, it's a bad idea to return an array of unknown size as a function's return value, because that makes the calling function responsible for deallocating the memory even though the called function allocated it.  If you don't know in advance how large the array will be, then a better approach is to allocate an array of sufficient size in the calling function (or in LabVIEW, in this case) and pass that by reference to the function, then have the function's return value indicate the number of values in the array that are actually filled with data.

  • Copying Multiple Arrays into One Large Array

    I'm currently trying to copy multiple character arrays into one larger character array in a method that prints data gathered from a database. Here is my code:
    private static void printData(String[] data){
            try {
                int totalLengthOfAllStrings = 0;
                for(int i = 0; i < data.length; i++) {
                    data[i] += '\n';
                    totalLengthOfAllStrings += data.length();
    int runningLength = 0;
    char[] printArray = new char[totalLengthOfAllStrings];
    for(int j = 0; j < data.length; j++) {
    char[] tempArray = data[j].toCharArray();
    runningLength += tempArray.length;
    System.arraycopy(tempArray, 0, printArray, runningLength - 1, tempArray.length);
    DocFlavor df = DocFlavor.CHAR_ARRAY.TEXT_PLAIN;
    Doc printDoc = new SimpleDoc(printArray, df, null);
    PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
    aset.add(new Copies(1));
    aset.add(MediaSize.NA.LETTER);
    aset.add(Sides.DUPLEX);
    PrintService[] services = PrintServiceLookup.lookupPrintServices(df, aset);
    if (services.length > 0) {
    DocPrintJob job = services[0].createPrintJob();
    try {
    job.print(printDoc, aset);
    System.out.println("Print successful!");
    catch (PrintException pe) {
    catch(Exception e) {
    e.printStackTrace();
    I keep getting an ArrayIndexOutOfBoundsException and for the life of me I can't figure out why.
    Can anyone help with this?
    Thanks!
    -Matt

    I think your problem lies with the second for loop:
    for(int j = 0; j < data.length; j++)  {
        char[] tempArray = data[j].toCharArray();
        runningLength += tempArray.length;
        System.arraycopy(tempArray, 0, printArray, runningLength - 1, tempArray.length);
    }If I am not wrong, you should swap the sequence of the runningLength and System.arraycopy statements, and also move the minus 1 from arraycopy statement to the runningLength statement. The result would look like this:
    for(int j = 0; j < data.length; j++)  {
        char[] tempArray = data[j].toCharArray();
        System.arraycopy(tempArray, 0, printArray, runningLength, tempArray.length);    // swapped and removed the -1
        runningLength += tempArray.length - 1;    // swapped and appended the -1
    }The main reason for these changes is because when j == data.length - 1, the value of runningLength would have already exceeded the size of printArray. Therefore, swapping the position would be able to overcome this problem.

  • Deleting rows from very large table

    Hello,
    I need to delete rows from a large table, but not all of them, so I can't use truncate. The delete condition is based on one column, something like this:
    delete from very_large_table where col1=100;
    There's an index (valid, B-tree) on col1, but it still goes very slow. Is there any instruction which can help delete rows faster?
    Txh in adv.
    A.

    Your manager doesn't agree to your running an EXPLAIN PLAN? What is his objection? Sounds like the prototypical 'pointy-hair boss'.
    Take a look at these:
    -- do_explain.sql
    spool explain.txt
    -- do EXPLAIN PLAN on target queries with current index definitions
    truncate table plan_table
    set echo on
    explain plan for
    <insert query here>
    set echo off
    @get_explain.sql
    -- get_explain.sql
    set linesize 120
    set pagesize 70
    column operation     format a25
    column query_plan     format a35
    column options          format a15
    column object_name     format a20
    column order           format a12
    column opt           format a6
    select     lpad(' ',level) || operation "OPERATION",
         options "OPTIONS",
         decode(to_char(id),'0','COST = ' || NVL(to_char(position),'n/a'),object_name) "OBJECT NAME",
         cardinality "rows",     
         substr(optimizer,1,6) "OPT"
    from     plan_table
    start     with id = 0
    connect by prior id = parent_id
    There are probably newer, better ways, but this should work with all living versions of Oracle and is something I've had in my back pocket for several years now. It's not actually executing the query or dml in question, just running an explain plan on it.

  • SELECTing from a large table vs small table

    I posted a question few months back about teh comparison between INSERTing to a large table vs small table ( fewer number of rows ), in terms of time taken.
    The general consensus seemed to be that it would be teh same, except for teh time taken to update the index ( which will be negligible ).
    1. But now, following teh same logic, I m confused why SELECTINg from a large table should be more time taking ("expensive" ) than SELECTing from a small table.
    ( SELECTing using an index )
    My understanding of how Oracle works internally is this :
    It will first locate the ROWID from teh B-Tree that stores the index.
    ( This operation is O(log N ) based on B-Tree )
    ROWID essentially contains teh file pointer offset of teh location of the data in teh disk.
    And Oracle simply reads teh data from teh location it deduced from ROWID.
    But then the only variable I see is searching teh B-Tree, which should take O(log N ) time for comparison ( N - number of rows )
    Am I correct above.
    2. Also I read that tables are partitioned for performance reasons. I read about various partiotion mechanisms. But cannot figure out how it can result in performance improvement.
    Can somebody please help

    user597961 wrote:
    I posted a question few months back about teh comparison between INSERTing to a large table vs small table ( fewer number of rows ), in terms of time taken.
    The general consensus seemed to be that it would be teh same, except for teh time taken to update the index ( which will be negligible ).
    1. But now, following teh same logic, I m confused why SELECTINg from a large table should be more time taking ("expensive" ) than SELECTing from a small table.
    ( SELECTing using an index )
    My understanding of how Oracle works internally is this :
    It will first locate the ROWID from teh B-Tree that stores the index.
    ( This operation is O(log N ) based on B-Tree )
    ROWID essentially contains teh file pointer offset of teh location of the data in teh disk.
    And Oracle simply reads teh data from teh location it deduced from ROWID.
    But then the only variable I see is searching teh B-Tree, which should take O(log N ) time for comparison ( N - number of rows )
    Am I correct above.
    2. Also I read that tables are partitioned for performance reasons. I read about various partiotion mechanisms. But cannot figure out how it can result in performance improvement.
    Can somebody please helpIt's not going to be that simple. Before your first step (locate ROWID from index), it will first evaluate various access plans - potentially thousands of them - and choose the one that it thinks will be best. This evaluation will be based on the number of rows it anticipates having to retrieve, whether or not all of the requested data can be retrived from the index alone (without even going to the data segment), etc. etc etc. For each consideration it makes, you start with "all else being equal". Then figure there will be dozens, if not hundreds or thousands of these "all else being equal". Then once the plan is selected and the rubber meets the road, we have to contend with the fact "all else is hardly ever equal".

  • Sending arrays from Excel into Labview

    I want to send an array from Excel VBA into a LabView VI.
    The Excel example shows how to send individual numbers and return an array into Excel but not send an array.
    Everything tried sends blank arrays into LabView, which can then be modified in LabView and returned to Excel.
    A VBA code snippit that does not work is:
    Sub LoadData()
    ' LoadData Macro
    ' Keyboard Shortcut: Ctrl+l
    ' This is an example to demonstrate LabVIEW's Active-X server capabilities.
    ' Executing this macro loads a LabVIEW supplied example VI "Frequency Response.vi",
    ' runs it and plots the result on an Excel Chart.
    Dim lvapp As LabVIEW.Application
    Dim vi As LabVIEW.VirtualInstrument
    Dim paramNames(0)
    Dim paramVals As Variant
    Set lvapp = CreateObject("LabVIEW.Application")
    viPath = lvapp.ApplicationDirectory + "\examples\apps\freqresp.llb\DAK Frequency Response.vi"
    Set vi = lvapp.GetVIReference(viPath)   'Load the vi into memory
    vi.FPWinOpen = True                     'Open front panel
    paramNames(0) = "Foo"
    paramVals = Sheet1.Range("j1:j1000").Value
    Call vi.Call(paramNames, paramVals)
    This code generates an error - expecting 1D array or variants.
    However, if I supply the correct array, then LabView thinks it is empty
    'foo' is a cluster
    'Array' is a double array
    Neither work to receive the data

    Thanks for the reply but that approach will be difficult.  The problem to solve is relatively simple IF LabView could read arrays (it writes arrays easily).  Here is the problem:
    I want to convolute two large arrays.  I have written VBA programs to do this but they take too long - over 30 sec whereas the LabView version take <1 sec IF I could get the data into LabView.
    The convolute is part of an optimization program that goes though many loops so that it takes hours to run efficiently AND if I manually change cells in the spreadsheet, then it takes 30sec to come back as VBA does not respect clean cells (for some reason).
    I was trying to write a function in VBA to do this calculation via LabView rather than VBA.  One way to  do this is to write a text file in VBA and read in LabView, then pass the results back or maybe the clipboard as a buffer.  That is faster but clumsy.  You could also have LabView look for dirty cells and then do the calculation as the server rather than the client.  Again, time consuming and cumbersome.  I have written pure LabView code to do the curve fitting but prefer to use Excel as that is easier to incorporate and work with the data.   You can do convolute using FFTs but Excel does not do that correctly - they CANNOT make their FFTs into a function (VBA functions cannot modify cells in the spreadsheet but only return variables.  FFT modifies cells so cannot be called from a function, only a macro, which then needs to be updated manually).  Again, I can kluge VBA (real kluge this time) to make FFTs work as a function BUT prefer the LabView solution, if possible, as I am not sure the FFT will actually save time.
    I am not sure if the problem is LabView's fault or Excel's (2013) fault that the variables are not set-up properly.  LabView claims to be able to do this.  Again, you can pass single variables into LabView and read back arrays but try as I might, I cannot get arrays into LabView.
    Any help in sending arrays (maybe Labview expects a variant variable and needs to convert it somehow) would be appreciated.  Variants are suppose to be able to be converted automatically but maybe there is a bug in LabView (2010) that does not handle input variant arrays correctly (I have tried making them clusters, double arrays, ect).  LabView thinks that all the arrays sent by VBA are empty. If LabView modifies the same array, VBA sees that modification so that the addresses appear to be sent correctly i.e. the array "handle" is being sent to LabView or else it could not fill the array to send back to VBA.
    If ever this is solved, I will put on-line the solution for others as again marrying both programs will have advantages.  Others may find this interesting is marry LabView with Excel so that LabView does some of the heavy calculations that Excel has kluged. 

Maybe you are looking for

  • What are Azure limitations for Websockets in Cloud Services (web and worker role)?

    A WebSocket Server should be built on Azure platform with OnPrem connections and have questions regarding limitations for Websockets in Azure Cloud Services - web and worker roles. Websockets can be configured for Web Sites and limitations are unders

  • Backing up database with read-only tablespaces

    I am trying to develop a script that will dynamically build RMAN scripts for backing up a database with read-only tablespaces. The application running on this database creates new tablespaces in read-write mode on weekly basis, populates them, and th

  • Connect SQL Server through DBCO - DBCONNECT

    Hi Guys, I am trying to connect to one of the SQL Server in my Domain. I have made entries as mentioned by SAP note in DBCO Transaction. When I am testing connection through program 'ADBC_TEST_CONNECTION' it is showing me following error: Testing a D

  • Advance in quantity contract

    Hi All, I am creating on quantity contract and i want to bill advance for entire quantity and rest of payment i want to bill by raising invoices in connection with realese orders. Waiting for your inputs. Thanks in advance. Kaushal

  • M y issue is E recruitment u2013 Recruiter job requisition (BSP)

    M y issue is E recruitment u2013 Recruiter job requisition (BSP) Required Fields on Job Requisition fields are noted with a red asterisk (*). How to add red asterisk in job requisition page (BSP) Regards Eshwar