use file Spreadhseet read 1 extra row each iteration of the loop

Hello

I wrote a program that uses number of data points according to the specified user to the settings. For each data point, I use a Spreadhseet VI reading to correct each data point according to the calibration spreadsheets I've already saved. For each data point, so I need to multiply/divide it by corresponding values in each spreadhseet of calibration. This corrected number is then displayed in a XY chart as recorded in another worksheet in the corrected values file. I placed indicators at the output of each worksheet VI reading to see what value is read. The program reads the first data in each worksheet correctly point but then to each successive iteration, the number is completely wrong, and I don't know what is happening.

Essentially, I need to know how to read successive lines a spreadhseet file where the number of line that is read is consistent for the number of the iteration of the enclosing loop. I think that the problem lies in my inexperience with this VI because I don't know if I'm seizes my desired correctly parameters.

I joined my program as well as two of the three calibration spreadsheet files related (the third is the same size and the same format as the worksheet example diode). The program is large enough, but the problem is contained in the case of IPCE. Spreadhseets in calibration are taken in the case of IPCE calibration.

Thanks in advance,

Kai

Hello Kai,

You should watch the context-sensitive help from and use the two ReadPosition inputs and output!

You must provide a postion of file line-by-line reading and if you have to remember the position of reading of your last call to read. "Taking into account" can translate to LabVIEW speek by "shift register! BTW. reading a file once and using the data in the table afterwards generally are much easier for these small tables...

But before tackle you this problem, you must get rid of at least 95% of all local variables. LabVIEW is all about the stream, it is not used (or even have) variables to process the data. Your "Overlord" VI is a bunch of (possible) race conditions mixed with a huge amount of RubeGoldberg...

Kennst das deutschsprachige Forum LabVIEW?

Tags: NI Software

Similar Questions

  • How to read the data processed on frm loop on each iteration of the loop?

    Hello...

    I need to display numbers as 1, 2, 3... constantly using the loop on each iteration (IE out of the loop using threads). I generated the numbers 1 2 3... using the back power node... I can read the final value after the last iteration of the loop for.

    I connected an indicator of the loop for. This indicator displays the value as a 4 If the number of loops that 4. I couldn't view 1 2 3 4 an indicator of items at each iteration.

    I'm in a position to read the value of the variable on each iteration of the loop. Please help me fromthis regard...

    Thanks in advance...

    In fact, I'm programming for multiplication of two table 2D.

    I need to select the particular code to perform this action using the structure of the case. who is right for which I need to give the value select 1,2,3 to a case selector, so I finish the task. you got my point?

    Thanks for the reply

  • A generated within a loop in a subvi output data can be transferred to the main program for each iteration of the loop?

    Hi LV users,.

    I have a very basic question, I have not succeeded to asnwer using basic considerations.

    I made a sub - vi that performs a scan of current-voltage using a unit of measurement-source Keithley and a loop FOR.

    The subvi outputs 2 tables with my data (essentially an array of voltage and the corresponding current table). I also defined a Terminal at the exit of a group of these 2 tables in order to plot a graph XY - output. Specifically, I indexed this cluster to update after each iteration of the loop FOR, in my sub - vi (the indicator is placed outside the loop, of course).

    My problem is that I want my main program to display the XY-graph in real time, with an update after each iteration of the loop FOR which is in my sub - vi.

    I have a problem because my sub - vi output terminals are available for the main program concluded as soon as the sub - vi has completed its own execution (which is what we expect of sub - vi to do).

    How can I use a sub - vi (because it's handy) and get in the main program in the course of its performance data that are generated from the loops of sub - vi?

    Thanks in advance for your help,

    Yoyo87

    Elements of the queue in the Subvi them put your main VI where you want to display the data and the.

    It is similar to the architecture of producer/consumer. There are examples of it in LabVIEW. The examples work with 2 parallel loops, in your case a loop (the producer) will be in the Subvi.

  • Graph waveform repeats with each iteration of the loop

    Hi guys,.

    I got some great responses from you many already, so I hope you can help me once more!

    I try now to simply take a voltage that is measured by a sensor, I tied to AI1, and I built a graph of very simple waveform using a DAQ assistant. I have the setup terminal to CSR, the acquisition value continuous sample mode and read samples and rate game to a control on the Panel before which I can control myself. All this is a while loop that is needed to collect data over time.

    However, the problem I have is that for each loop of the loop, it seems, to reset the graph, so my x-axis never increases over time, ideally I want it to do is to show results through from 0 to 100 on the x-axis to say, and then, when it comes to 101, he will start again on the extreme left of the graphic to the right to a crossing another 100 points given) (there's a term for this, but I forgot, sorry!). To be honest, this kind of logic like everything in the loop will be restarted, but after trying to chart the loop it does not work, so I'm fresh out of ideas.

    I think I might have to do is to manually build segments of data acquisition (DAQ mx) and have only certain parts of them in the loop, although I can't be sure. I tried various examples and online on the database of NOR (including tension-int acq & graphic clk which works well in the examples, but not at my request) but no luck for now

    If anyone can think of what could be the problem, then please let me know. FYI the sensor is optical fiber if it makes a difference. I have attached the file VI that I did does not really...

    See you soon!

    Ritchie

    Since you use a chart there is no way to fix it. If you choose to go to a XY chart you could solve this problem. See the example below.

  • How do you give each iteration of a loop IF %

    Subject: Send a signal to step to a stepper motor driver at regular intervals.   My first try to use a loop was a failure because the data is only passed on a loop when the loop ends.   Instead this application requires the data to be passed on a loop on each iteration.

    What happens if changes can be made to a loop for output at each iteration?  Or, if a loop is not suitable for this application which is preferable?

    Howard

    A loop looks like a reasonable approach. But you will have to send the signal to each iteration of the loop, then talk to the stepper motor inside the loop on each iteration. You can also think of calendar of loop (how fast you want to send commands to your engine) and stop the loop (for example, the user clicks on a stop button).

    Another concept, you can familiarize yourself with are state machines. LabVIEW courses cover these, and there are many messages about the machinery of State here on the forum.

  • repeating nodes using loop but when XML string concating then concating only last iteration of the loop FOr?

    I stuck with a problem that I use FOR loop to generate expandable nodes.
    Now when I concat the node generated in the primary node and then I only last iteration of the loop FOR.
    can someone suggest me a way to manage this error...
    BECAUSE me IN 1.pl_phone_tab. County
    LOOP
    SELECT xmlelement ("phone"
    , xmlelement ("PHONETYPE", xmlattributes ('01' AS "dmnADRP_PHONETYPE"), pl_phone_tab (i) .p_phtype_tab)
    , xmlelement ("PHONENUM", pl_phone_tab (i) .p_phnum_tab)
    , xmlelement ("PRIMARY_CONTACT", pl_phone_tab (i) .p_prcon_tab)
    )
    IN p_phone_xml
    DOUBLE; END LOOP;
    SELECT xmlelement ("PhoneInfo"
    xmlconcat (p_phone_xml))
    IN p_phone_info_xml
    DOUBLE;
    Here, I'm a single node, but there must be two nodes for node of PHONE
  • How the entry changes with each iteration of the while loop

    Hello

    can anyone explain (clarify) to know how or what contribution will be fed like the d block of adaptive filtering for the first, second entry (n) and remaining iterations of the while loop as shown in the picture as an attachment...

    As I need to feed the e (n) out of the while loop as input d (n) to the Adaptive block for the first iteration for the next iteration of the previous output e (n) of the block Adaptive must be fed back as input (n) d and other x (n) of entry form the DAQmx.

    Thank you.

    You have a shift register on the edge of the loop, so for the first iteration, the input (n) d will get everything that feeds the shift register on the left of the outside. After that the adaptive filtering performed, e (n) is injected in the shift to the right, register to be read from the shift register on the left on the next iteration. And so on. This seems pretty much what you want.

    PatanGova wrote:

    As I need to feed the e (n) out of the while loop as input d (n) to the Adaptive block for the first iteration for the next iteration of the previous output e (n) of the block Adaptive must be fed back as input (n) d and other x (n) of entry form the DAQmx.

    If you need retain the value in calls, use a node that is initialized in the world of feedback to feed out of the while loop at the entrance.

  • How to save a graph after each iteration in a loop for?

    Hello

    I wrote the code that initializes a spectrometer. Once initialized, if the "Capture" button is pressed, the spectrometer takes a new spectrum three times (see loop for) every second. This spectrum is shown as a diagram in my front. My code works fine... it will update the spectrum every second.

    However, I would like to be able to record each of these three iterations in the form of separate graph. Basically I want to click on "Capture" and have my code to save three graphics to a specified folder. How can I do this?

    I have attached my VI.

    Thank you.

    Probably the easiest is to take the data of the for loop and pass out in a tunnel that is indexed.  Manipulate the resulting data table you want.  You could also do a producer/consumer and write files as the data comes out.

  • How to reset a variable after each iteration of a loop?

    Here's the code if you need to see. 'fact' is what I want to zero whenever the factorialN method completes. Thanks in advance.
    import java.util.Scanner;
    
    public class Factorial {
         static int fact = 1;
         static int newNum = 0;
         /**
          * @param args
          */
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              char answer;
              do {
              System.out.println("What is the number? ");
              Scanner keyboard = new Scanner(System.in);
              int num = keyboard.nextInt();
              factorialN(num);
              Factorial aFactorial = new Factorial();
              System.out.println(aFactorial);
              System.out.println("Do you want to continue? y/n ");
              String answerString = keyboard.next();
              answer = answerString.charAt(0);
              }
              while (answer == 'y' || answer == 'Y');
    
         }
         
         public static void factorialN(int num) {
              while (newNum < num) {
                   newNum ++;
                   fact = fact * newNum; }
         }
         public String toString() {
               String returnValue = "Its factorial is " + fact;
               return returnValue;
            }
    }

    What is the problem? Declare the method as "int" instead of "void" and the return value.

  • How to add items to a table 1 d with each iteration?

    Hello

    I have a 3 loop iteration For which gives a table of 5 elements after his execution. At each iteration of the loop, how can I add each item to its previous value to form a final picture of the cumulative sum of the parts? For example:

    Array of values for 1st iteration: [A, B, C, D, E]

    Array of values for 2nd iteration: [F, G, H, I, J]

    Array of values for the 3rd iteration: [K, L, M, N, O]

    How can I make the Final table being a cumulative amount of IE: [(A + F + K), (L + B + G), (C + H + M) (D + I + N) (E + J + O)]?

    Your help will be apreciated, thanks!

    The Add function is polymorphic. So, if you give 1 2 tables you will get a table that corresponds to the sum of each item. With a loop, you must use a node registry or feedback shift to keep track of the sum of the currents.

    For example:

  • loop nested using iteration of the outer loop as counter

    Hello world.  I have a moment where I perform calculations at each iteration of the loop and display on the front panel.  Then, in a loop iteration randomly (referred to here as I = 9 to test) it fires an event where that performs calculations on x number of iterations (iterations of the outer loop while) the result of external calculations, while performing at the same time and the view from the outside so that the calculations of the loop.  Is that two mathematics algorithms are synchronized in iterations.  After x iteration the program returns then to only calculate and display the while loop calculations using the value from the shift register, updated until another event is triggered (I do not show an another event trigger in the code example) I can just find a way to trigger an event , and at the same time to make two calculations with the same loop iterations.  Any suggestions?

    The VI of the sample in the previous post of crossrulz should provide the functionality you are looking for. The while loop acts to go through ten operations you want to perform and records time difference will allow him to record these values, as you understand. I think that crossrulz refers to shift registers on the while loop that surrounds the case structure that records the shift are unusable on a structure of the case, as you pointed out.

  • Why can't just open and use files Z5 for a text called 'The Theatre' adventure game?

    I'M in TRAIN OF DOWNLOAD AND USE FILES/PROGRAMS to PLAY TEXT ADVENTURES ESPECIALLY ON CALLED 'THE THEATRE' [A TEXT ADVENTURE USING A z5 FILE HAD each time I HAVE TRIED TO OPEN AND RUN IT I KEEP GETTING THE MESSAGE WINDOWS don't IS NOT RECOGNIZE this TYPE of FILE. ANY HELP PLEASE.

    To simplify things, download and install the Windows version of
    http://www.ifarchive.org/if-Archive/Infocom/Interpreters/Frotz/WindowsFrotzInstaller.exe

    I just tried and, once installed with all the default options, you can double-click a .z5 file to launch the game and interpreter.

  • Difference b/w reading synchronous file and read the file adapter Service

    Can someone tell me the difference between synchronous file read the service and the service of simple reading of the file adapter functions.

    where exactly do we use the synchronous file service? Please give me some example of scenario where we can use file synchronous read characteristic of service...

    Synchronous reading is used for playback of files mid process. People tend to use for consuming files based on a business rule. You can specify which files you want to read. An example of this would be an an email is sent telling the faile abc.csv has been downloaded. The BPEL process shuts down gets it. You can also cheange the location of the file dynamically in the process as well.

    Using the file adapter is used to call a process so when a file is placed in a place the BPEL process is called. It is most commonly used.

    see you soon
    James

  • How insert elements into a table after each iteration of a for loop

    I'm new to labview and work on an application where I'm supposed to store an element in an array (without crushing) after each iteration in a loop for. I tried using function Array build, keeping the flag outside the loop for and played with indexing, but did not work. Please suggest me an idea how to do it.

    Thank you

    It would be better if you attached the real VI.

    None of your images show an operation 'insert into array.

  • If doesn't work is not inside the loop for the registration of the declaration file?

    Hello!

    I have the following documents open in Photoshop:

    123456_mrp_ou. TIF

    869548_mrp_ou. TIF

    896589_mrp_in. TIF

    896589_mrp_ou. TIF

    .. and I have this if statement in a loop for to search for files with a specific 'pid' number and save them in the folder My Documents:

    var originalPid = 896589
    for(i = 0; i < app.documents.length ; i ++) {
          activeDocument = app.documents[i]
            if(activeDocument.name.substring(0,6) === originalPid) {
                    var standardSave = new File('/Users/constantincerdan/Documents/' + activeDocument.name)
                    activeDocument.saveAs(standardSave, TiffSaveOptions, false, Extension.LOWERCASE)
    }
    }
    
    
    

    It did not find the two files and save them when I run. However, the loop without if statement runs very well and saves all the documents in the Documents folder:

    var originalPid = 896589
    for(i = 0; i < app.documents.length ; i ++) {
          activeDocument = app.documents[i]
                    var standardSave = new File('/Users/constantincerdan/Documents/' + activeDocument.name)
                    activeDocument.saveAs(standardSave, TiffSaveOptions, false, Extension.LOWERCASE)
    }
    
    
    

    How it works with an if statement so that it saves only the two?

    Any help is very appreciated!

    You are comparing apples to oranges, you need to compare strings.

    originalPid = 896589;

    alert (typeof originalPid);

Maybe you are looking for