Counting in delays

Hello

I have a table with date-periods. Some are overlapping.


StartDate enddate number

2015-01-01 - 4

2015-03-01 - 2015 - 04-04-6

03-05-2015-2015-07-04-8

31-05-2015-2015-08-01-10

2015-10-04 - 15

Within each period, I have a number.


The query has created new periods with startdates en followed enddates of each other.

The periods are not overlapping and within the specified time, the numbers are counted.

Possible solution tabibitosan can help create the result set

Thanks Wouter


create table period_sum (startdate, enddate, num)

as

Select to_date ('2015-01-01', 'yyyy-mm-dd'), null, 4 Union double all the

Select to_date ('01-03-2015', "yyyy-mm-dd"), to_date ('2015-04-04', "yyyy-mm-dd"), 6 Union double all the

Select to_date ('2015-05-03', "yyyy-mm-dd"), to_date ('2015-07-04', 'yyyy-mm-dd'), 8 of all the double union

Select to_date ('2015-05-31', "yyyy-mm-dd"), to_date ('01-08-2015', 'yyyy-mm-dd'), 10 of all double union

Select to_date ('2015-10-04', 'yyyy-mm-dd'), null, double 15

/

StartDate enddate num

2015-01-01 4 2015-02-28

2015-03-01 10 2015-04-04

2015-04-05 4 2015-05-02

03-05-2015 2015-05-30 12

2015-05-31 22 2015-07-04

2015 05-07-2015-08-01 14

08-02-2015 2015-10-03 4

2015-10-04 19

SQL > with all_days like

2 (select mindate + numtodsinterval (level-1, 'day') dt

3, cntall case when cntenddate then ' else n 'Y' end null_enddate_exists

4 (maxdate, mindate, max (nvl (enddate, startdate)) select min (startdate), count (*) cntall, count (enddate) cntenddate of period_sum)

5. connect by level<= maxdate="" -="" mindate="" +="">

6)

7, sums_per_day as

8 (select ad.dt

9, ad.null_enddate_exists

10, sum (ps.num) sumnum

11 of: ad all_days

12 inner join period_sum ps on (ad.dt between ps.startdate and nvl (ps.enddate, date ' 9999-12-31'))

Group 13 by ad.dt

14, ad.null_enddate_exists

15)

16. Select min (dt)

17, case when null_enddate_exists = 'Y' and grp = max (grp) () then null max (dt) to another end

18, sumnum

19 in (select dt

20, sumnum

21, null_enddate_exists

22, max (rn) in grp (order of dt)

23 of (select dt

24, sumnum

25, null_enddate_exists

26, sumnum deal when lag (sumnum) (order dt layout) then another row_number() (any order by dt) null end rn

27 of sums_per_day

28                  )

29         )

30 per grp group

31, sumnum

32, null_enddate_exists

33 arrested by min (dt)

34.

MIN (DT) CASEWHENNULL_ENDDAT SUMNUM

------------------- ------------------- --------------------------------------

01/01/2015 00:00:00 28/02/2015 00:00:00 4

03/01/2015 00:00:00 04/04/2015 00:00:00 10

04/05/2015 00:00:00 05/02/2015 00:00:00 4

05/03/2015 00:00:00 30/05/2015 00:00:00 12

31/05/2015 00:00:00 07/04/2015 00:00:00 22

07/05/2015 00:00:00 08/01/2015 00:00:00 14

08/02/2015 00:00:00 03/10/2015 00:00:00 4

10/04/2015 00:00:00 19

8 rijen zijn geselecteerd.

Tags: Database

Similar Questions

  • cleaning multithreaded DLL

    Hi all

    I'm building a small DLL (for use from matlab) for acquisition of data. One of the functions may take several hours: streaming over 1 million samples in a file. So for this particular function, I want (read: I'm trying) to run it as a background operation in a separate thread. After reading a quick guide OR the multi-threading I selected the following:

    -Start streaming function

    * start a new async timer, which calls every second ProcessSystemEvents all detached CVI callbacks are executed

    * start the new pool of threads for maximum 1 wire and the highest (but not time critical) priority

    * Schedule streaming function for this pool (once again with a priority higher but non-emergency)

    specification of the cleaning function to be run in the current thread after completing the function continuous

    -reminder async-timer run ProcessSystemEvents every second post CVI callbacks are executed

    -cleaning function

    * Release the function ID from thread pool

    * Throw the thread pool

    * Take async-timer

    -State function which can be used from the main thread (still available at the matlab prompt) to check the status of the streaming

    The beginning of the broadcast (simulated with a countdown of the meter) goes well

    I can retrieve the status that goes from kCmtThreadFunctionExecuting to kCmtThreadFunctionComplete.

    However, the function of cleaning - as specified in the service scheduling - is never started.

    Q1: what did I wrong that prevents the scheduled cleaning?

    Q2: are there different approaches/examples that don't just want I want?

    Thanks in advance, Jos

    Use: Labwindows/CVI 8.0.1

    / * some administrative global variables * /.

    public static int PoolHandle = - 1;
    public static int ThreadHandle = - 1;
    public static int ThreadSamples = 60;
    public static int ThreadStatus = 0;
    public static int ThreadTimer = - 1;
    / * cleanup function * /.

    void CVICALLBACK FBGLAB_ThreadCleanup (int poolHandle, int functionID, unsigned int, int value event, void * callbackData)

    {
    int counter = 0;
    int Status = - 1;
     
    Delay (0.2); / * short wait so function thread can close * /.
    printf ("starting pool clean up\n");
    CmtGetThreadPoolFunctionAttribute (PoolHandle, ThreadHandle, ATTR_TP_FUNCTION_EXECUTION_STATUS, & status);
    While ((status< kcmtthreadfunctioncomplete)="" &&="" (counter=""><>
    {
    Counter += 1;
    Delay (1.0);
    }
    If (status<>
    {
    / * finish the thread after timeout * /.
    CmtTerminateThreadPoolThread (PoolHandle, ThreadHandle, 0);
    Delay (1.0);
    }
    CmtReleaseThreadPoolFunctionID (PoolHandle, ThreadHandle);
    CmtDiscardThreadPool (PoolHandle);
    DiscardAsyncTimer (ThreadTimer);
    ThreadHandle = - 1;
    ThreadTimer = - 1;
    PoolHandle = - 1;
    }
    / * simulated stream * /.

    int CVICALLBACK FBGLAB_ThreadStreamingWavelength(void *functionData)
    {
    ThreadStatus = ThreadSamples;
    While (ThreadStatus > 0)
    {
    Delay (1.0);
    ThreadStatus-= 1;
    }
    ThreadStatus = 0;
    Return (0);
    }
    / * async-timer callback * /.

    int CVICALLBACK FBGLAB_Timer(int reserved, int timerId, int event, void *callbackData, int eventData1, int eventData2)
    {
    If (event is EVENT_TIMER_TICK)
    {
    printf ("State of Thread is %0d\n", ThreadStatus);
    ProcessSystemEvents();
    }
    Return (0);
    }
    / * part of the function to retrieve the status of streaming * /.

    long __stdcall FBGLAB_GetStreamingStatus (long lDevice, char * response, long BufferSize)
    {

    int Status, FunctionStatus;
    Status = CmtGetThreadPoolFunctionAttribute (PoolHandle, ThreadHandle,
    ATTR_TP_FUNCTION_EXECUTION_STATUS,
    (& FunctionStatus);
    }

    / * Start simulated stream * /.

    long __stdcall FBGLAB_StartTest (long Nsamples, double SampleInterval)
    {
    int Status = 0;
    If (PoolHandle > = 0) return (FBGLAB_ERROR_MULTIPOOLEXIST);
    If (ThreadHandle > = 0) return (FBGLAB_ERROR_MULTITHREADEXIST);
     
    If (status > = 0)
    ThreadTimer = NewAsyncTimer (1,0, -1, 1, FBGLAB_Timer, 0);
    If (status > = 0)
    Status = CmtNewThreadPool (1, & PoolHandle);
    If (status > = 0)
    Status = CmtSetThreadPoolAttribute (PoolHandle, ATTR_TP_THREAD_PRIORITY, THREAD_PRIORITY_HIGHEST);
    If (status > = 0)
    Status = CmtScheduleThreadPoolFunctionAdv (PoolHandle,
    FBGLAB_ThreadStreamingWavelength, NULL,
    THREAD_PRIORITY_HIGHEST,
    FBGLAB_ThreadCleanup,
    EVENT_TP_THREAD_FUNCTION_END, NULL,
    CmtGetCurrentThreadID(),
    (& ThreadHandle);
    Return ((long) Status);
    }

    Hello again,

    It seems that the solution is as simple as the cause.

    -J' I create a pool of threads of high priority and program a priority acquisition function. Planning is done with CmtScheduleThreadPoolFunctionAdv. I do not use the option for a reminder at the end of this threadfunction.

    -A second more later (or in the service of acquiring) I schedule a cleaning of normal priority in DEFAULT_THREAD_POOL_HANDLE. Planning is done with CmtScheduleThreadPoolFunction. Inside this function, I wait until the acquisition thread is finished: CmtWaitForThreadPoolFunctionCompletion

    -Because all these functions are to 'demand' the original calling function returns. I get the prompt matlab for other tasks.

    I have to check what expectation-statement requires less processing for example power CmtWaitForThreadPoolFunctionCompletion or delay with the State Audit.

    But I have already seen that this combination:

    -start the acquisition in a high priority thread pool

    -then release the assignment of function and removes the high priority pool

    -During this time I had the back guest matlab and can run another task

    Thanks to everyone for their contribution, Jos

  • life cam3000, I sound even when the volume is turned off and I want to record from the input card.

    Hi and thanks for your support.

    The lifecam 3000 is ideal for photography, but I can't find a way to change the settings for audio,

    and also, I have only the settins wmv for video.

    I search the Web for a program that can do both, but with no good result.

    I HAVE TRY TO DΘSACTIVER THE MICROPHONE, but the cam is not work whitout it.

    Even if the volume of the microphone to * 0 * I hear coming from the microphone of the camera...

    I want to playing me video drum but earing the microphone cam make a sound broooooov.

    With all that CV and a counter to delay the start and stop sewing,.

    a program and a complete cam and one of the best on the market for the price.

    I must say that I am running with vista 32B.

    Sincerely, Stensonn.

    If equipment has replaced the onboard audio hardware, the BIOS should then be edited, disable

    the integrated audio controller. If or other configurations exist, then we can use both, for to do, with only old

    installed audio hardware, Vista, mgr open the device, scroll down to sound, expand the tree, look for the hardware, R.click

    in this regard, select "Uninstall", output device mgr, pc shutdown... Install the new card, start the pc, enter the BIOS, disable the old, start

    Vista. Install new, install any drivers/software, vista installs auto... Once through, restart pc 2 X or so, once through, at startup.

    enter in BIOS, select old material, exit, install vista it automatically. The only problem, both are installed, but can only be

    run at a given time. It is / was average XP, probably the same vista. You can go to run, type: DXDIAG to run the

    Tests of direct X...

  • Calculation Percenatage in oracle

    I have a SENSOR table as follows

    Sensor_id

    Maxi_value

    1

    10

    2

    15

    3

    16

    4

    20

    5

    17

    6

    19

    7

    14

    8

    11

    9

    15

    With the help of County

    SELECT count (*) AS DELAYED the sensor where Max_value > 15;

    SELECT count (*) AS aDEFERRED the sensor where Max_value < 15;

    Calculate the percentage of DELAYED / DELAYED + FALLS


    I've used this query but in error

    Select (select count (*) AS DELAYED the sensor where Max_value > 15).

    (select count (*) AS DELAYED of the sensor

    where < 100 Max_value), ((SELECT RETARDÉ/RETOMBE + RETARDÉ)) * 100)) AS DEFECTIVE.


    ORA-00923: THE KEYWORD not found where expected

    00923 00000 - "OF THE keyword not found where expected

    Please I need help on how to solve this problem.



    Maybe I'm missing something here, but is it not simply:

    Select Report, delayed,

    (delay / (delay + signalis)) * 100 pct_delayed

    FROM (select count (cases where max_value > 15 May 1 end) delayed,

    Count (case when MAX_VALUE<= 15="" then="" 1="" end)="">

    the sensor)

    Depending on how you feel about 15, you might want to > = deferred and< for="">

    John

  • AS2 Timer needs to pause

    Hello everyone,

    I am a bannerslider who will the next Movieclip/Image every 7 seconds.

    But I did a playback / pause in it so that the timer could take a break.

    But my problem is that the timer is not a break. And I don't see the problem!

    Maybe someone can put me in the right direction?

    My ACE is as follows:

    slides = 5; <-Hoeveel er & tuning
    wait = 7; <-some second per image
    playclip._visible = false;

    contentHold.content1.button.onPress = function() {}
    getURL ("
    www.visualbrand.nl/kijken.html", "_self");
    };
    contentHold.content2.button.onPress = function() {}
    getURL ("
    http://www.bestsellers.nl/catalog/category/view/id/249", "_self");
    };
    contentHold.content3.button.onPress = function() {}
    getURL ("
    http://www.bestsellers.nl/music/8718036994508.html", "_self");
    };
    contentHold.content4.button.onPress = function() {}
    getURL ("
    http://http :// www.bestsellers.nl/5099990631825.html", "_self");
    };
    contentHold.content5.button.onPress = function() {}

    getURL ("http://www.bestsellers.nl/catalog/category/view/id/270", "_self");
    };
    contentHold.content6.button.onPress = function() {}
    getURL ("
    http://www.visualbrand.nl", "_self");
    };
    currentPosition = contentHold.content1._x var;
    var startFlag = false;
    menuSlide = function (input) {}
    If (startFlag == false) {}
    startFlag = true;
    var _loc1 = input._x;
    var distanceMoved = 0;
    var distanceToMove = Math.abs (_loc1-currentPosition);
    var finalSpeed = 3.000000E - 001;
    currentSpeed var = 0;
    var dir = 1;
    -> SLIDE VAN LINKS/RIGHT LEFT/LINKS NAAR < -.
    If (currentPosition < = _loc1) {}
    dir = - 1;
    } ElseIf (currentPosition > _loc1) {}
    dir = 1;
    }
    end else if
    contentHold.onEnterFrame = function() {}
    currentSpeed = Math.round ((distanceToMove-distanceMoved+1) * finalSpeed);
    distanceMoved = distanceMoved + currentSpeed;
    contentHold._x = contentHold._x + dir * currentSpeed;
    If (Math.abs (distanceMoved-distanceToMove) < = 1) {}
    contentHold._x = maskMovie._x - currentPosition + dir * distanceToMove;
    currentPosition = input._x;
    startFlag = false;
    delete contentHold.onEnterFrame;
    }
    end if
    };
    }
    end if
    };
    bAll.mov1.b1.onRelease = function() {}
    menuSlide (contentHold.content1);
    bAll.mov1.gotoAndPlay (1);
    bAll.mov2.gotoAndPlay (1);
    bAll.mov3.gotoAndPlay (1);
    bAll.mov4.gotoAndPlay (1);
    bAll.mov5.gotoAndPlay (1);
    bAll.mov6.gotoAndPlay (1);
    bAll.mov7.gotoAndPlay (1);
    };
    bAll.mov2.b2.onRelease = function() {}
    menuSlide (contentHold.content2);
    bAll.mov1.gotoAndPlay (175);
    bAll.mov2.gotoAndPlay (175);
    bAll.mov3.gotoAndPlay (175);
    bAll.mov4.gotoAndPlay (175);
    bAll.mov5.gotoAndPlay (175);
    bAll.mov6.gotoAndPlay (175);
    bAll.mov7.gotoAndPlay (175);
    };
    bAll.mov3.b3.onRelease = function() {}
    menuSlide (contentHold.content3);
    bAll.mov1.gotoAndPlay (350);
    bAll.mov2.gotoAndPlay (350);
    bAll.mov3.gotoAndPlay (350);
    bAll.mov4.gotoAndPlay (350);
    bAll.mov5.gotoAndPlay (350);
    bAll.mov6.gotoAndPlay (350);
    bAll.mov7.gotoAndPlay (350);
    };
    bAll.mov4.b4.onRelease = function() {}
    menuSlide (contentHold.content4);
    bAll.mov1.gotoAndPlay (525);
    bAll.mov2.gotoAndPlay (525);
    bAll.mov3.gotoAndPlay (525);
    bAll.mov4.gotoAndPlay (525);
    bAll.mov5.gotoAndPlay (525);
    bAll.mov6.gotoAndPlay (525);
    bAll.mov7.gotoAndPlay (525);
    };
    bAll.mov5.b5.onRelease = function() {}
    menuSlide (contentHold.content5);
    bAll.mov1.gotoAndPlay (700);
    bAll.mov2.gotoAndPlay (700);
    bAll.mov3.gotoAndPlay (700);
    bAll.mov4.gotoAndPlay (700);
    bAll.mov5.gotoAndPlay (700);
    bAll.mov6.gotoAndPlay (700);
    bAll.mov7.gotoAndPlay (700);
    };
    bAll.mov6.b6.onRelease = function() {}
    menuSlide (contentHold.content6);
    bAll.mov1.gotoAndPlay (875);
    bAll.mov2.gotoAndPlay (875);
    bAll.mov3.gotoAndPlay (875);
    bAll.mov4.gotoAndPlay (875);
    bAll.mov5.gotoAndPlay (875);
    bAll.mov6.gotoAndPlay (875);
    bAll.mov7.gotoAndPlay (875);
    };
    bAll.mov7.b7.onRelease = function() {}
    menuSlide (contentHold.content7);
    bAll.mov1.gotoAndPlay (1050);
    bAll.mov2.gotoAndPlay (1050);
    bAll.mov3.gotoAndPlay (1050);
    bAll.mov4.gotoAndPlay (1050);
    bAll.mov5.gotoAndPlay (1050);
    bAll.mov6.gotoAndPlay (1050);
    bAll.mov7.gotoAndPlay (1050);
    };

    playclip.onRelease = function () {}
    lastTime.play ();
    Pauze._visible = true;
    playclip._visible = false;
    };

    pauze.onRelease = function () {}
    lastTime.stop ();
    playclip._visible = true;
    Pauze._visible = false;
    };

    Count = 1;
    delay = 1;
    last time = 0;
    _root.onEnterFrame = function() {}
    If (delay == 1) {}
    If (Math.floor (getTimer () / 1000) == last time + 1) {}
    Delay = 0;
    }
    end if

    } ElseIf (Math.floor (getTimer () / 1000) == last time + wait) {}
    last time = Math.floor (getTimer () / 1000);
    delay = 1;
    If (count == 1) {}
    move = 1;
    } ElseIf (count == slides) {}
    move = 1-slides;
    }
    end else if
    Count = count + move;
    trace (Count);
    menuSlide (contentHold ["happy" + count]);
    }
    end else if
    };

    Thank you in advance!

    remove the asterisks.

  • Outputs produced by the analog input job Retrig delay counter

    Hi all!

    First of all, I want to thank everyone on this forum who take the time to answer the questions, this forum has been invaluable to me.  I have a question about delays in adjustment to the pulse output of a counter, like what is described here.  My question is related to another, asked hereon the trigger of an analog signal and producing a pulse for each triggered event.  I have this job and can be seen in the attached vi.  Basically, now I'm able to produce a TTL pulse whenever my analog signal passes a predetermined threshold.  I have also documented the vi to my best understanding, if I have something wrong in the documentation, please let me know.

    In any case, now that I have a pulse at each outbreak, I would like to be able to adjust the delay of events so that the pulse is not produced until the period n/20 (n = 0, 1, 2,... (19) what I expect to see is a similar pulse train in 'fig. 2' in the article, where the white pulse is the counter pulse, and the pulse red would be the same as my analog signal.  So, for example, if I had a 281Hz signal, I want to produce a single pulse with a width defined by the user whenever my signal crosses a threshold (it's zero delay: 0/20); This part may be made using the vi attached to this subject.  Now I want to delay this impulse as to each trigger event, a pulse is not produced until 1/20 of the period, or 0,000178 seconds after the trigger.

    Looking at my vi, I think that if I change the output channel of the meter to 'CO Pulse Time' and then set the respective initial delay, time and little time, I can get delayed impulses mentioned in the article.  Correct me if I'm wrong, but I think that basically 'big time' controls the pulse width. 'initial period' is what controls how long to wait after the first trigger event is reached, before generating a pulse, but this applies only to the first impulse and not the rest; and finally 'small time' is the time to wait before the next pulse is created.

    Earlier today, when I use the CO Pulse Time option, it seemed to work properly for me to a certain degree.  At low frequencies the impulses seem to trigger to each event when the pulse width is set at 2.5% of the period.  When I tested at 281 Hz with a pulse width, 'big time' of 0,000089 sec and without anything wired for the 'initial delay' or 'small time', the impulses seem to ignore systematically each triggers 2... that tells me that something is wrong in my settings, rather than problems with the sample clock.  So I decided to connect '0' to 'small time', but then I got an error message indicating that some time may be less than a value (I forgot what the error message).  So I concluded that I must not understand what these terms mean.

    Sorry for the long explanation, but I really need help with this.  So let's say that the first set of data, I want to acquire is at zero delay, such as pulses are generated at each triggering event like how I have my VI now; so, for the next set of data I want pulses to generate 0,000178 seconds after the trigger threshold; so, for the data set third, I want to pulses to generate 0,000356 seconds after the trigger threshold; and so on... How should I do for this?  Thank you very much!

    Hello!

    Please post on the Forums OR! I think the main issue here is that you are sampling not fast enough to catch all of your high. So you set your high dry 0,000089. You will need to substantially increase the frequency of sampling in order to catch all these. Something around 25 k should do the trick.

    To the extent where using the time counter Pulse, you're totally on track. I think that the use that the delay will do the job.

    I hope this helps! Let me know!

  • How to reset the counter at each iteration, and how to introduce a delay

    Hello world

    First of all I apologize for the basic level of my questions, I'm new with Labview...

    I'm counties of reading out of a USB-6008 labview chip using the DAQ assistant and I write the output to a file. The problem is that instead of giving me the number of levels for each iteration it gives me the sum of all this. How to make Wizard Reset to 0 data acquisition account on each iteration? I tried using a shift register, but it added a counter to my folder and nothing else...

    Thank you very much

    Sure thing. Sorry about that.

  • How to count the number of conditionally highlight cells in a column or row

    I'm working on a table to identify problems with my credit rating. So, I have a column that indicates the due date on the invoice and G that contains the date to which I made the payment.

    I'm trying to follow how many times I'm late with payments. I want to improve.

    So if the G column is later than column D, both with the Date formatting. So, now I've highlighted cells and I want to summarize for the year, how many times I was late payments.

    I thought a column G to count the number of days before or after that back I was with payments. But if the sum, it only gives me no useful information. I guess I could count the number of cells with values less than 0.

    I prefer to be able to put in the summary column for G something that said 0-12 years ago has highlighted cells in the column.

    Thank you

    You can not count based on sharing or formatting.  You can, however, be based on the same conditions.

    There are functions:

    COUNTIF() counties based on a condition is true

    and

    COUNTIFS() based on several conditions being true

    = NB. If

    Here is a way.  IT will take an additional column that calculates the "delay" in the days of a payment

    the first two lines are the lines of header

    H3 = IF (COUNTA (D3, G3) > 1, MAX ((G3−D3) DUR2DAYS, 0), "")

    It's shorthand dethrone select cell H3, and type (or copy and paste it here) the formula:

    = IF (COUNTA (D3, G3) > 1, MAX ((G3−D3) DUR2DAYS, 0), "")

    Now select cell H3, copy

    Select the H3 cells at the end of column H, dough

    H1 = "payments late =" & COUNTIF(H,">0")

  • Version 2.0 of the Firmware is delayed

    All,

    For the first time in our timeline of the firmware, we regret to inform you that firmware Version 2.0 is delayed a few days due to the last minute, programming complexity. As you can imagine this version has some very powerful new features that are more complex to finish than expected.

    Tentative release date is this Friday OCT. 4.

    We thank you for your patience and understanding, I will update you here if the situation changes

    Concerning

    Peter

    J_Lanyard - I didn't know that Peter had said that it is on the calendar. In this case, I can understand that you counted on it...

  • Acquisition of NOR-6602 delay and buffer overflow

    Hello world

    I use an NI PCI-6602 to record photon arrival times. Basically, it counts the number of rising edges on the sample clock 80 MHz which occur between two rising
    edges on the photon TTL signal. The array of integers can be converted at a time by multiplying by 12.5ns. Please find my VI for the task and its attached Subvi.

    I have two problems:
    (1) I want to do this same measure for two photon detector channels. I've set up two independent channels. My goal is to correlate the signals with a gap between them. I am able to implement a delay in the software, but my data there seems to be a small inherent delay between the start of each channel.
    The amount of the delay is seemingly random and occurs in the positive and negative direction. In VI I joined, I tried to use the start of arms in order to get both channels to start acquiring at the same time, but this reduces the severity of the delay, it has not removed completely. There is always a delay of 1 to 500 microseconds. I have implemented the trigger arm to start properly, or there at - it another way to solve this?

    (2) I get an error message indicating that "the data has been overwritten before it can be read by the system. The number of samples that have been collected before this error varies and also varies between the counters on the Board. I had a theory that the transfer of sample rate was not good enough, but according to the manual, the transfer rate should be approximately 2000kS/s. It is more than enough as the photon count rate is less than 50 k/s. The PC that I use has a PCI graphics card too. Is it possible that is to limit the frequency of sampling? Here are the specs of PC: processor Intel Pentium D (3.0 GHz), 2 GB of RAM, nVidia GeForce 7300 graphics THE.

    Thanks in advance.

    Hi James,

    I think you might be interchanging the words "metering" and "sampling".

    The counting begins with the relaxation of beginning of arm, which should be at the same time for both channels (with perhaps a shift of 1 tick, who would be 12.5 ns on the 6602).  Count refers to increment the register of account of material at each tick of the input terminal (80 MHz base time in your case).

    Sampling of the account register will take place at different times on each dependent channel when the photons are detected.  So the temporal measures on each channel will be different, but if a photon should occur on each channel at the exact time you would get an identical timestamp on each channel for a sample.  Sampling refers to the value of the register count in a buffer you can lock read later in the software.

    This image (from theM-series user manual actually, but the 6602 should work the same way) watch your use case:

    The time that the meter is armed is identical between the chains, so each counter at some point value would be equal.  The time sample clock are not identical on each channel, so locked into the buffer values don't would not the same.

    Using the same external signal to sample some registers simultaneously count shows that relaxation of arm early works (in other words, if you give the same sample clock counters, you get the same results).  If the beginning of the arms did not work, you will see different results on each counter even with a same sample clock (the sample clock not to arm the meter).  Out the relaxation of beginning of arm would confirm this point - arm tasks in the software (which is what happens with no beginning configured trigger arm) will give unpredictable delay between each task starts - you will see a difference between the channels, even with a sample clock shared.

    Looks like the problem is that you could have if wait photons occur on the two separate channels at most close at the same time?  You can try out photon detector to confirm whether or not there is a current backlog of the scope.  Looks like it is - but this isn't what you're trying to measure?  Expect photons to be detected by each channel exactly at the same time?

    Best regards

  • How can I specify a delay generates a pulse meter?

    Hi all

    I have a question on the use of the meter to generate the pulse train. I did not how to program but I try the test panel in MAX and I see that it generates pulse train to certain rates and with a pulse duration. I think if it is possible to generate only a single pulse with given the duration of the impulse to sometimes after I start the job? I have a code to generate an analogue waveform, waveform of 35ms. I wonder if it is possible to synchronize the output of the analog waveform and counter such to 12.5ms after that the output waveform has started, I send this unique pulse from the meter port on. I have no idea how to do that, I think to use a delay but it is difficult to accurately control the time exactly 12.5ms.

    Well, assuming DAQmx_Val_Low for the resting State, fires the meter will wait the initial delay and then generate a pulse at the time you request.  Little time is not actually used in this example simple impulse.

    From what you described, you must add a trigger to start your task of meter output (DAQmxCfgDigEdgeStartTrig) to you can set the meter to trigger off the beginning of analog output trigger.  Set the initial delay on the counter for 12.5 ms.  Start the task of counter in front of the task of the analog output.  You should get your pulse 12.5 ms after you have started the task of the AO.

    Best regards

  • PCI-6602 Initial delay

    Hello

    Currently, I use the code below to run counters to a frequency fixed/market factor.  After the first counter triggers the rest of the counters, take turn of shooting using the terminal of initial delay on the creation of the channel vi.  It works well and keeps them all to shoot at a time.

    Now, I need to change the frequency/duty cycle once per second for 70 seconds (70 different points table) and repeat until I want to stop.  I'm able to do it without any problem.

    My problem is to put my initial delay each second based on my frequency to keep a nice ripple effect.  In order to define the initial deadline, I have to stop the task.  Is there another way to keep the evenly spaced counters (a beautiful ripple) depends on the frequency without stop the task?

    I'm assuming that your need to stagger the injectors 'cooking' means that you are concerned by the timing of the active edges of the pulse.  Whether rising asset or fall may not be particularly relevant if we can just make them very short duration.

    1. I would like to begin by suggesting understand you the max freq reasonable you'll never need to host and then plan to stagger the firings through this same interval of time even when you operate at a slower rate that will simplify things considerably.

    2 configure all of your counters in slaves to be redeclenchables (as you already are), but REMOVE the call to Timing.vi DAQmx they will all then be generators of redeclenchables pulse.  Keep have triggered them by CTR0, the master clock.

    3 set the slaves in terms of time of low / high time.  Assuming the State of inactivity which is low (the default if I remember correctly), each 'initial period' equal to this unique 'small time' counters and define the minimum 'big time' can accommodate your system.

    Note: unless the behavior has changed in more recent versions of DAQmx, the value of 'initial period' is used after 1st relaxation while the "small time" value is used for all of the following triggers.  Don't ask * me * why, but NEITHER people have weighed in on this subject in the preliminary discussions, calling it of "expected behavior".   EXPECTED by which is exactly what I wonder.  I have yet to see a single comment saying: ' Yes, great, that's just how I * wanted * he behave. "   IN ANY CASE...

    4. start all your slave counters before you run the master.

    5. the freq of the main counter can be changed on the fly without stopping and reprogramming it.  All counters of the slave will continue to draw a single impulse per side assets of the master.

    6 speculative idea, I haven't checked.  You can * probably * update of low time / pairs high time the slave of counters on the fly as well.  If so, this will allow you to broadcast the 'ripple' overall most of the available range during operation at low speed.  It seems that your application can live with the possibility that these updates of the slave synchronization cannot occur in the same cycle of pulse master.

    -Kevin P

  • Deadline for redeclenchables counter finished

    Hello I am new to labview and using a pcie-6323 and had some problems clock. What I'm trying to do is a counter to generate a clock (picture in the figure) and based on it to trigger and generate a different "trigger camera clock' to trigger a camera. Trigger camera clock is a desk finished, redeclenchables. It is a code writtern by former laboratory. Previously it worked very well.

    Recently, I would like to add a constant delay for all trigger camera clock pulses, not just the initial one. When I saw this example, https://decibel.ni.com/content/docs/DOC-10685, I tried to add the start.delay to my code, as in the following figure. But once I run the program, I got a 200452 error code and the program must be closed.

    I saw this link mentioned to use activate Initial on Retrigger. delay, http://digital.ni.com/public.nsf/allkb/204538A044431C9B86257377004EB952 . But I tried to put it in several different positions, for example after the Creat channel vi, after the moment where vi, after the left trigger vi and the node property trigger, I have always the same error problem.

    I think that the pcie-6323 should be with the STC3 timing engine, http://www.ni.com/pdf/manuals/370784g.pdf , so I don't know why I got the 200452 error. I wonder if there is a simple way to solve this problem and reach my goal. I have seen a few examples used two counters to this late, but I think that there should be an easier way? If anyone can show me a figure or taste vi, it would be very useful. I really appreciate it!

    Thank you very much!

    Startup time is bad, use Initial delay (entrance in create virtual channel - original 0.0008 trigger closed task of the clock). Delay enable initial on retrigger applies to it.

    Another way is to use frame duration clock pulse (duty cycle) as control to delay - start a task on the forehead and the other - on falling edge.

  • How to delay signals

    As part of a larger assignment, I did this 3 bit counter (see attachments). It should output signals in this order:
    000
    001
    010
    011
    100

    (and this should repeat endlessly). But it does not work as expected, I'm stuck.

    I think the problem is output triggers to get to folding and, given that the entry is instantly their output.

    I struggle to find an element that can delay milliseconds. Any help appreciated.

    Hello

    In Multisim, there is a component called TRANSPORT_DELAY that allows you to add a delay to your digital signals. It is in the Misc Digital Group and family TIL. Please take a look at the attached example. You can change the delay time by going to the properties of this component and on the value tab, click editing model.

    I hope this helps.

  • How can I measure the Max delay

    Hi guys,.

    I'm trying to add the module to the pulse to my VI. To do this, I guess I need to measure delay Max.

    In my class VI, I have some instruments of the current driver, LED, spectrometer, camera and temperature controller. In addition, current is the variable I can change all the time during the execution of the VI.

    I was wondering how can I measure the delay between the one and the other, and when I change the value of the current, how long will take to capture the right data

    I knew that the number of cycles to measure VI all the time but how can I do for several parts

    Thank you

    Time required for the execution of some code can be done using 'Tick counts' now if you do not want it for full code but you want for specific elements of the code, then you must use the same function (i.e. "Tick count" separately for each section of the code.

Maybe you are looking for

  • Satellite Pro NB10 - A - 10 PU143E - how to install Win 7

    Hello We recently bought the netbook above, that came pre-installed with Windows 8.1 pro.I want to install Windows 7 on the computer. Initially when I looked in the bios was not the option for the CSM,So I updated the bios, and now I have the MSC opt

  • Problem HP Simplepass not working on windows 8

    I upgraded my hp pavillion dv6 to windows 8, and now my pass simple hp does not work on windows 8. Any suggestions?

  • USRP N200, GPSDO toolkit, scale and 'Phase '!

    I need to run a simple experiment using two USRP N200 auxiliary with labview program to receive the magnitude and the phase of the received signal?  Is this possible? and what is this phase value reception reliable because I checked the value of quan

  • reset the wizard import identity in windows live mail

    Ayuh, I'm trying to move from XP to W7. I remember seeing in migrating from OE to WLM FRONT operating system. (Because the WLM for W7 version lacks the import OE account available in the XP compatible version Wizard?) I installed WLM on XP, and all m

  • the seller link and/or app app built?

    How do we get the link for the seller and the app itself, so that it can be placed in the application when submitted? For example, the application can have a link to itself in the BlackBerry world, so that they can share the app with others.  The sub