Insert element in selected column of 2d array

Hello
     How to insert value in selected column of an array
In my program i am reading the CAN data from channels using
CAN read Channel API, the recent data read from the CAN channels
will be displayed in the indicator "Channel Data" 1D array, the
size of array depends on the number of channel selected for
monitor. i want to save all channel data.
i want to insert the first element of "Channel Data" array to
first column of "All Channel Data" 2D array, the second element
to the second column of 2D array...
i attached my VI
how to do this give me an idea.
thanks
sk
I am using LabVIEW 7.1
Attachments:
err2.zip ‏89 KB

For 2D arrays, you must insert entire rows or columns at one time.  You cannot insert just one element.  Why?  Lets say for example you have a 2 x 3 array (2 rows with 3 columns).  If you insert an element in row 3 (a new row) column 1, what goes into columns 2 and 3?  You just messed up the integrity of the array, and Labview doesn't allow that.  What you need to do is gather data for all columns in the new row and insert the entire row.  The Insert Into Array function is used with the row number wired to Row Index and nothing wired to column index.  You can gather all your data, build a 1D array and insert that array into a new row in the 2D array.
- tbob
Inventor of the WORM Global

Similar Messages

  • Insertion in Table having Column of object array type

    Hi!
    I want to make an object type and then the VARRAY of the that object type and then make table having column of VARRAY type.
    How can i issue an Insert statement to insert values in columns of VARRAY type .
    I will be thankful.
    regards
    Imran

    See following discussion http://asktom.oracle.com/pls/ask/f?p=4950:8:11071256505039606339::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:1583117527730
    and let's thank again Tom !

  • How to insert bytes in varchar2 column

    existed data:
    ALIAS VARCHAR2(240)
    SELECT ALIAS,DUMP(ALIAS,8) FROM AR_COLLECTORS WHERE COLLECTOR_ID=47880
    ¿¿¿     Typ=1 Len=9: 351,231,263,345,230,211,350,217,261
    How to create the same data from SQL PL/SQL?
    INSERT INTO AR_COLLECTORS (ALIAS) VALUES ( ???

    I'm not quite sure what you are asking here. DUMP is a function that shows the internal representation of the data stored in a field or variable. You do not need to store the DUMP values explicitly, they are derived from your actual data. If, for some inexplicable reason, you want to store the output of the DUMP command in another table, then you can do something like
    CREATE TABLE dumpvals (real_value VARCHAR2(400), dump_value VARCHAR2(4000));
    INSERT INTO dumpvals
    SELECT column,DUMP(column,8)
    FROM table;
    or, in PL/SQL
    BEGIN
       FOR r in (SELECT column tval,DUMP(column,8) dval
                 FROM table) LOOP
          INSERT INTO dumpvals
          VALUES(r.tval,r.dval);
       END LOOP;
    END;If you can give a fuller explanation of what you are looking for, perhaps someone could give a better answer.
    TTFN
    John

  • Excel & ActiveX: Insert arbitrary columns from 2D array and create graph problems

    Hi there,
    I want to insert data from either a 1D or 2D array from LabView into Excel and create graphs.
    I used the information from the following example:
    http://www.ni.com/example/28934/en/
    and was able to create a new Excel file (I'm using Excel 2010), writing data from an 1D array to a column in excel by creating a while loop and using the first element of the array to write it to a specific cell. I use the counter of the loop to write to the next cell when the loop starts over and always delete the first value, which I write to the cell, from the array until it is empty.
    Now I also would like to write a 2D array - so the first column in Excel should be the first column from the array and so. Here I cannot use the loop counter directly as Excel only counts 1,2,... for the rows, but uses A,B,... to count columns. Also I do not know in advance how many columns my 2D array will contain, so creating a lookup table like (A means 1, B means 2,...) is not really an option (except there really is no other way). Is there a possibilty to convert numbers into letters or some way to 'explain' to the program that column 2 in the array means column B in Excel for example, or is there a way to insert new columns?
    I figured out how to add new Worksheets and as I also need to create a certain number of Worksheets and I know that on standard 3 sheets are present when creating the file, I use the 'add' methode to create every new worksheets before worksheet 3 - I could use the same methode to create new columns in Excel, but so far I didn't find a methode to do so. Or is there a way to enter the whole 2D array at once?
    Then I'd like to create a graph (in case of the 1D arrays a bar plot, when using 2D arrays a 3D plot) to view the data. I found this example:
    http://www.ni.com/newsletter/51339/en/
    -> as I do not have the toolkit I'd like to do it using ActiveX directly, so I tried to do things like shown under the headline 'DIY ActiveX/.NET'
    I tried to load the snippet to a new Excel file but got the error message 'microsoft.office.interop.excel.dll not found' and hence the code is not working. That confuses me a little as I would guess when this dll is not present I cannot access Excel from LabView at all, though my understanding of what I'm really doing so far is quiet limited. ;-)
    Also - as far as I understand from the snippet - when creating a new chart object I should be able the create methodes for it, however when I do a right click on the chart object of an ActiveX Worksheet symbol there are none listed.
    To explain my problems better I added a snippet showing my two problems: The inner of the two while loops shows how I import a 1D array. In the outer loop I seperate the columns. I know that currently this is not working as all data end up in column A of the Excel sheet - so I would need to convert the number of the outer counter to A, B,... or find a different solution.
    Moreover on the snippet I placed an ActiveX Worksheet Property with the Chart Object - as I can see the difference to the Chart Object in the example code from the last link above is the color. However I'm not sure what that means and how to change/ solve this.
    And just to make sure - I know this way the VI does not run as the Chart Object is placed completely wrong - I just did it, so it is included in the snippet.
    I'd be thankful for any suggestions,
    Thanks!
    Solved!
    Go to Solution.
    Attachments:
    ExcelAreaScan.png ‏60 KB

    Hello everyone and thanks for the answers.
    I only have the LabView Student Edition available here - is the toolkit included in it too. How can I check if it is installed/ available and in case it is installed - where can I find it?
    Today I had time to take a look at the example
    Create via ActiveX Labview a XY Scatter plot graph on an excel sheet
    It almost does what I want in terms of creating a graph. The only problem I could not fix, is that in this example a sheet is created where only the graph is present. i'd like to add the graph to a previously created worksheet. Today I tried get this working but it seems I stilll don't really understand what I'm doing, I'll post a snippet of my code as soon as I can access the PC with LabView on it again.
    I also took a look at the other example for inserting 2D attays - it seems to be what I need, I just had no time so far to test it, I'll post an update when I could test it.
    Thanks for the help so far!

  • Insert into a table excluding duplicates of a selected column

    I have mytable:
    IDNO
    Item
    Date
    Level
    1
    X24
    12/23/13 10:41
    22996
    2
    X24
    12/23/13 10:41
    22996
    3
    X24
    12/23/13 9:21
    23256
    4
    X24
    12/23/13 9:21
    23256
    5
    X24
    12/23/13 9:22
    23256
    6
    X24
    12/23/13 9:22
    23256
    7
    X24
    12/23/13 9:22
    22916
    that is a result of INSERT i.e.,
    INSERT INTO myTABLE(Item,[Date],[Level])
    values('X24','12/23/13 :22','22916')
    I want the INSERT to exclude the duplicate level defined as the previous level in a selected column [Level]. This would avoid having to 'view' the table using:
    SELECT
    i.IDNO,i.[Date],i.[Level]
    FROM
    mytable
    i
    INNER
    JOIN
    mytable
    d
    ON
    d.IDNO
    =
    i.IDNO-1
    WHERE
    i.[Level]
    <>
    d.[Level]
    IDNO is an identity column.
    How can this INSERT be achieved without the overheads? 

    Quite helpful comments particularly the ISO- 11179 and the design elements that can prevent the problem in the first instance. My apologies with regards to my impolite post omitting the DDL.  It is a small procedure and [Date] and [Level] can be accommodated
    by the server but are bad habits. My efforts to control the data input were in vain as the data was not from a software conducive to such controls. Because of the high frequency volume of the data, (suggested by the time-stamps with milliseconds cut), any
    effort to have 'The data... cleaned in a presentation/input layer ' would be futile.  The suggestions of  yourself
    and Erland Sommarskog, SQL Server MVP, [email protected], of a UNIQUE constraint to deal with the problem
    underscores the importance of design even in the 'smallest' of procedures. 
    This worked:
    drop table Foobar
    CREATE TABLE Foobar
    (item_name CHAR(5) NOT NULL, 
     foo_timestamp DATETIME2(0) NOT NULL
      CHECK (foo_timestamp 
        = DATEADD(MINUTE, DATEDIFF(MINUTE, '2000-01-01', foo_timestamp),
         '2000-01-01')),
     water_level INTEGER NOT NULL, -- why not be silly? 
     PRIMARY KEY (item_name,foo_timestamp, water_level));
    INSERT INTO Foobar
    VALUES
    ('X24', '2013-12-23 10:41:00', 22996), 
    -- ('X24', '2013-12-23 10:41:00', 22996), rejected by DDL!!
    -- ('X24', '2013-12-23 09:21:00', 23256), rejected by DDL!!
    ('X24', '2013-12-23 09:21:00', 23256), 
    ('X24', '2013-12-23 09:22:00', 23256), 
    -- ('X24', '2013-12-23 09:22:00', 23256), rejected by DDL!!
    ('X24', '2013-12-23 09:22:00', 22916);
    select *
    from Foobar
    item_name foo_timestamp
    water_level
    X24   2013-12-23 09:21:00
    23256
    X24   2013-12-23 09:22:00
    22916
    X24   2013-12-23 09:22:00
    23256
    X24   2013-12-23 10:41:00
    22996

  • Deactivate "insert element before / remove element" in array

    Hello guys.
    It is possible to deacitvate "insert element before / remove element" function appears after right-click on a array in the frontpanel?
    "Description and Tip" should stay.
    Thank you.
    Alex
    Solved!
    Go to Solution.

    You can customize the right-click shortcut menu to remove some application items and keep others:
    Right-click on the array (and not on the array element!) in the front panel and select Advanced->Run-Time Shortcut Menu->Edit...
    This brings up the Shortcut Menu Editor:
     Change the drop-down control from "Default" to "Custom".
     Select the "???" line in the tree control on the left.
     on the right, change the Item Type from "User Item" to "Application Item -> Description and Tip..."
     It will automatically fill in the corrent Name and Tag.
     Save the rtm either into its own file or into the control.
     LV will automatically handle application items in the control, no event case needed.
     I sometimes find the "Copy entire menu" function of the shortcut menu pretty useful if I only want to disable a few items.
    http://zone.ni.com/reference/en-XX/help/371361G-01/lvconcepts/customizing_vis/#Customizing_Menus
    -Barrett
    CLD

  • How to insert select columns from one internal table to another

    Hi,
    How to insert select columns from one internal table to another based on condition as we do from a standart table to internal table.
    regards,
    Sriram

    Hi,
    If your question is for copying data from 1 int table to other ;
    we can use
    APPEND LINES OF it_1 TO it_2.
    or if they have different columns then:
    loop at it_1 into wa_it1.
    move wa_it1-data to wa_it2-d1.
    apped wa_it2 to it_2.
    clear wa_it2.
    endloop.
    thnxz

  • Bug or Feature? Array Custom Contextual Menu Destroys "Delete" and "Insert" Element!

    Step to Reproduce:
    - Create an Array (doesn't matter of what type).
    - Ctrl-M (to switch to Run Mode)
    - Notice that:
           - when you Right-Click on the Array borders, you have access to an "Empty Array" menu item among other things
           - when you Right-Click in an Array element, you have access to an "Insert Element Before" and a "Delete Element" menu item among other things
    - Now switch back to Edit Mode and modify the contextual menu in the following way:
            - Advanced>>Run-Time Shortcut Menu>>Edit...
            - Edit>>Copy Entire Menu
            - Switch to "Custom" menu (instead of "Default"): the menu disappears and is replaced by a single ??? item
            - Edit>>Paste: The default menu reappears with the ??? on top
            - Create you favorite custom menu item by editing the ??? item (say: Do Nothing)
    - Save the menu with the control and switch to Run Mode (Ctrl-M).
    - Now try the first 3 steps above: wherever you right-click, you have access to the Custom Menu, but the Array Element contextual menu is GONE.
    In other words, you cannot (it seems) define a custom contextual menu for an array without destroying the default contextual menu for its elements.
    Therefore, if you want to preserve the ability to Insert and Delete Elements in an array, you have to add these two items to the Array contextual menu and juggle with the position of the right-click to figure out whether or not to display them...

    Well, I created in LabVIEW 2012 such a control and added part of the default menu in the way you described with copy-paste as a submenu to an Edit entry in my custom menu and it did not disappear:
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to insert elements into an array after each iteration of a for loop

    I am new to labview and working on an application where I am supposed to store an element into an array (without overwriting) after each iteration in a for loop. I have tried using Build Array Function keeping the indicator outside the for loop and played with indexing but didn't work. Please suggest me an idea how to do it.
    Thanks
    Solved!
    Go to Solution.

    Thank you for your suggestion.Here is my actual application attached . In the first image, a difference in time is evaluated and an enum const of insert into array is passed to the shift register where it takes to Insert element into array phase (Second image). I need to enter the time difference into an array after every loop iteration. Please have a look and could you let me know where I am mislead.
    Attachments:
    Image 1.JPG ‏88 KB
    Image 2.JPG ‏71 KB

  • Insert columns of one array into another

    how can one insert columns of an array into another array at every odd place of that array in which insertions are to be made? In short, columns of one array to be inserted into another array bt possibly in between the already initialised array. 
    Solved!
    Go to Solution.

    here's an example, feel free to ask question if it's not clear for you.
    hope it helps
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Attachments:
    insert.vi ‏20 KB

  • Selected Column insert, delete and updation at replication end

    Hello,
    In GoldenGate, is there a way to get a timestamp column at target table to get updated for some selected columns from source table only. For eg.
    At source - Table Temp_Source , columns - Emp_Id (PK), Emp_Name, Department, Address
    At target - Table Temp_Target, columns - Emp_Id (PK), Emp_Name, Department, Last_Update
    The Last_Update column takes timestamp for last updation made at source table which is replicated at target end.
    Now I just want the changes made in EMP_Id, EMP_Name , Department columns to be replicated at target table and also the Last_Update to get updated for changes made in these columns only. The changes made in Address column should not affect Last_Update at target end.
    The extract or replication script for this should work for insert, update and delete scenarios for specified columns. Using COLS creates problem in insertion as it Abends the replication process.
    Is there any way I can achieve this functionality??

    At target end I have written the following code in Replication process -
    GetUpdates
    IgnoreInserts
    IgnoreDeletes
    Map <source table>, target <target table>, COLMAP (USEDEFAULTS, LAST_UPDATE = @IF((EMP_ID <> BEFORE.EMP_ID OR EMP_NAME <> BEFORE.EMP_NAME OR DEPT <> BEFORE.DEPT), @getenv("GGHEADER", "COMMITTIMESTAMP"),REFRESH_TIMESTAMP));
    But this code entertains only the Primary Key changes i.e. EMP_ID, I want the Last_update to get updated for changes in EMP_NAME and DEPT even but not for Address column change at source end.

  • Keybord trick to insert quickly a value into a constant array

    Hi everybody,
    I want just to know if there is a keybaord trick which allows yuo to pass quickly from an element to the next one (or to new one) while I'm typing the values into a constant array, you know if is there?
    What I mean is a keybord key as the TAB key that quickly allow you to pass from a cell to the next one into the grid control.
    Thank you in advance,
    Regards.
    Ricky
    Italian Developer engineer
    www.www.selt-sistemi.com
    Solved!
    Go to Solution.

    Darin.K wrote:
    [...] unzip the files and put them in the directory
    [LabVIEW ####]\resource\dialog\QuickDrop\plugins
    Create some cells in Excel (or other similar program), select and copy to the clipboard.  (Any tab delimited data will work).  On the FP Ctrl-Space Ctrl-e creates a control with the data in numeric form (simple check to decide DBL or I32).  Ctrl-Space Ctrl-E (shift+e) creates a string control.  Similar commands for the BD to create array constants (numbers or string).  Single rows or columns become 1D arrays, otherwise you get 2D array controls/constants.  Change the letter by renaming e.vi if you'd like.  I chose e for Excel since X was taken along with s for spreadsheet and a for array.
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • Report Does Not Follow Select Column Order

    Hi all,
    Apex 2.2 on 10gXE
    I always encounter this problem, the display column on report does not follow the select column sequence order in the "region source".
    It is very tedious clicking the up/down arrow one-by-one in the "report attributes" especially if the display columns are plenty like 40 columns.
    Is there a fix/patch or alternative tips for this bug?
    Thanks a lot,
    Edited by: 843228 on May 24, 2011 10:32 PM

    Apex 2.2 on 10gXEStart by upgrading from this old unsupported version.
    >
    I always encounter this problem, the display column on report does not follow the select column sequence order in the "region source".
    It is very tedious clicking the up/down arrow one-by-one in the "report attributes" especially if the display columns are plenty like 40 columns.
    Is there a fix/patch or alternative tips for this bug?
    >
    This is not a bug. APEX maintains the original column order of the report. This avoids problems downstream in areas like the processing of <tt>g_fnn</tt> arrays in declarative tabular forms, where the assigned arrays are column-order dependent.
    APEX 4.x fixes column ordering bugs that could lead to report corruption, and includes drag-and-drop column ordering in the new tree view in addition to the up/down arrow re-ordering.
    If you really want column order to follow that in the source query, the workaround is to create a new report using the modified query.

  • How to insert data in a column with uniqueidefier data type

    Guys,
    I need insert data in a column with uniqueidefier data type, when i am trying to that getting error.
    error message says: "Conversion failed when converting from a character string to uniqueidentifier."
    I have data in table a col1,col2,col3,col4 - col3,col4 has datatype as varchar and i am updating table b columns col1,col2 with table a col3 and col4.
    Please guide how to do it.

    Hi,
    Not any String can be convert to uniqueidentifier.
    1. you have to make sure u use a value which is fir to be uniqueidentifier
    2. Use convert or cast in the insert query in order to convert the string into uniqueidentifier
    insert X ... convert(uniqueidentifier, 'string which fit to be convert to uniqueidentifier')
    Please post DDL+DML for more specific help
    DDL = Data Definition Language. In our case that is, CREATE TABLE statements for your tables and other definitions that are needed to understand your tables structure and there for let us to test and reproduce the problem in our server. Without DDL no one
    can execute any query.
    How to get DDL: Right click on the table in Object Explorer and select script table as CREATE. Post these create table scripts here.
    DML = data manipulation language is a family of queries used for manipulating the data it self like: inserting, deleting and updating data. In our case we need some sample data in order to check the query and get result, so we need some indert query for
    sample data.
    If you post a "create query" for the tables and "insert query" with some sample, then we could help you without Assuming/Guessing. There is a reason that DDL is generally asked for and expected when discussing query problems - it helps
    to identify issues, clarify terminology and prevent incorrect assumptions.  Sample data also provides a common point of reference for the discussion. A script that can be used to illustrate or reproduce the issue you have, will encourage others to help.
    [Personal Site] [Blog] [Facebook]

  • Using combination of insert into and select to create a new record in the table

    Hello:
    I'm trying to write a stored procedure that receives a record locator parameter
    and then uses this parameter to locate the record and then copy this record
    into the table with a few columns changed.
    I'll use a sample to clarify my question a bit further
    -- Create New Amendment
    function create_amendment(p_mipr_number in mipr.mipr_number%TYPE, p_new_amendment_number in mipr.amendment_number%TYPE)
    return integer is
    new_mipr_id integer;
    begin
    THIS is causing me grief See comments after this block of code
    insert into mipr
    (select mipr_id from mipr where mipr_number=p_mipr_number),
    (select fsc from mipr where mipr_number=p_mipr_number),
    45,
    (select price from mipr where mipr_number=p_mipr_number),
    practical,
    (select part_number from mipr where mipr_number=p_mipr_number);
    THe above will work if I say the following
    insert into mipr
    (select * from mipr where mipr_number=p_mipr_number);
    BUt, Of course this isn't what I want to do... I want to duplicate a record and change about 3 or 4 fields .
    How do I use a combination of more than one select and hard coded values to insert a new record into the table.
    /** Ignore below this is fine... I just put a snippet of a function in here ** The above insert statement is what I need help with
    select (mipr_id) into new_mipr_id from mipr where mipr_number=p_mipr_number + amendment_number=(select max(amendment_number) + 1);
    return new_mipr_id;
    end;
    THANK YOU IN ADVANCE!
    KT

    function create_amendment(p_mipr_number in mipr.mipr_number%TYPE)
    return integer is
    new_mipr_id integer;
    tmp_number number;
    tmp_mipr_id integer;
    begin
    tmp_number :=(select max(amendment_number) from mipr where mipr_number=p_mipr_number);
    Question:
    tmp_number :=1; works..
    tmp_number doesn't work with the select statement?
    Obviously I'm a novice! I can't find anything in my book regarding tmp variables... What should I look under is tmp_number a
    variable or what? In my Oracle book, variable means something different.
    Thanks!
    KT
    I have the following code in my stored procedure:
    Good luck,
    Eric Kamradt

Maybe you are looking for

  • How to extract Slide data in 3rd part application from clipboard

    I need to be able to copy/paste or drag/drop from PowerPoint into another application (C# WPF). In my OnDrop method the DragEventArgs Data has these formats:         [0]    "Preferred DropEffect"    string         [1]    "InShellDragLoop"    string  

  • BT Infinity Noise/Speed questions

    Is my noise margin good or bad? 1. Product name: BT Home Hub 2. Serial number: +068543+NQ42955553 3. Firmware version: Software version 4.7.5.1.83.8.173.1.6 (Type A) Last updated Unknown 4. Board version: BT Hub 5A 5. VDSL uptime: 0 days, 19:59:25 6.

  • How to download another Keystone from Apple's web

    I just upgraded to OS X Yosemite and in process I lost my Keynote file. How could I download free of charge another Keystone from the Apple web side? Thanks for your help, Roxy

  • Long text in production order

    Hi All, I have enter some text in all my production order. Based on that txt can i pulled the orders in the report(in std report). Is there any report like this. Thanks and Regard, D.Dutta

  • Data being dropped after joining Fiscal Time with Fact Table

    Hi, In my RPD, i have jolined the Fiscal Calendar with my fact tables : Fiscal Day is joined to Create Time column in the fact table. Fiscal Day Data is : 6/6/2006 12:00:00 Creare Time Data is : 6/6/2006 11:45:49 6/6/2006 11:56:50 When i pull the fis