How to save a value ?

Hello. I am making a program in Labview....and my problem is for example:at the end of a cicle i need to save the result that has been calculated in the cicle...so i can use it later in other cicle calculations....
my question is how can i save that value in a variable (or register)  ? 
thanks
JOSE 

Sorry i said cicles instead of loops. I understand that the value is in the wire that conect to other things outside the loop...i just canot save/store it in some 'variable' so i can use it later...i will try a shif register  
thanks again for your anwsers
JOSE

Similar Messages

  • How to save a value in form jsp?

    hi all,
    i have a dropdown list in my struts web app,
    i am having a form in which a bean is instatiated(bean has 2 properties "name" and "code").
    i am using like this in the jsp:
    <td><html:select property="item.code">
                             <logic:iterate id="itemType"
                                  name="<%=WebConstants.getItemTypeListName()%>">
                                  <option value='<bean:write name="ItemType" property="code"/>'><bean:write
                                       name="ItemType" property="name" /></option>                              
                             </logic:iterate>                         
                        </html:select></td>
    each "itemType" has "code" and "name".
    when the user clicks on the item name on the dropdown item beans "code" is populating.now i need to populate "name" aswell at the sametime using hidden property.
    i want to save tha value of name in the jsp to use it later to populate "name" in my form using hidden property?
    do anyone have idea how to save the value in jsp?
    regards and thanks in advance

    Thank you. I execute the program below. I can now retrive the data from the Lt.txt. But the value is limited to 3 digits. For example, the content of my file is 777888.
    When I run the program, I only get 777. How can I retrive the whole exact number?               
    import java.io.*;
                   class Test {     
                   public static void main(String args[]) {          
                   try {               
                   File inputFile = new File("Lt.txt");               
                   File outputFile = new File("outagain.txt");                    
                   FileReader in = new FileReader("Lt.txt");               
                   FileWriter out = new FileWriter(outputFile);               
                   char[] tmp = new char[3];               
                   int cnt = in.read(tmp);                              
                   System.out.print("\nRead: ");               
                   for (int i = 0; i < cnt; i++) {                    
                   System.out.print(tmp);               }               
                   System.out.println(" ");               
                   in.close();          }
                   catch (IOException ex) {               
                   System.out.println("IOException:"+ex.toString());          }     }}

  • How to save a value in a .txt n retrive back the exact value from the file?

    Well I have a number. Let's say 600. I need to save this value in a .txt file so that I can retrive this value. I tried using the below source code. It can be executed but I'll get num 49 everytime I execute it even though the value in my .txt is 600.
    try {
                   File inputFile = new File("Lt.txt");
                   File outputFile = new File("outagain.txt");
    FileReader in = new FileReader("Lt.txt");
    FileWriter out = new FileWriter(outputFile);
    int c;
              c = in.read();
              in.close();
    System.out.print("\nggggggggg"+c);
    in.close();
                   } catch (IOException ex) {
                   System.out.println("IOException:"+ex.toString());

    Thank you. I execute the program below. I can now retrive the data from the Lt.txt. But the value is limited to 3 digits. For example, the content of my file is 777888.
    When I run the program, I only get 777. How can I retrive the whole exact number?               
    import java.io.*;
                   class Test {     
                   public static void main(String args[]) {          
                   try {               
                   File inputFile = new File("Lt.txt");               
                   File outputFile = new File("outagain.txt");                    
                   FileReader in = new FileReader("Lt.txt");               
                   FileWriter out = new FileWriter(outputFile);               
                   char[] tmp = new char[3];               
                   int cnt = in.read(tmp);                              
                   System.out.print("\nRead: ");               
                   for (int i = 0; i < cnt; i++) {                    
                   System.out.print(tmp);               }               
                   System.out.println(" ");               
                   in.close();          }
                   catch (IOException ex) {               
                   System.out.println("IOException:"+ex.toString());          }     }}

  • How to save the value in Cedit control into a text file bu using measurement studio c++?

    Im using measurement studio c++ to create a application. How to save a randomly generated value which display in the CNumberEdit Control to a text file? how to do the coding part?

    You can use the CNiFile class to write the value out to a file. For example, create a new Measurement Studio C++ project and follow these steps:
    Add a CNiNumEdit to the dialog.
    Add a member variable for the CNiNumEdit called m_numEdit.
    Add a button to the dialog.
    Double-click the button to add a message handler for the button's BN_CLICKED message.
    Add the following code to the button's BN_CLICKED message handler:
    CNiFile file("C:\\Values.log", CFile::modeCreate | CFile::modeWrite | CFile::typeText);
    file << m_numEdit.Value << endl;
    file.Close();
    Run the application, edit the CNiNumEdit's value, and click the button. The value should be written to the Values.log
    file as specified in the code above.
    Hope this helps.
    - Elton

  • How to save controls value in labview

    hi
    i want to know how to save the controls value in PC. means if i assign 5  digital value to a control it should remain there even i restarts my PC.
    Solved!
    Go to Solution.

    This can mean two things. Will the default value always be 5? You could right click the control, select Data Operations, then Make Current Values Default. This can only be done at edit time and the value is saved with the vi. If you know you will always need the same default value then do this. If you need the user to be able to change the default value without editing and saving the vi then see the post by smercurio_fc above.
    =====================
    LabVIEW 2012

  • How to save a value in a byte array, retrieve it and display it?

    Hi,
    I am doing a project for my data structures class that involves saving a value (given in String format) in a byte array (our 'memory'). Initially I just tried casting character by character into the byte array and casting back to char[] for retrieval (using .toString() to return what's supposed to be the original string), but this did not work. I tried the .getBytes() method, applying it to the string and then trying to recover it by placing the contents of the 'memory' in a byte array and applying toString(), but that didn't work either. I looked a bit and found this class, CharsetEncoder and CharsetDecoder. I tried to use these but when I try the compiler tells me I cannot instantiate CharsetDecoder because it is an abstract class. At this point I'm at a loss as to what I can do. Is there any way to place a string in a byte array and then recover the string in it's original format? For example, I might save a value in my particular class of "456". But when I try to recover the value from my 'memory' i.e. the byte array, it comes out like [gnue@hnju.... or something similar. I need it to output the original string ("456").
    Below is my code as it is right now, for the methods setValue and getValue.
    Thanks!
    public void setValue(String value) throws InvalidValueException {
         //… stores the given value in the memory area assigned to the variable
              if(this.type.isValidValue(value)){
                   bytes = value.getBytes();
                   int i,j,k;
                   int l=0;//might be wrong?
                   int ad=address-(address%4);
                   mem.readWord(ad);
                   reg=mem.getDataRegister();
                   if((address%4)+bytes.length-1<4){
                        for(i=address%4;i<address%4+bytes.length;i++)
                             reg.setByte(i, bytes[i]);
                        mem.setDataRegister(reg);
                        mem.writeWord(ad);
                   else if((address%4)+bytes.length-1>=4){
                        if(address%4!=0){
                             for(i=address%4;i<4;i++){
                                  reg.setByte(i, bytes);
                                  l++;
                             mem.setDataRegister(reg);
                             mem.writeWord(ad);
                             ad+=mem.WORDSIZE;
                        while(ad<address+bytes.length-(address+bytes.length)%4){
                             for(j=0;j<4;j++){
                                  reg.setByte(j, bytes[j+l]);
                                  l++;
                             mem.setDataRegister(reg);
                             mem.writeWord(ad);
                             ad+=mem.WORDSIZE;
                        if((address+bytes.length)%4!=0){
                             mem.readWord(ad);
                             reg=mem.getDataRegister();
                             for(k=0;k<(address+bytes.length)%4;k++){
                                  reg.setByte(k, bytes[k+l]);
                                  l++;
                             mem.setDataRegister(reg);
                             mem.writeWord(ad);
                   else
                        throw new InvalidValueException("The value passed is not valid.");
         /** Gets the current value of the variable.
         @return current value converted to String
         public String getValue() {
              //… returns the current value stored in the corresponding memory area
              //… value is converted to String
              bytes=new byte[this.getType().getSize()];
              int i,j,k;
              int l=0;//might be wrong?
              int ad=address-(address%4);
              mem.readWord(ad);
              reg=mem.getDataRegister();
              if((address%4)+bytes.length-1<4){
                   for(i=address%4;i<address%4+bytes.length;i++)
                        bytes[i] = reg.readByte(i);
              else if((address%4)+bytes.length-1>=4){
                   if(address%4!=0){
                        for(i=address%4;i<4;i++){
                             bytes[i] = reg.readByte(i);
                             l++;
                        ad+=mem.WORDSIZE;
                   mem.readWord(ad);
                   reg=mem.getDataRegister();
                   while(ad<address+bytes.length-(address+bytes.length)%4){
                        for(j=0;j<4;j++){
                             bytes[j+l] = reg.readByte(j);
                             l++;
                        ad+=mem.WORDSIZE;
                   if((address+bytes.length)%4!=0){
                        mem.readWord(ad);
                        reg=mem.getDataRegister();
                        for(k=0;k<(address+bytes.length)%4;k++){
                             bytes[k+l] = reg.readByte(k);
                             l++;
              return bytes.toString();

    You can certainly put it into a byte array and then construct a new String from that byte array. Just calling toString doesn't mean you'll automatically get a meaningful string out of it. Arrays do not override the toString method, so the use the one inherited from object.
    Look at String's constructors.

  • How to save input values in a dialog?

    Hi there,
    I've got the following dialog with an EditText in it:
    var win, form; 
    form = "dialog {  \ 
        orientation: 'column', \ 
        alignChildren: ['fill','top'], \ 
        preferredSize: [305, 300], \ 
        text: 'Form', \ 
        margins: 15, \ 
        input_group: Panel { \ 
            text: 'Number', \ 
            orientation: 'row', \ 
            alignChildren: ['fill','top'], \ 
            margins: 15, \ 
            input_obj: EditText { \ 
                text: '' \ 
    win = new Window(form);
    Once the dialog is closed, I want it to save the EditText values, so when I open it again it already has it filled.
    How do I create this behaviour?
    Thanks!

    Alternatively, you could use customOptions:
    var win, form;   
    form = "dialog {  \
        orientation: 'column', \
        alignChildren: ['fill','top'], \
        preferredSize: [305, 300], \
        text: 'Form', \
        margins: 15, \
        input_group: Panel { \
            text: 'Number', \
            orientation: 'row', \
            alignChildren: ['fill','top'], \
            margins: 15, \
            input_obj: EditText { \
                text: '' \
        btn: Button { \
            text: 'Click me' \
    win = new Window(form);
    win.btn.onClick = function () {
        var desc = new ActionDescriptor();
        desc.putString(0, win.input_group.input_obj.text);
        app.putCustomOptions("77F66FF5-EFAD-49B7-AFE3-8A1403376CB8", desc, true);
        win.close();
    try {
        var desc = app.getCustomOptions("77F66FF5-EFAD-49B7-AFE3-8A1403376CB8");
        win.input_group.input_obj.text = desc.getString(0);
    } catch (e) {
        win.input_group.input_obj.text = "predefined value";
    win.show();
    Cheers,
    Davide Barranca
    www.davidebarranca.com
    www.cs-extensions.com

  • How to save a value (not in file) in Labview?

    Hello,
    I seems to be an easy question, but i don't know how to do it. I want to save the first value from my acquisition board (BUT NOT IN A FILE), in Labview "memory" and keep it for a later use. Like a variable stored in programming. With shift register it's continuing updating, and when i stop the shift register loop, it gave me 0 value. How to do it ? Thanks in advance!

    It sounds like they want the value to live through closing the VI and opening it for another time.  If you're just wanting to maintain the value through the single run, shift registers will carry the value.  If you don't initialize the value (wire something into the left register), they will maintain the value as long as you don't close LabVIEW and kill the memory allocation.
    If you want to keep the value until the next run, you'll need to use Invoke Node to make that value default.  That way, it will open up next time with the value saved.

  • How to ask for an array and how to save the values

    I'm supposed to be learning the differences between a linear search and a binary search, and the assignment is to have a user input an array and search through the array for a given number using both searches. My problem is that I know how to ask them how long they want their array to be, but I don't know how to call the getArray() method to actually ask for the contents of the array.
    My code is as follows:
    import java.util.Scanner;
    import java.util.ArrayList;
    public class Main
        private static Scanner input = new Scanner(System.in);
        public static void main (String args[])
            //creates ArrayList
            int List[];
            System.out.println("How long would you like the array to be?");
            int arrayLength = input.nextInt();
            //Initializes array list
            List = new int [arrayLength];
            System.out.println("Please enter the first value of the array");
        public static void getArray(int List[], int arrayLength)
            for(int i=0; i < arrayLength; i++) {
                 System.out.println("Enter the next value for array");
                 List[i] = input.nextInt();
         public static void printArray(int List[])
             for(int i=0; i < List.length; i++)
                 System.out.print(List[i] + " ");
    public class search
        public static int binarySearch(int anArray[], int first, int last, int value)
            int index;
            if(first > last) {
                index = -1;
            else {
                int mid = (first + last)/2;
                if(value == anArray[mid]) {
                    index = mid; //value found at anArray[mid]
                else if(value < anArray[mid]) {
                    //point X
                    index = binarySearch(anArray, first, mid-1, value);
                else {
                    //point Y
                    index = binarySearch(anArray, mid+1, last, value);
                } //end if
            } //end if
            return index;
        //Iterative linear search
        public int linearSearch(int a[], int valueToFind)
            //valueToFind is the number that will be found
            //The function returns the position of the value if found
            //The function returns -1 if valueToFind was not found
            for (int i=0; i<a.length; i++) {
                if (valueToFind == a) {
    return i;
    return -1;

    I made the changes. Two more questions.
    1.) Just for curiosity, how would I have referenced those methods (called them)?
    2.) How do I call the searches?
    import java.util.Scanner;
    import java.util.ArrayList;
    public class Main
        private static Scanner input = new Scanner(System.in);
        public static void main (String args[])
            //creates ArrayList
            int List[];
            System.out.println("How many values would you like the array to have?");
            int arrayLength = input.nextInt();
            //Initializes array list
            List = new int [arrayLength];
            //Collects the array information
            for(int i=0; i < arrayLength; i++) {
                 System.out.println("Enter a value for array");
                 List[i] = input.nextInt(); 
            //Prints the array
            System.out.print("Array: ");
            for(int i=0; i < List.length; i++)
                 System.out.print(List[i] + " ");
            //Asks for the value to be searched for
            System.out.println("What value would you like to search for?");
            int temp = input.nextInt();
            System.out.println(search.binarySearch()); //not working
    }

  • How to save the value from JTextFormattedField using TAB key in lostFocus

    Can you, please help me with this problem:
    I want to have saved new value in JTextFormattedField after I use TAB kye.
    I tried with focusLost, then setting setFocusTraversalKeys etc.
    It looks simple, but !?
    Thanks

    I also tried the JFormattedTextField for the IPAddress Object which I created but it would't work that well I have a bad experience with these TextFields it showed me the formate 0.0.0.0 but when I entered the text in it, it jumps of after tow digits in each column

  • SIMPLE BROWSE BUTTON QUES: How to save the value on submit

    THis is my file field
    <input type="file" name="upic2" value="<%=upic2%>">
    If this was a regular field, value="<%=upic2%> would hold the value, but is doesnt work for the browse field. Does anyone know what I am missing.
    THanks
    Adam

    I take it that this will not work and its a limitation of the browse button.

  • How to save byte[] value to Oracle table?...

    ... what would be the data type in table for the column? THanks.

    I was thinking doing toString() to convert it to a String to insert to Oracle table. My question is actually would it to be safe to retrieve it later on to compare with anther byte[]? Thanks.

  • How to save webdynpro output

    Hi everyone
          I am new to webdynpro technology can anybody help me???
               I created one alv table with insertrow and deleterow after entering the values in the new row how to save that values . i want to update the database(ekpo)  with insertrow values. please give me an idea

    Hi
    EKPO Purchasing Document Item
    You should not insert directly to SAP Standard Table, Use BAPI's to create Purchase Orders with the Line Items.
    Abhi

  • How I can save the value of a variable in a database?

    hello,
    how I can save the value of a variable in a database? I need to keep the # of times you press click animation. to know how many times it has been seen.
    I connect to msql database, using php, javascript, ajax and jquery, but not how to save the variable counter clicks from adobe edge Animate
    appreciate your help so I can connect to the database from adobe edge animate.
    thank you very much
    Luis Felipe Garcia
    [email protected]

    Hi, all-
    This isn't an Animate-specific issue, but I thought I'd take a stab at it anyway.  As with anything else on the web, you need to have a server script to handle incoming data, so it's all back end work.  Your page will need to call that script and provide parameters to that script that it can read.
    The easiest way I can think of to do this (and this is all highly theoretical, so please make sure it's secure before you implement it) is to create a 1px div that has visibility off.  Whenever you click, you can load your URL in that div, which then increments your counter on your db.
    Hope that helps inspire some interesting solutions!
    -Elaine

  • I am working in Numbers and can't seem to change the generic value assigned to the legend.  Any advice on how to select the legend and save new values?

    I am working in Numbers and can't seem to change the generic value assigned to the legend.  Any advice on how to select the legend and save new values?

    Ntenich,
    If your table has a Header and your Legend text is in the header, it will be picked up by the table.
    Jerry

Maybe you are looking for