Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic Rhapsody (steve huntington)
Decrease font size
Increase font size
Topic Title: Windows Multimedia Timer adapter 4.0.1
Topic Summary:
Created On: 27-Apr-2005 21:02
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 27-Apr-2005 21:02
User is offline View Users Profile Print this message


Justin DYER

Posts: 548
Joined: 30-Jun-2004

These are instruction on how to use the Windows Multimedia Timer with Rhapsody.


1. Extract the WinMMTPkg.zip to your generated code directory. It should extract 3 files, WinMMT.lib, MyTimerFactory.h, MyWinMMTimer.h.

2. In your Rhapsody project, place the following libraries into the "Library" field of your component: winmm.lib,WinMMT.lib

3. For your component configuration, change the property CG::Configuration:reFrameworkInitCode to have the following:

MyTimerFactory *myLLTimerFactory = new MyTimerFactory;
OXF::setTheTickTimerFactory((OMAbstractTickTimerFactory *)myLLTimerFactory);

4. For your component configuration, change the property CPP_CG::Configuration::SpecificationProlog to have the following:

#include "MyTimerFactory.h"

5. Now build and run your application.

Your application will now be using the Windows Multimedia Timer. This timer is more accurate than the timer supplied with Rhapsody for the Windows OS. With the Multimedia Timer you can have a resolution down to 1 millisecond. To change the resolution for your timeouts, change the property CPP_CG::Framework::TimerResolution for your configuration. The lowest possible value is 1 and the default is 100 ms.

WinMMTPkg.zip
WinMMTPkg.zip  (11 KB)

Report this to a Moderator Report this to a Moderator
 17-Jan-2006 16:16
User is offline View Users Profile Print this message


lars-arne axelsson

Posts: 1
Joined: 14-Dec-2005

Hi!
As this was just what I need to create a host and target version that are as similar as possible I downloaded it immediately.
But I ran into trouble as we use the .NET environment which does not have the msvcirtd.lib required by the winMMT.lib. I tried, unsuccessfully as one would expect, to load the lib from my visualc++ 6.0.
Is there anything one could do? I am not so keen on replacing the timer in oxf as I would need to find out how... I havent work on the lower side of oxf...
if there is no other option I suppose thats what I need to do...
best regards /lars-arne axelsson
Report this to a Moderator Report this to a Moderator
 17-Jan-2006 16:57
User is offline View Users Profile Print this message


Jesper Gissel

Posts: 88
Joined: 20-Jul-2005

We are using .NET too, so we have the same problem as mr. Axelsson.

Is it possible to have the sourcecode for the lib?

-------------------------
Jesper Gissel
Johnson Controls Denmark, Marine Controls
Report this to a Moderator Report this to a Moderator
 18-Jan-2006 21:24
User is offline View Users Profile Print this message


Justin DYER

Posts: 548
Joined: 30-Jun-2004

Attached is the code and original project for creating the WinMMT.lib. Good luck.

17040_01-Mmt.zip
17040_01-Mmt.zip  (547 KB)

Report this to a Moderator Report this to a Moderator
 19-Jan-2006 07:12
User is offline View Users Profile Print this message


Jesper Gissel

Posts: 88
Joined: 20-Jul-2005

Great, Thanks for the source.

There was no problem in compiling and using the MMTimer with .NET, but it seems to me, that the framework timer is more accurate than the MMTimer! :confused:

If I change the timeout value from 10 to 1000 in the test statechart to get a longer test, I get 1006 ms from the framework timer, but the MMTimer gives me 1028 ms!!!

Any comments on that?

It should be noted, that I have not examined the code thoroughly yet, but when I get the time, I surely will... That is, if no one has done this for me at that time

-------------------------
Jesper Gissel
Johnson Controls Denmark, Marine Controls
Report this to a Moderator Report this to a Moderator
 21-Feb-2006 14:20
User is offline View Users Profile Print this message


Justin DYER

Posts: 548
Joined: 30-Jun-2004

jegissel,
You may need to tweak the CPP_CG::Framework::TimerResolution property. It is set to 1 ms in that test model. That causes a lot of overhead and actualy makes the timer run slower. As a rule of thumb, I typicly change it to whatever the lowest tm I have in my model. If that is indeed 1 ms then you may want to find another means of acheiveing this acuracy. One way is to use a hardware timer in conjunction with the Rhapsody triggered operations.

Anyway, if you change this property to 10 instead of 1, you will see it is much more accurate. At least it was for me.
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic Rhapsody forum.
There are currently 0 users logged in.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.