IMAQ Block Statistics inserted in 2D array

Not sure which VI causes my problem, but I think it might be Block Statistics.
I'm using Vision add-ons for Labview, and I am interested in getting the green color-distribution of a Region of Interest. So I found the Block Statistics function, which divides my ROI into small blocks, and then returns a bundle of information including the color-values. I've then tried inserting the color values in a 2D array to later export it to a spreadsheet tool like Excel.
However, the different rows share the same values throughout each column (the top row's values are copied to each row). Can anyone tell me what's wrong, and how I can fix it? I have tried changing pretty much everything concerning the for-loops, but I think the problem might be the Block Statistics.
Help would be much appreciated
Attachments:
Green.vi ‏108 KB

Ok, I resolved the issue.
The output of the Block Statistics function had to be reshaped, and some auto-indexing went wrong.
So finally, after a couple hours of troubleshooting, I can continue.

Similar Messages

  • How can I do to insert a 1D array in a line of a table or a 2D array ?

    I have some vectors I concatenate in a 1D array when I pushed a button. Furthermore, when I pushed the same button, I would like to insert this 1D array in a line of a 2D array or in a line of a table. How can I do ?
    Thanks.
    Cyril.

    Hi,
    to insert 1D array into 2D array you must use
    Functions->Array->Insert Into Array.
    Wire your 2D array to array input of this vi, then specify the row index you want your 1D array will be, and then wire your 1D array to element input. The output will be what you want. The length of all 1D arrays must be the same, otherwise you may loose some data.
    If you want to add data to text table then you need first to convert your numeric array to textual form with
    Function->String->String/Number Coversion VIs
    Good luck.
    The example is attached.
    Oleg Chutko.
    Attachments:
    Insert.vi ‏17 KB

  • Insert SDO_GEOMETRY using array binding

    Hi,
    does anyone know howto insert the elem_info array and the ordinates array of a SDO_GEOMETRY object using array binding and ODP or if there is a way to insert the SDO_GEOMETRY object using the same technique.
    /Anders

    The current releases of ODP.NET do not support object types, hence no "proper" SDO_GEOMETRY support. You can retrieve the data as an XML-type as illustrated here:
    Re: ODP.Net + Spatial
    I know of no way to insert an SDO_GEOMETRY object using array binding at this time.
    If someone else has a solution, please do post!
    - Mark

  • How to auto insert a number array with size of 20 into a named excel file with the positon is from A1 TO A20?i use lv6.1

    can you give me a example vi for it ?thanks a lot!
    how to auto insert a number array with size of 20 into a named excel file  with the positon is from A1 TO A20?i use lv6.1

    You don't need us to give you an example, as the example already comes with LV. Go to Help>>Find Examples and search for "excel". You will find an example called "write table to XL". You should note that the example doesn't do that exactly, because it writes a 2D array from 2 to N.
    You can modify the example by using only one for loop (instead of nested loops) with a 1D array or by going into the Set Cell Value and modifying it to accept a second cell value for the Cell2 terminal and wiring in a 1D array instead of the single string. If you do modify it, be sure to save it under a different name, so you don't overwrite the original.
    To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
    Try to take over the world!

  • Better way for inserting column into array?

    I have to insert a 2-D array(20x10) into the end (column) of a bigger 2-D array(1000x10). I am seeing two ways to do that:
    1. Insert smaller 2D array at the end of bigger array.
    2. Insert the bigger array at the 0th column of smaller array.
    Which one would be more efficient? Will there be any performance difference?
    Or any other better way to do this?
    The second one looks simpler but I think it would require a bigger copying of memory.

    Both methods use a buffer allocation, so they might be very similar. Since we don't know what the compiler is doing, you could also try this:
    I am assumung that you only need to append once and not append more and more columns as the program progresses. Is this correct? In any case, you should consider operating on the transposed version, because it is always easier to append rows instead of columns (rows are adjacent in memory, while appending columns require more data shuffling under the hood
    In any case, you should simply wire up the alternatives and do a proper benchmark if you are planning to use this on much larger arrays in the future, for example. Can you give us some context how you are planning to use this?
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    AppendColumns.png ‏3 KB

  • Inserting a associative array into a table

    Hi,
    I am working on a process where I want to store the temporary results in an associative array. At the end of the process I plan to write the contents of the array into a table that has the same structure. (the array is defined as a %rowtype of the table)
    Is it possible to execute ONE sql statement that transfers the array into the table? I am on 10g (10.2.0.4.0)
    Here's what I have now:
    declare
      type t_emp is table of emp%rowtype index by pls_integer;
      v_emp t_emp;
    begin
      -- a process that fills v_emp with lots of data
      for i in v_emp.first .. v_emp.last
      loop
        insert into emp values v_emp(i);
      end loop;  
    end;But it would be better if the loop could be replaced by sql one statement that inserts all of v_emp into emp. Is that possible?
    Thanks!
    PS: I'm not sure whether it's a good idea to use this approach... building a table in memory and inserting it into the database at the end of the process. Maybe it's better to insert every record directly into the table... but in any case I'm curious to see if it is possible in theory :)
    Edited: Added version info

    True, SQL cannot access the PL/SQL type.
    So you can not do something like this:
    insert into emp
    select * from table(v_emp)That is not possible.
    But FORALL is possible:
    FORALL i in v_emp.first .. v_emp.last
        insert into emp values v_emp(i);FORALL makes just one "round trip" to SQL bulk binding the entire contents of the array.
    It is much more efficient than the normal FOR loop, though it is mostly a PL/SQL optimization - even the FORALL actually inserts the rows "one at the time", it just hands the entire array to the SQL engine in one go.
    If the logic has to be done procedurally, FORALL is efficient.
    If the logic can be changed so arrays can be avoided completely and everything done in a single "insert into ... select ..." statement, that is the most efficient.

  • How to insert 2-D array of elements in excel sheet

    I have a 2-D array of elements. I want to insert this array into an excel sheet and display the data in a graph. I used the example "excel insert table" but the problem with that VI is, it is inserting the elements cell by cell which is taking long time. I am wondering whether there is way to insert a complete column or row into excel sheet at a time.
    Thank you,
    Mudda.

    Hi,
    Try this vi which inserts the table in one operation. You can modify it to suit your purposes.
    Hope this helps.
    Edit: Should note that it works for both string and numeric array inputs.Message Edited by DavidT on 06-29-2005 10:09 AM
    Attachments:
    Excel Insert Table (LV7.1).vi ‏100 KB

  • My cursor is blocking table Inserts

    I have a function that copies any new rows from Database_A, Table_A to Database_B, Table_A via a database link. This happens periodically, and there can be around 100k new records accumulated in between these periods.
    I gather the records which need to be copied by filtering on a "copied" field on the table. Within the loop, I update the row's copied field so it won't be copied during the next pass. Here's the function:
    FUNCTION copy_records RETURN INTEGER IS
         pCount INTEGER := 0;       
            CURSOR recs IS
                SELECT * FROM TABLE_A
                WHERE FLG_COPIED = 'N' OR FLG_COPIED IS NULL
                ORDER BY MYKEY;    -- do the oldest first (only important if we commit during iterations)             
        BEGIN
            pCount := 0;
            FOR rec IN recs LOOP
                -- first copy to backup db
                INSERT INTO TABLE_A@BACKUP_DB
                    (FIELD_1, FIELD_2, FIELD_3)
                VALUES
                    (rec.FIELD_1, rec.FIELD_2, rec.FIELD_3);
                -- now flag as copied
                UPDATE TABLE_A
                SET FLG_COPIED = 'Y'
                WHERE MYKEY = rec.MYKEY;
                -- counter sent back for logging
                pCount := pCount + 1;              
            END LOOP;
            RETURN pCount;
        EXCEPTION
            WHEN OTHERS THEN
                RETURN SQLCODE;
        END;
    END;My problem is that it is blocking on the table while this process takes place. I would expect some row-level blocking, which is fine (this table is primarily INSERT only). But I'm not sure why it blocks such that it won't allow me to INSERT into the table. Can anyone explain this to me?
    If I do a COMMIT during each iteration, I can at least perform an Insert, but this seems to slow things down greatly when used across a DBLink, so I'd like to avoid it (plus I wish to make this function an all-or-none transaction). I'm also not sure if the effect of the COMMIT is to make the block row-only, or just minimize the window of the table locking.
    Edited by: xaeryan on Oct 14, 2011 3:51 PM

    xaeryan wrote:
    Solomon Yakobson wrote:
    xaeryan wrote:
    My problem is that it is blocking on the table while this process takes place.No it is not. Based on your code all it is locking are table TABLE_A rows it updates. So if any other session tries to update/delete rows updated by your function such session will wait till you commit/rollback. If any other session tries to update/delete rows NOT updated by your function such session will NOT wait.
    SY.Based on my observations, it is - when I try to perform an INSERT while the function is running, it will not complete. I can see in Toad that there is a row-level lock for my function which is NOT blocking, however there is also a transaction level lock associated with the same session ID which is listed as blocking. There's not much more detail on that one in Toad.
    Is there anything in Oracle that might do something unexpected when your cursor selects the majority of the records? Like optimization for performance that might involve blocking? It seems silly, I know, but I can't seem to understand why this function stops any use of this table.how can we reproduce what you report?

  • Insert element into array problem

    Hi,
    I have problem about how to insert value into an array. here is one section, could anyone help me to insert input value into array and delete the first value in the array. Gap means to fill in code
    void Ins(String name)
    // Insert name or increment its multiplicity.
    // If the bag is full remove the oldest entry.
    int i; // Running index on BagName
    int target; // if target < n then name.equals(BagName[target]);
    // else target == n
    Date EntryDate; // Current date and time
    // Get current date and time
    EntryDate = new Date();
    BagDate[n] = EntryDate.toString();
    Mult[n] = n+1;
    BagName[n] = name;
    n++;
    // Search bag for name
    // Gap 2
    // Assertion: target < n => name.equals(BagName[target])
    // else target == n
    // Update Mult if target < n
    // Gap 3
    // Make room for and insert name if target not found
    } // Ins(String name)
    Message was edited by:
    sibojava
    Message was edited by:
    sibojava

    Do you have several accounts?
    See this thread, it's the same question:
    http://forum.java.sun.com/thread.jspa?threadID=5143232
    Kaj

  • Inccorect Encrypted block when inserting SSL certificate

    Generated new SSL certificate for Weblogic Serer 6.1, inserted Server certificate, the Root Certificate Authority (Chain File), the Private key file but is getting the following error - can anyone assist?
    weblogic.security.AuthenticationException: Incorrect encrypted block possibly incorrect SSLServerCertificateChainFileName set for this server certificate at weblogic.t3.srvr.SSLListenThread.insertIntoCAChain(SSLListenThread.java:291)...

    This might be caused by an invalid/not specified private key password.
    Pavel.
    bibi <[email protected]> wrote:
    Generated new SSL certificate for Weblogic Serer 6.1, inserted Server
    certificate, the Root Certificate Authority (Chain File), the Private
    key file but is getting the following error - can anyone assist?
    weblogic.security.AuthenticationException: Incorrect encrypted block
    possibly incorrect SSLServerCertificateChainFileName set for this server
    certificate at weblogic.t3.srvr.SSLListenThread.insertIntoCAChain(SSLListenThread.java:291)...

  • Help with insertion into an array

    I'm trying to create a method that inserts a number at an index of an array, but throws an exception if the index is out of range or if there is already an element stored at that index of the array.
    void insert (R x, int i) with x being the number inserted, and i the index. Any help is greatly appreciated.

    BigDaddyLoveHandles wrote:
    sethaw wrote:
    1. Create a new array that is big enough to hold all the numbers from the old array plus the new element.
    2. Copy the values from the old array to the correct position in the new array. You may want to use 2 different for loops, one to copy the values before the new element and one to copy the values after the new element.
    3. Set the array variable that is pointing to the old array to be the new array that you just created.Why not attempt to do 1, then 2, then 3? The code you posted in reply #3 was worthless, I hope you can see this: it assigned the value x to every position in the array!And there are curly braces missing!!! :)
    I hate when people omit the braces...lazy bastages.

  • How to insert a 1d array line into a 2 d array?

    I have a vi that acquire the signals of several pulse encoder and store it into a 1d array, and I want to move these data to a 2d array and fill it. I mean I want to acquire signal and store at line 1 of the 2d array, then acquire again and store at line 2 of the 2d array and keep going like this successively.
    how can I do that?
    Solved!
    Go to Solution.

    labvlearner wrote:
    I have a vi that acquire the signals of several pulse encoder and store it into a 1d array, and I want to move these data to a 2d array and fill it. I mean I want to acquire signal and store at line 1 of the 2d array, then acquire again and store at line 2 of the 2d array and keep going like this successively.
    You need to be careful with the terminology, because there are two very different scenarios:
    You have an existing 2D array and you want to insert a column(or row), thus growing one of the dimensions by one and moving everything to the right (or bottom) over one slot. (similar to "insert column" in excel)
    You have an existing 2D array (possibly all zeroes at the beginning) and you want to replace an existing column with new data. (many newbies call that "insert" too, even though it is not)
    If you know the final size of the 2D array, option 2 will be orders of magnitude more efficient, because it avoids constant memory allocations. Every time (almost) you grow an array, it needs to be recreated at a new memory location because arrays need to be contiguous in memory.
    LabVIEW Champion . Do more with less code and in less time .

  • Insert element into array (manually)

    Hello,
    I have an issue with the insertion of elements into an array. Here's the situation;
    - I've declared an array of strings as a local variable (let's say a 10-element array)
    - All the fields of the array have been filled with strings.
    - I would like to insert a new element into the array (for example at index 3)
    When I go to the "bounds" property and increase the array's bounds, the new element is added at the end of the array. Is there a means to insert the new element in any other position ?
    Thanks
    Zouz

    If you call a PropertyObject.SetVal<DataType>ByOffset() method, you can pass PropOption_InsertElement to the options parameter.

  • Return Values to Block from Insert Procedure

    I have a block with an insert operation performed by a procedure. The insert is working fine.
    However, I was assuming that within the procedure I could modify a value in the record (prior to the insert) and then that new value would be returned to the item in the form so the user can see it. (The procedure allocates a unique reference number from a sequence and I would like to display it back on the screen in the reference number field.)
    Can anyone help or suggest an alternative?
    Thanks
    Lisa Davies
    Durban, South Africa

    I have a block with an insert operation performed by
    a procedure. The insert is working fine.
    However, I was assuming that within the procedure I
    could modify a value in the record (prior to the
    insert) and then that new value would be returned to
    the item in the form so the user can see it. (The
    procedure allocates a unique reference number from a
    sequence and I would like to display it back on the
    screen in the reference number field.)It is really disappointing to me that Oracle cannot handle this simple need by specifying DML Return Value using built-in inserting/updating.
    I had to write a post-insert trigger in the forms to update the field in the data_block with the value generated by the DB-side pre-insert trigger.

  • Insert cluster in array

    I did something wrong
    I try to build an array of xy location but it doesn't work!!! I have Labview 6.0
    Attachments:
    build_XY_array.vi ‏43 KB

    Hi
    You are using "Replace Array Element" instead of "Insert Array Element" Function.
    I changed the "Replace..." with "Insert..." in both your True and False Cases. Moved the resultant Array Inside the While Loop.
    The Modified VI is attached.
    Mache
    Good Luck!
    Mache
    Attachments:
    build_XY_array.vi ‏40 KB

Maybe you are looking for

  • GL cost batch informations

    Hi Cost batches are posted into GL, Now we have a requirement to find all individual transactions information which are in cost batche. Regards Kishore S

  • Dispose objects during window closing

    I use vb to call java application through batch file (.bat) to connect to another java app to send message. Since the java application is executing in command prompt window, if the window accidentally closed, is it possible to close the connection, t

  • Alerts and Error Handling

    Which is the best way to handle alerts in XI and Why: AlertFramework in the runtime workbench, CCMS etc? Also which of the options provides the functionality to view all alerts in Solution Manager? Basically we want to set up the systems so that the

  • AirPort Express (2nd generation) not visible in AirPort Utility or iTunes (AirPlay)

    Hi! I'm using an AirPort Express (2nd generation) for my Wi-Fi. I've configured the AirPort Express with my iPhone 5, but when I try to find the AirPort Express on my Windows 8 computer, it doesn't show up in the AirPort Utility software and in iTune

  • Using RANGE_ID_LEADING field as a search criterium

    Hi, I would like to use a new search criterium for salary ranges based on the field RANGE_ID_LEADING in matchning between a requisition and the candidates. The problem is that this new search criterium is not defaulted automatically from the requisit