Switch digital counter to receive counts between samples not between edges

I'm working with PCI 6602 card. I have created 3 channels:
Ctr2 works in CI Cnt Edges mode (with Sample clock) and gets the samples.
Ctr3 works as a pulse generator.
Ctr4 works as a digital edge which ticks a timed loop where samples from Ctr2 are read (using Counter 1D U32 NSamp mode).
The problem is that the samples are gathered incrementaly and I want them to be gathered differentialy. Now to know how many samples were gathered during one generated pulse I have to copy the subset of the array with gathered samples and subtract it from original which takes time. Is there any way to avoid it?
Attachments:
akwizycja_1FP_5us_histogram_v2_1d.GIF ‏20 KB

If I understand your question correctly, you can let the counter hardware do this for you by performing Period measurement using Units=Ticks.   Each edge of the sample clock signal will store the count value then reset that count back to 0. 
To configure this under DAQmx is a little quirky though.  Under edge-counting, you've wired your "channel" signal to the counter's default Source pin and you use your other counter to generate a sample clock signal.  Under period measurement, DAQmx tends to assume that the "channel" signal will be wired to the default Gate pin and act as an implicit sample clock.  It also expects a constant clock signal to be routed to the Source.  You'll have to override these defaults.
You can use a DAQmx Channel property node to specify that Ctr3InternalOutput should act as CounterInput-->Period-->InputTerminal (or something like that) and that your external signal PFIx should act as Counter-->Timebase-->Terminal.   (Sorry, I don't have LV handy so syntax is very approximate.  Hope it helps you get started at finding the right properties.)   This will let you count differentially, collecting # edges of your channel signal between successive edges of your 200 kHz sampling clock.
200 kHz continuous sampling for counter measurement is a bit on the aggressive side, by the way.  Not only will it be a bit tricky to keep samples moving across the PCI bus, but you'll probably have fairly significant quantization error at that rate.  If your channel signal is nominally, say, 2 MHz, you'll expect 10 counts per interval.  But the effects of quantization may well give you occasional 9's or 11's for a +/- 10% error per measurement.
What kind of external "channel" signal are you trying to characterize?  What's the reason for the high sampling rate of 200 kHz?
-Kevin P.

Similar Messages

  • Differenct between count(0), count(1) and count(*)...???

    Hi,
    Please clarify the difference b/w count(0), count(1) and count(*)...???.
    SQL> set timing on
    SQL> select count(0) from trade
    2 /
    COUNT(0)
    112158506
    Elapsed: 00:00:03.08
    SQL> ed
    Wrote file afiedt.buf
    1* select count(1) from trade
    SQL> /
    COUNT(1)
    112158506
    Elapsed: 00:00:02.01
    SQL> ed
    Wrote file afiedt.buf
    1* select count(*) from trade
    SQL> /
    COUNT(*)
    112158506
    Elapsed: 00:00:02.03
    SQL>
    Is there any differences??
    Thanks
    SATHYA

    Looks the same to me
    admin@10gR2> create table big_table as select * from all_objects;
    Table created.
    admin@10gR2> set autotrace traceonly
    admin@10gR2> alter system flush shared_pool
      2  /
    System altered.
    admin@10gR2> select count(1) from big_table;
    Execution Plan
    Plan hash value: 599409829
    | Id  | Operation          | Name      | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |           |     1 |   185   (2)| 00:00:03 |
    |   1 |  SORT AGGREGATE    |           |     1 |            |          |
    |   2 |   TABLE ACCESS FULL| BIG_TABLE | 72970 |   185   (2)| 00:00:03 |
    Note
       - dynamic sampling used for this statement
    Statistics
            322  recursive calls
              0  db block gets
            947  consistent gets
              0  physical reads
              0  redo size
            413  bytes sent via SQL*Net to client
            381  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              4  sorts (memory)
              0  sorts (disk)
              1  rows processed
    admin@10gR2> alter system flush shared_pool
      2  /
    System altered.
    admin@10gR2> select count(*) from big_table;
    Execution Plan
    Plan hash value: 599409829
    | Id  | Operation          | Name      | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |           |     1 |   185   (2)| 00:00:03 |
    |   1 |  SORT AGGREGATE    |           |     1 |            |          |
    |   2 |   TABLE ACCESS FULL| BIG_TABLE | 72970 |   185   (2)| 00:00:03 |
    Note
       - dynamic sampling used for this statement
    Statistics
            322  recursive calls
              0  db block gets
            947  consistent gets
              0  physical reads
              0  redo size
            413  bytes sent via SQL*Net to client
            381  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              4  sorts (memory)
              0  sorts (disk)
              1  rows processed

  • Sender System and Counter in Receiver file

    Hi,
      I have a requirement of having 'Sender Sytem ID' and 'Counter' in receiver flat file.
    Please suggest, what is the best way to achieve this.
    Scenario :  ABAP --> PI ---> Legacy System
                      Proxy to File scenario
    regards
    Amol

    Hi,
    Please refer the following threads-
    System ID in the user defined function
    /message/686478#686478 [original link is broken]
    As mentioned in the threads, use the method
    System.getProperty("SAPSYSTEMNAME"); in udf for getting SYSID.
    Counter??? DO you mean record counter..something like that??
    You can use the standard count (statistic) or counter(arithmatic) functions for that.Please check the documentation for more help.

  • How to count the number of Fridays and Saturdays between two dates

    Hi every one ... If we want to count the number of Fridays and Saturdays between two dates, how would we do that ? !
    Dates are ( 11-Feb-2010) to (19-May-2010)
    how to do it in SQL
    Edited by: khalidoracleit on Jul 28, 2010 5:51 AM

    some nice coding here, I'm still amazed with what some people can do with "connect by". But I agree with some statements here that this can take "time", and to be honest, it's funny to see it working, but if you do not have a computer, just a calendar and some paper, would you go for "counting" so there must be a better solution?
    The best working math in here is done by Aketi Jyuuzou, who writes so good English that I wonder why he still insists that he doesn't ;-)
    Anyhow I "translated" that code to English, and I really like that math. Math is math and data is data.
    ALTER SESSION SET NLS_DATE_LANGUAGE='ENGLISH';
    WITH my_dates AS (
    SELECT to_date('20100211','yyyymmdd') start_date,to_date('20100519','yyyymmdd') end_date FROM DUAL
    UNION ALL
    SELECT to_date('20100211','yyyymmdd') start_date,to_date('20100214','yyyymmdd') end_date FROM DUAL
    UNION ALL
    SELECT to_date('20100211','yyyymmdd') start_date,to_date('20100213','yyyymmdd') end_date FROM DUAL
    UNION ALL
    SELECT to_date('20100211','yyyymmdd') start_date,to_date('20100212','yyyymmdd') end_date FROM DUAL
    SELECT to_char(start_date,'DD.MM.YYYY') start_date,to_char(end_date,'DD.MM.YYYY') end_date,
           to_char(start_date,'DAY') start_weekday,to_char(end_date,'DAY') end_weekday,
           end_date-start_date day_difference,
           (next_day(end_date,'FRIDAY')-7
           -next_day(start_date -1,'FRIDAY'))/7+1
           +(next_day(end_date,'SATURDAY')-7
           -next_day(start_date -1,'SATURDAY'))/7+1 as count_of_fr_and_sat
    FROM my_dates;
    START_DATE END_DATE   START_WEEKDAY                        END_WEEKDAY                          DAY_DIFFERENCE         COUNT_OF_FR_AND_SAT   
    11.02.2010 19.05.2010 THURSDAY                             WEDNESDAY                            97                     28                    
    11.02.2010 14.02.2010 THURSDAY                             SUNDAY                               3                      2                     
    11.02.2010 13.02.2010 THURSDAY                             SATURDAY                             2                      2                     
    11.02.2010 12.02.2010 THURSDAY                             FRIDAY                               1                      1                      -- andy

  • SCOM-Difference between Problem Count and Event Count in Application Failure Analysis Report

    Dear All, 
    Could someone explain me clearly , the difference between  Problem Count and
    Event Count in Application Failure Analysis  Report. Please help me in understanding What is meant be problem and event in the report .
    Thanks in Advance.
    Regards,
    Rajesh Kumar C

    Hello Rajesh,
    The "problem" is the logically grouped set of the exception events which have the identical hash calculated over several fields as "Stack", "Source", "Failed Function" and so on... So, even if exceptions are different
    in the other properties but hash matches over the considered properties - then all those exceptions go into the same "problem group".
    So, event is an instance of the problem. One event contributes to one problem but one problem might have a huge event count if you have a repeating issue.
    The logic is similar for the performance analysis report, only fields that go into the "problem" hash are different. e.g. "Stack" is not used in hash for perf events...
    Dmitry Matveev

  • Music pauses on my iPhone 5C when switching between apps or when receiving alerts/notifications sometimes (not always) and I have to manually restart the song. I'm running the latest 7.0.1 software. It's a bit annoying.

    Music pauses on my iPhone 5C when switching between apps or when receiving alerts/notifications sometimes (not always) and I have to manually restart the song. I'm running the latest 7.0.1 software. It's a bit annoying.

    I have had a similar problem with my system. I just recently (within a week of this post) built a brand new desktop. I installed Windows 7 64-bit Home and had a clean install, no problems. Using IE downloaded an anti-virus program, and then, because it was the latest version, downloaded and installed Firefox 4.0. As I began to search the internet for other programs to install after about maybe 10-15 minutes my computer crashes. Blank screen (yet monitor was still receiving a signal from computer) and completely frozen (couldn't even change the caps and num lock on keyboard). I thought I perhaps forgot to reboot after an update so I did a manual reboot and it started up fine.
    When ever I got on the internet (still using firefox) it would crash after anywhere between 5-15 minutes. Since I've had good experience with FF in the past I thought it must be either the drivers or a hardware problem. So in-between crashes I updated all the drivers. Still had the same problem. Took the computer to a friend who knows more about computers than I do, made sure all the drivers were updated, same problem. We thought that it might be a hardware problem (bad video card, chipset, overheating issues, etc.), but after my friend played around with my computer for a day he found that when he didn't start FF at all it worked fine, even after watching a movie, or going through a playlist on Youtube.
    At the time of this posting I'm going to try to uninstall FF 4.0 and download and install FF 3.6.16 which is currently on my laptop and works like a dream. Hopefully that will do the trick, because I love using FF and would hate to have to switch to another browser. Hopefully Mozilla will work out the kinks with FF 4 so I can continue to use it.
    I apologize for the lengthy post. Any feedback would be appreciated, but is not necessary. I will try and post back after I try FF 3.16.6.

  • Difference between count(col_nm) and count(*)

    Hi i tried the following
    create table chknull (a )
    as select 1 from dual union all
    select 2 from dual union all
    select null from dual And i selected the values which are not null
    select count(*) from chknull where a is nullReturns me 1 record
    But
    select count(a) from chknull where a is nullReturns me 0 record
    Why it returns like above;
    Could you please give me the hint in this
    Thanks

    Count(<expression>) where expression is a column, a literal or a calculation, counts all non-null occurences of the expression. Since your column a is null, the count of non-null occurences of the expression is zero. Count(*) is a special case of count(<expression>) where the expression evaluates to a row. So, as long as the row exists count(*) will count it.
    Consider:
    SQL> WITH t AS (
      2     SELECT 1 id, 'A' name FROM dual UNION ALL
      3     SELECT 2, 'B'  FROM dual UNION ALL
      4     SELECT 3, null  FROM dual)
      5  SELECT count(*) star, count('Banana') literal, count(name) col,
      6         count(case when mod(id, 2) = 0 then 1 end) calulation
      7  FROM t;
          STAR    LITERAL        COL CALULATION
             3          3          2          1John

  • Counter is skipping counts

    I am using a GPCTR with NIDAQ 6.9.3 on a MIO-16XE-50. I have a motor with a sensor on it that sends a digital pulse based on revolutions. I am using VB6.0 to watch this counter and using it to trigger data conversions. Intermittently, that is, with no pattern or consistency, the counter will skip counts. I know the VB loop isn't too slow, and I've tried slowing the motor down. Any idea as to what is causing this to happen? I've tried adding a low-pass filter to the signal, thinking it was glitchy, but that didn't help.
    any ideas or help would be greatly appreciated.

    Is there any buffering between your sensor and the 16-XE-50? I have noticed that these cards do not behave well if the source impedence is high. You should put a Schmitt trigger between your motor signal and the card. I assume you have checked things like switching levels to make sure your signal is switching a full 0-5V or close to it. I have done a fair bit of work with the GPCTR's on that card and will help further if you need it.
    Regards
    Jamie

  • How to connect grace digital wifi radio receiver to airport express.

    Hi,
    I need to connect grace digital wifi radio receiver to airport express. The receiver works fine with belkin n150, however when connected to express as primary base station ( belkin switch off), it displays
    "Default gateway.......
    Port 80 not found. not connected"
    The conneted type is dynamic wifi network (POE + ). The express is set in bridge mode and configured through ipad.

    Hi,
    Called up the apple support services on Dec 9, 2013 and was on line for almost 1 hour without a solution. However, received a call back from team in Singapore on the same day and commitment to revert on the issue within 24 hrs. Received a call within 24 hrs and the entire discussion came down to the point that I have to manually set the grace digital equipment.
    I tried other options and eventually the simplest thing to do was to set the connection option to DHCP only and ignore the error.
    Now its working fine..

  • How can I eliminate stairsteps between samples in a graph?

    How can I eliminate stairsteps between samples in a graph? I am graphing the input from a fieldpoint AI-100 and I get stairsteps between samples. I'm using Labview 4.1

    Paul,
    It sounds like you are running into the situation where the resolution of the ADC converter is the source of the behavior you see. Your configuration may be set so that a voltage change is not seen between samples, generating multiple points with the same value. If this is the case, the graph you see is correct. It is displaying the points it receives from the FP-AI-100. You can verify this by displaying the graph data in an array, and seeing if some of the adjacent samples show the same value.
    If this is the case, see if you can match the signal range to that of the ADC to take advantage of the resolution available. For example, if you set the range to be 0 to 30 volts, the smallest detectable voltage change would be 7.3 mV (range/gain*2^resolution) bec
    ause the FP-AI-100 has a resolution of 12-bit. You can read up on issues with range and resolution by doing a search on http://www.ni.com using the keywords "range" and "resolution".
    Otherwise you may be able to compensate for this behavior in software, such as running an averaging routine or applying a mathematical formula to the data points.
    Hope this helps!
    Wilbur Shen
    Applications Engineer, Web Support
    National Instruments

  • Count(1) vs count(*)

    Hey once again the same old question:
    Whats the difference between count(1) vs count(*)
    I have read this through many forums and looks like there's no difference and more specifically with latest version of database Optimizer is smart enough to translate b/w * and 1.
    My understanding so far says in Indexed table if you do select 1 from <<table>> it should not be even routed to Table and index fast scan would give back the results vs select * which will get routed to table to check null-ability on all columns.
    Am i missing something.
    comments welcome.
    Thanks!

    Hi, Rohit,
    rohitgoswami wrote:
    No, it sounds like you understand.
    so wouldn't count(1) use index vs count(*) use table?.No. Why would the optimezer do anything different in those two cases? Neither one depends on what's in any row of the table, or what's in any index entry.
    I will make discussion more generic without even putting oracle in picture. Lets say we have a book that has 1000 pages and it has a index. essentially we are saying is below:
    1.) going to first page of the book and reading the index and getting the page number of where chapter endsIn general, the index of a book says nothing about how many pages are in each chapter. Did you mean "table of contents" rather than "index"?
    is same as
    2.) going through all pages of the book and reading the page number to get there are 1000 pages.I don't see the analogy. Neither 1) nor 2) above seems to have anything in common with using an index to count the number of rows in a table.

  • I upgraded to a new apple mac book pro and now when I try to download to adobe digital edition I receive this error:Error getting License. License Server Communication Problem: E_ACT_NOT_READY

    I upgraded to a new apple mac book pro and now when I try to download to adobe digital edition I receive this error:Error getting License. License Server Communication Problem: E_ACT_NOT_READY

    What does that have to do with Digital Publishing Suite?
    We’d love to help but if does have something to do with it, please give us
    some details.

  • I am getting this error message while accessing IT2002 Counting rule 2/01/001 does not exist Message no. 3H010

    hi All,
    I am getting this error message while accessing IT2002
    Counting rule 2/01/001 does not exist
    Message no. 3H010
    Please guide ASAP
    Regards,
    Ayousef

    Hi Ahmed,
    Please go through the below mentioned thread.
    scn.sap.com/thread/1187160
    Regards,
    Haranath

  • List of tables count and Views count in schema wise

    Hi All,
    I want to get all tables count and views count in Schema wise, What is the query for that?
    Thanks in Advance.

    SELECT COUNT(*) FROM sys.tables t join sys.schemas s
    on s.schema_id=t.schema_id
    SELECT COUNT(*) FROM sys.views t join sys.schemas s
    on s.schema_id=t.schema_id
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to dynamically set Min count and Max Count values in Adobe Print Form?

    How to set the Min Count and Max Count values dynamically in a Print Form?
    The values when set should over ride the values set in Binding Tab.
    This is all needed to print multiple Material Number labels on a single page - and the number of labels to be printed needs to be under user control - something like an Avery Address labels
    Please advise.
    Thanks,

    Here is a work around that works for me and may not be an intelligent solution .
    I kept the Min Count to 1 on the subform binding properties.
    Per the number of labels required, I appended the same item to the internal table so many times and passed it to the label.
    it works fine for my requirement.
    However - leaving out the post for a while to see if this can be done at the form level via scripting.
    Thanks,

Maybe you are looking for