100% CPU with DAQmxRegisterSignalEvent(.., DAQmx_Val_CounterOutputEvent,..) / NIDaqmx 8.71 C client

Hi All,
Please see code below for my problem. I removed error checking to make things easily readable.  Whenever I enable callbacks using DAQmx_Val_CounterOutputEven,  the following code utilizes 100% CPU even with the 10Hz counter!!!!  Am I missing something here?  I tried all the options for interrupt based processing instead of busy polling to no avail.  This is just unacceptable.  These days one can't even deliver an app that is permanently running at 100% cpu without raising some eyebrows...
I must be missing something...
My application requires that I generate TTL level trigger pulses and at the rising edge of each trigger pulse, I also need to execute some very short C code. This code should start running within .5ms of the trigger edge.  This should be no problem for a modern CPU. This is why I am using DAQmx_Val_CounterOutputEvent.  However, I cannot have NIDaq implement this using busy polling (which I assume it's doing since it's eating 100% cpu).  It is simply not acceptable to be running at 100% CPU for several reasons.  The documentation and this support site talk about interrupt based processing, and the hardware is obviously capable of it.
So, the 2 questions I have are:
1. What do I have to do in order to have NIDaq use interrupt based processing instead of busy polling (for the DAQmx_Val_CounterOutputEvent callbacks in my application)?
2. In addition to (1), can I make it so that my callback only gets called on the rising edge of the trigger signal instead of both the rising and falling edges?  Perhaps I can wire the counter output to a general purpose input and then generate interrupts based on the rising edge that the input measures? 
Please help,
Philip
// currently the callback simply does nothing to make sure i'm not causing the 100% cpu problem
static int StaticTriggerCallback(TaskHandle taskHandle, int32 signalID, void *callbackData)
// we will get called once for every rising and once for every falling edge (20hz).  We would prefer to be called only on the rising edge.  Is that possible?
return 0;
void TTCameras:tartTimer(void)
 // Configure DAQmx ct3 as our spin camera trigger.  10Hz
 DAQmxCreateTask("", &taskHandle);
 DAQmxCreateCOPulseChanFreq(taskHandle, "/Dev1/ctr3", "CameraSpinTrigger", DAQmx_Val_Hz, DAQmx_Val_Low, 0.0, 10.0, 0.5);
 DAQmxCfgImplicitTiming(taskHandle, DAQmx_Val_ContSamps, 1000);
 DAQmxSetReadWaitMode(taskHandle, DAQmx_Val_WaitForInterrupt);
// I tried this but it does not help:
 //DAQmxSetRealTimeWaitForNextSampClkWaitMode(taskHandle, DAQmx_Val_WaitForInterrupt);
 // If I register this callback, CPU usage goes to 100%.  This callback needs to be done based on interrupts!
 DAQmxRegisterSignalEvent(taskHandle, DAQmx_Val_CounterOutputEvent, 0, (DAQmxSignalEventCallbackPtr)StaticTriggerCallback, NULL);
DAQmxStartTask(taskHandle);

Duplicate post. Look here.
Regards,
Chris Delvizis
National Instruments

Similar Messages

  • Finder and loginwindow use 100% cpu with 10.6.8

    I recently installed the patch to OS X 10.6.8 and now the finder is very unstable and uses 100% cpu and the loginwindow uses 100% cpu also.  Yes I have Parallels 6 on this machine but I already "un-checked" the "show windows applications in doc" option which is the recommended solution.  However, this did not fix the problem.  I do not know how to determine what actual process is causing this finder / loginwindow issue.  I very much appreciate if anyone has suggestion how to fix this problem. 
    This is on a mid-2011 MacBookPro.
    thank you.

    TBauer, I had the same problem with 10.6.8 using 100% of the CPU with Parallels 6 installed.  The following steps solved this problem for me:
    0.  Take a screen shot of your Dock if you wish to remember it as currently set
    1. Launch Activity Monitor and click on the CPU column so you can see Dock using the CPU
    2.  Move   ///Users/ ...  /Library/Preferences/com.apple.dock.plist to the trash
    3.  Click on Dock and click on Quit Process to stop the Dock
    OS X will then rebuild the default Dock
    4.  Put the items back in the Dock that you want
    That solved the problem for me yesterday morning.  I've launched Parallels 6 several times now and moved the machine from my work network to home and the 100% CPU problem hasn't returned.
    Hope that works for you, too!
    I don't think using the combo updater will solve the problem.  The problem appears to be a .plist that is generated with OS X 10.6.7 and earlier that contains icons of a larger than Apple documented size causes the CPU looping.  Rebuilding the dock.plist under OS X 10.6.8 appears to solve the problem.
    Parallels has issued a knowledge bulletin saying they are looking into the problem.  On their web site they have another approach involving moving the offending icon out of the dock to solve the problem.  I like my solution better but theirs works, too.

  • Win 7 pro 100% cpu with only a few programs running

    I have a 4.2 rating with a amd athlon 64 3400+ running at 2.41ghz, 2.5 gig ram in 32bit windows 7 pro.  My motherboard doesn't have windows 7 drivers which may contribute to the issue.  Asus k8N so I have no illusions that this computer should be lightning quick but it is very difficult to keep my patience due to the high cpu constantly.  I run about the same as I did in XP and I didn't have nearly the high cpu usage.  Outside of antivirus (AVG free), logmein, creative camtray, and tversity running all the time.  If I then open Outlook 2007, Firefox more then one tab and itunes, my cpu is at 100%, it's still usable for a definite slow down.  I've set the visual effects to best performance and that really hasn't made a difference.  What suggestions can you offer other then stopping logmein, the camtray, and tversity all of which are not using hardly any cpu.  It's constantly flipping between firefox and itunes primarily.

    Hi Cougar78,
    I would like to confirm what process uses the high CPU usage you find with Task Manager?
    You may update the BIOS and the hardware drivers first to check the issue.
    If it does not work, I also would like to suggest you test the issue in Safe Mode and Clean Boot.
    What are the results in both modes?
    Regards,
    Arthur Li - MSFT

  • Ora_m000 consuming 100% cpu with ORA-00600 [kcbz_check_objd_typ_3], [0]

    Hello,
    I have been trying to troubleshoot high cpu usage in our Ebiz R12 environment where cpu is running 100% by ora_m000 process and I see ORA-00600 in alert log.
    I have tried work around from metalink note 466049.1 and even applied fixed for patch 4430244, 5752105 but it hasn't fixed the issue.
    Before going through opening a ticket with support, I thought try my luck here. I'd really appreciate any suggestions to fix this problem.
    content of trace file.
    *** KEWROCISTMTEXEC - encountered error: (ORA-00600: internal error code, arguments: [kcbz_check_objd_typ_3], [0], [0], [1], [], [], [], [])
    *** SQLSTR: total-len=176, dump-len=176,
    STR={insert into wrh$_sysstat   (snap_id, dbid, instance_number, stat_id, value)  select    :snap_id, :dbid, :instance_number, stat_id, value  from    v$sysstat  order by    stat_id}
    *** KEWRAFM1: Error=13509 encountered by kewrfteh

    What's your database version in four decimal places?
    ORA-600 is Oracle internal error you need to work with Oracle support to fix the problem.
    Also use "Troubleshoot an ORA-600 or ORA-7445 Error Using the Error Lookup Tool"
    The lookup tool will show you the known bug related to the error message.

  • LR 5: 100% CPU with offline files

    Hi all,
    I'm experiencing a problem with LR5, something that I can live with, but I'd like to share the experience.
    I'm using LR5 on a mac. The root folder used to contain subfolders named after the year (2008, 2009, etc.) but after migrating to LR5, I turned on smart previews and replaced (most of) the folders with soft links.
    This setup roughly works for my needs: the softlinks point to a network path on a NAS, which may or may not be mounted (the only downside is that "synchronize folder" thinks that all files are missing...).
    When I mount the network storage with the original files, and start up LR5, everything works as expected: LR reports "original + smart preview" for the pictures, etc.
    But the NEXT time I start LR in "offline mode" (i.e. without the NAS available), LR uses both CPUs at ~100% for 3-4 minutes. It's still (kinda) responsive, but obviously less than perfect.
    Did anyone have a similar experience?
    MH

    Duplicate post. Look here.
    Regards,
    Chris Delvizis
    National Instruments

  • Dispatcher using 100% CPU with 4GB space "used"

    A short story with a happy ending ...
    A user tried to create a "big" table with a possibly somewhat cartesian select, resulting in the "oh no you don't: that would exceed 4GB" error/cancel scenario.
    They cancelled and went back to working on the few hundred megs of data but "system seems very slow ..." . The dispatcher d000 was consuming 99.9% CPU. After a fair amount of looking around on the system and in this excellent forum (some hints but no exact match - hence this post) I decided that the problem was the TEMP tablespace being stuck with nearly 4G size (5MB used) but unshrikable .
    Solution: I squeezed SYSAUX and USERS till they squeeled to get a couple of extra available MB, then created a 10MB new temporary tablespace, made it default temp, (would have altered any users set with non-default temporary tablespace but assumed there were none so ... ;-) bounced the database, shrank/fixed the original temp and made it the default again (with a lower max size constraint and a longing for the production version where temp will not count ;-)
    For info: OS/Environment Linux SuSE 10 x86_64 : Opteron with 8GB Mem and
    lots of disk ...
    (No relevant info in the trace files/alert log etc so not posted - everything up and unremarkable but slow and with 1 very busy dispatcher process)
    Otherwise pretty standard XE install running excellently for months.
    Thanks everyone!

    Gruss Dietmar,
    thanks for linking this to a better and clearer exposition of the space issues
    (<excuse>it was late here and home was already phoning to say the dinner was in the cat ;-)</excuse>.
    My reason for posting remains the strange 99.9% CPU user of the dispatcher while the system was in the "on-the-edge-of 4GB" state (and this behaviour survived an instance bounce and produced no other sign (trace file or alert log) than the evidence of ps/top or the obvious degradation in performance. Could be there's a little bug for the developers to squash in the marginal case (which could even apply in production if you fill (almost ??) the data counted in production ? Whatever the case the problem is pretty benign and easily remedied when you know how. I guess the GUI shrink facility and a touch of documentation should help out in the production release as well.
    Best Regards,
    P-)

  • 100% CPU usage with XP Cooler from PCAlert4

         Any idea why I would be running 100% cpu usage when running XP Cooler from PCAlert4?  I noticed PC was sluggish when running it so CTRL+ALT+DEL and under performance is 100% CPU with 245MB Ram Usage. No other TSR's running - several application but under 10% CPU usage without PCAlert and XP Cooler.
         I was also wondering if anyone had any ideas on the video?  I have the K7N2G with 768MB DDR PC 2100 (3x256) XP2200+ 266FSB running 1804MHz - Maxtor 30GB 7200RPM - 350W PSU (raidmax - yea yea I know, dont say a word though LOL) on board video and here is the problem - graphics are great, but they get choppy - running NFS HotPursuit 2 at 32bit 800x600 (doesnt seem to matter even when running 16bit 640x480still does it.) what setting am I missing?  Thanks in advance.

    Deathstalker (Richard),
         I did what you suggest in memory management and also changed out the mem on the board - it did make a difference, not as much as I had hoped, but it did.
    Raven,
         I have used Fraps in the past, forgot about it, but went ahead and downloaded it to get a better look.
    To the Both of you,
         Thanks so much for your replies, sometimes it just takes someone outside looking in to see the things overlooked.  But I went ahead and also ran all of the latest updates for the board (semi new system and I only installed with the CD that came with the Mobo) and everything is running better than expected.  Thanks again for your thoughts - keep 'em flowin, it's amazing whom we could help.  Take care.
    Don

  • FF 20 and Flas 11 = 100% CPU - Opera, IE8, Chrome are all OK. FIX IT!

    I am absolutely sick and tired of hearing excuses about why FF is not to be blamed when it chews 100% CPU with the Adobe Flash plugin.
    I have done all the dancing around I am willing to endure. I have even downgraded to FF18 and FF19. No friggin setting works. Nothing. IT IS IN THE CODE!! FIX IT!!!
    It is simply NOT acceptable that ANY other browser in the known universe works OK with Flash BUT FF.
    It is time that devs acknowledge this and do something about it instead of scratching their butts!
    PLEASE do not get me more links to troubleshooting pages, either from Windows, Adobe or FF.
    I'll repeat: IT IS IN THE FRIGGIN CODE. FIX IT!!!

    Also IE uses a Active version of Flash and Chrome comes with its own Flash though it can use Adobe version if pepper version is disabled.
    Adobe has been making a buggy Plugin for Windows ever since they came out with the Flash 11.3 version.

  • Firefox using 100% cpu

    I'm running firefox 11 on Win 7 Ultimate. For the last 2 weeks it is pegging out the cpu at 100% and this is with 3 tabs open. I close it and check the task manager it stays open. I have to end the process. I then reopen and all is good. It will work for a while but flash constantly crashes in youtube (not saying that is a firefox problem) but I don't get this cpu usage. Using 600 MB RAM and 100% cpu with 3 tab...come on now. So, any ideas what is going on?

    Hi laytoncy,
    Have you looked at our [https://support.mozilla.org/en-US/kb/firefox-slow-or-takes-too-long-start performance troubleshooting section]? There is a lot of good information in there that should help.
    Hopefully this helps!

  • Facetime using 100+% CPU?

    Hello everyone, recently I have noticed my fans kicking into over drive while on a facetime video call, I checked Activity Monitor and realized that Facetime was using over 100% CPU, with the system running at about 10%.
    I found that making Facetime full screen, and using the 4-finger swipe to hide Facetime instantly dropped the CPU down to about 34%. However, the video is paused, making this work-around pretty useless, considering what Facetime is used for.
    I am not sure if this is because of updates or firmwares, i have all the latest updates, the OS is Yosemite 10.10.1.
    If anyone has any information regarding this, or is experiencing the same issue, a response will be greatly appreciated. I have searched on the internet, however I can't seem to find any solutions or viable work-arounds.
    Below is my MBP configuration
    Macbook Pro early 2011 2.3GHZ i5
    4GB 1333 MHZ DDR3
    Startup Disk Samsung SSD 250
    Intel HD graphics 3000 384 MB
    New MacbookPro battery, few months old.

    Another information :
    if I run two java program on the same time (using same instance of eclipse), the two javaw.exe each use exactly 50% (if nothing else if running).

  • CSS 11501 100% CPU

    I have a CSS running at 100% CPU with no services up. I cannot ping the CSS interfaces after about 1 minute of up time. Im running 8.1. Any ideas? I turned logging back to default and turned off my ACLs.

    you'll need to go in llama/debug mode and do the following
    symbol-table load SPRITZ
    shell 1 1 spy
    shell 1 1 spyStart
    shell 1 1 spyReport
    shell 1 1 spyReport
    shell 1 1 spyStop
    symbol-table unload
    Do this when the CPU is high.
    This will tell us the cause.
    Also, if you only see the problem when logging is set to debug, then I would say do not set the level of logging so high unless you are trying to debug an issue.
    Gilles.

  • 100% CPU Utilization on

    I have a 1U Server purchased in August, 2003.  The motherboard model is MS-9129, motherboard chipset is Intel 845E ( Brookdale-E) + ICH4.  Bios is Phoneix Award 6.00 PG, dated 12/10/2002.  We are running Windows 2003 Standard Edition, SP1
    The system is currently operating at 100% CPU, with the System process consuming all otherwise unused capacity.  Within the System process, an ACPI thread is utilizing all the resources.  Our analysis, together win Microsoft Tech Support suggests upgrading the bios to a more current version.
    Two Questions:
    1) Have you experienced this, and do you concurr with the solution, or do you have a better one?
    2) What, and where can I get it, is the most current BIOS?  Do you have Installation instructions?
    Thanks
    Phil Rounds
    [email protected]
    Time is of the essence here.

    I've run a virus scan showing no viruses, and Symantec AV is up to date and running.
    I can't get a screen shot, as there is no software on the server capable of getting one, and I can't load anything when it is this slow.  Besides, all diagnostics I have, or that Microsoft has had me run, show that it is the ACPI subsystem which is causing the problem.  I have disabled all software other than the basic operating system, have assured that the OS up to date and still have the same issues.
    MSI's LiveUpdate shows the BIOS to be version 1.0, with the most up to date one for this system seems to be 1.3.  Does anyone know how
    this translates to Phoenix's numbering system?    All the system diagnostic tools I have shows my current  BIOS to be Phoenix 6.00.  Is the MSI 1.3 BIOS really an upgrade?
    Thanks

  • Firefox using almost 100% CPU - hogging resources - hanging

    After several hours of operating Firefox starts using almost 100% CPU - with peaks of 100% occurring in rapid succession - FF hangs until CPU useage drops below 100%
    Followed recommended troubleshooting as recommended on this site:
    * Started in Safe mode - no problems occurred.
    * Disabled all extensions; Plug-ins left operating.
    * No replication of problems.
    * Enable 1/2 of extensions up to Flashblock - restarted - seems ok
    * Enable most remaining extensions
    * (There are 3 Java extesnions - only enabling one) - again seems ok
    * Some hours later - problem reoccurred. Each time CPU useage peaked at 100% (according to Task Manager) the Firefox Window flickered & was unresponsive.
    * Deleted cache - no change
    * Disabled recently added programs - no change
    FF opens and closes normally & completely. '''Problem only seems to occur after FF has been operating for some time'''
    This has occurred intermittantly before but has become chronic over the last few days. Apologies if I've been repetitive or explained poorly - FF has hung several times while typing this.

    No issue for me, after 4 loops my CPU load was around 18%.
    Firefox 33.1.1 under Windows Vista.

  • Queue consumer stops with 100% cpu usage

    I'm trying to use Berkeley DB queue with transactions. When I tested what happens when transactions with DB_APPEND are aborted I found that while it works and DB_CONSUME correctly skips over rolled back records, unfortunately extents that have those records are never deleted, which causes database to always grow. Next I tried DB_CONSUME with database opened using DB_INORDER flag and it seems there's a serious regression in Berkeley DB that causes it to loop indefinitely with 100% cpu usage when it encounters a rolled back record. I tested various versions and found that this bug doesn't happen with 5.1.29, but it is reproducible with 5.2.42, so this regression might have been introduced in 5.2. I have also tested 5.3 and 6.0, and both have this behavior. There may be something wrong with the way queue records are rolled back, one indication of that would be that in 5.1.29 doesn't have neither of the two problems I found with DB_QUEUE: extents are deleted after being consumed, and there are no issues when consuming with DB_INORDER either.
    You can find Python code to reproduce this issue here:
    https://gist.github.com/snaury/027a3c546f5b0a62a440
    Sorry for using Python and not e.g. C++, but it's a lot shorter that way.

    We have looked at the issues and they are valid.   We will roll the fixes out for this in our next release of BDB.   The test case was very useful and really helped to speed the process up.    If you have any questions, please contact me directly at [email protected]  Thanks again for bringing this to our attention.
    thanks
    mike

  • Sessions with Event "class slave wait" taking 100% CPU

    Hi experts,
    I have an issue in an 11.2.0.2 RAC database with 2 standby nodes that are driving me nuts.
    All started when I've been told there are 2 Oracle processes consuming too much CPU in the environment.
    I found 2 processes which takes 100% CPU each. These processes are Oracle processes into the DB and checking them out although they are registered in v$process and v$session, there is nothing related to them in v$bgprocess so I could not find out which oracle processes started these 2 OS processes.
    The view v$session shows them ACTIVE in the event "class slave wait". There aren't too much information about this event, at least I failed to find...
    Using dbms_monitor and dbms_system to create trace events did not create any tracefile. Only ORADEBUG was able to create events but with nearly no information inside the trace files.
    Questions I need to have answered or at least hints that I can follow to find the answer:
    1) what is causing the CPUs to be consumed at 100%? Which process?
    2) Why does these processes are using that much of CPU?
    3) What can be done to safely get over it?
    Honestly I don't know where else to look at except trying to get some help. Could someone give me a hand please?
    BR,
    Lauro Ojeda
    Edited by: LauroOjeda on 26/01/2013 06:44

    Hi Pal, thanks for your reply!
    Here are the answers:
    1. If it is RAC there is no such construct as a "standby node" and you say you have two of them. Please be specific ... is this RAC or Data Guard or a combination? Or do you have a three node cluster with all services pointing to only a single server wasting all of the resources of the other three?
    A: This is a combination of them. We have 2 nodes in a RAC environment shipping logs to two physical standby databases in another site.
    2. Two processes can not be at 100% of CPU any more than I can be 200% awake. Please show us how you arrived at this conclusion, on what hardware and operating system, and include a formatted (read the FAQ to learn how) extract showing what you are seeing.
    A: top in Linux shows two oracle processes consuming 100% (or nearly of it) of 1 CPU each. This is a 16 cores server (each primary node) so 2 of these are working on full capacity to service the described processes.
    3. What processes? Name them and again run a SQL statement and post the output so we can see what you are looking at.
    A: Like I said before I failed to find which background process they belongs to as there are no indications of them in v$bgprocess and in v$session/v$process either. I can see them in v$process and v$session but again, there are no indications of for which bg process they belong to.
    4. Is anything slow? Are there any problems with the system or are you only reacting to two numbers you think are too high?
    A: No, system is not slow because of that but the client wants to investigate and have it sorted as it is not normal.
    Additionally I found a bug in metalink which seems to be the culprit, but I'm unsure yet. This is Bug 12929268 : HIGH CPU ON ORA_O00N PROCESS
    Is any other information that I may provide you?
    Thanks for help!
    Lauro Ojeda

Maybe you are looking for

  • Text message DELIVERY

    I had a Samsung Smooth and when I sent a test message that phone would show when the text message was received by the phone sent to. I just upgraded to the LG Cosmos and when I send a text message the information shows when sent but not when received

  • I cant update my ipod touch 4 to iOS 5

    So my iPod Touch 4th gen. is running  4.3.4 and I want to update it to iOS 5. I have downloaded the new iTunes 10.5 as Apple said to, and I have had no problems with iTunes or my computer. Like it should, I clicked on my iPod in the left sidebar and

  • WD Table:  Repositioning Paging Buttons in Table Footer

    Is it possible to reposition the paging buttons  to appear in the right hand side of the WD table footer?  Is it possible to reposition the paging to appear in the header of the Web Dynpro Table?

  • Transporter - Basic installation and connection questions

    We have never used or installed the Transporter before.  We are currently using Tidal 5.3x and are upgrading a sandbox environment to 6.2.  I have looked at all the transporter documentation I can find and am still missing some very basic questions -

  • SOLAR_PROJECT_ADMIN project deletion

    Dear Experts,   Is it possible to delete the project defined in the tcode SOLAR_PROJECT_ADMIN . We can hide the comlpleted project but how to delete it. Regards, Umesh