Capturing of time taken by a while loop in bpm

Hi ,
I have a busniess process ,and my receive step is defined in a while loop.
so it starts with a while loop.
I want to keep a condition on the while loop that it should receive the messages only for a period of 1 hour ,and if it exceeds this period it should end up the process triggeringa mail.
I mean to say if there are 12 records to be processed through the while loop ...and if I receive only 11 records ..it will be waiting for that final record in an infinite loop ..so I dont want that ...instead if the total no of records are reached then it should move forward ..If it is waiting for the missing records for an hour ..I should stop the process and trigger a mail to the queue monitor saying that record is missing...I have finished the process without this processing time condition successfully..
I am new to XI and I dont have any idea on how to capture this processing time of while loop.
can some one please help me out in this issue...
Thank you in advance...

Hi Latika,
Yeah I understand we can go with fork but why I am going with this is ,I have already designed a Payload dependent loop ,by using while loop.so it makes my job simple ...
Now I am converting it to time dependent loop,so only the final question I have is...In the time dependent loop documentation ..they have taken it as infinite loop and only kept the time limit in the deadline branch...so when the deadline reaches they trigger something.
If you go to the documentation of time dependent loop(http://help.sap.com/saphelp_erp2005vp/helpdata/en/08/16163ff8519a06e10000000a114084/content.htm) ..they took the infinite loop...in this loop if I mention the counter ..and if this record count triggers before the time limit...it should come out of the block...would it work this way ?
Thanks a lot...

Similar Messages

  • Use the LabView time delay in a while loop instead of using the instrument inherent time loop.

    I have a zes lmg500 that I use. It has the option of continues measuring data, with a user control cycle loop (still using a while loop but the delay is coming from the instrument). The problem is that the loop time is not constant. Can I use a very short time (100ms) as the instrument cycle time but use a longer time delay in the while loop that collect the data?
    I know many instrument offer the same abilities, so the question is relevant to all of them.
    Thanks for any help
    Solved!
    Go to Solution.

    Does that measurement VI have built-in wait functionality and a timeout?
    If not, then you are simply polling the VI at 1 kHz, but I suspect that this is not the case or your Waveform Chart probably wouldn't look as you expect (getting 0's put in everytime measurement data is not available).
    I expect that if you have the instrument set up to send data at a fixed time interval (i.e. 100 ms), all the data that it is sending you will end up residing in your serial buffer (or the instrument driver will have taken it out and put it in another internal buffer), so if you come back to read it 1 sec later, then you will have 10 data points to go through.  Whether you can read them all at once with the read VI or have to call it a whole bunch of times until empty I can't say.
    What is your objective?

  • PO Lead Time cannot capture the time taken for shipping!

    Dear All
    I understand that we have PO lead time = PO Processing Time (Working Day) + Planned Delivery Time (Calendar Day) + GR processing time (working day).
    And this PO lead time will be added on top of my PO Creation Date to defer the actual goods availability date.
    My question:
    1. Planned delivery time is the time taken from vendor place to send out the goods to my warehouse. What if it is overseas purchase where goods leaving vendor's Port will first arrive in my country custom, and it will take 3 days to do clearance. once it is cleared, forwarding agent will delivery goods from my country custom to my warehouse. In this case, how do I capture it in SAP system for the planned delivery time as it has 4 periods of time now
    a. Time taken from vendor's port to reach my country's port
    b. Time taken for my country custom to do clearing
    c. Time taken for forwarding agent to fetch goods from custom to my warehouse
    d. Time taken for unpack, take out , count, inspect and put for use (GR processing time)
    Do I need to use user Exit?
    Thanks
    Edited by: Daimos on Apr 27, 2009 6:52 PM

    Dear dogboy.
    I think we must use feature on the PO Confirmation Control (CC) Key at PO Item Level:
    ED - Estimated Time of Departure from Overseas Port.
    EA - Actual Time of Departure from Overseas Port.
    EA - Estimated Time of Arrival
    AA - Actual Time of Arrival
    And the purchaser will maintain the value of each of the CC Key each time they are notified by the vendor.
    And we need to come out with a Customised Report to capture those CC dates entered so that finance is able to prepare $ in advance if the moment the EA is maintained, meaning the estimated date of arrival at the Custom there.
    But the problem is that PO User Exit is only at the header of Confirmation Control Key but not capture the DATE field we entered for each CC.
    That was the problem I last encountered.

  • Time not stopping with while loop

    Hello,
    I've attached my VI.  I am having trouble with while loops.
    I want to turn on LEDs. The first LED should turn on after 3s.  The second LED should turn on after 5s.  The third LED will turn on later. 
    The LEDs turn on based on the following conditions:
    Case 0: numeric control > 10 then led_1 off, led_2 off, led_3 off
    Case 1: numeric control <= 10 then led_1 on, led_2 on, led_3 on
    Case 2: numeric control <=5 then led_3 on
    Because of the way I'm delaying time, I have the following problems
    Case 1 --> case 2: led_3 doesn't come on right away
    Case 2 --> case 1: led_3 doesn't turn off right away
    Putting probes in certain areas leads me to believe that these problems are due to the way the time delay is being generated.
    Thanks in advance.
    EDIT: Looking at it more...it seems to be that when the stop condition is true, the loop runs one more iteration. Is there a way to keep it from running that "one more iteration."
    Attachments:
    timing.vi ‏15 KB

    One of the problems is that your VI is not able to "breathe" because it is sometimes trapped inside inner loops that consume all CPU and step on each others toes. All you need is an single outer loop and a few shift registers.
    May of your specifications are still not clear, for example what should happen to LED 1&2 in case #3? Should they remain in the state they are in, or should they turn off, for example.
    Here is a simple rewrite that spins the outer loop at a regular rate, has no inner loop, and does not need any local variables or value property nodes. See if it makes sense. Also note that your code can be simplified dramatically by using arrays. Since the stop button is read with each of the regular interations, we don't need to worry about sequencing.
    Most likely you need to do a few simple modofications, because your specs are not clear.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    timingMODCA.vi ‏15 KB

  • Time Measurement in a While-Loop

    Greetings gentleman;
    I am a little bit new at Labview, and though i searched for an answer without posting, i was not able to find one.
    So here is my question, i would like to know how can i measure time of a loop sequence, in other words, how much time does my VI take to execute the whole main loop ?.
    A little explanation, the attached VI tries to be a Markov Chain, it takes some values in the first case structure depending of the previus loop, then, if the values are correct, it goes to the next step and so on. It is quite simple, yet, my issue lies with the time measurement. Since this is a probability "distribution" it could take infinite time to execute one single loop if it does not meet the requierements, but is programmed to meet them so an average timing should work.
    So, if you look at the While loop, the big one, that i would like to measure how much time does it take to do one round.
    Thanks for the help, i would be glad to read some ideas on how to measure that.
    Kind regards,
    Stgo.
    Solved!
    Go to Solution.
    Attachments:
    Markov Chain.vi ‏30 KB

    You can find a few examples in the NI Example Finder by searching for 'speed test' or 'benchmark'.
    Essentially, you create a flat sequence structure inside your while loop. In the first frame, you measure the current tick count. In the middle frame, you run your code. In the final frame, you measure the tick count again, and subtract the first count from this. This gives you the execution time to run the code.
    You can see a community page on it here.
    There's a high resolution tick/time count VI hanging around somewhere which is excellent for benchmarking and improving efficiency, used in place of the Tick Count (ms) primitive.
    Edit - remembered where it was
    https://decibel.ni.com/content/blogs/EvanP/2010/10/04/tick-count-us--microsecond-timing-granularity-...
    CLD

  • Why the execution time increases with a while loop, but not with "Run continuously" ?

    Hi all,
    I have a serious time problem that I don't know how to solve because I don't know exactly where it comes from.
    I command two RF switches via a DAQ card (NI USB-6008). Only one position at the same time can be selected on each switch. Basically, the VI created for this functionnality (by a co-worker) resets all the DAQ outputs, and then activates the desired ones. It has three inputs, two simp0le string controls, and an array of cluster, which contains the list of all the outputs and some informations to know what is connected (specific to my application).
    I use this VI in a complex application, and I get some problems with the execution time, which increased each time I callled the VI, so I made a test VI (TimeTesting.vi) to figure out where the problem came from. In this special VI I record the execution time in a csv file to analyse then with excel.
    After several tests, I found that if I run this test VI with the while loop, the execution time increases at each cycle, but if I remove the while loop and use the "Run continuously" funtionnality, the execution time remains the same. In my top level application I have while loops and events, and so the execution time increases too.
    Could someone explain me why the execution time increases, and how can I avoid that? I attached my test VI and the necessary subVIs, as well as a picture of a graph which shows the execution time with a while loop and with the "run continuously".
    Thanks a lot for your help!
    Solved!
    Go to Solution.
    Attachments:
    TimeTesting.zip ‏70 KB
    Graph.PNG ‏20 KB

    jul7290 wrote:
    Thank you very much for your help! I added the "Clear task" vi and now it works properly.
    If you are still using the RUn Continuously you should stop. That is meant strictly for debugging. In fact, I can't even tell you the last time I ever used it. If you want your code to repeat you should use loops and control the behavior of the code.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Real time waveform graph in while loop

    Hi
    I have a VI which includes a subVI that reads data from an oscilloscope and presents the output in the form of a cluster made up of the initial time t(0), a time interval delta t and an array of voltage readings.
    This cluster can then be wired to a waveform graph in the usual way. All of this is situated within a while loop in my VI and on each iteration of the loop I obtain a waveform graph of the voltage readings starting at the same time t(0) and ending at the same time t. However I want my graph to begin at a time t(0) when I set my VI running and then continuously acquire and build up the data on each iteration of the while loop so after my VI has finished executing I have a complete graph of all the voltage readings acquired after the set number of iterations of the loop. I know on the Express X-Y Graph VI you can double-click the node and deselect the box that says 'clear data on each call' - if I could do this in my case that would be great but I can't use an x-y graph because I have an array of y-values to plot on each iteration.
    If anyone can help me out it would be much appreciated - I'm sure there must be an easy solution to this but I'm going out of my mind trying to find out what it is!
    Many thanks,
    Bex.

    As usual, you have several options.
    You can use an XY Graph by generating the X values yourself. This will ensure that you place the data exactly where you want it on the X axis. This is fast, but does involve a memory cost.
    You can use a Waveform Graph with a waveform input instead of the cluster you are using. Use the Build Waveform primitive instead of the bundler to make your waveform. Set the t0 values to the appropriate values (negatives do work, as do small numbers - time is in seconds, use the To Time Stamp primitive to convert from DBL to timestamp). Finally, you need to set the Waveform Graph to use the t0 values. Pop up on the Waveform Graph and make sure Ignore Time Stamp is not checked. Depending on your version of LabVIEW, you may have to pop up on the graph or the axis. When you unselect Ignore Time Stamp, you will probably want to reformat the X-axis again. The Waveform Graph clears data at each iteration, so you will need to replot all your data each time. Just create an array of waveforms and keep adding to it. The t0s will put the waveforms in the right places. Yes, this may cause memory problems.
    Finally, you can use the Waveform Chart, which does have memory. Create the waveforms like you did for the Waveform Graph and send them to the chart. It will remember what was sent to it from run to run. Make sure you set the Chart History Length (pop up on chart and select Chart History Length...) to long enough to hold your entire data. You can use a property node to get the data back at the end, if you need to.
    Good luck!
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Capturing query time taken inside a proc

    Hi ,
    select * from v$version
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE 11.2.0.2.0 Production
    TNS for Solaris: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    =================
    I have a few insert and delete statements inside my stored procedure .
    I need to cature the time taken by these queries after their run .
    Is there any way we can get this . ( Not putting timestamps before and after the query and taking difference )
    Thanks ,
    Mahesh

    Mahesh wrote:
    I am looking is there anything like sql%rowcount which gives the count affected or we have set time on in sql*plus which gives the time .Elapsed time in Pl/SQL can be calculated by using DBMS_UTILLITY.GET_TIME
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_util.htm#i1002765
    Regards
    Peter

  • Time delay separate to while loop

    How would I be able to obtain data (pressure read in by DAQmx) that happened 2 seconds previous?
    I need to obtain the pressure difference from 2 seconds ago hence need the previous pressure with a 2 second time delay. When I try and do this the whole program delays by 2 seconds, even when I try separate the time delay through use of another time loop. 
    Any suggestions?

  • How to stop a while loop after certain time using Elapsed time vi

    how to stop a while loop after certain time using Elapsed time vi.

    Hi Frankie,
    Just place the Elapsed Time VI inside the WHILE loop, and wire the 'Time Has Elapsed' output to the conditional terminal in the lower right corner (which should be set to 'stop if true' by default).
    In the future, please post your LabVIEW questions to the LabVIEW Forum.  You have a much better chance of getting your questions answered sooner, and those answers can then help others who are searching the LabVIEW forums.  Thanks!
    Justin M
    National Instruments

  • Other choise to while loop polling?

    Hi!
    I have worked with USB-bus oscilloscope and trying to build labview software using dll-librarys. Almost everything works BUT... how i can poll dll-library (*.vi) which is external "counter"? I know that dll is returning number of samples from scope hardware and i know number of those samples are 3072 blocks. Now when I polling that dll in while loop it returns just something (2999 or 3001 or 2989 or something like that). I think that dll returns that value which is exactly time in dll when while loop poll it? Hardwares speed is 50Msps 8-bit. How else i can poll that dll? Or other choises to while loop, where i have to poll something and when it returns something then do something...
    Thx again

    Here are two choices (could be more out there):  Active Polling or Event Registration
    Active polling = use of while loop with your DLL calls.  This makes sense if you know there is always data available to retrieve.   Caveats include processor usage, which can affect UI response and processing.
    Event Registration = use of Event Structure with Callback (e.g. Active X callback), such that your hardware notifies the OS when data is ready.  This makes sense if you are not always capturing data in your top level code and if your hardware driver includes callbacks.  Caveats include more complex programming (understanding of Active X, dynamic event registration, event structure, etc.)
    If you're having trouble understanding how you might integrate these into your main application, in addition to these forums, there are also NI Certified Alliance Partners (like us) that can help you get going.
    Message Edited by LabBEAN on 08-17-2009 12:33 PM
    Certified LabVIEW Architect
    Wait for Flag / Set Flag
    Separate Views from Implementation for Strict Type Defs

  • How to stop execution in while loop without stopping execution of other loops in the same vi

    HI
    I am quite a novice in Labview.
    I have a problem in my project. I used a while loop inside my vi to build an array of ten values along with other loops. Then I used a stop button to stop manually the while loop. But it seems like the loop doesn't stop in the middle of the array building and so other loops in the vi doesn't work until the while loop finishes building the array and as soon as while loop execution is over, the complete vi stops. But all that I wanted was to build the array using the shift register along with the control to stop building array anytime. And not to stop execution of other structures when the while loop finishes.
    Can anyone help me?
    Rahul

    Hi Rahul,
    Modified ur Vi to work with single button.
    But the subtract case is not in any loop.
    So, once both the loops stop, the subtract case will execute only once. Depending on state of subtaract boolean at that time, corresponding case will be executed and the Vi will stop.
    so think of a logic where u can put this also in a new loop.
    Or you can also incorporate it in one of the two loops and pass the other loop's data to it.
    Let us know how you will proceed in this regard
    I am posting your VI as well a VI with my modifications VI in Labview 7.0 so that Thomas can give his suggestions too
    Plus, always keep a time delay in your while loops.
    Oh sorry, the "arrayinouttestnewfinal.vi" is the modified vi
    Regards
    Dev
    Message Edited by devchander on 01-10-2006 06:15 AM
    Message Edited by devchander on 01-10-2006 06:19 AM
    Attachments:
    arrayinouttestnewfinalnew4.vi ‏59 KB
    arrayinouttestnewfinal.vi ‏63 KB

  • Dsc periodic I/O "stop while loop" usage?

    I'm using LabView 8.5.1 with DSC.  I have created a working periodic I/O server VI and successfully deployed it. 
    The one glitch I am running into is what happens when the Shared Variable Engine I/O process is terminated.  I normally terminate it by using "remove process" from Variable Manager.
    The I/O server wizard lets me choose the while loop for termination during the build process, but any code following the while loop is not executed.  In fact, the process continues running for 10 seconds until the "abort VI timeout" is reached, at which point the VI stops.  The "stop" terminal of the main while loop is wired to a "create control" "STOP" button on the front panel.  Publishing or not publishing the "STOP" control during the I/O wizard process has no effect.
    I'd like to do cleanup steps after the while loop terminates.  Unfortunately the "Heat Exchanger" example has no code after the while loop to illustrate the concept.
    What am I missing? 
    Thanks,
    Mike

    Hi Van - let me clarify my question...
    I don't believe that the termination portion of the DSC "periodic I/O server wizard" actually works properly, or at least an example is needed of how to make it work.
    It appears to me that the wizard functionality of "choosing the server termination method" might not work.  Within the wizard, the two options are to abort the running server VI, or to choose a "while loop" to be forcefully-terminated with a standby timeout value to force a VI abort anyway, if the while loop does not exit.
    I set up a simple server VI with one main while loop that does RS-232 I/O with a "running" beep on a 1 second timer.  After the while loop is another small block of code that closes the serial port, and a different "terminating" beeper.  When I run the VI interactively, both beeps work fine.  When I use the wizard to turn it into a server and it is deployed to the SVE, the beeps begin normally.  When I stop the SVE process via "remove process" in Variable Manager, the "running" beeps continue for another 10 seconds until the abort timeout occurs, even though with the wizard I specified the only while loop in the VI to be aborted.
    The heat exchanger example works fine.  Unfortunately it does not have any code following the while loop, so it doesn't shed any light on this issue.  Ideally that example would be updated a little to show how to use the "while loop termination" feature.
    Basically my request comes down to this:  is there a way to actually make this work, or is it another in the list of bugs in 8.5.1?
    Thanks,
    Mike

  • Wait time in while loop: wait before all other code in the loop runs

    My vi is attached. 
    In the 'Check for Equilib' case, there is a while loop that takes data from a pressure gauge and compares it against data taken equilibTime seconds previous.  equilibTime is hooked up to a wait(ms) function inside the while loop.  Currently it appears that the code in the loop runs, and then the loop waits so many seconds before the next iteration.  I would like to reverse this process, i.e. in each iteration, the loop will wait so many seconds and then run the rest of the code in the loop.  I want to do this because I don't want there to be any delay between then time the 'check for equilib' code finishes and the start of the 'add shot' case.
    Can anybody suggest an elegant way of implementing this?
    Thank you
    Attachments:
    Take Isotherm.vi ‏294 KB

    No.  Use Flat sequences they are far preferable to stacked sequences.  Functionally they are the same.  But a flat sequence is easier to read, doesn't hide code, and you don't have to worry about backwards wiring caused by sequence locals in stacked sequence.
    Note, you have two oddities in your lower while loop.
    1.  Write a value to an indicator's terminal node and to a local variable of the same indicator is pointless.  They do the same thing.
    2.  Reading from a local variable of an indicator and writing to its terminal node is just as pointless, as you aren't doing anything.
    In your middle loop "Add shot" case, you have the local variable of DC estimate righting to a right hand side shift register, but you never use the left hand shift register.  So you are saving that value for future loop iterations, but never use it.

  • Execute case structure a certain number of times within a while loop

    Hi guys,
    I was wondering if it was possible to execute a case structure a specified number of times within a while loop. Basically I'm running a camera where each iteration of the outer while loop displays a frame of a live video feed and I'd like to capture the next x amount of frames (specified by the user) each time the 'Start Capture' button is clicked. The block diagram within the case structure captures and saves an image frame. As the program is written right now, frames will continue to be captured until the 'Start Capture' button is clicked again. Instead of having to click the button again to stop the case structure from executing for each iteration of the while loop, I'd like it to only execute for the next x iterations of the while loop. Any help would be appreciated. Thanks.

    Hello Uxorious,
    A while loop has a iteration counter that gives an integer value of how many times the loop has iterated. You can utilise this to count the number of frames captured. I assume that the program could be running for any amount of time before clicking start capture, if that is the case then you will need to be able to detect when you have clicked the button and add the desired number of frames you wish to capture to the current loop iteration.
    If you use a shift register on the outer loop with the start capture button connected to it (inside the loop) you will be able to compare its current value to its previous value. If it changes from false to true then you can add the desired number of frames to it to give you the loop iteration value where you need to stop.
    Then you can compare the current loop iteration value to that number and once reached, you can use a property node to change the value of your start capture button back to false.
    One final thing, don't forget to initialise the shift register I suggested to false so that you don't run the risk of missing the first time you press the button.
    I hope that makes sense.
    Alistair
    Best regards,
    Ali Bailey
    National Instruments
    Don't forget to Kudos useful posts!

Maybe you are looking for

  • Address Book Entries Far Fewer than Contacts

    When I look at my Address Book, only about 75 email address show up (along with a couple hundred entries with telephone numbers). But I have many more email contacts. I mean, if I start a new email and just enter the first letter of an addressee, sco

  • CSS:  doesn't line up in F/fox

    I am new to laying out with CSS. I added a background to the body that repeats on the X and has a horizontal bar part way down the page. I need that horizontal bar to line up with the bar on the main page design, which I have contained in a wrapper d

  • WTK2.0 Beta 2.0 OTA provisioning

    Trying to use OTA provisioning tool that came with WTK2.0. I tried to install an application, go a message no midelt found, check url. The host is correctly setup to serve the jad and jar file. Thought I made some mistake in setting up host, tried to

  • Viewing original cost in PCA after the Distribution cycle run in CCA

    Hi, We have allocated costs from common cost centers to product cost centers using Distribution Cycles in Cost Center Accounting (CCA). If we want to only view the original costs before distribution in a Cost center report, we use the filter & exclud

  • [SOLVED] Awesomewm - How do I start a program in a certain workspace?

    For example, If I wanted to run 'xterm -e alsamixer' in workspace 2, how would I do that? Last edited by itsbrad212 (2010-04-25 03:36:22)