Sleep/wait in a trigger

Hi,
I want to slow down a loop in a trigger:
loop
select flag into dummy from table;
exit if dummy = 0;
sleep/wait 2 seconds;
end loop;
I tried with dbms_lock.sleep, but I got compilation errors.
Any ideas?
Cheers,
Thomas

Try running an idle loop.You can measure the sysdate right at the beginning of the loop and the loop doing nothing NULL; untill the current time is atleast two seconds greater than the time at the beginning of the loop.

Similar Messages

  • Using DAQ occurrence to wait for start trigger

    Hi,
    I'm trying to use digital triggers to start and stop datalogging. Every time start trigger appears, new file is created and data is acquired to file until stop trigger occurs. Now I'm using set DAQ occurrence and wait for occurrence functions to wait for start trigger before creating a new file. The problem is that after first stop trigger this occurrence method doesn't work. I believe it's because AI is not cleared and configured before calling DAQ occurrence again. Number of scans acquired is not zero, if I don't clear and configure AI again? Am I right?
    Do I have to clear and init AI everytime before occurrence config or is there a better way to make program wait for start trigger?
    Thanks in advance,
    Jakke

    Hi Matt99eo,
    Have you configured your device for triggering?  Although you have not mentioned your device specifically, the M series user manual provides a great explanation of digital triggering.  Using the DAQ Assistant, this can be configured from the triggering tab.  Hopefully this helps!
    Regards,
    h_baker
    National Instruments
    Applications Engineer
    Digital Multimeter Resources

  • All acquisitions wait for digital trigger, why?

    On one computer I have 2 eseries 6023 daq boards installed. One for a digital triggered acquisition, and the other for a continuous (chart recorder type) acq. When running the two seperate VI's, why does the the cont. acq. VI wait for the trigger on the other VI? Appreciate any help.

    Hi digger,
    AI Read.vi waits until the samples are in the buffer.
    Do following: Call AI Read.vi with 0 scans to read. Look in scan backlog output if any samples are available. If there are samples waiting call AI Read.vi with this output contected to the input scans to read otherwise do nothing.
    This prevents AI Read.vi from waiting until samples are in the buffer.
    Waldemar
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • HSDIO conditionally fetch hardware compare sample errors (script trigger to flag whether or not to wait for software trigger)

    I am moderately new to Labview and definitely new to the HSDIO platform, so my apologies if this is either impossible or silly!
    I am working on a system that consists of multiple PXI-6548 modules that are synchronized using T-CLK and I am using hardware compare.  The issue I have is that I need to be able to capture ALL the failing sample error locations from the hardware compare fetch VI... By ALL I mean potentially many, many more fails than the 4094 sample error depth present on the modules.
    My strategy has been to break up a large waveform into several subsets that are no larger than 4094 samples (to guarantee that I can't overflow the error FIFO) and then fetch the errors for each block.  After the fetch is complete I send a software reference trigger that is subsequently exported to a scriptTrigger that tells the hardware it is OK to proceed (I do this because my fetch routine is in a while loop and Labview says that the "repeated capbility has not yet been defined" if I try to use a software script trigger in a loop).
    This works fine, but it is also conceivable that I could have 0 errors in 4094 samples.  In such a case what I would like to do is to skip the fetching of the hardware compare errors (since there aren't any) and immediately begin the generation of the next block of the waveform.  That is, skip the time where I have to wait for a software trigger.
    I tried to do this by exporting the sample error event to a PFI and looping that PFI back in to generate a script trigger.  What I thought would happen was that the script trigger would get asserted (and stay asserted) if there was ever a sample error in a block, then I could clear the script trigger in my script.  However, in debug I ended up exporting this script trigger back out again and saw that it was only lasting for a few hundred nanoseconds (in a case where there was only 1 injected sample error)... The sample error event shows up as a 1-sample wide pulse.
    So, my question is this:  is there a way to set a flag to indicate that at least one sample error occurred in a given block  that will persist until I clear it in my script?  What I want to do is below...
    generate wfmA subset (0, 4094)
    if scriptTrigger1
      clear scriptTrigger1
      wait until scriptTrigger0
    end 
    clear scriptTrigger0
    generate wfmA subset (4094, 4094)
    I want scriptTrigger1 to be asserted only if there was a sample error in any block of 4094 and it needs to stay asserted until it is cleared in the script.  scriptTrigger0 is the software trigger that will be sent only if a fetch is performed.  Again, the goal being that if there were no sample errors in a block, the waiting for scriptTrigger0 will not occur.
    I am probably going about it all wrong (obviously since it doesn't work), so any help would be much appreciated!

    Please disregard most of my previous post... after some more debug work today I have been able to achieve the desired effect at slower frequencies.  I did straighten out my script too:
    generate wfmA
    if scriptTrigger1
      clear scriptTrigger0
      wait until scriptTrigger0
    end if
    generate wfmA
    scriptTrigger1 = sample error event flag
    scriptTrigger0 = software trigger (finished fetching error backlog in SW)
    However, I am still having a related issue.
    I am exporting the Sample Error Event to a PFI line, looping that back in on another PFI line, and having the incoming version of the Sample Error Event generate a script trigger.  My stimulus has a single injected sample error for debug. For additional debug I am exporting the script trigger to yet another PFI; I have the sample error event PFI and the script trigger PFI hooked up to a scope.
    If I run the sample clock rate less than ~133MHz everything works... I can see the sample error event pulse high for one clock period and the script trigger stays around until it is consumed by my script's if statement.
    Once I go faster than that I am seeing that the script trigger catches the sample error event occasionally.  The faster I go, the less often it is caught.  If I widen out the error to be 2 samples wide then it will work every time even at 200MHz.
    I have tried PFI0-3 and the PXI lines as the output terminal for the sample error event and they all have the same result (this implies the load from the scope isn't the cause).
    I don't know what else to try?  I can't over sample my waveform because I need to run a true 200MHz. I don't see anything that would give me any other control over the sample error event in terms of its pulsewidth or how to export it directly to a script trigger instead of how I'm doing it.
    Any other ideas?

  • BPM Process Sleep / Wait for long duration - is it feasable in SAP PI?

    Hi
    We have a business requirement where based on a particular date in the future, we require a message we receive to "wait" until that date before it can bed processed (several weeks/months).
    I understand that there is a "wait" step in CCBPM - has anybody had any experience with using this step for "long running processes".
    When using this, is SAP PI intelligent enough to "sleep" and free resources for this process until the date arrives in the wait step?
    What happens with other messages hitting the BPM and there is a process on a wait step? Can queing be setup that subsequent messages that are not on a wait step be processed ahead of the BPM sitting on a wait step?
    Are there any other better solutions in SAP PI instead of using BPM wait for a long running transaction (several weeks)?
    Thanks in advance.

    Hi,
    AFAIK it's an anti pattern to run a process over such a long time.
    Here it's said that at should not longer run than a few days:
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/d92e428819da2ce10000000a1550b0/frameset.htm
    But even a day is quite a long time.
    All informations of the process must get stored and it's very memory consuming specially if you expext a lot process instances.
    It would try to avoid this situation.
    Regards
    Patrick

  • How to put a SQL Agent Job wait in the trigger while the job is running.

    Hello!
    I am not a geek in writing t-sql code so I am seeking forum help in completion of my task.
    I have a trigger which fires upon a action and with in that code, I am starting a job via t-sql like
    EXEC msdb.dbo.sp_start_job N'JobName';
    Now, I want to check the condition like that, If the trigger got invoked while the job is running, it should wait till the successfully completion of the job.
    Thanks for your time and help on this.

    You can use Context_info with Wait for delay 
    Below are some useful links..
    http://www.sqlservercentral.com/articles/T-SQL/2765/ 
    http://technet.microsoft.com/en-us/library/ms180125(v=sql.110).aspx 
    http://ask.sqlservercentral.com/questions/42786/how-to-avoid-a-stored-procedure-to-be-executed-par.html
    Thanks,
    Saurabh 
    http://www.linkedin.com/in/sbhadauria http://www.experts-exchange.com/M_6313078.html

  • How do I continuous​ly wait for a trigger?

    using labview and GPIB to control tektronix 3034B oscope. want to continuously wait for trigger. how do i get rid of timeout? I am using IVI instrument driver for 3034B

    Hi,
    You can use the low level adquisition VIs. First call Initiate Acquisition. Then use the Acquisition Status VI to determine if the acquistion is complete. This wait you can wait indefinitely.
    Of course, you could also set the timeout value of the ReadWaveform VI to something like 86000000 ms, which is aprox. a day of timeout .
    DiegoF
    National Instruments.

  • Sleep. wait, delay??

    Greetings,
    I don't know if this is the right forum, but the problem is the following:
    I want to make a (ASCII) file -based on some data in my databse-, start a Fortran executable (that produces an ascii file) and wait for that program to finish. Then I want to read and store the results. And subsequently present them to the internet user.
    But how do I wait?
    I don't like to count from 1 to 1.0e+9 as than I consume all the processor time.
    TIA Henk

    Check dbms_lock.sleep
    Thanks, that is a good idea!
    null

  • Sleep / wait function for Business Server Page

    Hi friends of BSP,
    on my BSP I generate at the onload function x iframes for calling BEx 7.x WebTemplates.
    It is a dynamical count of iframes depending on some URL parameters.
    Now, I get the problem, that if the count of iframes is to big, the system can not load all WebTemplates, because they are generated to fast and the system can not handle this amount of processes.
    Is there a possibility to include a wait or sleep function?
    If the answer is "yes", how to implement those functions?
    thanks for any help and support
    kind regards
    Patrick

    Hi Jamie,
    now, we us the JS method window.setTimeout().
    But there are some restrictions.
    In BSP Applications this method works only if the delayed functions is the same function calling the delayed function
    function delayFunction(index)
      var timeout
      timeout = window.setTimeout(function() { delayFunction(i) }, 1000);
    and the delayed called has to be the last step of the function
    (for exmaple there is no possibility to include the setTimeout-function in an IF condition or in any loop).
    Many thanks
    Kind regards
    Patrick

  • Can trigger wait for another trigger before it is fired?

    i have table TAB1
    and i have TAB1_HISTORY
    when row gets inserted into TAB1 i have some logic in TRIG1 to updated few fields using rowid ARRAYS just to be safly updated everything in case more than one rows gets into TAB1.
    now TRIG1_HISTORY suppose to move data from TAB1 into TAB1_HISTORY but some fields are null because TRIG1 may be not finished updating fields yet.
    Any way to trig1_history follows trig1? I know one way is to make TRIG1_HISTORY as store proc .
    i am usign 10g
    thanks

    There is no such thing as unassigned rowids.
    If there is a rowid, the row exists and it can be updated.
    The general strategy for your problem is
    before statement trigger: set up an array with empty values.
    before or after for each row: do whatever you want, and buffer the primary key (or rowid) in the arrary you set up.
    After statement: do anything you want to do with the collected primary keys/rowids.
    This is being processed in the correct order and it shouldn't fail.
    Hth
    Sybrand Bakker
    Senior Oracle DBA

  • Delay/sleep/wait in an iPhone SDK app?

    I'm trying to get some numbers to count up on the screen of my iPhone, but I can't see any way of delaying the app.
    I have a for loop that changes the figures on-screen from one value to another by individual increments, but when I run it, you only see the final figure because it runs so fast.
    Is there a way of adding a delay in the for loop so that the numbers visibly change? I'd like to see 0 change to 1 change to 2 change to 3 etc. instead of, erm, just 3.
    I thought of putting a second for loop in that counted up to, say, a million, but that's too fudgey for me. I'm sure there's a delay function in the iPhone SDK...

    You can also do eg. [NSThread sleepForTimeInterval:5.0] to sleep for 5 seconds..

  • Stopping program without waiting for trigger

    Hi everybody
    I have a problem that I just can't get my head around. I have a program that I use to aquire data. The program goes through the motions of waiting for the trigger, aquiring the data on the appropriate channel, displaying it, and loops back to waiting for the trigger. The problem is That when I want to stop my program while it is waiting for a trigger I must wait for it to recieve a trigger before it will stop excution.
    Is there a way for my program to stop the trigger vi when I select to end the program?
    Thanks
    Beaton
    - there is always an easy way, but it is always the hardest to find

    Hi Beaton,
    you have to split the 'wait for trigger time' into shorter sub-steps.
    Let's say you wait 10sec for trigger signal. Make a loop instead waiting 1 second for 10 times! After each iteration you can check for: 'break the loop (end program)' or 'trigger received' or 'any other error occured'. This way you can stop your program very easily - you can also make your own error state saying 'Error number 123456: stopped by user'...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Wait for trigger

    Hello
    I need help making a VI for waiting for a trigger. I am working with a TDS 2024 scope.
     I have to tell  the scope how long to wait for the trigger and if it does not find it in that time, then it will tell the user that no trigger was found.
    Can anyone help me with this?
    xxmidna

    Midna19 wrote:
    Hello
    I need help making a VI for waiting for a trigger. I am working with a TDS 2024 scope.
     I have to tell  the scope how long to wait for the trigger and if it does not find it in that time, then it will tell the user that no trigger was found.
    Can anyone help me with this?
    xxmidna
    Time to break out the scope manual and see what commands are needed to achieve this.  Put a VI together and then we can talk about refining it. 
    Alternatively, you can see if you can find some drivers for this scope.  I think Tektronix has pretty good LV support.
    (This assumes you know how to use the scope.)
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • NIScope CPU usage 100% when waiting for trigger

    Hello, I'm using a NI 5102 DAQ card and want to acquire single bursts. However when the Multi Fetch.vi is waiting for a trigger (and this can be up to a minute) the CPU usage goes up to 100 %. Is there any way to overcome this?
    Attachments:
    Current_ProjectSWEEP2withoutAgilentNEWScopeWrite_to_FilePOSTED.vi ‏98 KB
    ScopeSUB.vi ‏108 KB

    Yea, Ive noticed the same thing.  The niSope dll in the Fetch.vi grabs 100% CPU if timeout is larger than 1 or 2 seconds. 
    Has anyone talked to NI about this?  The problem is in that dll which is polling the PCI Scope Card.  That dll is not giving back any CPU if it waits for more than a second or two.
    John Dailing
    [email protected]

  • Extra empty groupName in TDMS file when using DAQmx Start New File & stop DAQmx while waiting for trigger?

    I wrote a VI that listens to an external trigger coming from a PFI line and saves a user-defined number of pretrigger+posttrigger samples into disk, and then the DAQmx restarts to wait for the next trigger. I used the DAQmx Start New File.vi to change the filename of each of the next file. However, I found that for each of the resulting TDMS files, there is an additional group that is added in addition to the real data. For example, if the groupName is set to "task_voltage", then there is an additional groupName called "task_voltage #1".
    I suspect that this is because the program preallocate diskspace using the old filename for the pretriggered samples, but when the trigger happens and the samples are ready to be written into disk, an actual new file is opened and saved. The reason I think this might be the case is because, say each file would be 50kB and I already have 1 file triggered and saved, before the second trigger comes in, I can see that the file size of the first file is twice as much as it should be (100kB), but the file size will return to noraml (50kB) after the second trigger happens and a second file is created.
    Does anyone know if this is really the case? Is there a way to configure the task so that this doesn't happen?
    Another question I have is that the program currently set up so that the VI will wait until a trigger happens to return the values. However, this means that if a trigger doesn't happen, the VI waits indefintely, and the "stop" button in the while loop is useless. I have to use the "Abort Execustion" button on the tool bar to stop the VI. Is there a way to interrupt and stop the DAQmx task even if the trigger doesn't happen?
    Thanks in advance for any help!
    Attachments:
    pretrigger_loop_new_file.vi ‏29 KB

    I don't believe there is a way to programmatically change/delete the group name in a TDMS file. What you can do however, is convert between TDMS and TDM using the VIs found in the Data Storage palette and then perform whatever modifications you need using the TDM utilities.
    Applications/Systems/Test
    National Instruments | AWR Group

Maybe you are looking for

  • Can't get app into ipod

    I have an ipod touch of 2008 vintage and have only now tried to install an app.  My ipod software is 1.1.5 and itunes is 10.3.1.55.  I have downloaded the app and it appears when I click on "Apps" in Library (in a new wwindow).  Yet, when I sync my i

  • G4 upgrade now one monitor won't power on

    ANY HELP WOULD BE APPRECIATED! I'VE BEEN UP ALL NIGHT!! I put in 2GB of RAM today along with a super combo (DVD, CDRW) drive. I tested the machine with a single monitor at work, it was fine. When I got it home and hooked it up to my dual monitors, on

  • The ABAP/4 Open SQL array insert results in duplicate database records

    Hi, Iam getting following error : The ABAP/4 Open SQL array insert results in duplicate database records. Error in ABAP application program. The current ABAP program "SAPLV60U" had to be terminated because one of the statements could not be executed.

  • Need info about DataInputStream - read (byte[] ) method

    Hi all, I would like to know when does datainputStream.read(byte[] buffer) method return? Here dataInputStream is an object of type DataInputStream. Does the method return only after buffer.length bytes are read from the input stream? or Will it retu

  • Reg Mobile Archive Converter (Fileds are disabled)

    Hi All I have configured the MI server and is working fine. Only problem I face is, few fields in the Mobile Archive Converter are disabled and there is no application types found in the "Application Type" drop down. So I am not able to convert the w