SetAsyncTimerAttribute(..... ASYNC_ATTR_INTERVAL....) does not work in CVI 8.5, returns error=-2

Using WindowsCVI version 8.5,  trying to set the time interval ( between 20 to 25sec.) in an ascynchronous timer.  IT DOES NOT WORK!
The following code snippet is from asynctmr.c:
            case ASYNC_ATTR_INTERVAL :
                double doubleInterval = va_arg(parmInfo,double);
                if (doubleInterval >= 0)
                    double      doubleResolution = GetResolution ();
                    CVIUSTEtime interval;
                    if (doubleInterval < doubleResolution)
                        doubleInterval = doubleResolution;
                    ConvertDoubleToTime (doubleInterval, &interval);
                    if (CVIUSTEsettimer (asyncTimerPtr->timer, &interval))    <---this function call always returns a {0}.  Causing...
                        asyncTimerPtr->interval = interval;
                    else
                        error = ASYNC_TIMER_FAIL_ERR;    <-----this error to be returned to the caller.
                else
                    error = ASYNC_INVALID_PARAMETER_ERR;
                break;
The timer is created with an interval of 10.0seconds, which works just fine.  But any attempt to change the original value will not work!
Solved!
Go to Solution.

Thanks again for your help.   I used your suggestion to just create the async timer(s) only as needed, embedding the current interval time in the parameter NewAsyncTimer() call.  This seems to work.  Attached is a code snippet of the Timer creation and Callback.  Notice that the instance of the timer self destructs when its timeout event occurs.  I hope this is OK to do this. 
          if ( ( action == OUTPUT ) || ( action == BOTH ) )
             LaunchOutputTerminals( sys.channel[cidx].output );
             NewTimerID = NewAsyncTimer( TimerPeriod, -1, 0, Output_Timer, NULL );            
             sys.channel[cidx].tmr_id = NewTimerID;
             SetAsyncTimerAttribute( NewTimerID, ASYNC_ATTR_ENABLED, TRUE );
       sys.channel[cidx].saved_state = PresentInputState;  //..save new state
    return( 0 );
int CVICALLBACK Output_Timer( int panel, int control, int event,
                              void *callbackData, int eventData1, int eventData2)
   i32 cidx = 1;
   DebugPrintf( "Output_Timer Callback\n" );
   do
      if ( control == sys.channel[cidx].tmr_id ) break;
   while( ++cidx < 17 );
   switch (event)
      SetAsyncTimerAttribute( control, ASYNC_ATTR_ENABLED, FALSE );
      case EVENT_DISCARD:
         sys.channel[cidx].tmr_id = 0;
         break;
      case EVENT_TIMER_TICK:
         KillOutputTerminals( sys.channel[cidx].output );
         DiscardAsyncTimer( control );
         break;
   return( 0 );        

Similar Messages

  • Wireless net does not work after installing SP1 for Vista - Error code 10

    After installing Vista SP1 on my computer (T61 - Vista Business 32 bit) my intel 82566mm wireless net does not work.
    Windows says "Error code 10" and suggests that I update the driver. I have downloaded the newest driver via another computer, but it does not help. Still error code 10.
    Any one else has the same problem?

    I fixed the problem. Uninstall iTunes and then reinstall it clean. Looks like upgrading is problematic.

  • Autocomplete does not work in CVI 9.0

    IDE does not show the auto complete member of the structure. The issue is very similar in the post described here.
    And then when I look at the bug fix for the post here it mentions that it is fixed in CVI 2009 which I believe is the same as CVI 9.0. It doesn't seems to have been fixed at least what I see on my machine.
    CLD,CTD

    Wolfgang wrote:
    So 2009 is the release after 9.0...
    ...and is version 9.1.
    Martin
    Certified CVI Developer

  • Suspending service does not work and I keep getting an error message (South Korea)

    Hi, I am currently back at home at South Korea during the summer and I cannot seem to suspend my service.
    I continue to get this error message saying that suspending service is not available at the time and that I should try again later.
    I got this message over the past 10 days and I cannot seem to suspend my service.
    Since I am in South Korea, customer service live chat does not even work.
    Is there anyway possible I could suspend my line before I get into a new billing cycle?

    How To: Direct Message  and  Joe L

  • I have just bought a new imac over the internet. it does not work. which store do I return it to?

    I have just bought a new imac over the internet. it does not start up which store can I return it to?

    jimoefrompymble wrote:
    I have just bought a new imac over the internet. ...
    If Purchased from Apple... Contact AppleCare... you have 90 days Free Telephone Support... 3 years if you Purchased the AppleCare Protection Plan.

  • I have just installed the latest update ...IOS 7.0.4. Prior to this, my email worked fine. Now my AOL does not work; it gives an ID/password error. Everything works fine on my Windows computer. Any thoughts?

    I have just installed the latest update - IOS 7.0.4. Prior to this, my AOL email worked fine. Now it gives an ID/password error message. However, everything is fine on my Windows computer. Any thoughts?

    Hello there, Tim.
    The following Knowledge Base article provides some good troubleshooting steps for working on resolving your issue:
    iOS: Troubleshooting Mail
    http://support.apple.com/kb/ts3899
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Airplay does not work with slideshows and music - get the slides but no music with iPad Air2 and ios 8.1.22

    iPad Air 2 with celluar with ios8.1.2 will not airplay with apple tv slideshows with music. I see the slides on the TV but do not hear the music. This works on the iphone 5s with iOS 8.1.2 and with my other iPad which is on iOS7.
    This problem was reported on Nov 21, 2014 and other people had reported it prior to me.
    When will this be fixed by Apple - it worked in the past and does not work now.
    Should i return my iPad Air 2 and get my money back?

    Problem seems to be resolved. Should have thought of it myself ;-) thanks so far!

  • Sync does not work on my mobile

    Hi.
    Sync does not work on my mobile.
    Only error is in swedish "(förlegad)"
    How do I resolve this all my passwords, history and bookmarks are gone.
    Regards Tomas

    Ah! You are still using the old sync account. (deprecated) will be next to the Firefox Sync account. Try the new one :-) [[How to update to the new Firefox Sync]]

  • Norton password manager does not work on 8. How do I return to a previous version?

    when I updated to firefox 8, Norton password manager does not work. How can I return to a previous version. I am surprised that you introduced an update missing this.

    Norton needs to be updated.
    http://community.norton.com/t5/Norton-360/Firefox-8-Support-for-Norton-Toolbar/td-p/581640

  • Tree does not work

    When I take the tree component from the Flex 3 Comp Exp. and
    put it into Flex and compile it does not work. I get an 1119 error.
    "Access ----"

    I figured out the problem.
    Is there anyway to have have the user click a tree link and
    have an image appear?

  • Oracle 9i Database Software Registraton Does Not Work

    The link http://www.oracle.com/technology/software/registration/index.html?9ibooks does not work and shows the messgae, "An error occurred while processing the request. Try refreshing your browser. If the problem persists contact the site administrator."
    Please fix the link or give instructions to get the registration key.
    Thank you,
    Robert Hunter
    [email protected]

    This program is defunct. We suggest that you download Oracle Database 10g Express Edition:
    http://www.oracle.com/technology/products/database/xe/index.html
    ...which is free, with no reg key required.
    Cheers, OTN

  • Upgrade z1 to 4.4.4 accelerometer does not work anymore

    Hi
    After upgrading my Sony Xpera Z1 to Android 4.4.4 the App "Moves" (Protogeo) does not work anymore!
    It says: Tracking error, accelerometer does not work!
    This work fine before!
    See sceen shot attached.

    the compass does not work anymore also...
    Using AndroSensor the following is waiting for an Event:
    Accelerometer
    Gravity
    Gyroscope....
    something is wrong!

  • HP Mediasmart Live TV does not work on Windows 10

    HP Mediasmart Live TV does not work after Windows 10 upgrade.  Error says:  Your TV tuner cannot be accessed because it is being used by another application.  Please close any programs that might be using it and then try again.  Although I am able to open the settings and scan for channels, and I see the channels being found, but still no luck watching after the setup is done.  My HP Laptop has a built in HP ATSC/Analog TV Tuner card.  (AVerMedia maybe?)  I suspect that is may have something to do with the fact that the driver does capture at the same time you are watching (Allows you to pause and then continue watching live TV, also has the ability to scedule recordings)  Unfortunatly Windows 10 also removes Windows Media Center, so I can't check with that software, is also possible a remnant may be left behind to support Windows Media Center that is conflicting with something else.  Also would be nice if they would fix the installers so it does not uninstall the software, then fail to re-install it.  (All without any display or error messages, so your left scratching your head trying to figure out what happened.)  I managed to get the rest of MediaSmart to work, although it looks like the internet veiwer may not connect to anything anymore.  Looking for an updated driver or installer, or patch that would work for Windows 10.  As far as I can tell on the internet HP MediaSmart Live TV is supposed to work on Windows 10.

    OK, More information.   Installed Media Portal 1.  This works with the tuner card without additional modification, so this appears to be some kind of issue with the software.  Media Portal 1 does install a different version of Direct X, I don't know if that could have anything to do with it, but HP MediaSmart Live TV still comes up with the same error and will not run.

  • HTTP Return Code on CSM causes IP Sticky does not work

    I have CSM running on 3.1(1a).
    I configured HTTP Return Code Checking:
    map HTTPCHECK retcode
    match protocol http retcode 404 404 action remove 5 reset 60
    And apply it to the following web server serverfarm:
    serverfarm DCMSWEB
    nat server
    no nat client
    predictor leastconns
    retcode-map HTTPCHECK
    real 10.1.31.1
    inservice
    real 10.1.31.2
    inservice
    I also configure IP sticky for my web server:
    sticky 2 netmask 255.255.255.255 timeout 60
    And apply that sticky to the virtual server:
    vserver DCMSWEBHTTP
    virtual 10.1.30.100 tcp www
    serverfarm DCMSWEB
    sticky 60 group 2
    replicate csrp sticky
    replicate csrp connection
    persistent rebalance
    inservice
    But, the problem is my sticky does not work if I apply HTTP return code checking on the serverfarm.
    "show mod contentswitchingmodule 8 sticky" does not show any IP sticky connection.
    If I remove HTTP return code checking from serverfarm, my IP sticky is back to normal.
    Has anyone encoutered this similar problem before?
    Is this a bug on the CSM software?

    This is a new bug.
    The workaround is to use the command 'client 0.0.0.0 /0' under the vserver.
    Gilles.

  • Calling test sequence from CVI DLL that use ATL COM object does not work

    I am trying to call some DLL function writen in CVI from teststand. The CVI DLL is using ATL COM object(Written by me).
    The ATL COM object making instance of several ATL COM object inside it (including two controls that contains dialog). If I use a client writen in VC++ 6 and use the ATL COM (writen by me) works perfectly. But if I try to use it from CVI DLL it does not work any more.
    What is wrong? The client is passing an IUnknow interface to my component. Can anybody explain me what is wrong?

    It is not clear from your question as to what is specifically failing. If possible, one option would be to remove TestStand from the picture and see if the problem still occurs using a CVI EXE that invokes the CVI DLL.
    Scott Richardson - NI
    Scott Richardson
    National Instruments

Maybe you are looking for