Hi Scott,
When a capsule creates more than one timer it is up to the capsule to
correctly relate incoming timeout messages with the original request.
When you observe "some fire a few times in a single second" what you
are really seeing is several incoming timeout messages, from several
different timer requests, which all arrive at the same time when they
hit a common multiple of their period (assuming you use 'informEvery'.)
When you observe "Some timers fire every 30 seconds" (but you expected
a timeout message earlier) the timer most likely did fire earlier, but
your capsule may not have correctly matched timeout messages with requests.
The 'informEvery' and 'informIn' operations take a second argument
which should be used in this situation. When a capsule makes more than
one timer request, each request should have a unique value for this second
argument. The argument is returned in timeout messages, allowing the capsule
to match timeout messages with the original requests.
For example, I created a capsule with 'informEvery' requests having
periods of 1, 2, 3, 5, 7, 11, and 13 seconds. Each request has a unique
index, numbered 0 through 6. At time 20 seconds, the capsule receives input
messages from timers with periods 1, 2 and 5; at 21 seconds the timers with
periods 1, 3, and 7 fire; etc. etc. The capsule can tell exactly which timer
has fired using the unique index.
Robert Prager
Canada/Eastern Regional Services Organization
Rational - the e-development company
-----Original Message-----
From: Steve Scott [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 30, 2000 12:50 PM
To: [EMAIL PROTECTED]
Subject: (ROSE) Multiple timers don't act in real time
I am a new user to RR-RT. I have over 12 years experience creating
embedded software in C.
My problem is that I have created a number of capsules that each have
one or more timers which should fire periodically, such as once every 1
second, 2 sec, or 5 sec. Total is about 10 timers in 6 capsules. The
problem is that when I run the application and look at the trace and log
messages, my timers don't fire at those intervals, in fact they seem
"spastic". Some timers fire every 30 seconds, some fire a few times in a
single second. There is very little code in any of the capusules, just a
line or two at most.
What I am doing wrong? I have tried both the "in" and "every" methods
for invoking the timers. Maybe I can't expect real-time perforamnce from
this simulation running on Win 2000 Pentium III 400 Mhz?
-- Steve Scott
************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*
* To: [EMAIL PROTECTED]
* Subject:<BLANK>
* Body: unsubscribe rose_forum
*
*************************************************************************
************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*
* To: [EMAIL PROTECTED]
* Subject:<BLANK>
* Body: unsubscribe rose_forum
*
*************************************************************************