"multiple loops"

I am creating a multiple-loop (4) process control VI that passes 2 basic types of data between loops, i.e., an integer array and clusters. Originally queues were used to transfer the data, but I ran into problems when trying to dequeue more than one queue per loop. I next tried functional globals, but were just too slow to prevent the empty queue syndrome. Next came global variables, which proved to be the fastest, contradicting all conventional programming practices. All this experimentation was done on a single-core PC. I now have implemented the code on a multiple-core (4) PC. Does the use of global variables relagate the mutliple-core architecture to single-core execution? Perfmon indicate 25% CPU usage, don't know if this is one processor doing 100%, or 4 x 6%? I have seen a global queue used to transfer data, which sounds like an oxymoron, but could this be a good way to go?

LabVIEW will automatically make use of multiple cores/CPUs. If you want more precise control you can use a Timed Loop, as those allow you to specify which core to use. You may also want to take a look at the information in the Multicore Programming part of the NI site.

Similar Messages

  • Multiple loop in one loop

    Dear experts,
    Please find the code below.This is text variable customer exit.Can u ple help me to put these multiple loops into one loop.Do u suggest this code is ok?
    Appreciate your help.
    WHEN 'ZSTXTPE01AA'or 'ZSTXT0FISCPER305AA'or 'ZSTXT0FISCYEAR01AA'
    INCLUDE Z_VARIABLES_TEXT
    DATA: vtype i,
          fisper i,
          fisyear i
    IF I_STEP=2.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0VTYPE01AA'
    vtype=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= vtype.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0FISCPER305AA'
    fisper=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= fisper.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0FISCYEAR01AB'
    fisyear=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= fisyear.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    Rgds
    ACE

    LOOP AT I_T_VAR_RANGE INTO loc_var_range
    WHERE VNAM IN('ZS0VTYPE01AA', 'ZS0FISCPER305AA','ZS0FISCYEAR01AB')
    vtype=LOC_VAR_RANGE-LOW.
    endloop.
    L_S_RANGE-LOW= vtype.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    L_S_RANGE-LOW= fisper.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    L_S_RANGE-LOW= fisyear.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    try the above code
    also
    What u r doing inside ur loop endloop?

  • Multiple loops in one loop for text variables

    Dear experts,
    Please find the code below.This is text variable customer exit.Can u ple help me to put these multiple loops into one loop.Do u suggest this code is ok?
    Appreciate your help.
    WHEN 'ZSTXTPE01AA'or 'ZSTXT0FISCPER305AA'or 'ZSTXT0FISCYEAR01AA'
    INCLUDE Z_VARIABLES_TEXT
    DATA: vtype i,
          fisper i,
          fisyear i
    IF I_STEP=2.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0VTYPE01AA'
    vtype=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= vtype.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0FISCPER305AA'
    fisper=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= fisper.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0FISCYEAR01AB'
    fisyear=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= fisyear.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    Rgds
    ACE

    Hi ACE BW,
    You can try to use the SELECT statement and then include the LOOP inside it.
    Thanks,
    Daniel

  • Multiple Loops folders causing delayed loading?

    I have installed Logic Studio and GB and updated all the software, restarted the computer and I find that some of the new loops or instruments in GB take 2 to several minutes to load up. Loops and instruments like Timpani. I have several Loop folders:
    Libraries > Application Support > GarageBand > Apple Loops or Apple Loops Index. There is NOTHING in the Apple Loops or Apple Loops Index folders.
    Libraries > Application Support > Audio > Apple > multiple folder with info in it including > Apple Loops for GarageBand and > Jam Packs
    In the Libraries > Application Support > Logic (folder) there are no Loops
    Should I move the Loops to the have GB access them more quickly? Alias folder and how do I create that?
    THANKS!
    A teacher who wants to upgrade her Lab for 200 students!

    To do this, in iTunes go to Edit>Preferences>Advanced Tab>General Tab and then uncheck the "Keep iTunes Music Folder Organized" box.
    That has nothing to do with iTunes looking for music on your computer.
    Keep iTunes music folder organized will create a folder hierarchy of artist and album names that contains all relevant audio files with the correct track names and order.
    When you run iTunes for the first time (only), it asks to search your computer for music.
    After the first time, the ONLY music that will get added to iTunes is the music you add. iTunes does not add music based on what you put in folders. It does not "watch" to see if anything is added to a folder.
    If you do not want music copied to the iTunes music folder when adding to library, (and you want the music in your own folders somewhere else), set it in the prefs.

  • How do i copy several tracks at the same time in Logic Pro or is there a way to set multiple loops in one song?

    For example in an AABA song format, do I have to record the 3 As and then do another to fade out and end?  Seems like it would be much easier to create the part once and tell LP how many times and when to repeat each part.  HELP!!

    Do you have to copy each track separately? It would be much easier if I could select all the tracks together for copying/pasting.
    You cannot select multiple tracks in LP9, but you CAN select multiple regions. Use Shift-Click to select the parts on the tracks you want to copy, then hold the "option" key and drag them to the new position. This will create a copy at the new position.
    Let's say you have tracks for piano, drums and bass. In the arrange window, click on the 8-bar "A" part for piano. Hold shift key and click on the drums region then again for the bass region. All three will be selected. Now hold the option key and drag all three sections to the right to place them on bar 25.
    Also, how do you specify that you only want to loop X times? I can get a perpetual loop but I have to turn it off to get it to stop.  This is very inconvenient when I'm playing.
    You can control looping in a few ways.
    1. Go to a region that does NOT have looping checked. Click near the TOP RIGHT of the region in the arrange window. Drag to the right to specify where the looping will stop. This is tricky... if you click too low, it will extend the length of the region. You must click the correct spot near the top to control looping.
    2. For a region where looping is checked, go to the end of the region in the arrange window (at the end of the song) and do as #1 above. Drag to the left until you reach the point where you want the region to stop looping.
    3. Use the "pencil" tool to create a blank region where you want the first region to stop looping. If your 8-bar verse is repeating once, create a blank region at bar 17. The first region will stop looping there.
    Hope this helps.

  • Xml newbie - multiple loops for children in xml?

    Hi all,
    I am hoping someone can help me with this!
    I have what I guess is a pretty basic xml that I need to parse and insert in a table. I have the basic code where I loop through the node list and assign values in the table type, and then insert into the table.
    However, I have multiple levels of data that I plan to insert in one de-normailized table. So, for example:
    <POHDR>
    .. some fields...
    <POLINE>... several fields of info ...
    <PODISTLINE> ... more pieces of info ...
    </PODISTLINE>
    </POLINE>
    <POLINE>... several fields of info ...
    <PODISTLINE> ... more pieces of info ...
    </PODISTLINE>
    <PODISTLINE> ... more pieces of info ...
    </PODISTLINE>
    </POLINE>
    .. multiple such lines
    <POHDR>
    <POHDR>
    <POLINE>... several fields of info ...
    <PODISTLINE> ... more pieces of info ...
    </PODISTLINE>
    </POLINE>
    <POLINE>... several fields of info ...
    <PODISTLINE> ... more pieces of info ...
    </PODISTLINE>
    <PODISTLINE> ... more pieces of info ...
    </PODISTLINE>
    </POLINE>
    .. multiple such lines
    <POHDR>
    All this would go in one staging table with multiple lines of po_header, po_lines and distribution lines information.
    I have the pretty basic generic code, where I do the loop and assign values:
    v_parser := xmlparser.newParser;
    xmlparser.parseclob (v_parser, p_po_clob_file);
    v_doc := xmlparser.getDocument (v_parser);
    xmlparser.freeparser (v_parser);
    v_po_nl := xslprocessor.selectNodes(xml.makeNode(v_doc), 'POFILE');
    FOR i in 0.. sys.xmldom.getLength(v_po_nl)-1 LOOP
    v_po_n := sys.xmldom.item(v_po_nl, i)
    v_po_rec.extend;
    v_po_rec(v_po_rec.last).ponum := sys.xslprocessor.valueOf(v_po_n, 'PONUM');
    ...... etc.
    ... and then the insert.
    But I don't know what to do about getting the PO line and PO Distribution line child items. I guess I could do :
    v_po_rec(v_po_rec.last).polinnum := sys.xslprocessor.valueOf(v_po_n, 'POLINNUM');
    but wouldn't I need to do another loop to find the child line items - and then another to get line distributions?
    Please help!
    Thanks a lot!

    Thanks - and yes, understood.
    However, my XMLType data is not in a XMLType table (just a column of a regular table), so I cannot use the extract functions.
    I am not using XML Schemas - right now that is not in the works. We may look into that later.
    I did try using xmlsave - but again, that just saves the data in top rowset (PO Header, and does not insert any line items in the table)
    Isn't there a way to do this with just a loop? I tried looking at your child example Re: How to use PL/SQL to read and manipulate data from a xml file , but that does not loop to go through multiple children..
    Is there a way to do this with a loop using xmldom? Or a way to do it using xmlsave (but also saving the child rowsets?
    Again, any help will be most appreciated - if you can tell me there isn't then I will look into one of the other options.
    Thanks again!

  • How to make chart from multiple loops without local variables

    Hi,
    It is my first experience in LabView.
    I did a program that communicate with Power Supply Device via RS232, sets an output voltage and read Voltage and Current in some sort of a program: Voltage goes up, staying in some value and then goes down. So there are many FOR LOOPS that sequensed one after another.
    I need to make a 2 live Charts (one for current and second for voltage), and the only one solution that i could obtain is using local variables. BUT also I need to export my data to the file after the end of the program (with real elapsed time for collecting data points) and with the use of local variables I cannot do so. Maybe the Shift Register will work, but I could not make it work.
    Thank you for help.
    Attachments:
    test.vi ‏47 KB

    You have multiple, deeply stacked, sequential loops. Way too complicated.
    All you need is a simple state machine architecture using a single loop and a single instance of your charts. No local variables needed. Simplify!!! You could even graph both values on a single chart.
    Look at your code. It is basically repeating the same thing with slighly different inputs. You only need to change the inputs based on state, and re-use the same IO function instances. Only one instance each needed.
    (you also have some misguided autoindexing near the middle of your code. Bad!)
    LabVIEW Champion . Do more with less code and in less time .

  • Create multiple looping videos on one DVD

    My client wishes to have a DVD with multiple video selections on the menu and the option to have those videos loop when they are selected to play, so they will play endlessly until they choose another video. Evidently this is going to a trade show of sorts. Is there a script or a setting that will prevail on this matter. I know that on the main menu there are loop settings but not on tracks or have I missed something? Anyone with suggestions?

    Myles:
    Check this recent thread:
    http://discussions.apple.com/thread.jspa?threadID=810404
    You can use stories to create normal and loop playback tracks without scripting.
    Hope it helps !
      Alberto

  • Problem with multiple loops

    Hi all,
    I recently wrote my first VI for a soil consolidation test, which reads voltage measurements from an LVDT, keeps a moving average, and records the LVDT measurements versus time an XY graph.  Everything is contained in a while loop with a stop button and works just fine.  However,I'm having some trouble scaling this approach up for multiple LVDT measurements at once.  What I want to do is this:
    I have a while loop with a relatively short time delay that reads all channels in my SCC system at once.  My DAQ Express VI is set to acquire 1 data point on demand.  Then I send the dynamic data type wire out of the loop and convert the data for each channel to a different scalar value.
    Next, I have another while loop for EACH channel/consolidation test.  I'm doing this because I want each loop to have the potential cycle at a different rate, depending on the soil type I'm testing on that particular LVDT.  For example, on Test 1, I may want to acquire a point every half second, whereas for Test 2 I only want a point every 5 minutes.  I'd assumed the best way to do that would be to have ONE DAQ VI set to acquire all channels at a relatively high frequency (as I mentioned before), and then have each test go "get" the appropriate reading when it needs one.  I don't think I want to use a queue, because I may be skipping quite a few data points in between the ones I actually care about.
    This is the approach I'd thought up, but the concept could be completely wrong.  To make a long story short, I want to acquire time elapsed/voltage data for 5-6 different channels at different rates.  I want each channel/test to be contained in a different loop so that I can compute individual moving averages for each one.
    My problem is getting the multiple while loops to work with one another.  My 'secondary' loops for the individual channels don't seem to be cycling.  If I put a probe on the data tunnels, I get nothing passing out of the first loop containing the DAQ Express VI.  However, everything within that 'primary' loop works just fine.  If anyone has any suggestions, I'd greatly appreciate it.

    Here's what I had in mind (LabVIEW 7.0).
    Message Edited by altenbach on 04-26-2006 01:25 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    SampleFewer.vi ‏53 KB
    SampleFewer.png ‏9 KB

  • Dynamic event multiple loops

    I'm trying to see if I can use one Dynamic User Event to control multiple Event Structures. It seems that sometimes once a dynamic event occurs and its "interrupt" is answered by an event case, other VIs only have a short amount of time (<50ms) to reach their event case state for accepting this event otherwise the event seems to be cleared and the other VIs are oblivious that the event even occured.
    My Question: Is it possible to use one dynamic event to control multiple Event Structures reliably?
    A previous post somewhat speaks of this issue but does not provide a solution or anything insightful.
    http://forums.ni.com/ni/board/message?board.id=170&message.id=223495&query.id=135563#M223495
    I've included an example of my issue
    Attachments:
    DynamicUE.zip ‏61 KB

    Thanks to both of you. I found the answer to my question in the second posted link. "the common, correct use case is to have one Event structure per dynamic event registration". I tested this out with the previous attachment by registering the User Event refnum from the ESTOP functional global to another Event Registration node. I then ran this refnum to the top loop. (instread of the top loop sharing the registration refnum with the middle loop). Now I can put a delay of 2000+ ms and not even miss an event. cooool. This will probably NOT be my final solution but its good to know in the future.
    Most likely I am going to design each of my main VIs to have a main while loop with a User Event Structure listening for dynamic events. Associated with each of these VIs will be a functional global which contains its User Event Refnum and Registration Refnum. This functional global will act as a gateway into the associated VI for other VIs/Subvis to use. This will follow the "one Event structure per dynamic event registration" rule while keeping my API organized and allowing room for scalability by simply adding more functional globals in the future.
    Just putting this info out there for other users.
    Thanks again,
    Craig

  • Single graph, multiple loops

    Hello,
    I have a (hopefully) simple problem with a (hopefully) simple solution. The picture explains it best I think.
    There are three queues firing at different times, thus necessitating three independent FOR loops. I need to be able to plot the output from each FOR loop onto a single graph.
    Any suggestions?
    Thanks in advance

    Hey John,
    OK I looked at the picture and we STILL need a thousand words.  Put each for loop in its own independent structure.  Then they can run in multiple threads.  Right now the while loop you have will not iterate until ALL of the for loops finish.  This style does not make it easy to extend or maintain when the assumption that the arrays have the same number of points becomes invalid (that is, always code around assumptions)
    Now to break my own advice,  I'm assuming the user REALLY needs the data graphed, and the experiment cannot provide a result based on analysis of the data that you are graphing.  BUT- CHECK THIS ASSUMPTION before we go too far down the wrong road!
    As I said, before waxing philosophically, your code needs some improvement to abstract the display functionalities and make them less dependent on the UI in this code level.  Or, to restate, you need LVOOP concepts!
    One of the simplest ways to do this is to use an "Action Engine" to maintain the data in the UI graph.  You can pass a reference to the existing graph into this AE and use "Actions" (methods) "Clear", "Adopt", "Appendto.Plot" etc...
    In this case I would also think about changing the graph into an "X-Control."  An X=Control allows code to be executed dependent on the action being performed on the data, like an AE but, with better handling of resource when called asynchronously from multiple locations.  For really good advice on how to go this route poke an NI KNIGHT. cus you've gotten out of my league (I know the concepts and theory, I've used X-Controls,  but I lack the amount of practical experience some of these Knights have with the newer powerful LV architectures)
    Reguardless- keep me posted!  your code looks interesting!
    Jeff

  • Procedure with multiple Loops and Insert into table

    Hello All,
    I am trying to create the Procedure to create a new table for our DWH.
    In this Case, I have 2 tables and I need to create Loop for each value from one table and get the respective data from second table based on first table data.
    Please find the below example:
    First table: TABLE_A
    X             Y              Z
    1              a              10
    1              b             abc
    1              c              xy
    1              e             $
    2              a              11
    2              c              asf
    2              d             tal
    2              f              ghs
    Second Table: TABLE_B
    A             B             C             D             E              F
    10           abc         xy           sd           ew          100
    10           jhy          xy           sd           ew          100
    11           ght         asf          tal           ss            ghs
    11           ght         afr          tal           ss            ghs
    O/P Table from Procedure: OUTPUT_TABLE
    A             B             C             D             E              F              X
    10           abc         xy           sd           ew          100         1
    11           ght         asf          tal           ss            ghs         2
    Business Logic In the Procedure:
    CREATE OR REPLACE PROCEDURE OP_TAB_PROCEDURE IS
    BEGIN
                    -- First get the DISTINCT values from the TABLE_A to generate the Loop
                    FOR ID (SEELCT DISTINCT X FROM TABLE_A_
                    LOOP
                                    -- For Each ID get the Y ,Z values from TABLE_A other than $ in Z
                                                    TEMP:
                                                    SELECT Y, Z FROM TABLE_A WHERE X = ID.X AND Z <> '$' ;
                                                    Based on above SELECT statement, I need to construct dynamic SQL query to get the data from TABLE_B
                                                    OP_EACH_ID:
                                                    SELECT * , ID.X AS X FROM TABLE_A WHERE [In this place I need generate sql cond dynamically. For Example, For X=1 in TABLE_A , the where cond must A=10 AND B='abc' AND C='xy'
                                                                                                                                                                                                                     For X=2 , the Where cond must be WHERE A=11 AND C='asf' AND D='tal' AND F='ghs']
                                                    -- I need to INSERT all the values from OP_EACH_ID into OUT_PUT_TABLE
                    END LOOP ;
    END;
    I am new to PL/SQL , so please help me on the above case.

    duplicate post

  • Need to send multiple Loop-N1 Segments

    Hi All,
    I have created a BPEL process that takes a custom input XML document and creates and EDI 810 Invoice out of it.
    The custom document has elements something like the below
    <Invoice_Data>
    <customer_Name>Customer Name</customer_Name>
    <customer_Address>Customer Address</customer_Address>
    <seller_Name>Seller Name</seller_Name>
    <seller_Address>Seller Address</seller_Address>
    </Invoice_Data>
    The output needs to be something like this
    <Transaction-810>
    <Loop-N1>
    <Segment-N1>
    <Element-01>Customer Name</Element-01>
    <Element-02>Customer Address</Element-02>
    </Segment-N1>
    </Loop-N1>
    <Loop-N1>
    <Segment-N1>
    <Element-01>Seller Name</Element-01>
    <Element-02>Seller Address</Element-02>
    </Segment-N1>
    </Loop-N1>
    </Transaction-810>
    I am using a transform activity but created the first N-1 Segment is easy but i do not understand how can i create two entries of that segment.
    Please can someone help me with the xslt transform needed for this? An example would be really helpful

    If the LoopN1 elements are not equal, you need to specify them separately in your template (this can't be done in design view as far as i know). The following works on your sample input:
    <xsl:template match="/">
    <Transaction-810>
    <Loop-N1>
    <Segment-N1>
    <Element-01>
    <xsl:value-of select="/Invoice_Data/customer_Name"/>
    </Element-01>
    <Element-02>
    <xsl:value-of select="/Invoice_Data/customer_Address"/>
    </Element-02>
    </Segment-N1>
    </Loop-N1>
    <Loop-N1>
    <Segment-N1>
    <Element-01>
    <xsl:value-of select="/Invoice_Data/seller_Name"/>
    </Element-01>
    <Element-02>
    <xsl:value-of select="/Invoice_Data/seller_Address"/>
    </Element-02>
    </Segment-N1>
    </Loop-N1>
    </Transaction-810>
    </xsl:template>

  • XML Publisher Multiple loops page break

    In my XML Publisher template i am haveing nested loops. The tag <?split-by-page-break:?> is working fine for all but the last iteration. Is there a tag for page break which work always irrespective of the iteration.
    I cannot use ctrl+enter in the template as the whole page is a table whose headers are repeating and on inserting the ctrl+enter the table break.
    Is there any other way to achieve the functionality of ctrl+enter through the xml tag.

    Hi,
    Yes, i was abe to do this, i moved the Customer name filed above the Invoice group and added extra conditin in the rtf.
    Regards,
    RR

  • Append statments for multiple loop

    Hi all,
              I have three loops under a main loop
    Loop at maintable .
            loop at table1.
            endloop.
            loop at table2.
            endloop.
            loop at table3.
            endloop.
    endloop.
    my question is that i have mutiple records in the table 1,2,3
    i dont know where to use my append maintable as if i use in the main loop only one  record of the table
    is updated
    anyone there to help me
    please

    Hi Sridhar,
    In case you are worrying about duplicate records, you can always use, Delete adjacent duplicates statement on your main table to remove it.
    I think i am not very clear on what you are trying to acheive.
    First, You want records from your MAINTABLE to be filled from itab1, itab2 and itab3. Hope this is correct.
    To acheive this,
    First
    loop at itab1.
    " Append entries to your maintable.
    endloop.
    Now, based on these entries, if you want to fill records from itab2 and itab3. If yes, then
    loop at itab2.
    " read maintable with key. If found, modify, else, append to maintable
    endloop.
    loop at itab3.
    " read maintable with key. if found, modify, else append to maintable.
    endloop.
    Hope this is what you want. If otherwise, please let us know.
    Best Regards,
    Ram.

Maybe you are looking for