DAQmx non-cumulative buffered edge counting (like the PMT TTL problem) with PCI6221 in C program environment

I have a PCI-6221. I am programming in C/C++ and DAQmx. My application is much like the previous thread counting the number of asynchronous TTL pulses from a PMT in some user specified time interval. The time interval is typically around 1 msec and the signal rates are around 1-10 kHz. So I expect to count 0 to 10 pulses per timebin. In traditional DAQ this was called Non-cumulative buffered edge counting.
To get a clock at about 1kHz, I first create an "analogue in" task that samples at 1kHz. The only thing I use this task for is to route its sample clock to the gate of the counter. This defines my time interval as 1 msec.
I then create the counter task. I am using count edges. So I think counter0 gate = PFI9 and source = PFI8.
DAQmxCreateCICountEdgesChan(*taskHandle,chan,"",edge,initialCount,countDirection);
DAQmxCfgSampClkTiming(*taskHandle,clockSource,rate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,samplesPerChan);
where clockSource="/Dev1/ai/SampleClock"
I apply my signal to PFI8.
After starting the task, I read an array of values with
DAQmxReadCounterU32(taskHandle,samplesToRead,10.0,data,samplesToRead,read,NULL);
I expect the array data to have values ranging from 0-10 for PMT input with an average rate of about 10 kHz. The trouble is that the array data does not seem to make sense. I get constantly increasing values. For very low input frequency, it just increments by one per array member.
More troublesome, when I hold PFI8 at ground, so that I expect zero pulses to be counted at the source for each edge at the gate that occur 1 per msec, I get a timeout error. I really must be able to count zero events per bin.
Am I doing something obviously wrong?

Hello,
The behavior of non-cumulative event counting is equivalent to period measurement. Additionally, the timeouts when no edges occur on your event counting terminal are the result of duplicate count prevention. In DAQ 7.4, the default behavior of duplicate count behavior should take care of this for you, but if you cannot upgrade to DAQ 7.4, I'd do a search of the discussion forums for "duplicate count prevention". There are a number of previous posts about this attribute, including this one.
If you aren't using the second counter on your device, you should be able to use the Period Measurement 2 Counter High Frequency measurement method to get your desired values. The "Measurement Time" attribute in this case would be the "sample clock" (1 kHz in your example). Then just raed the data raw to get counts rather than scaled.
If you'd like to do it using the AI timing engine. Configure a 1 counter period measurement task, use "clockSource" as your input terminal and use your PMT TTL pulses as the "Counter Timebase Source". Then read the data raw, since the scaling will not be appropriate for your needs.
I hope this helps!
gus....

Similar Messages

  • Buffered Edge Counting 20 MHz with duplicate count prevention

    Dear all,
    I went through the specs of several boards (M- series, S- and E- series, 6602 etc...). It seems that these boards can count edges with duplicate count prevention on at a maximum rate <= 20 MHz (i.e., 1/4 of 80 MHz) - but maybe I have misunderstood the docs.
    Is there a NI board capable of buffered edge counting with a general purpose counter for random events going at rates from 0 Hz to > 20 MHz? Do I need to look for a reconfigurable board?
    Thanks in advance.

    Dear Elizabeth,
    Thanks for the answer.
    In my application, events arrive asynchronously (actually, randomly). During the duration of a gate (namely, 1 microsecond), one expects anything from 0 to many (i.e., possibly more than 20, up to 80) events. This requires duplicate count prevention. 
    I may have misunderstood the specs for M series boards, but the document:
    Using Duplicate Count Prevention for Counter Tasks in NI-DAQmx
    from the NI web site, for instance, states that:
    "All the other timebase edges that occur while the external source input is high are ignored. If no source edges are detected between two gate edges, as shown in Figure 3, duplicate count prevention ensures that pulse measurements return zero because the external source must be logic high to allow the internal timebase to increment the count register. This reduces your maximum source frequency to quarter of the original maximum (80MHz) timebase for NI-STC II and NI-TIO boards. Therefore duplicate count prevention should only be used if the frequency of the Source signal is 20 MHz or less.
    Duplicate count prevention should only be use in the following situations:
    Counter measurements
    The counter Source is using an external signal (such as PFI x)
    The frequency of the external source is 20 MHz or less
    What's your take on that?
    Thanks for your time.

  • Edge counting buffer/arr​ay size problem (VC++)

    Hello,
    I accidentally posted this in the multifunction DAQ forum so forgive me for posting this again here.
    I am attempting to do a buffered edge counting with PCI-6115 for the application I am trying to develop.
    Ideally, I would initialize a buffer array, then use a sample clock to time and acquire counter values which would then be stored in a buffer. 
    After a certain number of samples, I would then use the
    DAQmxReadCounterU32 function to extract the said data and perform some
    calculations.
    However, windows gives me an error when I try to initalize the size of the buffer array to be larger than 255001, I need 264000+.
    Essentially, only this part of the code seems to execute:
    int         error=0;
    TaskHandle  taskHandle=0;
    TaskHandle  taskHandleCtr=0;
    uInt32      data[260000];
    After trying to initialize the uInt32 array my program crashes saying there was an error with my exe with a popup asking me if i want to send an error report to Microsoft.
    Would
    this be a problem of windows not allowing me to allocated more than
    255000 32 bit samples for that array?  If so how do i put the array
    onto the onboard memory?
    Solved!
    Go to Solution.

    Sorry guys, it actually didn`t have anything to do with the DAQ board.
    Apparently it was C++ that limits the size of the array I was calling, which was the traditional "int a[size]".
    I used this instead to solve my problem:
        int* a = NULL;
        a = new int[10000000];
    Problem solved.
    Sorry for posting in the wrong forum, and thank you to everyone who's read this.
    Howard

  • Hello, is there any way of having a reboot disk for lion that I'm downloading, like the one I have with snow leopard ?

    Hello, is there any way of having a reboot disk for lion that I'm downloading, like the one I have with snow leopard ?

    Once the Lion download is complete quit the installer and follow these directions. The file you need to make a boot disk disappears after you install Lion.
    Egg Freckles | Burning A Lion Boot Disc
    However, the Lion installation includes a recovery partition. It won't be of help if your entire HD dies but is very handy otherwise. This Knowledge Base article has a lot of good information about Lion's recovery partition.
    OS X Lion: About Lion Recovery

  • I would like to ONLY buy Lightroom, but it seems like there is some problems with this option. Or is it not an option anymore? (I already have photoshop installed)

    I would like to ONLY buy Lightroom, but it seems like there is some problems with this option. Or is it not an option anymore? (I already have photoshop installed)

    Photo editor app | Download free Adobe Photoshop Lightroom 5 trial
    At the above link go down to the bottom of the page right hand side. There is a button to purchase the Lightroom Perpetual License.

  • HT1766 The screen shows problems with iCloud only choices are ignore or settings, however nothing I do will unlock it from this screen, cannot power off keeps that bubble on the screen. What do I do?

    The screen shows problems with iCloud only choices are ignore or settings, however nothing I do will unlock it from this screen, cannot power off keeps that bubble on the screen. What do I do?

    Try this now.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.

  • Is there a fix yet for the no sound problem with lion on the iMac without having to restart every time I switch the computer on?

    Is there a fix yet for the no sound problem with lion on the iMac without having to restart every time I switch the computer on?

    Try booting in Safe Mode by holding the the shift key immediately after powering on your system. Safe boot mode will for a directory check of your startup volume, then load only the required kernal extensions (kext files), and deletes some cache files. Once the system boots into Safe Mode you can simply restart the system to see whether the issue has been resolved.
    If you still have the issue try resetting the SMC by shutting down the system and disconnecting the power cord for ~15 seconds, then reconnecting the power cord. Next, reset the parameter RAM (PRAM) by holding down the option-option-P-R keys after powering ON the system. Wait until the iMac restarts twice, then let the system boot normally.

  • Buffered edge count FIFO overflow even at very low rates

    Dear Forums,
    I am trying to use a PXI-6608 to timestamp the sample clock of a PXI-4498 during analog input. Because the sample rate will be on the order of 20KHz, I want to use a pulse generation task on one counter to divide it down by a factor of 1000, then use that pulse as the gate and the 10MHz clock on the 6608 as the source in a buffered edge -- I expect about 20 edges per second, which should be very manageable to retrieve over DMA.
    The result is that I get error -200279 ("attempting to read samples no longer available") immediately after the vi starts, before I have retrieved even one count.
    This is my first stab at using DAQmx for counter/timer instead of the old DAQ drivers, so I'm sure I've done something wrong, but I can't figure out what.
    I've attached the vi if that helps.
    Thanks!
    Cas
    Solved!
    Go to Solution.
    Attachments:
    simplified chassis test.vi ‏314 KB

    It appears that you have your gate and source backwards.  The sample clock should be ctr0internaloutput and the count edges terminal should be the 10 MHz clock.  You are getting the buffer overflow error because the FIFO on the card is only 2 samples and at 10 MHz these are being rewritten was faster than a computer could possible pull them off the card.
    Doug Farrell
    Product Manager - Condition Monitoring
    National Instruments
    National Instruments Condition Monitoring

  • I have a 7th generation nano, and am interested in the Nike   Ipod sport kit.  However, it looks like the kit only works with older nanos with the 30 pin connector.  What kit or what accessory do I need to utilize the Nike   ipod sport kit fuctionality?

    I have a 7th generation nano, and am interested in the Nike + Ipod sport kit.  However, it looks like the kit has a 30 pin connector on the receiver and the 7th gen nano is a lightning connector.  Not sure if the kit will work.  What kit or what accessories do I need to utilize the Nike + ipod sport kit fuctionality in the 7th gen nano?  Do I just need a separate sensor and/or a heart rate monitor? Or is there a kit available for 7th gen nanos?

    Hey SeanW89,
    Thanks for the question. The iPod nano 7th generation has bluetooth functionality that can connect to the Nike+ sensor. You do not need to purchase the USB kit, but rather just the sensor itself:
    Nike + iPod Sensor - Apple Store (U.S.)
    http://store.apple.com/us/product/MA368LL/E/nike-ipod-sensor
    iPod nano (7th generation): Frequently used features
    http://support.apple.com/kb/HT5470
    Connect to Bluetooth accessories
    You can connect your iPod nano to compatible Bluetooth headsets and other accessories, including some hands-free systems in newer cars. You can also connect to a Nike+ sensor or a Bluetooth heart-rate monitor. iPod nano supports A2DP for audio streaming and AVRCP for controlling playback on Bluetooth devices.
    Note: FM radio will not play through a Bluetooth accessory.
    Thanks,
    Matt M.

  • Adding To The LIst Of Problems With Internet Explolrer 11 And Another Browser

    I've b1 of the EA6500 router and like the othe posts I can't use IE 11.  The "solution" is to use either Chrome or Firefox but not my Chrome has stopped working.  All I get now is the LInksys Blue background.  When I first see the site it looks like it's trying but then gives me a blue page.  I've included screen prints of what I see when I go to Linksys Smart Wi-Fi page and below that is the version number.  I have deleted my browser history, cache, saved form data, etc. but the result is still the same.  And it doesn't matter if I use the router IP address or the Smartsys Wi-Fi link.
    So right now the only broweser that will let me do router administration is Firefox but something tells me it too will have problems eventually.
    the problem I'm having isn't with the router, it is with the company.  People have tried to blame Micrtosoft in these posts for the problem but it's not their problem.  The real kicker is that these Smart Wi-Fi routers are not old. nor are they cheap.  LInksys announced this line at CES 2012, then again in April, and the last one announced for thie "initial" line-up of new routers  was the EA6500 (the EA6500 was anounced in June 2012).
    I've been mostly happy with LInksys reouters but if this is the way they are going to conduct business, then maybe I need to make certain adjustments with the networking products we purchase. 
    To put it bluntly...this situation is unacceptable.

    Believe it or not I stumbled across the solution to the problem and need to partially retract one of my previous statements.  In a sense part of the responsibility does go to Microsoft because during one of their infamous "updates", the default version of Internet Explorer was changed to use the 64-bit version.  I rarely used the Internet Explorer (64 bit) link in my Start Menu...I always used the "default" which apparently was the 32-bit version because there are plenty of companies that have not updated their software for 64-bit.
    The article I came across is Problem With Internet Explorer? Maybe You Need Fewer Bits.  The fix is simple and all it really takes is to right-click the icon for Internet Explorer and choose "Properties".  When that comes up change the value in the "Target" field from "C:\Program Files\Internet Explorer\iexplore.exe" to "C:\Program Files (x86)\Internet Explorer\iexplore.exe".  Once you make the change save the change and then use that link to get to administer your browser.  I tried it and it worked.  I guess I missed the post from Linksys Support about that possibility.

  • Looks like there is a problem with your recording ...

    When I turned on my laptop today, I noticed that I was unable to use the webcam in skype. When looking within the video settings, there is a message that states "Skype could not find a webcam...". When trying to use Skype Metro App, it detects the webcam, however when trying to do a video call, the webcam does not turn on, and when trying to send a video message, there is the message "Looks like there is a probelm with your recording".
    This problem impacts all applications except for the Camera Metro App (Which works without problem). 
    I've confirmed that the webcam is in the device manager under imaging devices and I've tried to use both the default microsoft drivers, as well as the manufaturers drivers with no avail. There is no error under device manger for the webcam. I also tried a system restore to a date before the issue took place which also did not work.
    Any help would be greatly appreciated

    ruwim wrote:
    Please,  run the DirectX diagnostics tool.
    Go to Windows Start and in the Run box type dxdiag.exe and press the OK button. This will start the DirectX diagnostics program. Run this diagnostics and save the results to a file. Please, attach this file to your post.
    Be aware that you will have to zip this file before attaching it here.
    How do you attach a file on these forums? I've tried looking for an option to attach a file however I could not find one. 

  • Could not find the main class - Problem with Webservice-Access

    Hello Everybody,
    I'm having serious Problems with accessing a WebService (Tomcat-Axis) per executable jar-File.
    I constructed a simple GUI with 3 Textboxes 1 Button and 1 Resultbox.
    I use eclipse so it was no Problem to simple generate the Backgroundclient by Processing the .wsdl-File of the WS.
    Now I do this:
    Head_tServiceLocator serviceLocator = new Head_tServiceLocator();
    Head_t service = serviceLocator.getRPCCall();
    RPCCallSoapBindingStub Head_t = (RPCCallSoapBindingStub) service;and use the Webservice like an Object.
    All this works very well.
    Now the Problem:
    Head_t service = serviceLocator.getRPCCall();this Line has to throw a ServiceException.
    If i add a try-catch Block to Process the Message JAVA tells me after i exported to JAR (with Manifest-stuff and so on) and double Click on the JAR the following :
    Could not find the main Class - Program will exit.
    And if i add a throws Declaration to the Methodheader it tells me:
    Fatal Exception Occured - Program will exit
    But if i Comment out that Line at least the GUI is being displayed (so it DOES find the main-Class). But then of course the Webservice won't be accessed.
    All the JARs needed (axis.jar, commons-discovery.jar and so on) are in the same Directory as the Webservice-Client.jar
    Please Help me.
    Greets,
    Zap

    I am not done any typing mistake while creating the jar file i already followed the suggestion that you have mentioned but still the same error .
    This is my MANIFEST.MF file created under META-INF folder
    Manifest-Version: 1.0
    Class-Path: qtjambi-4.4.3_01.jar qtjambi-win32-msvc2005-4.4.3_01.jar
    Created-By: 1.5.0 (Sun Microsystems Inc.)
    Main-Class: Ui_MainWindow
    When i extracted the app.jar following this i got
    1. META-INF folder inside that MAINFEST.MF file the contents i have already placed above
    2. qtjambi-4.4.3_01.jar
    3. qtjambi-win32-msvc2005-4.4.3_01.jar
    4. Ui_MainWindow.class
    Please tell me whats wrong in that i can also give you the app.jar file please let me know the email id ..

  • Does the Intel have problems with flip4mac?

    Hi, I have a new intel Core 2 duo iMac and there are two websites that I cannot view flip4mac plugsin on but I can on all other websites. My powerpc eMac can view the websites (videos) that I can't view on my iMac and both of my computers have the exact same system software, Safari versions, Firefox versions, and they both have flip4mac version 2.2.0.49. The only difference is one computer is a powerpc and the other one is an intel.
    Apple has not been able to help me. Does anyone else have this problem with their intel iMacs?
    Thank you!
    Martha

    The reason I didn't put the links is because on both sites, you have to put in your email address to register. Anyway...
    Try this website out:
    http://www.crenshawchristiancenter.net/ecomm/index.php?option=com_content&task=v iew&id=2&Itemid=4
    Put your mouse on "Media", go to "Ever Increasing Faith" and a new window will launch, then click on "archives." None of the archives or any links in that new wndow will work on my iMac.
    The other website is:
    www.godslearningchannel.com
    You don't click on anything on the left side, you go down to below where it says:
    "The GLC bookstore is proudly carrying V!BE. Click here for more information."
    Go below that and you will see a moving box and you click on THAT. It will then ask for a faith pass, you put in an email address and then you can see the video link that is not working for me.
    God's learning channel will NEVER send you anything even though you "joined".
    I eagerly wait to see if you can view either videos.
    Thanks,
    Martha

  • Due to the rumored heat problems with the iPad 3, is there a danger in using a leather case design for it.

    I recently purchased a 64 GB Verizon LTE iPad,  along with a Bear Motion leather case designed specifically for that model. I've been reading a lot about the heat problems with the new iPad and although I haven't noticed them on mine, I'm worried that putting it in the case may cause worse problems. Is this something I should be concerned about?

    Unless you have a defective iPad you should be fine.  The only time it should be heating up is when you're running an intensive app like a game that's working the quad-core processor and the screen.  I bought a Targus leather case for mine and play InfinityBlade2 on it and haven't noticed any heating issues with mine, but the part holding the iPad is plastic, so it can disipate heat better.
    If your iPad gets too hot it'll warn you, so I'd use it for now and see what happens.  It'll shut down before it causes any permanent damage.

  • Is the gapless / pause problem with Lossless files solved on 120 GB?

    Hey everyone,
    I broke my trusty fifth gen 80 GB iPod a few months ago and recently purchased a 160 GB Classic to replace it. I've had two problems that I now know from searching this form that everyone else has had - the iPod pauses between tracks (all my library is Lossless) and it also pauses at random points in songs every now and again (not to mention being horrendously slow when browsing menus). Annoyingly, when I convert the exact same files to MP3 or AAC they play seamlessly no problem.
    Like I said, I've searched the forum and although I've found suggestions for the cause, I can't find confirmation that this problem has been solved with the 120 GB Classic. I've sent my 160 GB Classic back for a refund and I don't know whether to send my 80 GB off for repair or buy a new 120 GB Classic.
    Has anybody tested to see if Lossless files will play seamlessly without pausing on the new 120 GB?
    Many thanks!

    I have some lossless audio files and others in various quality, and the songs (no matter what quality) will sometimes get cut off and the next track on the playlist plays. I don't understand why this is happening, but it doesn't look like the problem you posted about is solved yet.

Maybe you are looking for

  • Table where Material De and Open PO Nur can be found.

    Dear All,          May I know what is Material De and Open PO Nur ?Please also state in which table above fields are found. Thanks with regards, S.Suresh

  • In which condition Table valued function should prefer over SP except use in joins?

    Hi,  My requirements is: Entity framework needs to call DB object (TVF or SP), which will provide some data to them and they'll work on it at app level. DB object would be simple, one result set, it will join 5 tables and get around 30 columns to the

  • Convert complex PDF file into Excel

    I'm trying to convert a PDF file ( 510 pages), consisting of horizontal and vertical charts into excel. The first few pages were fine but the rest were messed up. Every number was displayed in the wrong collumn. Could anyone help? I'm happy to send i

  • How to deploy Oracle Forms

    Hi All, As am new to Oracle forms. I created some forms in 10g. I need to deploy it in Application server. In Jdeveloper we will create .ear file then will deploy it in application server. How can i do it here. Please explain me in details.

  • Adobe camera raw 6.6 freezes when editing

    I have a pc, it freezes when switching from one photo to the next. This is a new occurrance and very annoying since I have to force close and start all over again. I process tons of action shots, and this is making it take forever. I have a newer com