Output graphics of two loops for

I would like to see a graph of the output generated in both loops for.

X: steps (i x I have two loops)

Y: Y1 should graph the polar output

Y2 should chart the Azimuthal output

Probably very simple to resolve/upgrade in place.  (The output file works fine).

Thank you

Kevin

Good work Kevin.

I have some suggestions for you (I don't know what it will be eventually, because then maybe they're based):

  • If the data do not change over time, you can use a graphic instead of a graph; Whatever it is, reduce the necessary processing power by updating the two parcels only once for a full run of the outside loop (see below)
  • You have a lot of indicators that are not obviously necessary (they simply out what puts out control - off 4;) Stop 5; Polar; Azimuthal, etc.).  When you submit here, the code is more it is easy to understand and faster you get an answer (minimal document also helps understand us what all is for).
  • Use the decrement vi but don't take it off 1 (reduced the increase in code).
  • Avoid strain - explicitly cast I32 to double so that no appeal should be made to the Manager of memory running (will reduce your footprint of memory of codes).
  • Written file are intensive and bays of building CU generally allocate dynamically memory - try to avoid these as much as possible.  In your VI, you can write to the file once when all iterations are complete.  This will reduce the runtime of the VI.

Anyway, there are a whole bunch of thoughts that you probably care to hear, but I hope they have been helpful.

Cheers, Matt

Tags: NI Software

Similar Questions

  • synchronization of two loops for...

    HII...

    I am using two loops for and I want each iteration for both loops start at the same time...

    in fact I want to sync between these two loops...

    so when the each iteration of the two loops will start at the same time then these will be synchronized...

    also if a loop takes more time in an iteration the other loop should suspend until the end of the iteration of the other...

    please me... thanks hlp...

    Hi samir,.

    two options:

    1: when both FOR loops should have same time iteration why not just put all the code in a loop FOR?

    2nd: when 1 is not possible/wanted, you can use a notification utility. Set the notifier early iteration of the first for a loop and wait for the signal in the second loop...

    3rd: use call loops and synchronize them...

  • synchronize two loops for written tdms data acquisitions

    Hello

    I have two loops of different data acquisition. A slow acquisition of CAN (10 s/s) and an analog acquisition faster (30 samples taken at a frequency of 300 Hz), I need to synchronize these data for tdms writes for later analysis in DIAdem.

    My example and the result in the DIAdem channel list is attached.

    Thanks in advance!

    Magnus

    Magnus,

    for a professional solution, you do not want to synchronize the devices on a hardware level. Since the material CAN work differently to 'traditional' DAQ devices, there are important things to take care of.

    Please look in the viewfinder to LV example for the word "CAN". For example, you can choose the example 'several cards CAN and DAQmx map Wfm Input'.

    Norbert

  • loop of two producers for quick DAQmx and the user controls?

    Hello

    Sorry if my question is maybe a bit too general (I don't have a VI implementation yet).

    I think about the solutions for a Structure of producer-consumer with event loop in the part of the producer.

    So far, if I had to do a project with DAQ, data analysis, data recording and enter the user controls, I've followed usually this kind of approach:

    I used the producer part to capture interactions with the user, and I also had a state machine in the part of the producer, with registry change. I also buy (any faster then 10ms) DAQmx device data in the part of the timeout of the structure of the event in the loop of the producer. I have several consumer loops down, such as data analysis, data recording, etc... I send the data measured in a cluster with the enumerations of the State of the loop from producer to consumer with queue loop.

    I'm not happy with my approach for the following reasons:

    1,

    If I need device acqure faster DAQmx data that the operating system clock can handle (like 1 MHz), so I can't put it in the part of time out of the structure of the event of the producer loop, because here I can go through the while loop with minimum 1 ms.

    2,

    If I put this part DAQ in a loop for quick consumption, it is not admissible for orders from the QUEUE line after that it starts to run (assuming that I use the standard structure of producer-consumer, so consumer loop every time iterates once, when a package comes from the Dequeue).

    Then say, how can I control a young (timed by DAQmx device internal clock) loop of data acquisition of the structure of the producer of the event loop? As loop DAQ to start, stop, restart, etc...

    Thank you very much for the advice!

    You can certainly have several loops of producer.  Have a User Interface, loop driven events to send commands and a separate data acquisition loop to send data are not a problem.  Each loop has a separate queue. (You might be able to make it work with a single, but using two queues avoids many problems).  Often, I used a system of three loops long before that everyone was talking about calling it a producer/consumer.

    Lynn

  • How to call two variables that are to keep several value in loop for

    Hello

    I have 4 point, two list and two checkbox select. ID and class Section are select list and student id and the id of the object are check .i want to insert more id then a topic in the table corresponding to the student id then a plus.

    for example. When I select the IDs of class 1 and section A then student of class 1 and section has come into student card (checkbox element) and all the object corresponding to the class 1 comes in the object id (item checkbox).

    now I want to insert several selected for what is, multiple student topics in at table when I press submit Button.

    My table is

    CREATE TABLE 'STUDENT_SUBJECT_DETAIL '.
    (NUMBER OF 'S_NO',
    NUMBER OF "STUDENT_ID,"
    VARCHAR2 (50) "SUBJECT_ID",.
    "SESION' VARCHAR2 (50)
    )
    /


    I use this Code

    DECLARE
    STU wwv_flow_global.vc_arr2;
    VOID wwv_flow_global.vc_arr2;

    Start
    STU: = wwv_flow_utilities.string_to_table(:P57_STUDENT_ID);
    SUB: = wwv_flow_utilities.string_to_table(:P57_SUBJECT_ID);
    I'm looping 1.STU.count
    I'm looping 1.SUB.count
    insert into STUDENT_SUBJECT_DETAIL
    values (CLA_SUB_ID_SEQ.nextval, Stu (i), (i) Sub,: p57_SESION);
    end loop;
    end loop;
    END;

    Published by: Ed on November 20, 2009 22:10
    DECLARE
        STU wwv_flow_global.vc_arr2;
        SUB wwv_flow_global.vc_arr2;
    BEGIN
        STU:= wwv_flow_utilities.string_to_table(:P57_STUDENT_ID);
        SUB := wwv_flow_utilities.string_to_table(:P57_SUBJECT_ID);
        FOR i in 1..STU.count LOOP
            FOR i in 1..SUB.count LOOP
                insert into STUDENT_SUBJECT_DETAIL
                values(CLA_SUB_ID_SEQ.nextval,STU(i),SUB(i),:p57_SESION);
            end loop;
        end loop;
    END;
    

    None good for me:

    1. you have 2 loops, and they are both using the variable I as a counter.
    2. your insert must be in the form: insert into table (column names) values (to be inserted)
    3. why not use a trigger to get the nextval in the sequence?

    Trent

    Published by: tr3nton on November 21, 2009 16:16

  • Synchronization output analog and an entry for imaging

    Hi all

    I'm stuck in my higher studies project and really need help. I tested an imaging system, where one uses two mirrors MEMS to analyze the sample and a tube set (PMT) allows to acquire voltage signals and translate them into images of scanning laser.

    I use the same DAQ card for input and analog output. The DAQ card sends features X and Y of the MEMS mirrors so that the reason for scanning 2D starts left to right and up and down.

    Scanning rate: 131500 pixels per second.

    Size: 1170 by line, 514 ranks in total pixels.

    Thus, the mirror will scan 601 380 pixels per image, which takes approximately 4.57 seconds to complete. I almost finished this part in LABVIEW.

    However, only a part of the scanned pixels are read by the PMT. We want to get an image of 512 x 512 pixels. For example, the PMT works like this:

    (1) the sampling rate is also 131500.

    (2) skip the first row.

    (3) starting at the second row, the PMT will jump the first 329 pixels, read in the next 512 pixels and skip the rest 329 pixels again. Then, it moves to the next line.

    (4) jump the last row.

    My approach in the plate sequence

    (1) ignore the signals of all 841 (1170-329 = 841).

    (2) create a loop for, run 512 times.

    (3) in each loop, first jumping 658 signals (329 x 2), then read the signals then 512 MB.

    (4) wait 1499 pixels left to complete the digitization (1170 + 329).

    Problem

    The mirror and PMT must start and finish at the same time running. However, when I run my VI for the analog input and create the image on the Panel, it takes 5.7 seconds to complete, which means that they are not at all synchronize. It seems that there is some unexpected time in the loop for, but I don't know how to change the code to meet the requirement of calendar.

    Please see the attached VI. Any help is greatly appreciated.

    ~ Sheng

    My approach in the plate sequence

    (1) ignore the signals of all 841 (1170-329 = 841).

    (2) create a loop for, run 512 times.

    (3) in each loop, first jumping 658 signals (329 x 2), then read the signals then 512 MB.

    (4) wait 1499 pixels left to complete the digitization (1170 + 329).

    Consider this: add up all these pixels, both those you want to record and those you want to ignore.

    If I read you right, that would be:

    841 + 512 * (658 + 512) + 1499

    Regardless of this number, set up a task that many samples and record the whole bloody thing.  Let the time of equipment for you.

    Then, AFTER that data are in hand, pass by and throw the first 841 points, then for each loop, throw away 658 and keep 512... etc.

    IOW, let the MATERIAL which made the better material: precise timing.

    Let the SOFTWARE do what does best software: weird logic.

  • Clear out in a loop for

    Hi guys,.

    I have a problem, so I activate timed values on the outputs analog of my RedLab card.

    The problem is that when I stop the program, the outputs are always activate.

    How can I solve this problem?

    Best regards from max

    What version of LabVIEW?

    I forgot which version he presented, but lately, you can add a CONDITIONAL TERMINAL to a loop FOR.

    Use it to stop the loop if the user clicks a button or if the voltage exceeds 3.14159 Volts, or whatever.

    You can also use a basic while loop, set the AUTOMATIC indexing entries and compare yourself 'i' to N - 1, in the loop.

    Stop BUTTON so STOP = TRUE or i = 3.14159 > N-1 or V...

  • Creating a table of automatic indexing of loop for

    Hello and greetings from a newbie to LabView,

    In my program, I want to write several orders via VISA and read them in order. I created a table of command and auto-indexé to a loop for.

    I want to receive a table of responses, in the order they were read of course. However, I'm not sure what is the best way to do it.

    I'm sure that the solution is simple but have been unable to find one. I have attached the vi for reference. (VISA vi reading is part of the LabView unit driver), which works, but looks like a unmodular approach and inelegant.

    Thank you!

    Simple, you can auto-index the output!

  • Create a table in a loop 'for' (reset the number of loops)

    Hello

    I try to incorporate a signal of acceleration from an analog input CRIO to get speed and then further integrate to get the moving of a vibration system.

    I understand that to achieve integration, a table must be fed in. My problem is that I could not buffer the signal in a buffer block, as I couldn't find buffer blocks. so I decided to create my data table by using a loop "for". The nests of the loop 'for' inside a timed loop. The problem that I'm stuck on is how to reset the loop 'for' in order to fill the buffer with each iteration of the outer loop timed.

    I enclose the code if that helps. Note that I use labview in 2013.

    If anyone who has encountered a similar problem before can help me, I would be gratefull.

    Concerning

    Ali

    You can use a shift register initialized as inputs to your curls, to build your table of one. However, you realize, don't you, that the execution of your program as written loops as soon as the computer can spit out responses, then the output array may contain several points that took place before the entry has updated? Assuming that your thing cRIO (I've not worked with these) has integrated into its routine acquisition of calendar data, I suggest you put that inside the loop to get a data point by reading.

    And do you really want your graph to distance for update only every thousand points (points of acceleration million) speed?

    Cameron

  • make a graph in real time of 1 DBL value at a time, using a loop for

    I have a somewhat interesting programming task where I have the following situation: (I have attached a mac version of vi Labview 2013)

    -Using a patented (pre-made and uneditable) sub - vi, who receives a value of 0 or 1 as input and reads off a single measure, whenever he receives 1 while a value of 0 is necessary to 'reset' of the vi to rehearse a new measure.

    -I would like to run this sub - vi repeatedly in a loop For each value of "measure" are sent to a curve of waveform to give a direct value (real time) for the graphic to display.

    -As it is, I have a vi file that simulates action in a loop but built in a 1 d array to get exuent values sent a waveform curve.

    -I don't know how to make a real-time graph which receives 1 value double both.

    -In addition, I want only every 2nd value sent to the loop for, but I already have several ideas on how to do it.  First of all, I am concerned about the target in real time.

    Kyle Shiel

    A graphic, not a graphic, allows you to update a point at a time. It would be inside the loop for. update the chart or not, you can use a select statement or the structure of the case.

    These are pretty basic functions in LabVIEW. Please see the free tutorials.

  • 2D Array output confusion - arrays and loops

    Hello

    I am writing a program for a measure 3-terminal of a FET.

    I use 2 power supplies: for every increase of grid voltage Vg, I'm doing a drain voltage Vd Sweep and save the Id and Vd.

    The attached code, you'll see a Subvi, called "I.V. 2 terminals", which returns a table of voltage Drain (1 d) and a table current Drain (1 d).

    But because the output of the Subvi is in a loop (For increment Vg), the end result is a 2D array.

    Whenever a table is leaving a loop it acquires a dimension.

    So ultimately I don't know what are the clues. How can I prevent the table to have a dimension of their out of the loop For?

    I would like to see the output of the Subvi to go straight out of the loop, intact.

    I have attached the Subvi as well, but I don't think that you will need.

    Thank you! I'm still very new to LabVIEW and I really appreciate your help.

    Nicolas

    You can disable autoindexing on any tunnel by clicking right, with evidence that cause you only get data from the last iteration. Is what you want?

  • two loops of consumer a producer, dequeue even item in two consumer

    Hello!

    What is the best way for the following:

    I have given in my loop of producer enqueu. I need this data dequeue-d in both loops of my intake, but I want to dequeu the same element in two loops.

    Of course if I take off in two loops, then the second loop of consumer will lose the odd elements and the first loop of consumer will lose the same elements.

    Thank you!

    Hello

    Create two queues or use notifiers...

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

    Someone at - it ideas for how can I randomly assign a loop for to add or subtract from the random numbers throughout the various itterations?  My current code generates two random numbers and added together for a number of itterations.  I need a few itterations randomly to be subtraction.  Thanks in advance!

    Add another random number generator and compare the result against 0.5. Use a case around your addition/subtraction operator.

    Looks like you might also want to exit what operation is in fact taken.

  • VI is jump a loop "For".

    Zipped VI is fixed, the upper level has "7_AD-DC producer consumer" as the title.  You will have to dig into the folder for access.

    I have attached a picture of the Vi, highlighted in red is the loop in question.

    The problem I have is that when I run the vi has the range of 0.25 to 0.5 Volt (chosen in the loop of producer not shown), it works fine, but if I run the vi put on the beach of 1 volt, it ignores all highlight loop, and finishes just the event.

    The program aims to help the particular device calibration.  If you follow the path of the error, it crosses the upper part (1605, 1605 mode range, range of AC - DC, the factor N, etc.) all the way through the indicators for "1 k reference in ' and ' 1 k reference on.  The program runs right up through these measures of reference, but when it is in range Volt 1 (shown in the picture) it ignores the entire for loop.  I son of error in all, and I thought that those who would prevent race conditions and they would oblige the Vi to run as expected, but apparently not.

    It's kinda a Vi spaghetti, I'm not the best with LabView, but it seems so strange to me that it works when the value 1/2 a volt but don't not 1 volt value.  I put the indicators on the elements that fuel the loop For, the number of frequencies and the tables of frequencies look good and I can't really think what causes violence to ignore the loop for.

    The for loop is not in 'jumps' it of executing 0 times and out of default data for all tunnels.

    You have an entrance tunnel auto-indexé why wire terminal N at all? The loop will be the least number of iterations it can.  N times, either the smaller auto-indexd table is something less.

    EVEN worse: the indexed table auto comes from a tunnel exit case structure value "Use default if unwired" so you have two options.  There is a hidden code clear the Board before being sent out of the cases showed, OR the value of the number of frequencies is<>

  • 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.

Maybe you are looking for