Thread: Timer in Linux

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    4

    Question Timer in Linux

    Hello folks!
    I am trying to perform digital control, in order to control the position of a dc motor. How can I programm a timer subroutine, in order it to help me in the sampling process? I want thus to set the sampling rate of the control, for instance at 0.01sec, so i want the timer programm to trigger the system to take a sample every 0.01 secs. My operating system is Linux, and I use a digital I/O card without a hardware timer.
    Thanks

  2. #2
    .
    Join Date
    Nov 2003
    Posts
    307
    Read the man page on setitimer.

    This sets up a timer that when it expires sends a SIGALARM to the process. So you need to learn about signal processing, too.

    Read the man page on the singal family of functions, also.

    On a multiuser (busy) system, even Windows, timers are not guaranteed to get the process going exactly on time, every time.
    The scheduler might decide that some other process is more important.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Timer in Linux
    By dav_mt in forum Linux Programming
    Replies: 5
    Last Post: 04-19-2008, 06:09 AM
  2. Linux timer functions
    By onebrother in forum C Programming
    Replies: 3
    Last Post: 06-18-2007, 10:53 PM
  3. timer qustion again, on linux
    By crystalike in forum C++ Programming
    Replies: 2
    Last Post: 09-13-2002, 12:43 PM