Newbie: How can I store a previous value??

I am trying to figure out how to do the following:
int xcoor=0, ycoor=0, hstep, vstep;
while true do
update_step(hstep, vstep); // essentially have a big while loop to generate the necessary hstep/vsteps
xcoor = xcoor + hstep; // I need to add a new hstep to the xcoor
ycoor = ycoor + vstep; // I need to add a new vstep to the ycoor
updategraph(xcoor, ycoor); // and feed the updated xcoor/ycoor to an XYgraph
I think I should use a Master/Slave design? but how do I keep the previous value the first time in the Slave and then add the new values to the stored value??
Attachments:
new_Block_Diagram.bmp ‏2137 KB
new_Block_Diagram.jpg ‏174 KB

You probably want to use a shift register.
Right-click on the right edge of the loop. Select the "Add Shift Register" option.
It will add a widget on both the right and left sides of the loop.
An item wired to the right side will appear on the left side during the next pass through the loop. You can initialize the value by wiring an input to the left side widget.
[email protected]

Similar Messages

  • How can I store 2 GB value

    Hi,
    Can I store 2 GB value (2 * 1024 * 1024 * 1024) in long type variable? if it doesn't hold the value is there any other way to store the value?
    Thanks in advance.
    Regards,
    Venkat

    The range of primitives is as follows:
    byte -2^7 - 2^7-1
    short -2^15 - 2^15-1
    int -2^31 - 2^31-1
    long -2^63 - 2^63-1
    Thus an int can store a value between -2147483648 and 2147483647.
    long will store values between -9223372034707292161 and 9223372036854775807.
    Your 2GB value = 2147483648 is only 1 past what an int can store.

  • How can I store the previous data elements in labview

    Hello,
        I am
    using PXI1042Q chassis with 8106 microcontroller and PXI 6289 DAQ
    cards. I am implementing a real time system where we acquire data
    point-by-point.  I would like to know if there is any way that I
    can store previous 500 sample points. I know that shift registers can
    be used to store values from previous cycles. It seems impractical to
    insert 500 shift registers in to system. Is there any way to store the
    previous 500 samples?
    Thanks,
    kartik 

    altenbach wrote:
    For better memory performance, you would use a fixed size=500 array and replace the oldest element with the newest at each iteration. Keep track of the current element index with another shift regsiter.
    Here is an old example tha keeps the last 10 values in a size=10 shift register and calculates the mean.
    Modify as needed.
    Information about action engines can be found here.
    There is also the "collector express VI". Since it uses dynamic data, it's probably more demanding on resources.
    LabVIEW Champion . Do more with less code and in less time .

  • How can I get the previous record's field value in a VO

    Hi I would like to know how can I get the previous record's field value in a VO
    For example : I have a VO porequisitionlinesvoimpl, and it contains 5 records (porequisitionlinesvoimpl.getRowCount() = 5). How can I search all records in the VO and get the field (attribute3) for all records?
    Many thanks anyone can help
    Lawrence

    Hi ,
    U can loop through the VO to get the value of attribute3,
    need to extend the controller ,use below code
    OAViewObject vo = (OAViewObject)oawebbean.getApplicationModule (VO1);
    OARow row = null;
    int fetchedRowCount = vo.getFetchedRowCount();
    RowSetIterator Iter = vo.createRowSetIterator("Iter");
    if (fetchedRowCount > 0)
    Iter .setRangeStart(0);
    Iter .setRangeSize(fetchedRowCount);
    for (int i = 0; i < fetchedRowCount; i++)
    row = (OARow)Iter .getRowAtRangeIndex(i);
    String value = (String)row.getAttribute("Atrribute3");
    Thanks
    Pratap

  • HT4539 how can i download a previous purchase to my new computer? I can't find it in my purchased category but they appear as purchased on th ei tune store??

    how can i download a previous purchase to my new computer?
    I can't find it in my purchased category but they appear as purchased on th ei tune store??

    What type of item is it ? What you can re-download will show under the Purchased link under Quick Links on the right-hand side of the iTunes store home page on your computer's iTunes. As long as they are still in the store then your apps and ibooks should appear there, and potentially music, films and tv shows (media can't be re-downloaded in all countries) - audiobooks and ringtones are currently one-time only downloads, so they won't appear.
    If they don't show then have you still got copies of the items somewhere e.g. on your old computer (copying between computers) or on a backup of your downloads ?

  • How can I get the edited value from the editor in JTable

    I have a JTextField added as an editor to a cell in JTable.
    I value gets changed when I press enter.
    but in actionPerformed of the JTextField when I say
    String txtEditorValue = txtEditor.getText();
    I am getting the old value. How can I get the edited value? Thanks.

    Hi,
    I guess, your understanding of how JTable works together with its models is not good enough - for example the method getTableCellEditorComponent(...) of the TableCellEditor interface is used to get the component, that should be used as editing component - its second parameter is a value that should be used to setup the editing component - it is normally not the editing component itself.
    JTable uses an underlying TableModel to store the cell values - if you have edited a cell, JTable gets the value of the editing component by itself and stores it in the TableModel using its setValueAt(...) method. To retrieve this data you only need to query the TableModel using row and column of this cell as parameters
    say jt is your JTable, and row and column are the row and column of the cell - so to get the value, simply use
    Object obj = jt.getModel().getValueAt(row,column);
    if you know, that there is a String in this cell use
    String str = (String) jt.getModel().getValueAt(row,column);
    The editor component is used for the view of the JTable - you only want the data, which is stored in the model - you don't have to deal with the GUI components in this case.
    greetings Marsian

  • Using action script 2 how can i send a variable value to a dynamic textbox on a different keyframe?

    using action script 2 how can i send a variable value to a dynamic textbox on a different keyframe?

    Thanks for your swift response.
    That sounds like a good solution, but the code I have on frame 2 is this
    timer = 0;
    countup = function(){
    timer++;
    countupInterval = setInterval(countup,100);
    If I added the same actionscript to frame 3 which has a dynamic textbox with a variable timer attached wouldn't it just put the timer back to 0? What I want is the last known value that was given when it was in frame 2.
    I am thinking of temple run here, I am trying to caculate the total distance(set in the timer variable) from the previous try.
    Hope this makes sense.
    Chazwick

  • HT4847 How can I store files on iCloud?

    How can I store files on iCloud?

    Actually, I have found that this is very possible, combining several other tips from around the web, though perhaps not easy.  I am using Moutain Lion.  I am assuming that you have already activated and signed into iCloud previously.  Here are the steps for creating a cloud storage location that you can drage any file into, and access from any of your Macs:
    1) Create a new folder in the directory that is synced with iCloud.  Start by opening a Finder window, and going to the ~/Library/ directory.  Do this by typing Shift-Command-G while the Finder is open, and typing ~/Library in the goto window.  Next, open the directory "Mobile Documents".  Finally, Control-Click inside the Finder and select the "New Folder" option, naming it whatever you like -- I chose "iCloud".
    2) Step two is about creating a shortcut to this iCloud folder in the Finder.  You cannot directly drag the iCloud folder into the Favorites section of the Finder, but you can do this:  Control-Click on your new folder, and select "Make Alias".  Now, drag this alias over to your Favories panel in the finder.  You will be prompted whether you really want to move the Alias out of iCloud: Say "Yes".  Now, delete the Alias -- you don't need the original instance of it any more. (Alternatively, you can skip to the end of step 3 and drag the symbolic link into the Finder Favorites)
    3) Step three is about being able to access this iCloud folder from the Unix command line, and from the Desktop GUI.  Open a Terminal window (Launchpad => Other => Terminal).  By the way, I recommend putting the Terminal into your Taskbar, if it isn't already.  You should be in your home directory ... to verify, type "cd" and press Enter.  Now, create a Unix symbolic link (an Alias won't work for this) to the actual location of the iCloud folder:
    Type "ln -s ~/Library/Mobile\ Documents/iCloud/ iCloud" and press enter.  The command should be entered precisely, I recommend cut and paste.  The first character is a lower case "L" and there is a space after the backslash between "Mobile" and "Documents".  You should now have a symbolic link to the iCloud folder created.  To view it in the Finder, go to your home directory: Shift-Command-G, and then enter "~/" into the window.  You should see a folder called "iCloud" there, with a little arrow animation in the corner.  You can drag this into the Taskbar to have a permanent clickable shortcut.  You can also access the contents of this folder through the terminal.  From your home directory, just type "cd iCloud" and press Enter.  You are now in the iCloud folder (or more properly, your local version of it), and can use the usual Unix tricks ... "ls" to list contents, "mkdir ABCD" to make a new directory called "ABCD", "mv a.txt b.txt" to rename a file "a.txt" into "b.txt", etc.
    4) Step four is about accessing this folder on other machines.  On a second Mac, repeat all of the steps above *EXCEPT* for creating the New Folder in step 1 ... it already exists, but you can get it into your finder bar, and create sym-links in the same way from there.
    The great thing about this is that when you work, you are editing a *local* copy of the file, so you can work offline if you like.  Then, whenever you have internet access, the *actual remote* cloud copy of any new or modified files is uploaded.  Likewise, updated files are downloaded from the cloud to get your local files into sync.  You have the benefit/safety of a local hard copy, AND the portability (and extra safety) of cloud storage.  It's exactly what I wanted, and it works like a dream.  Plus, time machine can back up your *local* copies, to maintain version history.  I'm not quite sure what happens if you try to simultaneously edit a file from two places, but don't do that.
    Hope that helps you!
    JWSpaceman

  • How can I re-download previously purchased songs from itunes?

    How can I re-download previously purchased songs from itunes?

    You only get one download.  It is your responsibility to backup your purchases.
    UNLESS, you are in the U.S, then you can use the Beta version of icloud.  Open itunes store, click Purchased, under Quick links

  • How can i get the all values from the Property file to Hashtable?

    how can i get the all values from the Property file to Hashtable?
    ok,consider my property file name is pro.PROPERTIES
    and it contain
    8326=sun developer
    4306=sun java developer
    3943=java developer
    how can i get the all keys & values from the pro.PROPERTIES to hashtable
    plz help guys..............

    The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
    InputStream is = new FileInputStream("tivoli.properties");
    props.load(is);

  • How can i get all these values in single row with comma separated?

    I have a table "abxx" with column "absg" Number(3)
    which is having following rows
    absg
    1
    3
    56
    232
    43
    436
    23
    677
    545
    367
    xxxxxx No of rows
    How can i get all these values in single row with comma separated?
    Like
    output_absg
    1,3,56,232,43,436,23,677,545,367,..,..,...............
    Can you send the query Plz!

    These all will do the same
    create or replace type string_agg_type as object
    2 (
    3 total varchar2(4000),
    4
    5 static function
    6 ODCIAggregateInitialize(sctx IN OUT string_agg_type )
    7 return number,
    8
    9 member function
    10 ODCIAggregateIterate(self IN OUT string_agg_type ,
    11 value IN varchar2 )
    12 return number,
    13
    14 member function
    15 ODCIAggregateTerminate(self IN string_agg_type,
    16 returnValue OUT varchar2,
    17 flags IN number)
    18 return number,
    19
    20 member function
    21 ODCIAggregateMerge(self IN OUT string_agg_type,
    22 ctx2 IN string_agg_type)
    23 return number
    24 );
    25 /
    create or replace type body string_agg_type
    2 is
    3
    4 static function ODCIAggregateInitialize(sctx IN OUT string_agg_type)
    5 return number
    6 is
    7 begin
    8 sctx := string_agg_type( null );
    9 return ODCIConst.Success;
    10 end;
    11
    12 member function ODCIAggregateIterate(self IN OUT string_agg_type,
    13 value IN varchar2 )
    14 return number
    15 is
    16 begin
    17 self.total := self.total || ',' || value;
    18 return ODCIConst.Success;
    19 end;
    20
    21 member function ODCIAggregateTerminate(self IN string_agg_type,
    22 returnValue OUT varchar2,
    23 flags IN number)
    24 return number
    25 is
    26 begin
    27 returnValue := ltrim(self.total,',');
    28 return ODCIConst.Success;
    29 end;
    30
    31 member function ODCIAggregateMerge(self IN OUT string_agg_type,
    32 ctx2 IN string_agg_type)
    33 return number
    34 is
    35 begin
    36 self.total := self.total || ctx2.total;
    37 return ODCIConst.Success;
    38 end;
    39
    40
    41 end;
    42 /
    Type body created.
    [email protected]>
    [email protected]> CREATE or replace
    2 FUNCTION stragg(input varchar2 )
    3 RETURN varchar2
    4 PARALLEL_ENABLE AGGREGATE USING string_agg_type;
    5 /
    CREATE OR REPLACE FUNCTION get_employees (p_deptno in emp.deptno%TYPE)
    RETURN VARCHAR2
    IS
    l_text VARCHAR2(32767) := NULL;
    BEGIN
    FOR cur_rec IN (SELECT ename FROM emp WHERE deptno = p_deptno) LOOP
    l_text := l_text || ',' || cur_rec.ename;
    END LOOP;
    RETURN LTRIM(l_text, ',');
    END;
    SHOW ERRORS
    The function can then be incorporated into a query as follows.
    COLUMN employees FORMAT A50
    SELECT deptno,
    get_employees(deptno) AS employees
    FROM emp
    GROUP by deptno;
    ###########################################3
    SELECT SUBSTR(STR,2) FROM
    (SELECT SYS_CONNECT_BY_PATH(n,',')
    STR ,LENGTH(SYS_CONNECT_BY_PATH(n,',')) LN
    FROM
    SELECT N,rownum rn from t )
    CONNECT BY rn = PRIOR RN+1
    ORDER BY LN desc )
    WHERE ROWNUM=1
    declare
    str varchar2(32767);
    begin
    for i in (select sal from emp) loop
    str:= str || i.sal ||',' ;
    end loop;
    dbms_output.put_line(str);
    end;
    COLUMN employees FORMAT A50
    SELECT e.deptno,
    get_employees(e.deptno) AS employees
    FROM (SELECT DISTINCT deptno
    FROM emp) e;
    DEPTNO EMPLOYEES
    10 CLARK,KING,MILLER
    20 SMITH,JONES,SCOTT,ADAMS,FORD
    30 ALLEN,WARD,MARTIN,BLAKE,TURNER,JAMES
    CREATE OR REPLACE FUNCTION concatenate_list (p_cursor IN SYS_REFCURSOR)
    RETURN VARCHAR2
    IS
    l_return VARCHAR2(32767);
    l_temp VARCHAR2(32767);
    BEGIN
    LOOP
    FETCH p_cursor
    INTO l_temp;
    EXIT WHEN p_cursor%NOTFOUND;
    l_return := l_return || ',' || l_temp;
    END LOOP;
    RETURN LTRIM(l_return, ',');
    END;
    COLUMN employees FORMAT A50
    SELECT e1.deptno,
    concatenate_list(CURSOR(SELECT e2.ename FROM emp e2 WHERE e2.deptno = e1.deptno)) employees
    FROM emp e1
    GROUP BY e1.deptno;
    DEPTNO EMPLOYEES
    10 CLARK,KING,MILLER
    20 SMITH,JONES,SCOTT,ADAMS,FORD
    30 ALLEN,WARD,MARTIN,BLAKE,TURNER,JAMES
    CREATE OR REPLACE TYPE t_string_agg AS OBJECT
    g_string VARCHAR2(32767),
    STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT t_string_agg)
    RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateIterate(self IN OUT t_string_agg,
    value IN VARCHAR2 )
    RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateTerminate(self IN t_string_agg,
    returnValue OUT VARCHAR2,
    flags IN NUMBER)
    RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateMerge(self IN OUT t_string_agg,
    ctx2 IN t_string_agg)
    RETURN NUMBER
    SHOW ERRORS
    CREATE OR REPLACE TYPE BODY t_string_agg IS
    STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT t_string_agg)
    RETURN NUMBER IS
    BEGIN
    sctx := t_string_agg(NULL);
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateIterate(self IN OUT t_string_agg,
    value IN VARCHAR2 )
    RETURN NUMBER IS
    BEGIN
    SELF.g_string := self.g_string || ',' || value;
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateTerminate(self IN t_string_agg,
    returnValue OUT VARCHAR2,
    flags IN NUMBER)
    RETURN NUMBER IS
    BEGIN
    returnValue := RTRIM(LTRIM(SELF.g_string, ','), ',');
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateMerge(self IN OUT t_string_agg,
    ctx2 IN t_string_agg)
    RETURN NUMBER IS
    BEGIN
    SELF.g_string := SELF.g_string || ',' || ctx2.g_string;
    RETURN ODCIConst.Success;
    END;
    END;
    SHOW ERRORS
    CREATE OR REPLACE FUNCTION string_agg (p_input VARCHAR2)
    RETURN VARCHAR2
    PARALLEL_ENABLE AGGREGATE USING t_string_agg;
    /

  • How Can I get multi column values from dynamic search help?

    Hi Gurus;
    I'm using dynamic search help in my program.
    I want to get multi column values from search help. But I dont know solution for this issue.
    I'm using F4IF_INT_TABLE_VALUE_REQUEST FM.
    How Can I get multi column values from dynamic search help?
    Thanks.

    Believe it or not, the same FM worked for me in a dynpro. I will try to explain here how it works in custom screen and then you can do your work for other screens or program types. I am not going to write my actual work but will explain in general.
    I have 4 fields (FLD1, FLD2, FLD3, FLD4) and i made the search based on FLD2 and when user click on a line (could be any field), then this would bring the line on to the screens.
    There are like 3 steps.
    You have your value_tab for my fields FLD1, FLD2, FLD3 and FLD4. This is just the data that we pass into the FM. (data: IT_VALTAB type table of ZVAL_TABLE)
    Next map the screen fields into an internal table (data: It_dynpfld type table of dselc ). I also have other internal tables defined  (just to keep it straight, i will be putting here) data:  It_return type standard table of ddshretval.
    Next step is to call the function module. Make sure you have values in IT_VALTAB.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
            retfield        = 'FLD2'
            value_org       = 'S'
          tables
            value_tab       = It_VALTAB
            return_tab      = It_return
            dynpfld_mapping = It_dynpfld
          exceptions
            parameter_error = 1
            no_values_found = 2
            others          = 3.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
          with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        else.
          perform get_selected_fields tables It_return.
        endif.
    The code within the perform GET_SELECTED_FIELDS  - We need to map the result fields after user selects it. The code goes like this. This is step is to update the dynpro fields.
    I need a internal table as well as a work area here. like,
    data: lt_fields type table of dynpread,
            la_fields type dynpread.
      field-symbols: <fs_return> type ddshretval.
    so fill out LT_FIELDS from the IT_RETURN table
    loop at lt_return assigning <fs_return>.
        la_fields-fieldname = <fs_return>-retfield.
        la_fields-fieldvalue = <fs_return>-fieldval.
        append la_fields to lt_fields.
        clear: la_fields.
      endloop.
    Call the FM to update the dynpro
    call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname               = sy-repid
          dynumb               = '1002' "This is my screen number. You could use 1000 for selection screen (hope so)
        tables
          dynpfields           = lt_fields
        exceptions
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          undefind_error       = 7
          others               = 8.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    good luck

  • How can i pass the Input value to the sql file in the korn shell ??

    Hi,
    How can i pass the Input value to the sql file in the korn shell ??
    I have to pass the 4 different values to the sql file and each time i pass the value it has to generate the txt file for that value like wise it has to generate the 4 files at each run.
    can any one help me out.
    Raja

    Can you please more elaberate., perhaps you should more elaberate.
    sqlplus is a program. you start it from the korn shell. when it's finished, processing control returns to the korn shell. the korn shell and sqlplus do not communicate back and forth.
    so "spool the output from .sql file to some txt file from k shell, while passing the input parameters to the sql file from korn shell" makes no sense.

  • How can i store data in term of a tree structure

    how can i store data in term of a tree structure

    What a tree is the question. If you just want a fast access, ehats about Hashtable or dictionary classes ? The data there is structured in a tree. For a simple binary tree, you can use something like
    class Node {
    Node(Object data){
       Node left;
       Node right;
       Object data = data;
    void insert(Object data, Node parent){
      int test = data.compareTo(parent.data);
      if(test < 0 ){
        if(parent.left == null){
          parent.left = new Node(data);
        else{
          insert(data, parent.left);
      else{
        if(parent.right == null){
          parent.right = new Node(data);
        else{
          insert(data,parent.right);
    }And so build up a binary tree. The traversing methods can be found in almost any good book (pre-order, post-order, in-order), for search you have just to look at greater/smaller and descend in the tree.
    The Object data can be changed to what you want for storage, String, or primitive Numbers, Vectors ...
    Is that what you search for?

  • How can I store my iTunes library on an NAS (Fritz Box)?

    How can I store my iTunes library on an NAS (Fritz Box)?

    1. Drag the library to the external drive, launch iTunes with the Option key held down, click on Choose Library, and point it there.
    2. Get a second. Having the backups on the same drive as the original data won't help when that drive fails.
    (66929)

Maybe you are looking for

  • BMR/Systemstate backup not working on windows server 2008 error 2147942487

    Hi, trying to backup system image using SCDPM 2010 RTM.Most of the server are getting healthy backups except for this one server which is giving error: Affected area: Computer\System Protection Occurred since: 1/27/2014 2:43:27 PM Description: The re

  • Use of tax code

    Hi, What is the use of a tax code? I mean once the pricing is done in a sales order and its subsequent documents are created till billing then is there any sap related transaction which uses tax code or it is just used to determine appropriate condit

  • Logic 9.1.6 Crashes on launching a project

    Hi If someone could help with this I would greatly appreciate this. I am working on a new project which I save as a new file each time I make a major change to the project. Anyway, I was getting a system overload/slow disk message quite frequently so

  • Any advice on count  when sum 0

    Hi there We would like to have 1 sql such that count when sum of value in column > 0 . Problem is sum an aggregate function and also count. As example imagine 2 customer records, one has a -ve value e.g -4 and 1 a positive value of +5 so sum of these

  • IMovie 09 crashing using Canon EOS 5D Mark II 1080p files

    Constantly crashing; have repeatedly: repaired permissions, restarted, ran latest Disk Warrior. Largest .MOV files 380.6MB, smallest 4.6. The project file size (unfinished) is 6.78GB. Does that sound beyond iMovie 09's capacity? Unit info: Model Iden