Read counter at well defined time intervals

Hardware : PCI-6224 & PCI-6723
Software : DAQmx & Labview
1) I connect an external device that generates TTL pulses to one of the board counters.
2) I want to know how many pulses were generated between 2 reads of the counter.
I can do that so far.
3) BUT it is very important to read the counter at a precise frequency, in other words with a hardware clock.
I tried to create a virtual channel using counter1 and the "DAQmx
timing sample clock" with the card 20MHz timebase as the source to
trigger every read of the counter. The read function is in a while loop.
But it doesn't work. I am stuck at this point.
Thanks for help.

A simple solution is to put a pulse train out of one counter at some known frequency, the period on this pulse train will be time each TTL in will be integrated (counted) from.  Lets say this is 10KHz so each bin of TTL counts will be 100us.  On a second counter set the counter to count TTLs on the source pin corresponding to the TTL in line and have it count in buffered event counting mode from rising edge of the gate to rising edge of the gate.  Now you should set the out pfi of the pulse of the pulse train to the gate pfi of the buffered event counter.  You should be able to count events (TTL edges) on a well defined time period.  I have done this with a 6602 in both traditional and daqMX labview code.  One warning in daqMX mode the default is to filter out 0 events, so if there are times where no TTLs arrive on the source line, and this is a valid case, make this setting false.  I am not infront of LV right now so I cant give you any code or exact function names but hopefully you can follow the general architecture.  Good luck,
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA

Similar Messages

  • How to read from DAQ in different time intervals

    Hello,
    I am currently using LabVIEW 2010. I am new to LabView.
    I have 9 thermocouples I want to record the temperature from and create a graph.
    For one graph I want to graph the data every second for the duration of about 1.25 hours. For the other I want to record and graph the data every 2 minutes for a duration of 30 minutes. The temperature then would be ramped up in an oven and set to a higher temperature. When it is stabilized, recording of the data again will begin again at intervals of 2 minutes for the duration of 30 minutes.
    The first is only to see the real time temperature variation while the program is recording and running. The second graph and data is what I will use to analyze.
    What I need help in is finding out how you can read from the DAQmx at two different time intervals. I tried two parallel loops with each one graphing the two separate graphs I need with a delay time. Those two parallel loops where then surrounded by another while loop. The result is that the outside loop waits until both loops are finished so I do not get the correct results for the real time data graph.
    Is there a way to call on the DAQ data you need at the time interval you desire? Any suggestions to solve this problem? Thank you for your time and help.

    You are on the right track.  Sample the data at the fastest rate and send it to the 1st graph.  For the slower graph, take a sample from the faster data at your desired time interval.  You could use a timer and a case structure for something quick and easy and still have everything run in the same loop.  You could use two loops running at different speeds, it is just a little more involved and a few other things to consider. 

  • Premiere Pro CC Feature Request: add multiple Markers at defined times

    I'm about to post a feature request and wanted to check to see if anyone else was interested, as I've read that forum support can help to get feature requests added - and also just in case this feature already exists, and I've missed it in my Googling...!
    Here's the request:
    Brief title for your desired feature:
    Option to add multiple Markers to a timeline at defined times
    How would you like the feature to work?
    It would be great to have an option in the Markers drop-down menu or to be able to right-click on the Marker icon in the timeline and be able to choose "Add Multiple Markers at xxx minutes/seconds/frames".
    Why is this feature important to you?
    I often end up creating a lot of montages, and it would be great to be able to use this feature to drop a Marker (for example) every three seconds in my timeline so that I can then add a bundle of clips using Automate to Sequence. At the moment, I do this by clicking on the Playhead Position hot text and typing in 00:03, 00:06, 00:09, etc, and dropping a Marker at each point, and this feature would speed things up a bit. I've also been asked by students if this feature is available as well.
    If anyone else would be interested in this request, please let me know...!
    Thanks

    Yes, that's true, when using my method described above, Prem adds each clip from the first frame and cuts it off when it reaches the next Marker, then I use the Slip tool to get them to the bit I like. I'd just like to remove the step of typing the time into the Playhead Position counter by dropping Markers at set intervals or by choosing to use the first xx seconds in the Automate to Sequence dialogue. Either way, the request is in now, but it doesn't look like it'll gain a lot of traction...!
    Cheers for the responses, Jim.

  • How to run two DAQmx Read (Counter in + Digital in) simultaneously?

    Hello to all, i have following issue:
    I want to acquire a digital (UART like) bus signal. For this purpose i use a DAQmx Card (PXI 6070e). I need precise time information about time lenght of 0 and 1, so i use a counter. The counter is adjust to CI Semi Period(continuous samples) -> on the edge change i'll get a new measured time value. It works perfectly, but i newer know what kind of state (0 or 1) actually belongs to current value. Of course they changing with each edge, but i need to know that exactly. So i should take a digital input which watching the current state. Unfortunately i can not synchronise two DAQmx-reads.
    Finaly i should get two values:
    time value(counter) and his state(digital in
    ) to work with them. How can i do this?
    I use LabView 7.0

    [SRQ 211371]
    This is not a trivial taks but here is one way to do what you explained with a PXI-6070E and some external circuitry:
    1. Use buffered semi period measurement to measure the width of your pulses.(Meas Buffered Semi-Period-Continuous.vi)
    2. Use a buffered continuous analog data acquisition with external scanclock (e. g. Cont Acq&Graph Voltage-Ext Clk.vi). Maybe you should use a triggered example to start the acquisition at a defined time.
    Now you could connect your signal to the ScanClock input (PFI7) of the 6070E but then you only would acquire only a sample at either the rising or the falling edge. As you need a sample at both edges you need some external circuitry that generates a short positive TTL pulse at each edge (rising and fa
    lling).
    Sorry that I can't provide a solution for this circuitry but I'm pretty sure something like this should be available as a low cost IC.
    You may want to allow your signal some settling time after the scanclock pulse has occurred. In this case simply acquire data on two AI channels. The first channel is only a dummy channel. Connect your signal to the second channel. The delay can be adjusted with the interchannel delay.
    If anybody knows a good solution for the external circuitry or if anybody has a better approach please post it here.
    Best regards,
    Jochen Klier
    NI-Germany

  • Reading 10 bits at the time?

    Hey!
    I'm currently working on a program reading files where the word-size varies from 4 to 16 bits and for instace 10 or 12 bits/word are common. Tried to search around the forum for a solution on how to read these files properly, but couldn't really seem to find anything that concerned this particular issue. So I'm wondering if any of you guys out there have a reasonable solution to the problem. The files are rather large (20+mb), so I'm hoping for something that doesn't need to do too much math on the file..
    Cheers
    Slafs

    What's the purpose of your reading? If you just copied the data, you wouldn't have to care.
    Do you know beforehand how long the next word will be? - In case you have fixed data structures in the file. Reserve an int as shifting space and another that counts the number of unconsumed bits within it. Read a byte at a time whenever the number of valid bits gets low and shift it in from the right or the left according to the endian of the file coding. Well, the whole math is shifting and counting. But make sure you use some buffered way to read the file unless you hate performance.
    If your file contains some code where the lengths of the words are encoded within the words themselves (Huffman and the like), the math is is little more complicated. You will need to build some type of state machine, which sequentially looks at chunks of bits. From the current state and the next chunk read you determine how many bits of the chunk you consume and if the next word has been completed by these bits.

  • Running a mid 2009 iMac on 10.7.5, 3 gb memory, 320 gb hd.    Suddenly the computer stoped reading DVDs and the only time I can read a CD is if I restart.  Quite often when I insert a CD it gets stuck and I cannot get it out until I restart and it shows u

    Running a mid 2009 iMac on 10.7.5, 3 gb memory, 320 gb hd. 
    Suddenly the computer stoped reading DVDs and the only time I can read a CD is if I restart.  Quite often when I insert a CD it gets stuck and I cannot get it out until I restart and it shows up on the desktop where I can then eject it.
    I have checked and double checked the finder prefs and all looks normal showing a check mark on CDs,DVDs etc. (the ones I want to show up on the desktop)
    I have reset the PEAM, repaired permissions with both the disk utility on the computer and the disk utility when I start up in the Recovery Disk.  I did notice that sometimes the permission repeat the same correction several times before it moves on, and sometimes it doesn’t. I have Windows installed on a partition but I keep it unmounted until it is needed for my wife’s work.  The dock seems to be just fine and all the apps seems to run just fine.  When I insert a photo CD iPhoto does not open but when I insert a music CD iTunes does open. 
    Also, most every time I open iPhoto it takes a long time(sometimes as long as 2 minutes) for it to load.
    Sometimes my Mail (Mail 5.3) does not post new mail but most of the time it does. 
    Once and a while it seems like the computer slows way down but then it seems ok ten minutes later.
    All  of these ‘things’ seemed to have happen suddenly and I have not downloaded anything from the internet in some time.
    Of course the warranty and extended warranty are both no longer in effect having had this computer for more than three years.
    I am running Java and Adobe Player because some of the sites I go to a lot require both.

    I believe that insufficient RAM may be the source of some of your problems. If you have a RAM of somewhere 4 to 8GB, you will experience smoother computing. 3GB doesn't seem right, so you might want to learn more by going to this site:
    http://www.crucial.com/store/drammemory.aspx
    I don't know what know what's happening with your optical drive, but it seems you use your drive quite a bit. In that case, look into a lens cleaner for your machine. It's inexpensive, works quite well.
    I hope you'll post here with your results!

  • How to run an "Automator" application at regular time intervals

    I would like to find out how to run an "Automator" application at regular time intervals, say at every 5 minutes.
    Is there any program, AppleScript or any method to do this?
    I would very much appreciate a help.
    Suwan

    save your workflow as an ical plugin, this will automatically insert the workflow into ical,and create a workflow category for it, then just set to repeat every 5 minutes, or save as an APP and use a program called CRONIX (freeware) to run the schedule.

  • SMS SRS Reporting Point - 7403 at regular time intervals

    Hi,
    At regular time intervals I see a 7403 error message in the "SMS_SRS_REPORTING_POINT" component appearing in my ConfigMgr 2012 SP1 environment. SQL Server 2012 is used.
    My reports are working fine and accessable via the Console and URL. This error 7403 appears twice a day. The srsrp.log states the following at the moment of the issue:
    STATMSG: ID=7403 SEV=E LEV=M SOURCE="SMS Server" COMP="SMS_SRS_REPORTING_POINT" SYS=servername SITE=XXX PID=8180 TID=6516 GMTDATE=Tue Aug 27 04:58:18.849 2013 ISTR0="servername" ISTR1="" ISTR2="" ISTR3=""
    ISTR4="" ISTR5="" ISTR6="" ISTR7="" ISTR8="" ISTR9="" NUMATTRS=0 SMS_SRS_REPORTING_POINT 8/27/2013 6:58:18 AM 6516 (0x1974)
    Failures reported during periodic health check by the SRS Server servername. SMS_SRS_REPORTING_POINT 8/27/2013 6:58:18 AM 6516 (0x1974)
    A few minutes before and after the health check is successful.
    I found out that at the moment of my 7403 error, the SQL RS recycle process is started. The log file reportserverservice.log looks like:
    06:55:58:: i INFO: Recycling the service from the default domain
    The recycle time of SQL Reporting services is configured at 720 minutes, so each 12 hours.
    Can someone tell me if this is normal and how I can avoid the 7403 error?
    Thanks.
    Greets!

    Yes I know this is an old post, but I'm trying to clean them up.
    Have you see this blog / KB before?
    http://myitforum.com/myitforumwp/2011/11/14/fix-configmgr-error-7403-srs-web-service-is-not-running-on-srs-reporting-point-server/
    http://www.enhansoft.com/

  • Error -200429 DAQmx read (counter u32 1ch 1samp).vi -append- Edge count in for loop

    I am receiving error -200429 DAQmx read (counter u32 1ch 1 samp).vi <append>. This is occuring on the second loop of a for loop.
    I have a sequence inside the for loop that is using four DAQmx assistant vi's for edge count at various times in the sequence. All four of these count fine the first time through but at the beginning of the second loop the first edge count receives this error and does not count.
    Any ideas?

    The code you have supplied is similar to the converted subvi but this code will give an empty task error on the DAQmx Create Channel vi.
    Notice on the Daqmx create task vi that there is nothing wired to the "Task to copy" or the "Global virtual channels" connectors - I believe this is why the task is empty when sent to the Daqmx create channel vi.
    The code we are currently using is a modification of a previous code used before a recent upgrade. It may be better in your/NI eyes to re-write this into a State machine but time constraints and resources do not allow that at this time - All other parts of the current program work except for the counter on the second iteration. Would rather not reinvent the wheel at this point. 
    If the task is being cleared was the issue then the other three should also not execute. The issue appears to be the "First Call"
    I have attached a zip file of the complete program as it is now written to give you a better idea of the whole picture.
    Attachments:
    Test Machine current code.zip ‏657 KB

  • Defining Time in select query.

    hi ,
    In BSAK table i dont have time field defined but in my RFC i need to fetch the data based on time and date.
    can any one let me know how can i define time field in the existing query ..
    i am using the below query.
    SELECT lifnr
             xblnr
             bldat
        FROM bsak
        INTO TABLE i_reversal2
         FOR ALL ENTRIES IN i_an_ven
       WHERE lifnr = i_an_ven-lifnr
         AND BUDAT >= date_in
         AND cputm >= time_in
         AND augbl <> ' '.
    thanks,

    sorry correction below.
    SELECT lifnr
             xblnr
             bldat
        FROM bsak
        INTO TABLE i_reversal2
         FOR ALL ENTRIES IN i_an_ven
       WHERE lifnr = i_an_ven-lifnr
         AND BUDAT >= date_in    
         AND augbl <> ' '.
    thanks,

  • Count the number of times a character is in a string using pl/sql

    I need to count the number of times ":" appers in the string ":XXX:CCC:BBB:".
    I have sound some solution using SQL but I do not want the context switch.
    Also I am on 10g so I can not use REGEXP_COUNT.
    Any help would be great.

    Hi,
    length(REGEXP_REPLACE(':XXX:CCC:BBB:','[[:alnum:]]'))counts all kinds of punctuation, spaces, etc., not just colons. Change any (or all) of the colons to periods and it will still return 4. Use '[^:]' instead of '[[:alnum:]]' if you really want to count just colons.
    Also, "SELECT ... FROM dual" is usually needed only in SQL*Plus or similar front end tools. In PL/SQL, you can call functions without a query, like this:
    x := NVL (LENGTH (REGEXP_REPLACE (txt, '[^:]')), 0);

  • Database connection variable is not well defined

    The following error message is in SIL_InsertRowInRunTable.log in Informatica WorkflowLogs directory
    Can someone help me to look where to start to troubleshoot?
    Thanks
    ERROR : TM_6292 : (4836|3912) Session task instance [SIL_InsertRowInRunTable]: TM_6193 [Error occured during expansion of DB connection parameters [Database connection name DataWarehouse for database connection variable $DBConnection_OLAP is not well defined.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    hello ALL.
    My DAC client and Informatica client is on windows and DAC server and Informatica is on Linux.
    I am getting similar issue:
    D:\OracleBI\DAC\ServerLog
    12 SEVERE Wed Feb 18 14:22:43 PST 2009 Starting ETL Process.
    13 SEVERE Wed Feb 18 14:22:48 PST 2009 Informatica Status Poll Interval new value : 20000(milli-seconds)
    14 SEVERE Wed Feb 18 14:22:52 PST 2009 /d01/OracleBIApps/DAC/Informatica/parameters/input/FLAT FILE specified is not a currently existing directory
    15 SEVERE Wed Feb 18 14:22:53 PST 2009 Request to start workflow : 'SILOS:SIL_InsertRowInRunTable' has completed with error code 7
    16 SEVERE Wed Feb 18 14:22:54 PST 2009 ETL seems to have completed. Invoking shut down dispatcher after the notification from the last running task.
    17 SEVERE Wed Feb 18 14:22:54 PST 2009 Finishing ETL Process.
    18 SEVERE Wed Feb 18 14:22:54 PST 2009 MESSAGE:::Some steps failed.
    EXCEPTION CLASS::: com.siebel.etl.engine.bore.SomeSessionsFailedException
    I have made sure that everything that ED has mentioned, i have checked still can't resolve the issue.
    in my WorkflowLogs/SIL_InsertRowInRunTable.log (according to this error, i have placed the required parameters files in the SrcFiles and LkpFiles. but still, the ETL process is being stuck at first step).
    this is the error i found:
    INFO : LM_36435 [Wed Feb 18 12:06:13 2009] : (25894|-1589191776) Starting execution of workflow [SIL_InsertRowInRunTable] in folder [SILOS] last saved by user [Administrator].
    INFO : LM_44195 [Wed Feb 18 12:06:13 2009] : (25894|-1589191776) Workflow [SIL_InsertRowInRunTable] service level [SLPriority:5,SLDispatchWaitTime:1800].
    INFO : LM_36388 [Wed Feb 18 12:06:14 2009] : (25894|-1589191776) Session task instance [SIL_InsertRowInRunTable] is waiting to be started.
    INFO : LM_36682 [Wed Feb 18 12:06:16 2009] : (25894|-1589191776) Session task instance [SIL_InsertRowInRunTable]: started a process with pid [14937] on node [node01_osirhdev12.osius.com].
    INFO : LM_36330 [Wed Feb 18 12:06:16 2009] : (25894|-1589191776) Session task instance [SIL_InsertRowInRunTable]: Execution started.
    ERROR : VAR_27086 : (25894|-1578701920) Cannot find specified parameter file [d01/Informatica/PowerCenter8.1.1/server/infa_shared/SrcFiles/SILOS.SIL_InsertRowInRunTable.txt] for [session [SIL_InsertRowInRunTable.SIL_InsertRowInRunTable]].
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [TM_6793 Fetching initialization properties from the Integration Service. : (Wed Feb 18 12:06:23 2009)]
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [DISP_20305 The [Preparer] DTM with process id [14937] is running on node [node01_osirhdev12.osius.com].
    : (Wed Feb 18 12:06:23 2009)]
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [PETL_24036 Beginning the prepare phase for the session.]
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [TM_6721 Started [Connect to Repository].]
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [TM_6722 Finished [Connect to Repository]. It took [0.24927] seconds.]
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [TM_6794 Connected to repository [PowerCenter] in domain [Domain_osirhdev12.osius.com] user [Administrator]]
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [TM_6721 Started [Fetch Session from Repository].]
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [TM_6722 Finished [Fetch Session from Repository]. It took [16.3948] seconds.]
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [TM_6793 Fetching initialization properties from the Integration Service. : (Wed Feb 18 12:06:40 2009)]
    ERROR : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [CMN_1761 Timestamp Event: [Wed Feb 18 12:06:40 2009]]
    ERROR : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [PETL_24049 Failed to get the initialization properties from the master service process for the prepare phase [Session task instance [SIL_InsertRowInRunTable]: Unable to read variable definition from parameter file [d01/Informatica/PowerCenter8.1.1/server/infa_shared/SrcFiles/SILOS.SIL_InsertRowInRunTable.txt].] with error code [4].]
    ERROR : LM_36320 [Wed Feb 18 12:06:42 2009] : (25894|-1589191776) Session task instance [SIL_InsertRowInRunTable]: Execution failed.
    WARNING : LM_36331 : (25894|-1589191776) Session task instance [SIL_InsertRowInRunTable] failed and its "fail parent if this task fails" setting is turned on. So, Workflow [SIL_InsertRowInRunTable] will be failed.
    ERROR : LM_36320 [Wed Feb 18 12:06:42 2009] : (25894|-1589191776) Workflow [SIL_InsertRowInRunTable]: Execution failed.
    IF any one had similar issues, please reply to this.
    Thanks

  • Incremental Counter in SSRS each time report is run

    Hi
    I need to have a header row in my SSRS report which is an incremental number e.g. each time the report is run the number increments by 1.  Something similar to a hit counter on a website.
    Is it possible to have an internal variable within SSRS which will increment by 1 each time the report is run?
    It seems straight forward, but from reading other articles online, it appears not to be.
    Can anyone advise?

    The most i think you could do is query the ExecutionLog3 view and count the number of times the report has executed successfully.  The problem is this log is only kept for 60 days default.  I am sure if you wanted to you could adjust the period
    of time in which the log is kept (keep in mind it is system wide) or you could pull the data out that you need incrementally and store it.  Here is some information on the view.
    http://technet.microsoft.com/en-us/library/ms159110.aspx
    I think the biggest challenge you will face on this one is political should you go down this path.  Good Luck!

  • Help!!coll​ect data at particular time intervals/​cycles

    Hello,
             I have to write a program to collect data at particular time intervals/cycles. We collect data at 100 points per cycle for 5000 cycles. But due to the huge volume of data I have to collect at certain intervals ( say cycles 1-10, 29-31,49-51 .... 3999-4001 .. 4999-5000). I would appreciate if anyone could please help me with this program.
    Thanks and bext regards
    lax

    Hello,
              Thanks for your reply. I have just started with LABview and the program I am dealing with was written by someone else. Anwyays, we are using  a NI PCI 6259 data aquisition card and NI SCXI (these are data aquisition for each channel I guess). We collect the load and deformation data (using LVDTs), which is the primary purpose of the project. We apply a load for 0.1s and rest for 0.6s. We collect the data at 100 points per second for the whole test (which runs for either 90minutes or 5000 cycles). We just start the test and collect data all the way through and the rate of collection remains the same throughout the test.
              As for finding out when exactly the cycle starts and ends. We will have to find that with time I guess. We plan to collect data for the first 100 cycles, then for 2 to 3 cycles every 50 or 100 cycles (which may increase towards the end of the test, i.e. we might jump from 3000 to 4000cycles).As for collection we collect the data 1sample at a time.
             I have attached a part of the program which measures all the data (which is part of another program). Some VI's might be missing (DAQmx start task, DAQmx stop task, DAQ mx read). Please let me know if you have any solution. Thanks again.
    Regards
    lax
    Attachments:
    Measure_All_FastData_queue.vi ‏51 KB

  • Joining Timestamps and Time Intervals + SQL Server 2012

    I'm trying to compile a report for the uptime of some assets grouped into 10 minute intervals, with the time the asset went down reported on in the next 10 minute block and any block it crosses into.
    Currently I have two tables the first is a Calendar table with entries for each 10 minute block which creates my time intervals for the month.
    CalendarDate
    01/01/2015 20:20:00
    01/01/2015 20:30:00
    01/01/2015 20:40:00
    Etc.
    The second table is my Events table which gives me the start of the down time and the end of the down time along with some other useful data.
    StartTime:-01/01/2015 20:29:25
    EndTime:-01/01/2015 21:42:54
    Asset:-Asset01
    EventCode:-Event01
    TimeOnRoundedUp:-01/01/2015 20:30:00
    TimeOffRoundedUp:-01/01/2015 21:20:00
    And
    StartTime:-01/01/2015 22:01:31
    EndTime:-01/01/2015 22:02:01
    Asset:-Asset01
    EventCode:-Event01
    TimeOnRoundedUp:-01/01/2015 22:10:00
    TimeOffRoundedUp:-01/01/2015 22:10:00
    There is only 1 Event active per Asset at any given time but many events for different assets, some events only last 30 seconds and are within the same 10 minute reporting period, other events span one or more periods.
    The result set I'd like to see is grouped by CalanderDate, Asset and EventCode showing the total number of seconds in the ten minute window the asset was running.
    Using the two examples above I'd like to see the two rows below:-
    CalendarDate, Asset, EventCode, RunningTimeSeconds
    01/01/2015 20:30:00, Asset01, Event01, 565 (600-35)
    01/01/2015 20:40:00, Asset01, Event01, 0 (600-600)
    01/01/2015 20:50:00, Asset01, Event01, 426 (600-174)
    01/01/2015 21:00:00, (600-0)
    01/01/2015 21:10:00, Asset01, Event01, 570 (600-30)
    For the Events that Start and Stop in the same interval I can get those, using DATEDIFF, it's the Events that happen to span one of more periods I can't work out.
    I can add additional columns to the tables if needed.
    Any and all help is greatly welcomed, thank you for reading my post.
    Mark

    Give this a go:
    DECLARE @calendar TABLE (dateTime DATETIME)
    DECLARE @daTetime DATETIME = '2015-01-01'
    SET NOCOUNT ON
    WHILE CAST(@dateTime AS DATE) = '2015-01-01'
    BEGIN
    INSERT INTO @calendar (dateTime) VALUES (@dateTime)
    SET @dateTime = DATEADD(MINUTE,10,@dateTime)
    END
    SET NOCOUNT OFF
    DECLARE @events TABLE (startDateTime DATETIME, endDateTime DATETIME, asset VARCHAR(20), eventCode VARCHAR(20))
    INSERT INTO @events (startDateTime, endDateTime, asset, eventCode)
    VALUES ('2015-01-01 02:39:57','2015-01-01 02:59:32','asset01','event01'),('2015-01-01 10:22:57','2015-01-01 13:01:32','asset01','event01'),('2015-01-01 17:38:57','2015-01-01 19:39:32','asset01','event01')
    SELECT *,
    DATEDIFF(SECOND,
    CASE WHEN e.startDateTime >= c.dateTime THEN e.startDateTime
    WHEN e.startDateTime < c.dateTime THEN c.dateTime
    END,
    CASE WHEN e.endDateTime <= DATEADD(MINUTE,10,c.dateTime) THEN e.endDateTime
    WHEN e.endDateTime > DATEADD(MINUTE,10,c.dateTime) THEN DATEADD(MINUTE,10,c.dateTime)
    END
    FROM @calendar c
    LEFT OUTER JOIN @events e
    ON e.startDateTime BETWEEN c.dateTime AND DATEADD(MINUTE,10,c.dateTime)
    OR e.endDateTime BETWEEN c.dateTime AND DATEADD(MINUTE,10,c.dateTime)
    OR c.dateTime BETWEEN e.startDateTime AND e.endDateTime

Maybe you are looking for