Techniques for calibrating software time

I need to generate pulses on one of the lines of my DIO-96, which doesn't have the pulse generating API available to it that some of the analog instruments do. I don't own Labview Realtime so I have to do it myself in C++. The method I've heard to use is to perform some standard mathematical operation in a loop many times and then time it to obtain an approximate value on the time needed to perform that operation-- Then simply use that operation as the basis for a timer by repeatedly invoking it in a loop. I was going to use arctangent in Visual C++, but if I just do something like arctan(1) is there a danger the compiler will cache the result and that that will skew the timing? Would it be better to gener
ate a random number each time and then perform arctangent on that? Or is there a better trick available? The Microsoft C++ libraries have a process timer function called clock and a few others, but these are not even precise enough for time intervals measured in milliseconds,much less microseconds. any tips appreciated.
brendan

I use VB and use this Windows API to generate the delay in millisecond. I'm sure you can use this API in VC++ too.
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sleep 100 'generates a 100 ms delay
Hope this helps
Rajiv Agarwal
www.rajiva.com

Similar Messages

  • Seeking advise on techniques for making a time-lapse movie

    Hi, This isn't technically a question having to do with FCE directly, but it seems like a good place to ask. I need to make a time-lapse movie showing the changing daylight on a fixed point from dawn until dusk. It will be edited in FCE, but I have no idea of how many seconds I should shoot at a time, and at what intervals I should shoot them. Or.... would there be any advantage to shooting still photos and then importing them into FCE?
    Can you suggest any resources which I could read on the subject?
    Thank, Bob

    Lets say you are doing this shoot at equinox (ie 12 hrs between sunrise and sunset).
    Since most cameras do not hold storage media that can hold 12 hours of media in one file, you need to either use an intervalometer setting on the cam (allowing for incremental recording) or record to an external drive that CAN hold 12 hrs of media.
    The approach one takes depends upon the recording limitations. If using external storage that can record the full length, it's just a matter of bringing in the file and speeding it up to whatever makes sense to your needs.
    If you are going to use an incremental capture approach, then you really do need to know what will be the speed of the final clip. Is this thing going to play back at real time? 2x, 10x, 100x? Or, asked another way, how long do you want it to run? 30 sec, 1 min, 5 min, 20 min, etc?
    Once you know that, it's really simple math to figure out.
    Video (in NTSC land) runs at 30 frames per second (29.97 if we are being precise).
    This means if you were to record it in real time you'd require 1,296,000 frames
    12 hrs x (60 min per hr) x (60 sec per min) x (30 frames per sec).
    If you want it to play 100x faster, you would need 12,960 frames. This can be accomplished by recording every 100th possible frame (that is, snapping an image every 3 1/3 seconds)
    Or, if you work it backwards - thinking that you'd like to compress 12 hrs to 12 minutes, you'd need to acquire one frame every 2 seconds. (This yields a 60x increase in speed.)
    Have fun.
    x

  • Every single time I power up photoshop CC get an error. says " the monitor profile "acer S201HL" appears to be defective. Please rerun your monitor calibration software. How do I fix this?

    Every single time I power up photoshop CC get an error. says " the monitor profile "acer S201HL" appears to be defective. Please rerun your monitor calibration software. How do I fix this?

    Your factory-supplied monitor profile, associated with your monitor by the operating system, is bad.  It's more common than you'd think.
    To avert the error:
    Open the Color Management panel of your Windows operating system.  In the Devices tab, if it is not already listed [ Add... ] the sRGB IEC61966-2.1 profile and [ Set as default Profile ].
    After doing the above, log out of Windows and back in again, just to ensure everything's updated.
    Note that the above assumes your monitor is more or less displaying color in the sRGB color space (sRGB is short for sRGB IEC61966-2.1).  For many monitors this isn't a terribly wrong assumption.
    If you want to ensure you have the most accurate color, consider buying a calibration and profiling device, which (with its associated software) can set your calibration and generate custom color profiles by doing actual measurements from your monitor.  You'll want to take some time to get your mind around how color-management works, and that is not a trivial task.  It's certainly well beyond what can be taught in a forum post by post.
    Good luck.
    -Noel

  • Why is it when I go to open a file in Photoshop cc I get a "Could not complete your request because of a program error".  I have uninstalled and re-installed software,  It works for a short time then I get that error again when i go to open a file.  Thank

    @Why is it when I go to open a file in Photoshop cc I get a "Could not complete your request because of a program error".  I have uninstalled and re-installed software,  It works for a short time then I get that error again when i go to open a file.  Thank you!

    Without proper system information and other details like what files you work with  nobody can tell you much. From corrupted prefs to issues with your PS swap file to actual problems with the fiel storage this could be anything.
    Mylenium

  • IPhoto nightmare. Tried to import photos using Nikon software for the first time and all my photos disappeared from iPhoto 8.1.2 (and everything from itunes too). Newly reinstalled iPhoto crashes as soon as I import anything now.

    Macbook OSX 10.5.8, iPhoto 8.1.2. I just tried to import some photos using Nikon software (View NX2) for the first time. When I next looked into iPhoto it was empty (so was iTunes but that's another story). I had backed up photos fairly recently but don't use time machine. Searched in vain everywhere and must have done something wrong because iPhoto wouldn't then open at all, saying it was unreadable. After a lot more attempts to recover I uninstalled iPhoto and the receipts and reinstalled from my original disc. It seemed to be ok and imported some photos from my iphone but as soon as the import is complete iPhoto crashes and when opened again it is empty. Have tried this several times and have shut down and have tried rebuilding with the alt and cmd buttons but nothing seems to help. Any ideas?

    not a reply but not sure how to add something to my own thread! It seems that Desktop was damaged too as when I try to open it a screen says there is no application selected to open Desktop with. No idea what I should choose! Any help appreciated, have really made a mess of my MacBook this time.

  • Scheduling specific time of day for automatic software updates

    How can one schedule a specific time of day (i.e. between 11:01 pm to 5.59 am when I have unlimited download availability) for an iMac to search for automatic software updates? System preferences only offer frequency, but no time option. If it is possible to schedule a specific time, will invoking the feature override the sleep function, wake up the machine and perform the software update and then let the machine go back to "sleep?" Thank you for all your help.

    to clarify barney's suggestion, the following terminal command will download all available updates and put them in your Downloads folder.
    softwareupdate -d --all
    so what you need to do is this.
    1. turn off automatic software update in software update system preferences.
    2. make a cron or a launch daemon to run the above terminal command periodically at the time of your choosing. to make a launch daemon I recommend using lingon http://tuppis.com/lingon/
    The daemon will only run if the computer is not asleep at the scheduled time so you might want to set to to wake/start shortly before that. this is done in system preferences->energy saver->schedule.
    to install the updates once they are downloaded double-click on the pkg files and follow the instructions.

  • HT1222 My phone is telling me about a Software Update but for the first time it is asking me for a passcode, I have never set up a passcode and do not know how to get around this to do the upgrade?

    My phone is telling me about a Software Update 7.1.1 but for the first time it is asking me for a passcode, I have never set up a passcode and do not know how to get around this to do the upgrade?

    See if this helps:
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212

  • Checking for calibration time

    I have a requirement to perform a daily calibration of an instrument on a daily basis.  The time of calibration must be user configurable.  So, what I have done is created a menu item which allows the operator to control the user time.  Additionally, I have a file where I store the last calibration time.  So, in my routine, I perform the calibration if it has been more than 1 day since the last calibration or the current time is greater than the daily set calibration time.   For the latter condition, there is always a possibility that calibration could get performed before the 24 interval is up ie:  initially, the daily calibration time was 9pm and then the operator decided to change it to 8am the following morning, so calibration would get run after 11 hours.
    However, if I implement the OR condition as follows :
    Current Time > Calibration Set Time ||  Current Time is 1 day older than last calibration time, I run into the problem that the calibration will be executed every time the current time > calibration set time, whereas I only want the calibration to be run once if the time has been changed.  I am struggling with the logic of how to implement it.  I am looking to the experts or the forum to help me overcome the intellectual roadblock right now.
    Solved!
    Go to Solution.

    You could store in the file the next "Expected Calibration" time.  This would be set whenever the user updates the test station.  This could also be set whenever a calibration is performed (whenever the calibration is performed, set it to 24 hours from now, or the next expected calibration time).  You would only need to check if the current time is greater than the Expected Calibration Time.

  • I have a 3g. Recently I synched for the first time. I also upgraded the software to 4.2.1 The sync took my photos and music off my phone. The photos worked fine. The music has disappeared. It looks like my iphone itunes isn't functioning at all

    I have a 3g. I synched my phone and computer itunes for the first time this week ( I also upgraded my phone itunes software to 4.1.2 ). Now I have no music on my phone, and my computer has seemed to lose the music that was uploaded (It was there for a bit, now gone). I think I should undo the software upgrade. How do I do that?

    not a reply but not sure how to add something to my own thread! It seems that Desktop was damaged too as when I try to open it a screen says there is no application selected to open Desktop with. No idea what I should choose! Any help appreciated, have really made a mess of my MacBook this time.

  • TS3406 did a upgrade to the software for the first time. .

    did a upgrade to the software for the first time.  Now when someone calls me the phone go straight to voicemail.. I never know someone is calling me...if they person hangs up and call right again I will get the call instead of the call going to voicemail.

    Check the Apple article below.
    http://support.apple.com/kb/HT5463

  • I have the CC Photography subscription. The last several days, every time I bring up Photoshop, I get a window stating "Sign In Required" and "Terms and Conditions for Trial Software". Why? This is not trial software.

    I have the CC Photography subscription. The last several days, every time I bring up Photoshop, I get a window stating "Sign In Required" and "Terms and Conditions for Trial Software". Why? This is not trial software.

    Asked to sign in after paying may help
    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
    or
    Chat Now button near the bottom for Activation and Deactivation problems may help
    http://helpx.adobe.com/x-productkb/policy-pricing/activation-deactivation-products.html

  • How can I download the software for a second time without a backup but with  the serial number?

    Hi guys,
    stupidly my hardware got broken and I've missed to do a backup for the programs. May it's a stupid question but how can I download the Lightroom software for a second time? I've got the serial number for this, but can't find a link without buying it again....
    Thanks a lot for your help!!!!
    Cheers,
    Hannah

    Lightroom - all versions
    Windows
    http://www.adobe.com/support/downloads/product.jsp?product=113&platform=Windows
    Mac
    http://www.adobe.com/support/downloads/product.jsp?product=113&platform=Macintosh

  • HT4623 Every time I try to update, I get a message saying unable to update- an error occurred while checking for a software update

    Every time I try to update, I get a message saying unable to update- an error occurred while checking for a software update

    im having a similiar problem but my iphone 4s is stuck in the recovery mode.. like every time i restore the phone to factory setting it redownloads the firmware but nothing changes. any ideas?

  • I am new to this forum. Just installed adobe iplayer for the numerous time. Then decided to have a software update immediately on my mac computer. Then a a small screen appeared afterwards stating the maleware virus was removed. What do I do now?

    Just installed adobe iplayer for the umpteeth time.
    Then decided to have a software update immediately on my mac.
    Then a small screen appeared afterwards stating maleware virus removed.
    What do I do now? Was not aware that I had a virus in the first place.

    That latest update is a removal tool for the Flashback trojan.
    One of the ways the earlier versions of that trojan were distributed was through fake Adobe Flash downloaders.
    Why are you repeatedly installing Adobe Flash Player? (not iPlayer - that's a BBC thing.)
    The only place from which to get the Flash Player plug-in is directly from Adobe themselves - Never Trust a Pop Up that says you have a missing plugin!
    Also be aware that the Flash Player is not a standalone player; it's a plug-in which installs in the Library and is available for all the browsers to use.
    As for what you do now?
    Nothing for the moment - you should be clear.
    But to be on the safe side, go to the Prefences for each of your browsers and disable Java (not JavaScript - that's a whole different animal). As Java is the vector used by the most recent versions, that should ensure you don't get reinfected.

  • My recently acquired Power Mac G5 sez it's time for a software upgrade!

    My recently acquired Power Mac G5 sez it's time for a software upgrade!
    It offered ILIFE Support 9.0.4, FRONT ROW UPDATE 2.1.7,MAC OS X UPDATE COMBINED 10.5.8 AND ITUNES 10.6.3!
    WHEN I DOWNLOADED THE ABOVE ENHANCEMENTS Itunes and others would not open do to the current architecture!
    I would like to bring this machine up to aq more modern Safari browser but again the current architecture is a issue...
    Currently, this is what I am working with....
    Hardware Overview:
      Model Name: Power Mac G5
      Model Identifier: PowerMac7,2
      Processor Name: PowerPC 970  (2.2)
      Processor Speed: 1.8 GHz
      Number Of CPUs: 1
      L2 Cache (per CPU): 512 KB
      Memory: 1.5 GB
      Bus Speed: 900 MHz
      Boot ROM Version: 5.0.5f0
      Serial Number: YM******NVR
    Any opinions are welcomed!
    :>)
    <Edited by Host>

    Hello,
    As far as Browsers...
    TenFourFox is the most up to date browser for our PPCs, they even have G4 & G5 optimized versions...
    http://www.floodgap.com/software/tenfourfox/
    I'd avoid vesrion 24 though, as it no longer supports plug-ins like Flash.
    http://code.google.com/p/tenfourfox/downloads/list
    SeaMonkey seems pretty fast also, with many options...
    http://www.seamonkey-project.org/
    http://www.seamonkey-project.org/releases/
    Might also look into iCab & OmniWeb versions.

Maybe you are looking for

  • Problem with Mail For Exchange over Nokia E7-00 (a...

    Hi, I have a problem with my nokia E7-00 (Symbian Anna). Until recently it worked fine with my terminal synchronization with GMAIL via Mail For Exchange. I synchronized the mail (including folders / labels I have on my account), address book and cale

  • IPhone will not restore and is stuck on low battery screen?

    I let my iPhone 3g's battery run flat a few days ago by accident, since then I have not been able to get the phone to recognize it is being charged. I plugged it into my mac and put it in DFU mode (i think), but my iTunes popped up with 'Unknown erro

  • My computer died.  Can I recreate my iTunes library from my old hard drive?

    My computer died and I had not backed up my iTunes library (I know, I know).  The crash was not due to a corrupted hard drive, however, and I can access all the files from my old hard drive with my new computer, including any iTunes files.  Can I rec

  • Nullpointer in Application Connection Manager

    Hi All, when deploying an application I get the following exception. Has anybody else seen this? I'm somewhat lost at this point since other applications (e.g. ascontrol) deploy correctly. This occurs from a highly customized build and deployment env

  • Christmas Eve (very much on topic)

    Greetings everybody, my wife just gave me a call on her cell phone: she's driving home from her parents but the roads are slippery so she has to drive slowly; that gave the opportunity to carefully inspect the presents (I didn't dare to open them (no