Skewing in a 2D array manipulation

I have an application that forms a 256 x 256, 2D array arrangement of data measurement points from a 1D array bin 256 elements long.I use a rotate VI to shift the incoming points in and predefined 2D arrays which is initialized to zero at start-up. I can't figure out that the 2D final output is shifted and skewed.Also, I simulate the data source from another loop and uses a Notification.VI for synchronizing the receiver and data source loops; a marker 255 is used to mark end and start of new data stream.
Bernardino Jerez Buenaobra
Senior Test and Systems Development Engineer
Test and Systems Development Group
Integrated Microelectronics Inc.- Philippines
Telephone:+632772-4941-43
Fax/Data: +632772-4944
URL: http://www.imiphil.com/our_location.html
email: [email protected]
Attachments:
array_processing_xy-scanner_beta_test_notifier.vi ‏192 KB

Hello Sean, thanks. You were right about how arrays does its job, before this reply I had already figured out the bug in the code.First, is that you would'nt really like to have any time delay VIs lying around unwatched because they mess up synchronization VIs (Queues,Notifications)between deep nested loops.It is important to check which index to use for counting the element arrays, this was a key in the debug. The skewing of the bits has pointed to the consumer loop index not neing synchronized with the producer loop. Overall the array does its job only when indexed right probing tools has been very valuable for tracking the data elements.Attached is the screenshot of the actual project GUI.
Bernardino Jerez Buenaobra
Senior Test and Systems Development Engineer
Test and Systems Development Group
Integrated Microelectronics Inc.- Philippines
Telephone:+632772-4941-43
Fax/Data: +632772-4944
URL: http://www.imiphil.com/our_location.html
email: [email protected]
Attachments:
one_line_scan_screenshot.GIF ‏276 KB

Similar Messages

  • Noob needs help with array manipulation

    First off, I'd like to say hello to eveybody!
    I'm trying to figure out how to search for a value in an array, delete the first occurence of it, and shift the rest of the array down one. Can anyone point me in the right direction of an algorithm, mabey?
    Any help is most appreciated!

    first of all, let me comment that for this purpouse, you're better using the ArrayList class.
    anyway, you would need to make a temporary array inside a method, and traverse the array in question using a loop. most people use a for loop.
    Then, put all the values of the old array into the temporary one, except for the one you dont want.
    after the loop, set the old array to equal the temporary array.

  • Best Way to do this array manipulation

    I have an array as follows:
    61 3 51 5 61.2 3.4 51.3 4.3 61 7 51 4
    where the data is in sets of two so array[0] and array[1] make up one data set (61,3) and the next data set is (51,5) then (61.2,3.4) ect. What I want to do is to clean this array up so that any data set where the X values are within some set value, say 1 then they are seen as duplicates and removed, unless the y values differ by more than 1. So for example this set would clean up to
    61 3 51 5 61 7
    Is there any nice way to do this in labview?
    Thanks.
    Intern NSWCCD Carderock.

    I tried to use the following VI but it doesnt seem to work, any suggestions? Thanks.
    Intern NSWCCD Carderock.
    Attachments:
    try.vi ‏82 KB

  • [Solved]Bash:Manipulating arrays of paths? the right way or not?

    Note: Refer to the following posts for better solutions and/or alternatives.
    This is a mock segment of a script I'm writting and I need to know if I'm doing it the correct way or at least in a proper bash way...
    the following works but will it always parse in a sorted manner. I have a set of directories that are named by date in the YYYY-MM-DD (International) format and want to be sure that they will always be treated as directory paths even when special characters "\n,\t,\s ...etc" are encountered in the path. The number of these directories changes and is compared to a set NUM-ber variable and when there are more than the set number the oldest ones are removed which brings a second question. Being dated as YYYY-MM-DD they sort from oldest to newest(lexicographical order) but do they always and is this the right way to deal with elements in an array separated by nulls? Any Comments or suggestions would be appreciated as I'm learning bash for the  time being (perl is next) and gathered this from bits and peices on verious wikis and forums. I basically want know if this a correct approach to the subject of extracting and performing actions on elements of an array that are directory paths.
    #!/bin/bash
    oifs="$IFS"
    IFS=$'\0'
    DIRTREE=(/path/to/dated/directories/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    NUM=5
    HOWMANYMORE=$(echo $(( ${#DIRTREE[@]} - $NUM )))
    if (( ${#DIRTREE[@]} > $NUM )) ; then
    rm -rv "${DIRTREE[@]:0:$HOWMANYMORE}"
    fi
    IFS="$oifs"
    Note:I have tested this for those wondering
    Last edited by Thme (2012-11-30 16:58:13)

    aesiris wrote:
    there is a special syntax for appending elements to an array:
    array+=(element1 element2 ...)
    you can simplify to
    NUM=3
    combined=()
    for dir in set1 set2 set3; do
    new=(/home/maat/dateddirs/"$dir"/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    (( count= ${#new[@]} - NUM ))
    combined+=("${new[@]:0:$count}")
    done
    This works as really well, however, in my case I still need the other sets in separate arrays for other purposes in my personal script so I adapted the approach a little and got this which uses the array+=(foo) syntax properly now. I was aware of this feature in bash arrays and experimented with it but had no success adding elements from other arrays until you demonstrated it in your example by adding them though a "for loop" and doing the arithmetic there... My current one now is very similar...I'm not sure how to reduce it further if possible but I need the other arrays as I do something completely different with them:
    #!/bin/bash
    NUM=10
    set1=(/home/maat/datedfolders/set1/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    set2=(/home/maat/datedfolders/set2/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    set3=(/home/maat/datedfolders/set3/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    CT1=$(( ${#set1[@]} - NUM ))
    CT2=$(( ${#set2[@]} - NUM ))
    CT3=$(( ${#set3[@]} - NUM ))
    for X in "${set1[@]:0:$CT1}" "${set2[@]:0:$CT2}" "${set3[@]:0:$CT3}"
    do
    combined+=("$X")
    done
    for
    for Xdirs in "${combined[@]}"
    do
    rm -rv "$Xdirs"
    done
    I'm considering changing the title of this thread as it reveals a little more than I originally expected to go over and provides some pitfalls as well as ways to approach array manipulation which can be applied to wide range of uses in bash scripting. Others may find totally different uses for what we've discussed here so....
    Last edited by Thme (2012-11-30 10:41:02)

  • Manipulation array

    Ok well,
    I`m currently block on one simple problem, But I don`t find the solution......... And sure it is simple....
    It`s easier with one drawing, I want to do this :
    1 1
    2 2
    3 3
    4 4
    5 5
    6 6
    And want to change the array to have :
    1 1 4 4
    2 2 5 5 
    3 3 6 6
    I found this post
    http://forums.ni.com/t5/LabVIEW/array-manipulation/m-p/2871852/highlight/true#M835498
    I don`t have lbview 2012 but one older version, I tried to play with shifts register and build array, but I`m a little lost.
    If someone has the solution, it`s welcoming.
    Solved!
    Go to Solution.

    You can use Insert Into Array in order to combine 2D arrays "next to each other" instead of "on top of each other", allowing you to simply split the array and then recombine:

  • All the xml and arrays are getting NULL Problem

    Hello guys
    I am working on a project which uses xml loading, e4x and array manipulation extensively, and it was going good but now I got stuck on a strange problem.  Whole code was fine and application was working and responding in a desired way, but then mystourisly it stopped working and started to retun NULL values to almost all the actionscript (internal) Arrays and XML varibales.
    Now Whenever i load xml file and assign the loaded values to internal xml variables, internal values get only NULL instead of data.
    Same is the situation with Arrays, I created some components in mxml, and when i passed them to arrays by reference, code gets compiled successfully, but again Array has only null values [that code was working fine too]
    I am wondering if Adobe Flex did a silenced update or something similar and it is the result of that things !
    I am using Adobe Flex 3.2 with SDK 3.3 on windows Vista Ultimate.
    Please check this attached project, Import it and see if you face the same problem
    Thanks
    Link to Problem Project
    http://isolatedperson.googlepages.com/problemXperiment.zip
    Problem Screenshot
    http://isolatedperson.googlepages.com/xmlissue.JPG

    Use HTTPService to load the data. You'll have fewer problems.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application creationComplete="dataSvc.send();"
      xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
         <mx:Script>
              <![CDATA[
                import mx.collections.XMLListCollection;
                import mx.rpc.events.ResultEvent;
                [Bindable] private var xlc:XMLListCollection;
                   private function loadXML(evt:ResultEvent):void{
                    xlc =  new XMLListCollection(evt.result.individual.@id as XMLList);
              ]]>
         </mx:Script>
         <mx:HTTPService resultFormat="e4x" result="loadXML(event)" url="alirazaTree.xml" id="dataSvc"/>
         <mx:ComboBox id="cbx" dataProvider="{xlc}"/>
    </mx:Application>

  • Array Processing in Forms 6i

    I am developing a common function in a PLL library that requires data from a calling form to be retrieved into temporary arrays on which some processing and calculation takes place and the resultant data is inserted into the destination table.
    In order to do this array manipulation and processing, I know of three options :
    1. Table Type
    2. Record Group
    3. Temporary Tables.
    Which is the best option to use in terms of
    1. Processing speed ,
    2. Client load ,
    3. Server Load,
    4. Multi user processing ,
    5. Re-usability,
    6. Forms 9i compatibility,
    7. Database Interactions
    If there is any other option, apart from the three above, please point out that too. Thanks in advance.

    If you are extracting the data and processing it all from one form, I would use a pl/sql table (Table Type). The coding would be easiest.
    A server side temporary table would give you SQL functionality, but would be much slower than a stand-alone client-side table.

  • How to create a vi that can be connected to any type of array

    I would enjoy to create a vi that can perform an operation (like resizing) on any type of array (array of string, of cluster, of num,...): Which type of control or indicator could I use for this purpose? Any Idea?
    Thank's for your help

    Olivier,
    to do this you have to use a variant input. You can wire any type of data to a variant input. Inside the VI you flatten the variant to a string. The flattened string of an array contains both data and length of the array. You reshape the array manipulating the string. When done, you unflatten the data to a variant and output it from the VI. The caller has to convert the variant input to the source array type. OpenG.org provides a quite extensive toolkit to manipulate variant data. Some VIs specifically manipulates arrays. To see a description of VIs go to : http://opengtoolkit.sourceforge.net/lvdata/index.html
    LabVIEW Data Tools can be downloaded from http://sourceforge.net/projects/opengtoolkit/
    You need both packages lvdata AND error.
    LabVIEW, C'est LabVIEW

  • Array manipulati​ons...

    Hi
    I would like some help with array manipulation
    I have multiple  files (1000 text files) with 5 columns each and 20,000 rows. The first row of each file has a header that labels the columns.
    I would like to be able to read each of these files, pull out colum 3 from each file and then build these into a new 2D array. It would be nice if they also had their corresponding header labels. So then I would end up with the new 2D array containing 1,000 columns (corresponding to column 3 of each of my 1000 files) with 20,000 rows plus a first row with the header labels.
    I would also like the option to in future select column 2 for example, or column 5; plus I would also like the functionality to allow me to perhasp pull out more than one colum, e.g. colum 2 and 3, before we build the new array.
    I hope I made some sense and that someone can help. Thanks you

    Oh nuts! 
    While I was trying link those posts to give a heads up to the forum I had a sinking feeling that I was going to get it all wrong.
    I need to be more mindful of my feelings ....
    cheers
    David

  • Some thing in my code causing excel file to be READ-ONLY

    Hello:
    I am pretty certain problem is caused by left bottom part of the picture, but I am not sure why.  The software basically write a header to a .xls file at start called XXX-peak.xls, at every cycle I read everything from the .xls, do some array manipulation modify 2 columns to the last row and rewrite the whole thing back to the same file.  I originally thought perhaps I left the file unclosed after an access but I think that would cause an error, besides,  all the read/write file VIs have file close features inside of them.  If someone could give me a quick diagnostic, it would be great!
    JC  
    Attachments:
    snapshot1.jpg ‏3779 KB

    First of all, you're not reading or writing any files in Excel (*.xls) format. You're reading and writing plain ASCII spreadsheet data. (The fact that Excel will try its best to parse the content when you later try to open it with excel does not make it an Excel file ).
    It is not obvious from the picture where the problem is, especially since we don't see the code in all the other cases and you read your filename via a value property. Where else is the file name used? It might be more efficient to open the file once, then use low-level file I/O to read from it and write back to it at desired offset location without ever closing the file during the run of the program.
    Why don't you attach the actual VI so we can better see what you're doing?
    LabVIEW Champion . Do more with less code and in less time .

  • JNI performance

    I have a problem with JNI performance. The following simple array manipulation takes twice longer using JNI than pure Java. The dll is compiled under VC++ 4.0. Am I doing something wrong or JNI simply puts out too much overhead when calling C dll?
    JNIEXPORT void JNICALL
    Java_VisualEffect_zoomR(JNIEnv *env, jobject obj,  jint len,jdoubleArray arr, jintArray arr1, jintArray arr2)
         jint *carr1, *carr2;
         jdouble *rnd;
         jint i;
         carr1=(*env)->GetIntArrayElements(env, arr1, NULL);
         carr2=(*env)->GetIntArrayElements(env, arr2, NULL);
         rnd=(*env)->GetDoubleArrayElements(env, arr, NULL);
         if ( carr1==NULL|| carr2==NULL )
              return 0;
         if ( rnd==NULL )
              return 0;
         for(i=0; i<len; i++)
              carr1= carr2[i]*rnd[i];
    (*env)->ReleaseIntArrayElements(env, arr1, carr1,0);
         (*env)->ReleaseIntArrayElements(env, arr2, carr2,0);
         (*env)->ReleaseDoubleArrayElements(env, arr, rnd,0);
    Appreciate any suggestions.
    Jay

    It may also simply be that Java is actually faster than C in this trivial case or there is no difference and so the overhead matters. How big are these arrays?

  • Taking the kth-column of multiple files and then joining them together in a single file

    Hi
    I would like some help with array manipulation
    I have multiple (1000) files with 5 columns each and 20,000 rows. The first row of each file has a header that labels the columns.
    I would like to be able to read these files, pull out colum 3 from each file and then build these into a new 2D array. It would be nice if they also had their corresponding header labels. So then I would end up with the new 2D array containing 1,000 columns (corresponding to column 3 of each of my 1000 files) with 20,000 rows plus a first row with the header labels.
    I would also like the option to in future select column 2 for example, or column 5; plus I would also like the functionality to allow me to perhasp pull out more than one colum, e.g. colum 2 and 3, before we build the new array.
    I hope I made some sense and that someone can help. Thanks you

    RVR,
    This is a great exercise to get familiar with LabVIEW's array functions.  A great place to start is actually the LabVIEW help on arrays, located here:
    http://zone.ni.com/reference/en-XX/help/371361B-01/lvconcepts/grouping_data_with/
    Depending on your data format, you can probably use the Read From Spreadsheet File VI to bring your data into a 2-d array.  You could then use the index array VI to pull your column out.  You could do this in a For loop and use Autoindexing to build your 1,000 column resulting array.  I would leave everything as a String format until I'm done. 
    This doesn't sound like a very difficult task.  Good luck!
    --Paul Mandeltort
    Automotive and Industrial Communications Product Marketing

  • Help to make faster my VI

    Hello!
    I have a cluster array with 105500 clusters; in a cluster there are 3 2D array with the same size (10 rows and 8 columns).
    I want to merge the data to obtain a single 2D array with 10*105500 rows and 8*3 columns.
    I  know that with large array we have to initialize an array (in this situation with 10*105500rows and 8*3 columns ) and use Replace Array Subset; so i have used this procedure but  the time needed is to much..
    What is the error in my VI?
    Solved!
    Go to Solution.
    Attachments:
    PostProcessing.vi ‏21 KB

    Ok, I haven't looked at your VI in detail but here is some advice:
    1) Don't use property nodes for reading/writing data in your for loop. You should process the data and store it in shift registers and then finally display it rather than doing the read/replace/write using Value property nodes.
    2) The build array function causes memory allocations which will take CPU time. If you can pre-calculate the size of your array then you can initialize array of the required dimensions to allocate the memory for the array once and then use replace array subset to put the items into the right place in the array. If you go to Tools -> Performance -> Show buffer allocations, this will help to show you (with some caveats) where LabVIEW is having to allocate memory in your VI.
    3) The 'index array' functions in your 2nd for loop are probably unnecessary - use auto-indexing tunnels instead if you can
    These points are the ones that immediately stand out as being what is causing poor performance of your VI without trying to get really clever about the array manipulation and optimisation of the VI (like using in-place element structures).
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • Converting speech to bit stream using DSK6713

    Dear Sir
    I am using Labview dsp module and Dsk6713 for my 16 QAM project, I want to put voice in it then modulating it by 16 QAM, the graph I get from The "analog input tool" is in the form of samples. Sir I want to get the bit stream that is in the form of 0'z and 1'z. So that I can modulate that bit stream.
    Thanx alot
    I hope to listen from you soon
    Regards
    Wajahat Hassan
    wajahat Hassan

    Hi Wajahat,
    It sounds like you are successfully able to obtain the data, and that you now want to change the format into a binary value.  What format are the voice signals in when being entered onto the graph?  You mention that it is 62 bit 1D data.  I am guessing that you meant that it is 64-bit data.  Is this data an integer, an unsigned integer, a float, or a complex number?  When you activate context help and hover over the wire, it should clarify the specific type.
    I have attached a screen shot of a basic example that takes an array of 8-bit unsigned integers, and converts them into a 2-D array of zeros and ones that represent the numbers in binary.  Each row of the array output represents that number in the array input, going from least significant bit to most significant bit.  If desired, the order of the bits can be rearranged using array manipulation.
    What version of the DSP module are you using?
    Regards,
    Lauren
    Applications Engineering
    National Instruments
    Attachments:
    Convert to boolean array.JPG ‏47 KB

  • How to Extract Text coordinates from PDF

    Hi,
    can anyone tell me how to get coordinates in pdf document using VB or .NET, suppose if some text is written in pdf document then how can i get coordinates of that text. Its very Urgent.
    Thanks in Advance.

    I am trying to use the getPageNthWordQuads information to determine if a word on the page is within a region that I am interested in.
    I have a limited knowledge of javascript and have been looking up text manipulation functions and array manipulation functions in an attempt to figure out how to separate the values that are returned from the Quads routine. The Adobe documentation indicates that the Quads function returns an array, but when I try to access one of the values in the array, it gives me the entire contents of the array as though it is a string. If I use the .length function to try to determine the length of it, it tells me it is length of 1! I obviously am mis-handling this reference, but I have yet to find any specific examples that work with the quads array the way I am trying to work with it....
    Here is my code...I am running it against an open file in batch processing mode(maybe this has something to do with it)...
    var sourceDoc = this
    var tx1=492.5;
    var ty1=761.5;
    var tx4=563;
    var ty4=726.2;
    try {
    for (var j = 0; j < (this.numPages); j=j+2){
    var cnt=0;
    var rcvrnum="";
    cnt = sourceDoc.getPageNumWords(j);
    if (j == 0) {
    try {for (var i = 0; i < cnt; i++) {
    var quads = sourceDoc.getPageNthWordQuads(j,i);
    var x1 = quads[0];
    console.println("Page(" + j + "),Word(" + i + ") = " + sourceDoc.getPageNthWord({nPage: j, nWord: i}));
    console.println("Quads length is " + quads.length);
    console.println("X1 = " + x1);
    if ( x1 >= tx1 & x1 <= tx4 & y1 >= ty4 & y1 <= ty1 ) {
    console.println("Q1 is good");
    console.println("Page(" + j + "),Word(" + i + ") = " + sourceDoc.getPageNthWord({nPage: j, nWord: i}));
    } catch (e) { console.println("Aborted: " + e) };
    } catch (f) { console.println("Aborted: " + f) };
    I have tried several variations of the code above to try to extract my values so that I can compare them, but to no avail. The above code outputs to the console the following...
    Page(0),Word(0) = OTTO
    Quads length is 1
    X1 = 19.350006103515625,782.15087890625,126.51744079589844,782.15087890625,19.350006103515625, 721.5038452148438,126.51744079589844,721.5038452148438
    Page(0),Word(1) =
    Quads length is 1
    X1 = 125.17047119140625,782.15087890625,153.91525268554688,782.15087890625,125.17047119140625, 721.5038452148438,153.91525268554688,721.5038452148438
    and so on...
    x1 becomes the entire output from the array and yet I can not perform a simple split function on x1. If I try to split X1 into an array by splitting on the comma, I get the following error.
    Aborted: TypeError: x1.split is not a function
    Am I supposed to import some libraries or something?
    Thanks for any help....
    Kevin Ailes

Maybe you are looking for

  • Cannot open iphoto after upgrade

    upgraded to 9.5... told me "To open your library with this version of iPhoto, it first needs to be prepared." have dowoaded and installed... rebooted and still same measage

  • Problem with Oracle 8i Lite & Forms 6i

    I have Oracle8i installed on Windows 2K and can connect to the database by using SYSTEM, ANYPASSWORD and ODBC:POLITE as the Host String. When I installed Forms6i, I have problem connecting to the database. No error messages, just could not connect wi

  • Wet my macbook with milk and screen turned white.

    Yesterday I spilled skim milk on my macbook pro. (newer version) I panicked and wiped the milk with a towel. Then wiped it with a damp napkin. The macbook worked fine and none of the features inside were damaged, keys worked too. I searched what to d

  • Configuration manager showing question marks???

    Hello, I installed BI Applications Configuration Manager as a requirement for the complete installation of BI APPS. For some reason I get something like this all over the application: ???configmanager.welcome_title??? ???configmgr.etlparams_text??? ?

  • Arrrgghgh!! "Force Quitting" Aperture has become routine

    I am processing 2-3 jobs of 100-300 images(most JPG) daily and am finding I need to slow up when doing things like pasting(stamping) image settings otherwise I get the SBOD(spinning beach ball of death). My steps: 1. Cull entire project 2. Rotate eac