No graduation async timer

Hello.  I have a program that is running multiple threads.  When the user clicks the start test button, a new thread is created to run all data acquisition and task processing.  Part of the task of data acquisition is to acquire an analogue to the digital map data.  To start the acquisition, a function is called from the map SDK.  This allows relaxation on the Board with a callback that is called when the map is triggered.  I have included in my code, a timeout by using an asynchronous timer so that if a trigger is not received with a set amount of time, the acquisition is cancelled.  The problem I have is that no clock is received by the async timer.  The basic layout of the code is as follows:

RET = dataAqFuncStart();

If (ret = NO_ERROR)

{

SetanalogTrigTimoutFlag (TRIG_TIMEOUT_CLEAR);

timerId = NewAsyncTimer (ANALOG_IN_TRIG_TIMEOUT, 1, 1,
DaqAnalogInTimer, NULL);

}

If (ret = NO_ERROR)

{

While ((GetdaqAnalogInFlag() == 0) & GetanalogTrigTimoutFlag() == TRIG_TIMEOUT_CLEAR)

{

}

}

Within the callback function for the data acquisition card, the daqAnalogInFlag is set if the map is triggered.  In the async timer, analogTrigTimeoutFlag is set to graduation of timer.  I never really get a graduation of timer if so my code is in the while loop.  In the context of debugging, I was followed by system resources which showed that the two sons of my computer was working 100%.  I placed a delay of 200ms in the while loop and this has reduced the CPU activity of approximately 3/4.  I guess it's because the code was executed the while loop getting frantically two flags.  Another thing, I tried as part of debugging placed 'GetAsyncTimerAttribute (timerId, ASYNC_ATTR_TIMER_TIME & timerTime)' in the while loop after the deadline.  On the first time through the while loop, the value timerTime has been to 0,0.  On the second occasion, the time is 5006.598 which obviously incorrect as only about 200ms has passed.  The last observation was that there is a call of the event to the reminder timer when I close the thread that was created at the beginning of the test.  This indicates that the timer has been created.

Are there other methods of debugging I can use or can someone point me in the direction of an answer?

Thank you

Do you really need a timer that is asynchronous to get the timeout? You could just check the value of the Timer (in the loop and exit) on a specified time? Is something like this:

if (ret == NO_ERROR)
{
    tini = Timer ();
    while ((GetdaqAnalogInFlag() == 0)  && (Timer () - tini < 1.0))
    {
       // Some code
    }
    // Cleanup code
}

Async timers are executed in their own separate thread: I don't know what can happen all by creating an asynchronous timer in one thread other than the main.

Tags: NI Software

Similar Questions

  • Async timer events

    I use CVI 2009 and TestStand 4.1.1 to test products.

    I create an Async timer when I call a function of Teststand that propelled to the top of the object to measure.

    My timer seems to start OK, but there are only 3 events prior to the recall of the timer Tick is no longer called.

    What could cause the timer events stop?

    Thank you

    1 take the timer.

    2, reminder timer is blocked or delayed and no return for timer events are queued up and not be served.

    3, an another async timer was created before the one you use for power USE up so this timer is a priority and is occupied by the management of reminders in your reminder of power queue USE is getting hungry.

    4 Async timer thread cannot get scheduled.

    Recently, I've solved a problem scheduling async timer using an indicator LED on my GUI and he put on during my async timer reminder entry and turned off when I left.  I made sure that he stayed at least 200 ms if I could see it.   Main thread set the light / stop by a global since you can not manipulate the UI directly from the asynchronous callback.

  • behavior of stall Async timer

    At the service of my never-ending quest to understand async timers...

    I have an application with two asynchronous counters, each with its own recall, and I understand that both run on the same thread.

    So if one of the reminders of cale, will either never get planned?  If they really are on the same, single thread, so if you lock one two reminders (for example put it in an endless loop), then the callback else should never get called.

    Thank you.

    Has a handle on this at last.

    The problem was that only 15 sec timer takes 16 sec to complete the recall

    Since it was created first, and since it cannot follow it's own program, it works all the time and the 30 sec timer gets hungry

    What makes this difficult to analyze, it is that time within 15 sec timer reminder enough to 16 sec after that the timer of 30 seconds is a state change to the system.  So the problem in correlation with the behavior of the reminder 30 sec timer, but the main cause was the behaviour of the 15 sec timer callback.  Correlation is not causation, as they say.

    I've implemented a a LED on the GUI for each timer that gets set on when the timer reminder came and stopped when she leaves, and then I could see what was going on.

  • Async timer slows operation

    Having already used asynchronous timers to solve another problem I had, I am now looking at an issue that has left me speechless

    Here is a code snippet that took an applied asynchronous timer

    int CVICALLBACK ParentEvent (int reserved, control int, int event, void * callbackData, int eventData1, int eventData2)
    {
    public static int iInfoFlag = 1;

    If the Com Timer event took place then:
    If (event is EVENT_TIMER_TICK)
    {
    SetAsyncTimerAttribute (control, ASYNC_ATTR_ENABLED, 0);

    First of all, changed the configuration of the probe?
    If (iSondeConfigure_HasChanged() is YES)
    Re-initialize screens etc, if true
    InitialiseSondeSystems (iFloatingPanels);

    Get data from the probe
    If (ProgStatus.bComTimerEvent is TRUE)
    {
    CompactDataControl (hParentPanel, iInfoFlag, & ProgStatus, NULL);
    }
    If Com events are disabled then define Info indicator following data probe
    acquisition sequence
    If (ProgStatus.iComEnable! = ACTIVE)
    iInfoFlag = 1;

    SetAsyncTimerAttribute (ParentTimer, ASYNC_ATTR_ENABLED, 1);
    }

    Return (0);
    }

    This routine was previously managed by a conventional programmer, but as they sit at the bottom of the pile when it comes to planning, as soon as the interface has been manipluated it silent. In each case the timer is set to 0.1 seconds, and if the bComTimerEvent flag is set to true, which is controlled by another (currently traditional timer) he goes and grabs the data from an external source. Using conventional timers, I can clock this timer 'data capture' quite happily at 0.25 seconds. However with the code, it will not catch data faster that 1.5 seconds. I timed the time required to call and to return from CompactDataControl. With the traditional counters his approximately 0.2 seconds, with the code as indicated, its about 1.45 seconds.

    Any thoughts on what I missed or messed up.

    Concerning

    Gavin

    Not a bit of lag of MISTLETOE, is not a problem as long as the data is entered, is done on a regular basis... The biggest problem that is known now, are things like the spikes in data... graphic lines flat because the time may have changed, but data not given that the last trace point, because the route is done on the fly, instead of a data buffer. There are some historical problems with this software, and I'm sure I'll work on them for some time to come, despite the fact that I work on and outside at least 3 years now!

    Thanks for the comments... you have answered my question - not in the way I had hoped, you might, but to be honest, probably in the way that I didn't expect - IE no solution of 5 minutes!

  • Async timer and Mutex?

    Hi all

    I rarely used async timers, but now I need.

    They run in a separate thread, right?

    That means that in some cases, I need to use mutex or critical sections?

    I remember feature for those in CVI. I usually use the library pthreads on Linux, so I don't know what you guys recommend in CVI.

    Thank you.

    In addition to notes ebalci, take a look at this multithreading documentation:

    CVI is delivered with a complete set of instruments, to share and protect data between threads: TSV beyond already mentioned by ebalci you can can count for example on the locks and Thread-Safe queues.

  • event data for the asynchronous timer

    My application uses an asynchronous timer to read analog and digital signals that are then loaded in a thread safe queue. The main part of the application unloads the queue, displays values and updates the locations of graph and also writes data to a file on disk.

    Asynchronous timer runs every 40 millisecs, show various updates run 5 times per second and the data is written to a file every second.

    Among the data elements is an entry SSI of lifting height, which, at this data rate should be increased to 25mm per second, or 1 mm each scan. I get a lot of variations in this reading, ranging from 0.3 mm to 1.7 mm and these variations seem to occur during updates of the display or the data file is written. I thought that using the async timer I would be safe from Windows Update problems, it runs in a separate thread.

    An earlier version used a timer Panel in which I was able to use the event data to show that timer interruptions were indeed affected by the activity of the screen. The async timer event data seem to zeros, whereas the event data of timer Panel that held a version of the hour and the time elapsed since the last interruption of the timer. How can I check that the async timer is interrupted at the right time?

    Reminder timer Asyncronus has the same exact structure of the timers UIR one, except for the first parameter, an integer that in the reminder timer UIR, holds the handle of the Panel the timer while it is reserved in the callback of the asynchronous timer. This means that the eventData parameter holds the information on the time elapsed in th eprogram, passed as pointers to values double. To read this information, you must operate this way:

    totalTime double, timeFromLastTimer;

    totalTime = *(double *) eventData1;      Time to start the program

    timeFromLastTimer = *(double *) eventData2;     The last reminder of timer time

  • Table update do not command button is held down

    Hi guys,.

    My application gets the data and then returns it in a table that is updated after each set of data is read. This part works fine, however I also require the user to be able to hold down one of the two buttons to control the function of an actuator control (forward and backward). Explain it further, when one of these buttons are pressed a voltage is output, releasing the tension is reset. However, the key is held down the table does not continue to date, when the button is released the table then updates through all the values in the queue. I understand that this is most likely a problem with holding the button causing the other user interface events are not processed. I therefore tried to use ProcessSystemEvents(), ProcessDrawEvents(), and experiments using an async timer to control the update of the UI through PostDeferredCallback(), all this without success.

    If anyone can help with a solution that would allow me to run both of these functions required at the same time it would be greatly appreciated!

    Thanks in advance

    Ben

    Problem solved by simply swallowing the event, I am able to perform the functions desired!

    See you soon

    Ben

  • cleaning multithreaded DLL

    Hi all

    I'm building a small DLL (for use from matlab) for acquisition of data. One of the functions may take several hours: streaming over 1 million samples in a file. So for this particular function, I want (read: I'm trying) to run it as a background operation in a separate thread. After reading a quick guide OR the multi-threading I selected the following:

    -Start streaming function

    * start a new async timer, which calls every second ProcessSystemEvents all detached CVI callbacks are executed

    * start the new pool of threads for maximum 1 wire and the highest (but not time critical) priority

    * Schedule streaming function for this pool (once again with a priority higher but non-emergency)

    specification of the cleaning function to be run in the current thread after completing the function continuous

    -reminder async-timer run ProcessSystemEvents every second post CVI callbacks are executed

    -cleaning function

    * Release the function ID from thread pool

    * Throw the thread pool

    * Take async-timer

    -State function which can be used from the main thread (still available at the matlab prompt) to check the status of the streaming

    The beginning of the broadcast (simulated with a countdown of the meter) goes well

    I can retrieve the status that goes from kCmtThreadFunctionExecuting to kCmtThreadFunctionComplete.

    However, the function of cleaning - as specified in the service scheduling - is never started.

    Q1: what did I wrong that prevents the scheduled cleaning?

    Q2: are there different approaches/examples that don't just want I want?

    Thanks in advance, Jos

    Use: Labwindows/CVI 8.0.1

    / * some administrative global variables * /.

    public static int PoolHandle = - 1;
    public static int ThreadHandle = - 1;
    public static int ThreadSamples = 60;
    public static int ThreadStatus = 0;
    public static int ThreadTimer = - 1;
    / * cleanup function * /.

    void CVICALLBACK FBGLAB_ThreadCleanup (int poolHandle, int functionID, unsigned int, int value event, void * callbackData)

    {
    int counter = 0;
    int Status = - 1;
     
    Delay (0.2); / * short wait so function thread can close * /.
    printf ("starting pool clean up\n");
    CmtGetThreadPoolFunctionAttribute (PoolHandle, ThreadHandle, ATTR_TP_FUNCTION_EXECUTION_STATUS, & status);
    While ((status< kcmtthreadfunctioncomplete)="" &&="" (counter=""><>
    {
    Counter += 1;
    Delay (1.0);
    }
    If (status<>
    {
    / * finish the thread after timeout * /.
    CmtTerminateThreadPoolThread (PoolHandle, ThreadHandle, 0);
    Delay (1.0);
    }
    CmtReleaseThreadPoolFunctionID (PoolHandle, ThreadHandle);
    CmtDiscardThreadPool (PoolHandle);
    DiscardAsyncTimer (ThreadTimer);
    ThreadHandle = - 1;
    ThreadTimer = - 1;
    PoolHandle = - 1;
    }
    / * simulated stream * /.

    int CVICALLBACK FBGLAB_ThreadStreamingWavelength(void *functionData)
    {
    ThreadStatus = ThreadSamples;
    While (ThreadStatus > 0)
    {
    Delay (1.0);
    ThreadStatus-= 1;
    }
    ThreadStatus = 0;
    Return (0);
    }
    / * async-timer callback * /.

    int CVICALLBACK FBGLAB_Timer(int reserved, int timerId, int event, void *callbackData, int eventData1, int eventData2)
    {
    If (event is EVENT_TIMER_TICK)
    {
    printf ("State of Thread is %0d\n", ThreadStatus);
    ProcessSystemEvents();
    }
    Return (0);
    }
    / * part of the function to retrieve the status of streaming * /.

    long __stdcall FBGLAB_GetStreamingStatus (long lDevice, char * response, long BufferSize)
    {

    int Status, FunctionStatus;
    Status = CmtGetThreadPoolFunctionAttribute (PoolHandle, ThreadHandle,
    ATTR_TP_FUNCTION_EXECUTION_STATUS,
    (& FunctionStatus);
    }

    / * Start simulated stream * /.

    long __stdcall FBGLAB_StartTest (long Nsamples, double SampleInterval)
    {
    int Status = 0;
    If (PoolHandle > = 0) return (FBGLAB_ERROR_MULTIPOOLEXIST);
    If (ThreadHandle > = 0) return (FBGLAB_ERROR_MULTITHREADEXIST);
     
    If (status > = 0)
    ThreadTimer = NewAsyncTimer (1,0, -1, 1, FBGLAB_Timer, 0);
    If (status > = 0)
    Status = CmtNewThreadPool (1, & PoolHandle);
    If (status > = 0)
    Status = CmtSetThreadPoolAttribute (PoolHandle, ATTR_TP_THREAD_PRIORITY, THREAD_PRIORITY_HIGHEST);
    If (status > = 0)
    Status = CmtScheduleThreadPoolFunctionAdv (PoolHandle,
    FBGLAB_ThreadStreamingWavelength, NULL,
    THREAD_PRIORITY_HIGHEST,
    FBGLAB_ThreadCleanup,
    EVENT_TP_THREAD_FUNCTION_END, NULL,
    CmtGetCurrentThreadID(),
    (& ThreadHandle);
    Return ((long) Status);
    }

    Hello again,

    It seems that the solution is as simple as the cause.

    -J' I create a pool of threads of high priority and program a priority acquisition function. Planning is done with CmtScheduleThreadPoolFunctionAdv. I do not use the option for a reminder at the end of this threadfunction.

    -A second more later (or in the service of acquiring) I schedule a cleaning of normal priority in DEFAULT_THREAD_POOL_HANDLE. Planning is done with CmtScheduleThreadPoolFunction. Inside this function, I wait until the acquisition thread is finished: CmtWaitForThreadPoolFunctionCompletion

    -Because all these functions are to 'demand' the original calling function returns. I get the prompt matlab for other tasks.

    I have to check what expectation-statement requires less processing for example power CmtWaitForThreadPoolFunctionCompletion or delay with the State Audit.

    But I have already seen that this combination:

    -start the acquisition in a high priority thread pool

    -then release the assignment of function and removes the high priority pool

    -During this time I had the back guest matlab and can run another task

    Thanks to everyone for their contribution, Jos

  • Multi Thread timers

    Hi all

    I'm working on a project that requests and receives a tcp modbus via ethernet connection values.

    Currently I use a timer to check the timer and wait times even re - connect the connection and send the next request if there is no timeout.

    The problem is that when one of the timeout of connections the other connection read more slowly.

    How can I create a multithreaded with each connection has its own timer to deal with timeouts and requests?

    I found a solution.

    The problem I had was that I had to have a delay of approximately 0.5 seconds to reconnect.

    Then I found another way to connect and send a request, but I forgot to remove promptly.

    That's why I wanted to use the async timer, and that's why I was getting this error.

    When I removed the delay everything works has should be, and it is all ran into a timer that saves a lot of confusion in the code.

    Thanks for your help.

  • DLL slows parrellel while loop

    Hello

    I am changing a VI I wrote, to work with another piece of equipment. Communication tends to work directly through labVIEW. My new equipment provided with a driver/dll library and now I have many layers before reaching the material (LabVIEW-> driver-> software-> the measuring equipment). I have some time this account down to run alongside my Subvi who manages my method of measurement of the loop. As I put in place the screw that call DLLs that count - while loop slows down in the same frequency, I'm calling the dll. I've changed the "Run in the user interface thread" setting to the "Run in any thread" option in the call library function node. In fact, which got rid of my problem about 90%. But my meter still comes in a few seconds at the end. I wonder in what sense the crux of library function call delayed a seemingly parallel thread?

    Any suggestion on the place where to continue searching for a fix?

    Welcome them

    / Lorenz

    It is hard to tell what might work without knowing your DLL and what he actually did, but I see something in your loop that will force LabVIEW to toggle the user interface thread! The property node to update the text of the start_method th button will ALWAYS force a change of context for the UI thread. If you can avoid this really should not be possible for the DLL block your loop more. At least try to not update this property if it needs to be changed with regard to the previous value and not at each iteration of the loop.

    A guess is that the DLL actually interfaces to ActiveX code somehow. LabVIEW initializes its ActiveX environment to run in the UI thread, because it is the only safe thread system in LabVIEW to perform many threaded ActiveX components or when the data marshaling is involved. If your DLL tries also to connect to an ActiveX interface, it will be forced to go the UI thread that explains how to access the property in your loop can get delayed.

    And another problem you have is the moment of software. count you down the loop increments of 10 ms, but Windows will be hardpressured for hard real-time performance. While you are not using the "wait until the next ms Multiple" to take account of some jitter, if the loop is blocked for more than 10 ms through an external resource, you will actually jump an interval.

    Better would be to calculate the time elapsed directly reading the timer tick before entering the loop, then use the output of graduation of timer her to "wait until the next ms Multiple" to calculate the difference. Dividing this difference by 10, and then adding your counter value initial this result would give you the same value that you feed your VI calculation, but what about the real system clock, not a counter loop running asynchronously with questionable interval.

  • Time machine unable to complete upward "an error occurred when creating a backup folder".

    Hi, I just graduated to El increase captain and since I had problems with my hard drive backup and the Time Machine. After you have installed the El captain, I get an error message that says 'save the failure. Full backup impossible. An error occurred during the creation of the backup folder. "Run disk utility to repair your backup disk.  When I made that I received the error "update boot support partitions for the volume as required.  Failed to dismount the volume for repair. Operation failed.  I can see the name of the hard disk in the sidebar of finder, but it has no history icon to eject so I right click on it and select "Force eject". Unplug the USB and reconnect USB for hard disk reappears in the side bar of the Finder. Once again same message execution utility disk first aid. I try to partition the drive in disk utility, but the button is grayed until I have change the disc name in the text field "Partition" 'apply' reselect "OX extended extended (journaled)" in the menu drop-down "Format". I then click on apply and get the error message that it "cannot unmount disk '. "Move up" button at the top of the disk utility window seems to do nothing. I then tried to drive 'Erase' and got the error message "disc remove POSIX reports: operation could not be completed." Input/output error. Operation failed. "So I clicked once more"Force eject", disconnected and reconnected USB, hard drive selected in the sidebar"Finder"ran"Set_Up.dmg"that was on the hard drive. Who seemed to rise to recording on the Seagates Web site. Player again activated in selected Time Machine preferences 'Back Up Now' of Time Machine in the Menu bar has obtained progress bar "Preparation to Back up...". "in Time Machine preferences for half an hour... Back at the beginning of the loop. States of Error Message 'save the failure. Full backup impossible. An error occurred during the creation of the backup folder. "Run disk utility to repair your backup disk.

    Ref: http://pondini.org/TM/Troubleshooting.html see espically - http://pondini.org/TM/C10.html

    Full backup impossible. An error occurred during the creation of the backup folder.

  • How to calculate the execution time of a SCTL in FPGA VI?

    Hello

    Can someone guide me that how to calculate the execution time of a SCTL for an iteration in the FPGA VI?

    Thank you and best regards,

    Rashid

    Hello r,.

    A SCTL will always run in a beat the clock it has been linked to.  So, if you use a 40 MHz clock, this loop will run in 25 ns.  If the code cannot complete in that, or if it requires two graduations of the watch to do the calculation, your code does not compile, then you have the guarantee that this will always be how long it takes this piece of code to run.

  • LabVIEW 2014 SP1, hardware and real-time PXI

    I'm doing my third LabVIEW Wipe/reinstall in as many days, completely frustrated (and after several calls an hour with the support of NEITHER).  Here's the situation:

    I wrote a fairly large (1000 VI) project of Acquisition/control of our graduate students data used for behavioral experiment on sound localization.  It was developed in 2012 LabVIEW with the module running on a PC/PXI system real time.  It worked very well and was brought successfully under LabVIEW 2014 (with upgrades comparable to the software of the PXI.

    About 18 months ago the students began to write their theses, and at one point stopped gathering data.  Also, at some point, I upgraded the software on this system to LabVIEW 2014 SP1, but I am not sure that I never tested my software with this new system.

    This week, I pulled up the system to use MAX to open some test on the PXI multifunction and DIO card panels to control manually one of the stimuli.  I discovered that MAX could not communicate with the advice on the PXI system - he attributes them as devices VISA, indicating each Board with an icon with a red X means that he could not communicate with the IP that I had assigned to PXI.  Yet, MAX (a) could "discover" this PXI, (b) MAX can 'see' its IP address, and (c) Windows could not only Ping the IP, but could FTP on the drive of the PXI and I could move files back and forth.

    I did two sequences complete "Wipe/reinstall" using LabVIEW 2014 SP1, all giving the same result.  I know it has worked in the past, including when I installed LabVIEW 2014 (without SP1), something I repeat myself now with my third installation.  I discussed with OR (thin?) possibility that there is a "hidden defect" in the Distribution of the SP1, one that is visible to LabVIEW RT users using PXI hardware and go unnoticed because (a) install a few sites of LabVIEW versions SP1, (b) a minority use the RT Modules and (c) PXI is "old material".

    If anyone has such a system or saw a similar problem, please answer.  I'll do a follow-up post if I managed to 'fix' my system by this last reinstallation "a solution of worked before."

    Bob Schor

    Well, the answer is that, in my system, LabVIEW 2014 SP1 with LabVIEW Real-time connected to a PXI system does not appear to connect to boards plugged into the chassis.  Returning to LabVIEW 2014 (fall release), installed in exactly in the same way that the three failed attempts of LabVIEW 2014 SP1, works immediately.  Engineers OR will try to duplicate/verify/possibly patch? in this issue.

    Bob Schor

  • VISA general parameters: Timeout Value vs Async lock timeout

    I think I found a bug in my code caused by a misunderstanding, I want to double check. In general, I set a timeout of the VISA (GPIB) using the property node ' General Settings: Timeout Value. Due to the multitude of GPIB communications that I do, I always wrap by read and write code in the async VISA locks. My previous assumed that the timeout from the setting in the property node would transfer on and be used by the node of VISA async timeout.

    In the screenshot below, "5000" is attached to the lock VISA async timeout value. If I were to delete, the time-out for the lock of async VISA would be '0' (the 'default' vi for) or '500' (as defined in the node property)?

    Thank you!

    Hi tkott,

    The value of VISA timeout property node sets the minimum for any VISA request timeout, while Timeout entry VISA Lock Async.vi specifies the maximum number of waiting to ask this lock.  The minimum expectation of property node (which by default two seconds) should take precedence when it is longer than the time-out of the VI entry, otherwise entry timeout value will define the duration of the time-out period.

    To answer your question, the node property will usually define your timeout, unless wire you a higher value of the lock of VI.  Is this the behavior you're seeing?

  • Timer &amp; events system process

    I usually use a "smart" delay dealing with the events, but I wanted to use a thread separate to process system events. Wording of menchar here, I feel that using a timer, it is automatically in a different thread. Is this true?

    A timer from asynchrous (in fact, all the timers async for a given process) runs on a common, separate thread.  A 'ordinary' timer is a Panel control that will run a reminder on the thread which instructed the Group of experts.

    Events system includes GUI events as I understand it, and these can be worked on the thread that the Committee.  Thus, on the face of it, you do not want to process system events using a 'regular' timer, not an asynchronous timer.

    I don't know exactly what will happen that if you did a process system events on an asynchronous callback to timer on its separate thread - some things may work, others might not.

    In the old days, CVI had a "processGUIevents" function, which was different from the function of "handle system events".  I don't know if CVI maintains this distinction much longer.

    I don't use a timer to make a smart delay, I put the thread to sleep and not the timing, rescheduling the thread after some time operating system.  You do not have a problem, unless you happen precisely set the 'smart' delay in a separate thread (a you created explicitly, or the CVI runtime provided thread timer async) and not expect to update the GUI, you have loaded on another thread.  I intend the delay "smart" to be used only from the main thread - which is the point of it, it allows the process to sleep but will react to user on the GUI input within a short time.

    It seems that the delay NOR will be spinlock, at least in some situations, and NEITHER was told that they treat events from the system during this period, at least in certain situations.  So, using the Delay(), NEITHER would have the same issues if use you some other thread than the thread that has loaded a GUI you are using.

    If your application does not have a graphical interface, there is no problem to use the smart delay on any thread, that I shouldn't think.

    I hope this helps.

Maybe you are looking for