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: Auto-generate Microsoft Visual Studio solution/workspace
Topic Summary:
Created On: 9-Dec-2005 15:46
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.
 9-Dec-2005 15:46
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Rhapsody's host-based model execution (animation) is a great tool for getting your design right before moving to a target platform. Occasionally, though, you might need to debug at the source-code level, whether to understand the generated code or to debug your own algorithms.

Of course, you can use Microsoft Visual Studio for this, but it's a hassle to set up a solution (or workspace) when all you want to do is run a debug session.

Enclosed is a Rhapsody macro that takes the pain away.


Features
  • Creates a Visual Studio solution (or workspace) to match your active component, then launches Visual Studio.
  • Enables easy debugging in Visual Studio.
  • Enables build/rebuild in Visual Studio, using the same build mechanism that Rhapsody does (so you can build with either tool.)
  • Auto-detects and uses the latest version of Visual Studio that you have installed.
  • Supports the following editions of Visual Studio:
    • Visual C++ 2005 Express Edition (FREE to download!)
    • Visual Studio 2005 Standard Edition
    • Visual Studio 2005 Professional Edition
    • Visual Studio .NET 2003
    • Visual Studio 98/Visual C++ 6.0

  • Supports Rhapsody in C++ and Rhapsody in C


Installation

The macro is in the enclosed MSUtils*.zip file. To install it follow these steps:

  1. Download the zip file and extract the MSUtils.bas file to your local PC. (eg. save as C:\Rhapsody60\vba\MSUtils.bas)
  2. In Rhapsody:
    1. Open your project.
    2. Choose Tools\VBA\Visual Basic Editor from the menu (if licensed!)

  3. In Microsoft Visual Basic:
    1. Choose File\Import File... from the menu.
    2. In the Import File dialogue, select the MSUtils.bas file and click Open.
    3. Close Microsoft Visual Basic.

Note 1: You need to do this for every project in which you want to use the macro.
Note 2: You can also add the macro to the Rhapsody Tools menu by choosing Tools\Customise... and adding a new helper.


Usage

  1. In Rhapsody:
    1. Select a component/configuration that builds under the Microsoft environment.
    2. Choose Tools\VBA\Macros... from the menu (or press <ALT-F8>.)
    3. In the Macros dialogue, set the Macros in: field to MSUtils, then select the runMsVc macro from the list and click Run.

  2. In Microsoft Visual Studio:
    1. To build, choose Build\Build from the menu.
    2. To debug in Visual Studio 2005 or .NET 2003, choose Debug\Step Into from the menu (or press <F11>.)
    3. To debug in Visual Studio 98 (6.0), choose Build\Start Debug\Step Into from the menu (or press <F11>.)


If you find this helpful, I'd welcome feedback, good or bad! (Good is better, or course )

Thanks to Jesper Gissel, who added the support for Visual Studio 2005 Standard Edition, and has tracked down and fed back solutions for a number of defects. (See his posts below.)

regards,
Simon




-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life

Edited: 26-Feb-2008 at 08:45 by Simon Morrish
Report this to a Moderator Report this to a Moderator
 15-Dec-2005 16:08
User is offline View Users Profile Print this message


Frank Vaughn

Posts: 1
Joined: 23-May-2005

I have done something similiar to this using CodeWright, but it is a pain. This will be very helpful.

Thanks!
Report this to a Moderator Report this to a Moderator
 3-Jan-2006 12:52
User is offline View Users Profile Print this message


Jesper Gissel

Posts: 88
Joined: 20-Jul-2005

It looks really promising

We are using VS2005, and it seems there are some small adjustments to be done for it to work...

Good work, Simon

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


Simon Morrish

Posts: 127
Joined: 17-May-2005

Thanks, Jesper!

If you need any help with the adjustments for VS2005, just let me know. Alternatively, could you let me know what changes you find necessary? I'll then release an updated macro...

best regards,
Simon

-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life
Report this to a Moderator Report this to a Moderator
 10-Jan-2006 14:09
User is offline View Users Profile Print this message


Jesper Gissel

Posts: 88
Joined: 20-Jul-2005

Hi Simon,

I've made the adjustments that were nesseceary for the macro to work with VS2005.

I'll leave it up to you to verify that my modifications are OK

Regards
Jesper




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


Simon Morrish

Posts: 127
Joined: 17-May-2005

Jesper!

Your changes look great. I pulled them into our revision control, then made some consistency improvements to the comments throughout the file, and have updated my original post above, replacing my original revision.

I just need to get VS2005 now so I can make use of them! :rolleyes:

No doubt they will be of immediate use to many. Thanks for your efforts and for sharing the changes back to the forum.

Regards,
Simon

-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life
Report this to a Moderator Report this to a Moderator
 23-Jan-2006 07:13
User is offline View Users Profile Print this message


Jesper Gissel

Posts: 88
Joined: 20-Jul-2005

Hi Simon,

I've made some additional modifications in MsUtils.

The changes I've made is in the functions getImpFiles and getSpecFiles.

The reason was, that in one of my RiCpp models I have som legacy .c files located under the component. They all have the .c extension included in the model name, which resulted in a filename like "ad.c.cpp" in the VS project file.

I have also added some lines of code in the initialise routine, for determining if the model should be regenerated and if the expected folders exists.

Another, minor, mod I've made is in fBase. If a filename without extension was passed to this function an error occured.

Its up to you if you want to use these changes or not, but I thought you should see them.

I say it again... This macro is EXTREMLY usefull and will save many hours

Regards
Jesper




-------------------------
Jesper Gissel
Johnson Controls Denmark, Marine Controls
Report this to a Moderator Report this to a Moderator
 26-Jun-2006 15:52
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Hi All!

I've updated the Visual Studio Solution generator as follows:

[list]
[*]Added support for Visual C++ 2005 Express Edition (FREE to download)
[*]Added support for Rhapsody in C
[*]Resolved the defects that Jesper reported in his previous post
[/list]

The updated macro is attached to the top post of this thread (MsUtils_060626.zip).

Hope it works for you! (If it does, or even if it doesn't, please would you click on the poll at the top of the thread? And if you find any defects, I'd be really grateful if you could let me know...)

best regards,
Simon

-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life
Report this to a Moderator Report this to a Moderator
 22-Feb-2008 15:55
User is offline View Users Profile Print this message


Michael Lettner

Posts: 16
Joined: 7-Dec-2007

Hello,

could someone confirm with me which version is the latest of Simon's great macro?

I can only find "MsUtils_060123.zip" on that forum for download - however, in the last post Simon mentioned he updated the macro, with the latest update named "MsUtils_060626.zip" - unfortunately, I can't find a link to this one.

If somebody can point me to the correct location, I'd appreciate it!!!

Thanks,
Michael
Report this to a Moderator Report this to a Moderator
 26-Feb-2008 08:36
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Hi Michael

Thankyou for your kind comment.

I've lost a few attachments and posts since Telelogic converted the forum to this new system. I am pestering them to complete on their commitment to sort it out, but meanwhile I've attached the missing file here (it won't re-attach at the top of the thread), and tidied up the formatting of the original post.

Let me know if it works for you, or if you have any problems. If you try it with VS2008, I'd be interested in your results; it's not something I've specifically implemented/tested yet.

best regards,
Simon




-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life

Edited: 26-Feb-2008 at 08:48 by Simon Morrish
Report this to a Moderator Report this to a Moderator
 27-Feb-2008 13:27
User is offline View Users Profile Print this message


Michael Sommer

Posts: 1
Joined: 12-Feb-2008

Hi Simon,

first, thanks for your great helper tool.

I tried to use it with the new VS2008 Express, which didn't work without modification (as you already expected).

Thus, for the sake of completeness I attached the modified macro file which runs well with VC++ 2008 Express (Version 9.0). I didn't check for VS2008 Std and Pro, but I assume it will work all the same.

Please feel free to take over my changes and update your release.

Regards,
Michael


Report this to a Moderator Report this to a Moderator
 29-Feb-2008 12:59
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Fantastic.

Thankyou, Michael, for doing that. I've reviewed and tested, and completely endorse your carefully-implemented changes.

It prompted me to make a couple of further minor changes; detection of VS2008 Team Developer, and detection of some VS2003 editions that may possibly fail at the moment, so I enclose this minor update below.

Thanks again. If you find any issues in your use of the macro, please let me know.

best regards,
Simon




-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life
Report this to a Moderator Report this to a Moderator
 1-Mar-2008 12:16
User is offline View Users Profile Print this message


Michael Lettner

Posts: 16
Joined: 7-Dec-2007

Hi Simon,

as discusses via email, I'll repost my comments about your macro here:

  • first, I think the macro is a great piece of work and can save a lot of time - thanks a lot!
  • I'd like to mention, that we found the macro does not run on my old version 7.0 (build# 749 936; the error message was "method 'activeConfiguration' of object 'IRPProject' failed"); however, we tracked that issue down and it seems that this is problem just with this particular build; so if anybody ever encounters such a problem, consider updating Rhapsody

    Now I wanna be a little bit more specific about my project - I want to describe what we want to do, and would hope if you have any suggestions on how to attack this problem (since I'm not sure that Simon's macro can help here all alone); please consider following setup:
  • the project is about a device that consists of a hardware, protocol stack, middleware and a HMI
  • the lower layers (protocol stack and middleware) are the by far greatest pieces of software in the project and exist as a (bought from a 3rd party) VS6-solution
  • on top of that, we want to integrate a HMI which is designed fully in Rhapsody in C (statecharts); the HMI should be able to use display-methods from the provided middleware
  • the existing VS6-solution already has a rather complex make-file to build all the lower-layer-components
  • what I'm actually looking for is a way to integrate my Rhapsody-generated code into the existing VS-solution; so in the end, I wanna press "Build" in VS, and it should build and allow debugging both the existing solution and the Rhapsody-generated code

  • I realized that the macro "only" creates a makefile project - therefore I'm not sure whether this fully supports my needs here, since I do not need the "exact" same makefile, but have to call functions like "RiCOXFInit" and "DefaultComponent_Init" (which are called now in the "main"-function of MainDefaultComponent.c) from a specific entry point in the existing VS6-solution
  • therefore it would be interesting to know which specific compiler/linker settings and additional include directories would be necessary to build Rhapsody code from native VS; I already tried to do that, but it seems that I'm still missing things here since I always get a "linker error: unresolved external symbol" (e.g. for RiC-specific symbols such as RiCMainTask, RiCReactive_init or RiCReactive_startBehavior)
  • I'm also open to hear if you think that integrating (vice versa) the existing VS6-solution into Rhapsody would be the better approach

  • to sum it up, I'm looking for a way to integrate the Rhapsody-generated code to an existing VS-solution, where the Rhapsody-code can call functions from middleware (e.g. some display methods) and vice versa (e.g. starting the oxf-framework)

    I hope I could outline my problem clear enough. If you have any comments/suggestions/ideas about that, I'd be happy to hear about them.


    Thanks in advance,
    Michael
  • Report this to a Moderator Report this to a Moderator
     11-Mar-2008 11:45
    User is offline View Users Profile Print this message


    Michael Lettner

    Posts: 16
    Joined: 7-Dec-2007

    As I have figured out a way to integrate Rhapsody into VS in the meantime, I've uploaded some more information on how to do this on a related post in this forum. See HowTo start Rhapsody from external app for more information.

    Rgds,
    Michael
    Report this to a Moderator Report this to a Moderator
    Statistics
    20925 users are registered to the Telelogic Rhapsody forum.
    There are currently 1 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.