View Full Version : Time in Millisecond
viralpatel
23-02-2010, 01:44
If i set the sysClkRateSet to 1000 for accuracy of 1ms, minute of the system clock is changing before 60 sec.
Ex. after 15 second my time change from 1 minute to 2 minute.
Please help me as i m new in VxWorks.
Thanks in advance.
I don't think most of us can help with any form of Delphi. Despite the name, chiefdelphi.com is not a Delphi programming language forum. It exists as a forum to discuss the FIRST Robotics Competition (http://usfirst.org/), and is named after a team that was originally sponsored by the Delphi Corporation. While there are a few people on the forum who do know various forms of Delphi, most of the members are much more familiar with C++, LabView, Java, or C, due to these being the primary languages used in the competition.
These links (found in this (http://www.chiefdelphi.com/forums/showthread.php?t=29944) sticky thread in the Programming subforum) may assist you in finding the answer that you are looking for.
Google's Directory For Delphi (http://directory.google.com/Top/Computers/Programming/Languages/Delphi/Resources/)
Delphi Starter's Links (http://www.hotkey.net.au/%7Ehambar/habit/delflink.htm)
CodeComments.com Delphi Section (http://www.codecomments.com/Delphi/)
Delphi & Delphi .NET (http://programmernet.org/forums/index.php?showforum=3)
Bunch of links to other sites (http://www.cbel.com/delphi_programming_language/)
Where I got them all from (http://www.google.com/search?q=delphi+programming+forums&hl=en&lr=&ie=UTF-8&start=0&sa=N)
We do invite you to observe the activity here and ask questions on what we are talking about. The people showing off robot designs are usually more than happy to expand on what the pictures show.
gvarndell
23-02-2010, 03:11
If i set the sysClkRateSet to 1000 for accuracy of 1ms, minute of the system clock is changing before 60 sec.
Ex. after 15 second my time change from 1 minute to 2 minute.
When you use sysClkRateSet, you need to call sysClkRateGet to verify the rate you asked for was actually achieved.
And even if sysClkRateGet returns the same number you passed to sysClkRateSet, it doesn't necessarily mean the underlying system tick interrupt is actually occurring every 1ms.
In this case, I'm going to assume you really did manage to get system tick interrupts going at 1000Hz.
Here's just 2 reasons why you don't want to do this.
1) there is an enormous processing overhead associated with interrupts. a system that must handle a timer interrupt every 1ms may be able to do little else.
2) when you change the system tick rate, there is no mechanism in vxWorks to notify the application of the change. if some code (not your code) called sysClkRateGet before the change and stored the returned value for subsequent use (assuming it would never change), that code will now have an invalid notion of system tick frequency and elapsed time.
Finally, it's difficult for me to reconcile the apparent dichotomy of someone who doesn't know vxWorks very well feeling the need to drive a realtime system at 1000Hz..
Edit: Sorry, I should have pointed the OP to the fact that his question belongs on a FRC programming forum.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.