How to save a chart after each iteration in a for loop?

Hello,
I have written code which initializes a spectrometer. Once initialized, if the "Capture" button is pushed, the spectrometer takes a new spectrum three times (see for loop) every second. This spectrum is displayed as a chart in my front panel. My code runs fine...it will update the spectrum every second.
However, I want to be able to save each of these three iterations as separate graphs. Basically, I want to click "Capture" and have my code save three charts to a specified folder. How do I go about doing this?
I've attached my VI.
Thanks.
Solved!
Go to Solution.
Attachments:
Spectrometer Iteration.vi ‏444 KB

Use Build Array to make a 2D Array of your X and Y data and use Write To Spreadsheet File to save the data.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • 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

  • How to save JavaFX chart s as images

    how to save javafx charts as images. please help me in this.
    thanks in advance

    Here is my pie2D chart. how to svae it as image file
    Stage {
    title: "Pie Chart"
    scene: Scene {
    content: [
    PieChart {
    title: "What Is Your Favorite Pie?"
    titleFont: Font { size: 24 }
    data: [
    PieChart.Data {
    value: 21
    label: "Pumpkin"
    PieChart.Data {
    value: 33
    label: "Apple"
    PieChart.Data {
    value: 17
    label: "Cherry"
    PieChart.Data {
    value: 29
    label: "3.14159"
    }

  • How to do data validation after each load

    Hi all,
    How to do data validation after each load.
    please send to : [email protected]
    bhaskar

    Hi Bhaskar,
    Check these posts:
    Re: Validation of data in BW?
    Re: validate data
    Bye
    Dinesh

  • How to suspend the installation after downloading packages via ota for lollipop 5.0.1. on my Note 4. always asks me to install it on notification bar. thank you :)

    How to suspend the installation after downloading packages via ota for lollipop 5.0.1. on my Note 4. always asks me to install it on notification bar. thank you

    If you factory reset, it wont make the update go away, but you should back up and reset before you install the update.

  • A tunneled Excel refnum goes from a valid value to a NULL between iterations of a For Loop?

    How would a tunneled Excel refnum go from a valid value to a NULL between iterations of a For Loop?
    For
    some reason this works find in one VI and when executed and not in
    another.  Here's screen shots of the highlighted execution with probes
    appropriately. The "Open" refnum is passed into "Performance Test -
    Write Data To Files.vi".  That's where the trouble is.  You can see
    that it goes into the For Loop.  The first iteration is okay, but the
    second and subsequent iterations have the refnum NULL.  See images
    below.
    (I don't know how to delete an accidental double post, sorry)
    Message Edited by James DiLiberto on 01-22-2008 01:48 PM
    Attachments:
    Second Iteration1.jpg ‏158 KB
    First Iteration1.jpg ‏145 KB
    Second Iteration Error Dialog1.jpg ‏20 KB

    Is there any chance that the Insert Data Into Excel VI is closing the reference or that it is closed anywhere else (e.g. through a local or by having its owner destroyed)?
    I wouldn't expect the numeric value of the reference to change to 0, but since ActiveX is an external resource, I suppose that it's possible that the probe shows the number only if the resource is actually accessible.
    Try to take over the world!

  • How to make a button to stop and run a for loop?

    How to make a button to stop and run a for loop?  and if it is stopped it shall start from where i t stopped.

    Your VI has some very fundamental flaws.
    The start/stop button is outside the FOR loop, thus it will NOT get read during execution of the FOR loop, but only before the FOR loop starts. Think dataflow!
    Thus the terminal of the start/stop button belongs inside the FOR loop.
    Your FOR loop iterates 20x, which probably takes about a nanosecond. You will NOT be fast enough to reliably press the start/stop button during a specific iteration of the FOR loop.
    Your code does not "stop and run" a FOR loop (sic). The loop always spins, but executes an empty case when "Stopped". I guess that's what you actually want?
    Once you solve (2), the x indicator will contain a random value whenever you "stop".
    As soon as the 20 iterations complete, the outer while loop spin an things start over, another nanosecond later.
    Place e.g. a 500ms wait inside the FOR loop to solve this.
    Don't place terminals of indicators on top of formula nodes.
    Your formula does not produce any output, so really has no purpose.
    Use a real "stop" button to terminate the while loop (mechanical action: latch when released). Right now you are using a plain switch, which does not reset to false before the next run. This means that you need to manually reset it before running the program again.
    It is oftern useful to operate the VI in execution highlighting mode. You will immediately see that your button does not get read during execution of the FOR loop. Try it!
    LabVIEW Champion . Do more with less code and in less time .

  • Text input - how set an automated space after each word?

    When typing in text and using the qwerty assisted text - how can i get it to automatically add a space after each word? My Droid original did that automatically... Thanks

    lovetennis7 wrote:
    When typing in text and using the qwerty assisted text - how can i get it to automatically add a space after each word? My Droid original did that automatically... Thanks
    I have confirmed that this feature was not included with the basic software package of the Incredible 2. 

  • How to update an array after every iteration?

    Hi,
    I have a vi that runs fine but the problem is it updates all the data once the vi stops running. I want something like as soon as (for outer for loop) 1 iteration completes it updates the array in front panel, then 2nd iteration it updates again ans so on. Can anyone please help me with this.
    Thank You
    Solved!
    Go to Solution.
    Attachments:
    Add Rows.vi ‏92 KB

    You need to create a reference to the front panel indicator that you want to update. (Right click, create, reference).
    You then feed this reference into the SubVI or loop where you want the update to happen.
    Wire the reference to a Property Node and select the Value Property.
    Whenever you put data into the value, it will update the referenced indicator.

  • How can I have each pass through a for loop communicate with a new indicator?

    Hello,
    I am using 16 color boxes to indicate how 16 channels are behaving.  If a color box is blue, its respective channel is running correctly, red means it has failed etc.  I am continuously checking each channel using a loop, and I wanted to update the channel colors every loop.  I have made an array of 16 numbers corresponding to the color I wish to have (which are blue = running, red = failed, green = completed, black = not in use).  However, I cannot find a way to pull these 16 numbers out of the array and to the color boxes short of 16 index arrays connected to the color boxes. 
    I understand how to convert each individual number to a color, I just don't know how to use a 16 times for loop to communicate with a different color box each pass through.  Is there any way to do this or should I just go for brute force?
    Thank you.
    Solved!
    Go to Solution.

    Sorry I keep making new posts.  Attached is an example i wrote up.  There are three cases in the disabled structure, each has a different implementation of what i belive your specs are.
    Tim Elsey
    LabVIEW 2010, 2012
    Certified LabVIEW Architect
    Attachments:
    update color box.vi ‏24 KB

  • Does any one tried anychart to save a chart as jpg in a blob for reports

    Hi does any body used anychart through plsql to save a chart as jpg in a blob in a table to display it in oracle reports, or for another use.
    Thank you :)

    Hi,
    Have you solved this?
    I have the same problem.

  • Executing each step of a for loop only on a VISA read output

    Hi,
    I would like to give multiple steps to a motor/controller to exectue, but I keep getting a "command overflow" error.  Therefore, I am trying to tell the for loop only to execute when the VISA Read receives an output. I have included the .vi I have written so far. For example, the code /1P1000p66R tells the controller to move motor "1" forward 1000 steps and then to output the number "66" when the motor has moved 1000 steps. My input to the "table control" is, e.g., 3 commands:
    /1P1000p66R
    /1D1000p66R
    /1D5000p66R
    How do I get the code to send each of those commands only when the number "66" is sent back to the program so that I don't get the command overflow error? Also, if anyone has a better way to control the motor to do multiple steps, let me know. I'm pretty new to all of this. 
    Thanks.
    Attachments:
    Motor Controller (Sub VI 2).vi ‏26 KB

    Rather than using a table control, I would just use a string array.
    Set your serial port parameters before the loop.  Close the serial port after the loop.
    Your controls don't have any real data in them saved as default, so I'm confused a bit as to what your are trying to do.  Why do you have a numeric control with the number 0 establishing the loop iterations?
    Instead of a For Loop, use a while loop.  Set the 1-D array of strings to be autoindexing at the input tunnel.  Write the command (why you have everything wrapped in a case statement with a true constant makes no sense.  Do a VISA read.  If the response has the 66 (you'll have to figure out how to parse it out), all is good.  If it does not have the 66, or the number of loop iterations equals the number of commands in the array -1 , then end the loop.
    Message Edited by Ravens Fan on 05-20-2009 09:31 PM
    Attachments:
    MotorController(SubVI).vi ‏18 KB
    Motor%20Controller%20(Sub%20VI%202)[1]_BD.png ‏8 KB

  • How do u create a 2-dim. vector with a for loop(two for's) ?

    JTable is such a pain in the ass sometimes... you see i don't have a predifined number of elements to be stored in the JTable... so i have to pass a Vector[][] but i don't know how to create one in two for loops...
    Vector v[][] = new Vector[][];
    for(int i = 0; i< v.size(); i++){
    for (int j=0; j<v.size(); j++){
    v[i][j] = { "" + (u+1) , ((Team)c.get(array[u])).getName()),
    intoString(((Team)c.get(array.getPlayed()))),
    intoString(((Team)c.get(array[u].getHomeWins()))),
    intoString(((Team)c.get(array[u])).getHomeDraws()),
    intoString(((Team)c.get(array[u])).getHomeLosses()),
    intoString(((Team)c.get(array[u])).getHomeFor()),
    intoString(((Team)c.get(array[u])).getHomeAgainst()),
    intoString(((Team)c.get(array[u])).getAwayWins()),
    intoString(((Team)c.get(array[u])).getAwayDraws()),
    intoString(((Team)c.get(array[u])).getAwayLosses()),
    intoString(((Team)c.get(array[u])).getAwayFor()),
    intoString(((Team)c.get(array[u])).getAwayAgainst()) ,
    intoString(((Team)c.get(array[u])).getPoints()) } ;
    It doesnt work this way because my layout in JTable later needs to be like this....
    uuuuuu uuuuuuuuuuuuuu uuuuuuuuuuuu uuuuuuuuuu
    666666 66666666666666 666666666666 6666666666
    777777 77777777777777 77777777777 7777777
    .. and so and so... do u follow me ??
    Please help me if you can ....

    I might still be mising the point but here goes.
    According to the API ( http://java.sun.com/j2se/1.3/docs/api/index.html ) for JTable, the appropriate constructor is:
    public JTable(Vector rowData, Vector columnNames)
    I'm assuming that the JTable should have one column for each of the items - Name, Played, HomeWins etc. I'll also assume there is an array of Team objects containing the data (if I'm wrong the code should be easy to adjust).
    The columnnames Vector is self-explanatory - add a String object for each column.
    For rowData, you need a Vector of Vectors.
    e.g
    Vector rowData = new Vector[teamArray.length];
    for (int k = 0; k < teamArray.length; k ++) {
      Vector oneRow = new Vector();
      Team team = teamArray[k];
      oneRow.add(team.getName());
      oneRow.add(team.getPlayed());
      oneRow.add(team.getPoints());
      rowData[k] = oneRow;
    JTable table = new JTable(rowData, columnNames);

  • After I put an inner for loop,i don't get any output!

    Hello,
    I have an RTF which does not show the output properly. I had a for-each@section, then i put another for-each to repeat the block of data twice
    The code is as follows:
    *<?for-each@section: Books_S1/Category_S2_Group/On_Rental_S3?>*
    <?Fax_Number_ID10?>
    <?for-each:xdoxslt:foreach_number($_XDOCTX,1,2,1)?>
    Value does not display here!!!!!
    <?Order_Number_DOCO_ID20?>
    <?end for?>
    *<?end for-each?>*
    Please help me on this issue, i must display the value in the inner loop. I think it has lost the data (+for-each@section: Books_S1/Category_S2_Group/On_Rental_S3+) when it steps into the inner loop
    Edited by: Lovvyrules on Dec 2, 2010 10:08 AM

    It should be the other way.
    Can you try this out.
    <?for-each@section:xdoxslt:foreach_number($_XDOCTX,1,2,1)?>
    <?for-each: Books_S1/Category_S2_Group/On_Rental_S3?>
    <?Order_Number_DOCO_ID20?>
    <?end for-each?>
    <?end for-each?>
    Also check the link for an example http://winrichman.blogspot.com/2008/09/multiple-copies-in-bi-publisher.html

  • How can I randomly assign addition or subtraction in a for loop?

    Does anyone have any ideas for how I can randomly assign a for loop to add or subtract random numbers throughout various itterations?  My current code generates two random numbers and adds them together for a set number of itterations.  I need some random itterations to be subtraction.  Thanks in advance!  
    Solved!
    Go to Solution.
    Attachments:
    Screen Shot 2015-06-11 at 7.56.31 AM.png ‏36 KB

    Add another Random Number generator and compare the result against 0.5. Use a case structure around your addition/subtraction operator.
    Seems like you might also want to output which operation actually got picked.

Maybe you are looking for

  • What is this icon in the top-right corner?

    I'm running iOS 5.0.1 on an iPhone 4S and when I run iHandySoft's Quick Scan Pro application, I get an icon that I don't recognize which replaces the battery icon in the status bar. This icon looks like a box with an arrow pointing down and to the ri

  • Handling events in a while loop

    In a while loop, I need to stop the loop after a change of state from false to true or true to false or I can do this by detecting a certain string from the serial port. Seems like I should be able to do this simply by using a counter which is edge t

  • About Calendar Year/Month in demo cube 0D_PU_C01

    Dear Friends,   I'm now working with the demo cube <b>0D_PU_C01</b>,and then I met such a problem:   I download the csv file via a program, and then I found the stucture of the data is not suitable for this cube , so I changed it manually, and when I

  • Intelligent postbox - how to include sent mails?

    hello how can i include 'send mails' in "intelligent postboxes" (not filters!). e.g. an intelligent box for all incomming AND sent mails since 2 days? takk claus <Personal Inforamtion Edited by Host>

  • Unix command for turning file sharing off

    Is there a Unix command I can use to turn off file sharing on Leopard ( as well as Tiger ) laptops? I don't mean a command to kill it for the session, I need it off even if the system is restarted. Yes, I can do it though the Preferences, but I need