Rhapsody TechBlog

BLOG about IBM Rhapsody. Contains technical information as well as more private travel stories.

Page 6 of 16

Roger Waters Factory Pattern

Us + Them

That is the name of the Roger Waters tour. I managed to buy tickets for the concert in the ZiggoDome on June 22 and I went there with my cousin and my son. It was a bit stressful… I just arrived from Switzerland, went home by train and back to 020 by car. But I managed and… I have seen a lot of concerts, ranging from mwoah OK to fabulous but this was one of the best (if not the best) I ever saw. And I have seen Pink Floyd (Rotterdam 1993), Genesis, U2, the Stones and Peter Gabriel (multiple times)


Sound quality was absolutely awesome, before the break the show was fantastic, after the break it became breath-taking. Not bad for a 75-year-old guy…
I think the Pink Floyd guys always had fantastic sound quality but the technology now really offers them what they wanted to have 30 years ago.

The Factory you see is (of course) Battersea Power Station, as seen on the Animals Album. It was projected as were many other things. I am listening to the Animals Album while I am typing this….

Battersea Power Station from the river.jpg
By Alberto PascualOwn work, CC BY-SA 3.0, Link

 

OK… back to work. speaking about Factory…

That reminds me of the factory pattern. A nice pattern that helps you creating objects where you don’t know at compile time what class you want to use.
I always look for design patterns in one of my favourite books: Head First Design Patterns. Do yourself a favour: buy it (And in English please…, the German translation sucks.)

I use the Factory pattern in a model where I have 3 different platforms to generate code for, Linux, Windows and Keil CMSIS, and there is a possibility that it needs to be adapted to QNX as well.
I want to have a common debug output but also some interprocess communication that works different on all platforms.
This sounds easy, just define interfaces and inherit from them. (Or to be correct: create realizations)
Now that sounds cool but when you need to instantiate the objects (semi-)dynamically you cannot use that. You have to call something that is not the same on all platforms.
This is where the factory comes in. You create a global Class/Object (with a fixed name i.e. AbstractFactory) that has a static function “getInstance” (Yes correct… that is a singleton!) that checks if a static variable is already filled with a value. If NULL it will create an object and store it in the class variable otherwise it just returns the variable.

You then have a certified entry point. The Abstract Factory class should then have functions that create concrete factories for the environment. In this case I needed a LinuxFactory, a QNX Factory and a Windows Factory.

In the concrete factories you will make create_xxx functions that create objects for the classes you need. This can be multiple objects but also a singleton.

In a random class you can then call:

MyDebug = AbstractFactory::getInstance()->createDebugOutput()

This will give you a pointer to a class that handles the debug output. This is also a singleton. For the IPC it was just a “new” that created an IPC Channel.

Design Patterns rule!

Some useful reminders:

  • Separate what varies from what stays the same
  • Composition is better than Inheritance
  • Program to an Interface rather than to an implementation.

That was it, happy modeling with Rhapsody

Walter van der Heiden (wvdheiden@willert.de)

Pi-Day, STL & Memory

Introduction

Today is March 14. For Europeans this is nothing special but in the US, where they reverse month and day, this day is written as 3.14. Which is the first 3 numbers of Pi.

STL

For a customer I do some modeling to help them create a super reusable application. This project is done in C++. The more I use C++. the more I like it, it is so much easier to do stuff than in C where you have to write everything out.

But here are also caveats. I sued the string class without really thinking. To find out later that this triggers the compiler to use the Standard Template Library. A very fine piece of C++ art that cost you memory. Lots of memory…

I compiled the application with the Keil/ARM compiler where I could read the map file afterwards to see where the memory had gone. The application was 12k, the STL took 180k…..

So… now I understood why Rhapsody has the OMString Class included….

OMString

The problem with OMString is that IBM did not include much documentation on the use of the Class. “Read the OMString.h file”….

Functions

  • GetAt(Nr)
    Gets the character at position <Nr>
  • SetAt(Nr, Char)
    Sets string position <Nr> to <Char>
  • Empty()
    Clears an OMString set the size to 0
  • GetBuffer()
    Converts the OMString to a char *
  • IsEmpty()
    Checks if the OMString is empty
  • getSize()
  • setSize()
  • resetSize()
    get or set the size of the OMString
  • getStr()
    returns the OMString
  • getDefaultBlock
  • GetBuffer
  • ReleaseBuffer
  • GetLength
    returns the length of the OMString

Operators

  • compare functions
    • <, <=, >, >=, ==, !=
      Compare two OMStrings or a string and a character array,
    • =
      Assignment, assigns a character, a char array or an OMString to another OMString
    • []
      access the OMString as an array
    • +, +=
      Add a char, char array os an OMString to another OMString

 

Constructors

You can construct an OMString with:

  • another OMString
  • An old fashioned character array
  • a character
  • a void.

 

So you can create and use an OMString very easy:

OMString    MyString (“Moin moin”);
MyString+=” Auch Moin”);

It uses way less memory than the STL and gives you a lot of freedom with Strings.

Yo! Happy PiDay! And keep on modeling with Rhapsody!

Walter van der Heiden (wvdheiden@willert.de)

Pi-Day, STL & Memory

Introduction

Today is March 14. For Europeans this is nothing special but in the US, where they reverse month and day, this day is written as 3.14. Which is the first 3 numbers of Pi.

STL

For a customer I do some modeling to help them create a super reusable application. This project is done in C++. The more I use C++. the more I like it, it is so much easier to do stuff than in C where you have to write everything out.

But here are also caveats. I sued the string class without really thinking. To find out later that this triggers the compiler to use the Standard Template Library. A very fine piece of C++ art that cost you memory. Lots of memory…

I compiled the application with the Keil/ARM compiler where I could read the map file afterwards to see where the memory had gone. The application was 12k, the STL took 180k…..

So… now I understood why Rhapsody has the OMString Class included….

OMString

The problem with OMString is that IBM did not include much documentation on the use of the Class. “Read the OMString.h file”….

Functions

  • GetAt(Nr)
    Gets the character at position <Nr>
  • SetAt(Nr, Char)
    Sets string position <Nr> to <Char>
  • Empty()
    Clears an OMString set the size to 0
  • GetBuffer()
    Converts the OMString to a char *
  • IsEmpty()
    Checks if the OMString is empty
  • getSize()
  • setSize()
  • resetSize()
    get or set the size of the OMString
  • getStr()
    returns the OMString
  • getDefaultBlock
  • GetBuffer
  • ReleaseBuffer
  • GetLength
    returns the length of the OMString

Operators

  • compare functions
    • <, <=, >, >=, ==, !=
      Compare two OMStrings or a string and a character array,
    • =
      Assignment, assigns a character, a char array or an OMString to another OMString
    • []
      access the OMString as an array
    • +, +=
      Add a char, char array os an OMString to another OMString

 

Constructors

You can construct an OMString with:

  • another OMString
  • An old fashioned character array
  • a character
  • a void.

 

So you can create and use an OMString very easy:

OMString    MyString (“Moin moin”);
MyString+=” Auch Moin”);

It uses way less memory than the STL and gives you a lot of freedom with Strings.

Yo! Happy PiDay! And keep on modeling with Rhapsody!

Walter van der Heiden (wvdheiden@willert.de)

EW 2019

Introduction

And… it is time for the yearly “High School Trip” for grown-ups: The Embedded World. We used to be there every year. Even since my Tasking days I have visited the EW (First time in 1998 if I’m not mistaken)
Since I am at Willert in 2001 we had a booth (together with Easycode, Microconsult, and in the beginning, Keil ( Before they were taken over by ARM)
We gave up in 2014 but we returned in a smaller way in 2016 and 2017 together with LieberLieber (& Sparx Europe) In 2018 we skipped again but we decided to give it a try again with a new concept together with our Merge Partner Sodius and with OOSE. 
So we have a booth again. Hall 4-150.

EW

The Embedded world is a 3-day fair all about embedded. Lots of exhibitors in Software and Hardware. Lots of people I know and sometimes haven’t met in years. After 3 days you are really really tired from standing and talking all day and part of the evening.
Also, of course, we are traveling to Nürnberg on Monday, for me that means travel to Bückeburg on Sunday evening… Then we built up the booth, most of it is done by a company that builds up the booth but we have to install some stuff ourselves.
We are always in the same hotel… it has changed ownership a couple of times but we are still there, not because of the great rooms (the are not great… the are OK.) but because it is quite near the fair and because of the great steaks they serve there. And… no… i will not tell you where it is 😉
The very nice thing is that the embedded scene is quite small so you know lots of people there. People change jobs so sometimes they work somewhere else (Like Emmanuel, he worked for us years ago, he has built the Target Debugger together with Alberic)

Stress

Then 3 days of stress. 3 presentations in the forum in Hall 2, and speaking with (potential) customers and giving demo’s. At night visit partners and then to the hotel, eat a steak and sleep.
After 3 days my feet hurt and then at 17h the gong sounds and we can pack the car and drive back to Bückeburg. Where we will arrive in the middle of the night… But it was all worth it. We’ll be back!

 

 

So that was it for today, I spoke with a lot of potential new Rhapsody customers!

Happy modeling with Rhapsody ( wvdheiden@willert.de )

 

And to India again!

Introduction

I love India. Friendliest people on earth, awesome food, great country! So I was happy to go there again. I was there to do some support/training in a large project with many people. All in Rhapsody and all in C++.

The Trip

The disadvantage was that I would be in India for a week, so that would cost me two weekends traveling. So on saturday morning I got up at 6 (am -> the wrong 6…) and before 7. I was sitting in the train to Zwolle that was surprisingly filled. Now, that part of the trip went very well, apart from the early hour of course.
Step-over in Zwolle to Schiphol and I arrived there on time.
I love Schiphol, great airport. It is really big but you hardly notice that, everything is being signed out very well. As long as you speak English or Dutch you will not have any problems finding stuff (Eat your heart out Munich and Paris…)
Checking in took longer than usual since I found out I was not checking in at the normal KLM booth (Hall 1 or 1A) but in 3 with Jet Airways.
I booked KLM, as usual, but it was a code sharing flight. I’ve been busy last weeks (Wauw: Tell us more new things….) so I did not really had studied the flight data.
It turned out I had quite a funny flight. All flights were Jet Airways, not a single segment was KLM, luckily also not Air France… On the outgoing trip I first flew to New Delhi, then to Mumbai and then to Hyderabad. Not really efficient… There are many direct flights from DEL to HYD. But OK. It is what it is. Rebooking was not possible, all flights were full.
So I checked in, left my good old Eagle Creek Roller at the desk and went to the KLM Lounge.

First Leg

It went faster than I though, I could hardly eat a small breakfast and then the screen said that the flight was already boarding. So I hurried to the plane, a Boeing 777 and quickly found my chair. A nice chair (Business class this time!!!) The flight left on time at 11:20 and it was good, Jet Airways is fine, nice staff and great food (Indian of course!!)
We arrived in Delhi on time and in the dark. Last time in Delhi I found out that there actually 2 airports in Delhi with the name “Indira Gandi Airport” Read “Incredible India”. This time I was OK (I thought…) because the connecting flight was in the same terminal. Even if your luggage is checked “through” (The label on the suitcase already contains all destinations) you still have to pick up your suitcase from the belt and bring it through customs and then check it in again.
With some trouble I managed to do that. I did not check the monitors on the airport so after going through security again ( Which was “Pedantic”… I had to completely unpack all my backpacks…) I started looking for the right gate. Just to find a monitor where my flight was indicated as “cancelled”. !@#$%^&*(
I started looking for help and at another gate with personnel from Jet Airways to ladies told me to wait, someone would come and sort it out.
Pff… But now I had time to organize an internet connection. That is not easy in India, there is “Free WiFi” but that works with a text message to your mobile phone. You first fill in your phone number, then you opt-in for some things and they will send you a Text Message with a code. Then you have to hack on your phone until the login screen comes again and give that code (with the phone number again, all very tiresome.
But that did not worked… I tried several times: no Text… Then I remembered that I am the new proud owner of an iPhone XS and that I have 2 SIM cards. The normal Willert Phone and my Dutch number.
So I tried it with the dutch number and: Bingo! a Text message and yes… I had internet. OK… only for 30 minutes… So I could FaceTime with home and then post on Facebook. Then I routinely checked my mail just to find 2 mails from KLM with a new Ticket and new Travel information… from hours before… So the cancellation was apparently nothing new.

Second Leg

Back to the ladies from the Jet Airways desk. Just when I did that the Manager appeared and started to speak with people who appeared from nowhere. With some pressure he looked at my stuff and organized some guy to escort me out of the secure area. He brought me back to departures where I tried to check in again.
It appeared my flight was now rebooked to Air India (?) at 7am (?) and directly to Hyderabad (!) OK. I would arrive an hour later than planned… that was doable.
Getting a ticket was not.. I went from booth to booth until I found a guy that was willing to help. He organized that my suitcase came back and that I could check in at the Air India Booth. he even brought me to the lounge (through security!) so that I could try to sleep a little bit. It was no 4:00 am and I still had 3 more hours…
No sleeping though… the lounge was noisy (Parents with small kids… really??) so after some coffee I went to the plane. This was again a 777, the business class was completely  empty. Shortly before take-off an Indian guy came in with lots of people around him. He was something important I think. the staff was crawling around him to bring stuff and wait for orders. Luckily they did not forget me (I was hungry…) and I was served breakfast. The Business Class was the widest I have ever seen. I had a huge place, the chair before me was really far away. A large screen was built-in but I could hardly see it. Not that I wanted, after breakfast I turned my chair into a bed and slept for the rest of the flight.
That went quite well. The Taxi from the hotel was not there (They had received my mail that my flight was cancelled) so after 25 hours I was in the hotel. Time for a nap..

Work!

I had the reast of the sunday to rest a litte bit. I did not sleep long. First a phone call from the check-in desk… then a knock on the door from somebody that wanted to fill the minibar. Grr.
So I already prepared for the busy week. I had to support a project where many people work on with very different levels of Rhapsody expirience. It is what it is… UML and certainly Rhapsody are not easy to learn. reading a book and do a 2 day training is not nearly enough to become expirienced. Not even beginner level can be reached. It requires a lot of effort and patience to become an expert there.
For all it is learning the process of MBSE. It is very different from just hacking source-code. These are the questions that you should ask yourself on different levels of the development process:

  • WHAT must be done
    • We take Use-Case diagrams for that. Add Sequence Diagrams and/or Activity Diagrams to explain the requirements. This is the base for the planning on what the system does.
  • WHO will do it
    • This is the domain of the archtectural Diagrams such as Class, Object, Package, Structure, Component and Deployement Diagram. They define the architecture of the system.
  • HOW must we do it.
    • Here we use Statecharts and activity diagrams, also flow-charts. Here we define the behavior of the system.

Of course this is not Waterfall anymore, we are agile! So we wil iteratively go through all these phases until we are done.
Thi smeans that just creating a class as placeholder for a statemachine and just adding a state to be able to respond to events is not the way to use MBSE.
Objects have states, the light is on or off. Objects also move between states and not only from inner to outer states.
The secret to finding out what states we have is to use many, many sequence diagrams. They will clear your mind and give you the information needed to define nice small statemachines that are understandable and re-usable!

So. That was it from India. I”ll be back!

Walter van der Heiden (wvdheiden@willert.de)

Geneva in 1 day and Framework Training

Introduction

I do not only do long haul flights to far-away countries. i also do day trips to destinations that are a bit closer.
This time I had to be in Geneva (also called Genève or Genf depending on your language..) There is a direct flight from Schiphol airport. An early one to Geneva and a late one back. So I booked and, for a change, I travelled light.

The Trip

It felt funny all day to hardly have luggage… I looked up multiple time in panic from the feeling something was missing… human habits… strange thing.
But it was a long day. I woke up at 5 to be in the 5:45 train to Schiphol. I always hear people complaining about trains being late and not arriving at all. I have to say that I never had trouble with that… Its the planes that give me trouble.. or the airports.. or the airline..

Being up that early had one advantage. The papers and the internet were taking since days about an event that was coming up: “The Superbloodwolfmoon” or something like that… The disadvantage was that you had to get up early to see it… and I was. It looked very nice, the picture was not as cool as I wanted but hey, it’s not a camera, it’s a phone!


So I was on Schiphol on time, without the need to check-in luggage I just walked on to the lounge. In exactly 2 hours from my own chair to the lounge chair. Not bad.
Flight went well, I picked up my rental car and picked up the collegues that were also there to drive to the customer.
It was a short visit, convincing the customer was not difficult, i gave a quick demo of Rhapsody using the RXF (in C++) and the fantastic Target Debugger. That mostly impresses the s…t out of new customers, certainly if they have been using Rhapsody before.
So we were back in time at the airport, we could even drink a quick cup of coffee. Then the flight back was leaving. After arrival I took the train back and was at home at 23:15. A long day indeed.

Training

I am asked a lot about what people need to do to learn more about Rhapsody. Well that is very easy. Try to visit relevant congresses like the ESE in Germany, also the Embedded World where the famous Bruce Powel Douglass gives lectures about MBSE. Also our MESCONF, the Rhapsody User Group Meetings and the IBM IoT meetings are very recommended to visit, you will learn a lot about Rhapsody and have the opportunity to speak with lots of other Rhapsody users.

Also highly recommended are trainings. The basic training (Yes, even if you already have experience with Rhapsody but have acquired your knowledge by learning it by yourself: a training will improve your knowledge! (I did that myself. After 6 months Rhapsody and creating adapters I visited a Training given my Martin Stockl. I thought, well let’s visit that maybe I learned something new… I can tell you I have never learned so much as during that training….

We also have advanced trainings, about different subjects. Also we have partners, like Frank Braun from Evocean that give very interesting Trainings like the standard C++ Raspberry Pi Training and soon the Framework Training (9/10 April in Munich. That will boost your Rhapsody knowledge! (Is in the German language) You can apply directly on our website.

That was it! Happy modeling with Rhapsody!

Walter van der Heiden (wvdheiden@willert.de)

Back in Hyderabad, India

Introduction

Sorry, hardly time to write these days. We are having long days to use the week as effectively as possible. And then there is the time difference… If I am finally done working the US is just waking up and full of energy looking at projects.. My home city is preparing for dinner… But lets not complain. I will write more about India later, first I want to write something about the (near) future!

Embedded World

We are back at the Embedded World!! Yes finally. Not as big as before, we dont see the point in having a huge booth anymore, a small one will do as well. We cooperate as before but now with OOSE (and with Sodius, of course)!
The Embedded World will be in the “Messe Nürnberg” from Februari 26-28. We are in Hall 4, Booth 4-150. We have Coffee….;-)

The motto will be:

EEE

(Engineering Efficiency Empowerment by seamles integration of Process, Methods and Tools)

The ability to collaborate across disciplines is the key success factor in product development. In today’s engineering processes we see a multitude of heterogeneous systems, which should fulfill the demand for integrated systems. We use requirements management tools, ALM / CLM / PLM solutions, modeling tools, department-specific tools, quality analyzers, just to name a few. All equipped with interfaces for integration or collaboration with other tools. Nevertheless, it is always a challenge to pass data loss-free from one discipline to the next. It is even more difficult when data is to be exchanged across company boundaries. Because often only a filtered subset of data is exchanged, or different standards or tool versions are maintained.

Willert, oose and Sodius cooperate with the objective to support you in the optimization of your processes and engineering methods and to ensure a valid data flow between the departments. Willert contributes its expertise in embedded and systems engineering. oose contributes its expertise in process and method consulting. And with SECollab, Sodius offers a tool for visualizing and processing engineering data from a wide variety of tools and disciplines.

Our Offer

On our booth on the Embedded World in Nürnberg we offer you a free, 30 minutes analysis and evaluation session of your current situation at our stand and give suggestions for improvement directly.

Use the expertise of Andreas Willert and Tim Weilkiens at our booth Hall 4 – 150 on 26. – 28.02. in Nuremberg. A maximum of 8 slots are available per day. If you want to be sure of getting a slot, make an appointment before the fair with Mrs. Willert: swillert@willert.de (Tell her I sent you…)

Of course I will be there to answer Rhapsody questions live!

We will gladly send you an admission voucher for the fair. (Sorry, the pictures are in german, they should be understandable. When I have the source I will translate them)

1st step: rough process definition

Grobe_Prozessdefinition

2nd step: Precise definition of the work steps

Praezise_Definition_der_Arbeitsschritte

Our lectures in the forum at Embedded World (Hall 2 – Booth 510)

Efficiency in engineering through seamlessly integrated processes and tools

Andreas Willert and Tim Weilkiens in German – 26.02. / 11.30 – 28.02. / 11.00 clock

A consistent environment reduces the obstacles on the way of developing artifacts from idea to product. Organizational, methodical and technical process breaks require more effort and at the same time lead to information losses and increased risk. We will show you how to develop benefit-oriented process steps and how to derive and implement the necessary seamless integration of tools.

 

Modeling the “Standards” Way

Walter van der Heiden in English – 27.02. / 10:00

In various standards we can observe common themes of abstraction, specialization, refinement and relationship (traceability). Aligning the value of these standards and easing the adoption is the most effective way to improve and realize success in an organization. We have applied a SysML for Systems Engineering, AUTOSAR for Vehicle Design and Software Architecture, and UML for Software Design and Implementation. Using high quality UML tools and simply targeted bridges, engineers can focus on their designs and models for developing their solutions. We want to demonstrate SysML models that transition to AUTOSAR designs, that are moved to implementation designs (in UML or Simulink), and finally code generation. All the while maintaining simple bidirectional traceability and design artifacts demanded by ASPICE.

 

That’s it, Happy Modeling with Rhapsody!

Walter van der Heiden (wvdheiden@willert.de)

 

Back in Hyderabad, India

Introduction

Sorry, hardly time to write these days. We are having long days to use the week as effectively as possible. And then there is the time difference… If I am finally done working the US is just waking up and full of energy looking at projects.. My home city is preparing for dinner… But lets not complain. I will write more about India later, first I want to write something about the (near) future!

Embedded World

We are back at the Embedded World!! Yes finally. Not as big as before, we dont see the point in having a huge booth anymore, a small one will do as well. We cooperate as before but now with OOSE (and with Sodius, of course)!
The Embedded World will be in the “Messe Nürnberg” from Februari 26-28. We are in Hall 4, Booth 4-150. We have Coffee….;-)

The motto will be:

EEE

(Engineering Efficiency Empowerment by seamles integration of Process, Methods and Tools)

The ability to collaborate across disciplines is the key success factor in product development. In today’s engineering processes we see a multitude of heterogeneous systems, which should fulfill the demand for integrated systems. We use requirements management tools, ALM / CLM / PLM solutions, modeling tools, department-specific tools, quality analyzers, just to name a few. All equipped with interfaces for integration or collaboration with other tools. Nevertheless, it is always a challenge to pass data loss-free from one discipline to the next. It is even more difficult when data is to be exchanged across company boundaries. Because often only a filtered subset of data is exchanged, or different standards or tool versions are maintained.

Willert, oose and Sodius cooperate with the objective to support you in the optimization of your processes and engineering methods and to ensure a valid data flow between the departments. Willert contributes its expertise in embedded and systems engineering. oose contributes its expertise in process and method consulting. And with SECollab, Sodius offers a tool for visualizing and processing engineering data from a wide variety of tools and disciplines.

Our Offer

On our booth on the Embedded World in Nürnberg we offer you a free, 30 minutes analysis and evaluation session of your current situation at our stand and give suggestions for improvement directly.

Use the expertise of Andreas Willert and Tim Weilkiens at our booth Hall 4 – 150 on 26. – 28.02. in Nuremberg. A maximum of 8 slots are available per day. If you want to be sure of getting a slot, make an appointment before the fair with Mrs. Willert: swillert@willert.de (Tell her I sent you…)

Of course I will be there to answer Rhapsody questions live!

We will gladly send you an admission voucher for the fair. (Sorry, the pictures are in german, they should be understandable. When I have the source I will translate them)

1st step: rough process definition

Grobe_Prozessdefinition

2nd step: Precise definition of the work steps

Praezise_Definition_der_Arbeitsschritte

Our lectures in the forum at Embedded World (Hall 2 – Booth 510)

Efficiency in engineering through seamlessly integrated processes and tools

Andreas Willert and Tim Weilkiens in German – 26.02. / 11.30 – 28.02. / 11.00 clock

A consistent environment reduces the obstacles on the way of developing artifacts from idea to product. Organizational, methodical and technical process breaks require more effort and at the same time lead to information losses and increased risk. We will show you how to develop benefit-oriented process steps and how to derive and implement the necessary seamless integration of tools.

 

Modeling the “Standards” Way

Walter van der Heiden in English – 27.02. / 10:00

In various standards we can observe common themes of abstraction, specialization, refinement and relationship (traceability). Aligning the value of these standards and easing the adoption is the most effective way to improve and realize success in an organization. We have applied a SysML for Systems Engineering, AUTOSAR for Vehicle Design and Software Architecture, and UML for Software Design and Implementation. Using high quality UML tools and simply targeted bridges, engineers can focus on their designs and models for developing their solutions. We want to demonstrate SysML models that transition to AUTOSAR designs, that are moved to implementation designs (in UML or Simulink), and finally code generation. All the while maintaining simple bidirectional traceability and design artifacts demanded by ASPICE.

 

That’s it, Happy Modeling with Rhapsody!

Walter van der Heiden (wvdheiden@willert.de)

 

Training in Bochum: Rhapsody in Java

Introduction

I have been to Bochum before but I normally don’t use Rhapsody in Java… So still a “first”. I can program Java, however! Not as good as C but I’ll manage.

And I have to say… I like RiJ! It is really, really easy to use. Rhapsody brings its own Java so there is no need to install anything! Itjust works.

It’s a long time ago that I gave a training where all students had their “Hello World” running in minutes.

The Framework is, of course, much simpler, Java already brings everything you need to run UML generated code.

The only thing the Framework needs to do is to proces the events and the timers.

Issues

There were not many issues with getting stuff to work. The most important thing was an issue when you installed Rhapsody and selected the wrong java Directory. But this is easy to repair.
in your Rhapsody Share directory there is an “etc” directory. In that directory you will find two batch files: jdkmake.bat and jdkrun.bat. These files have paths in them that need to point to the JDK that Rhapsody delivers by standard.

jdkrun_bat

 

jdkmake_bat

Hello World Example

The first program you make in any new language is “Hello world”. So we will creata a Java Hello world.
Open Rhapsody in Java and create a new project. Call it “HelloWorld” and create it in a directory where you can find it back. (Rhapsody wants to create projects in the Rhapsody data directory by default.
When the project is created you will see an empty Object Model Diagram. Draw a Class (either select the Class from the drawing menu or right click in the diagram and select “Class”. Then draw the class. Cal it “Hello” and give it a constructor, do not give it parameters.
In the constructor write ( in the Tab “Implementation” ) the following:

System.out.println”Hello World”);

Apply the change. Then we need an Object, right click on the Class “Hello” in the Rhapsody Model Browser and select “Make an Object”.
Then press “GMR” (Generate Make Run) and presto: it works!

Happy Modeling with Rhapsody!

Walter vand er Heiden (wvdheiden@willert.de)

 

2019

Introduction

First of all: All a Happy New Year! OK, OK… the year is already 2 weeks old… Dorry… not much time to write earlier. Anyways… please let 2019 be a year full of modeling. There will be lots of exciting things this year, new versions of tools, new versions of standards and, as usual, a lot of work. Unfortunately there will also be a lot of old stuff this year where we are still fighting with. Let me take you on a trip to memory lane.

Paths

It is 2019…. and still we are fighting with path- and filenames containing spaces and slash and or backslash.
I cannot prove what my assumption is, but I think I’m not far off the truth.

The first DOS (MS-DOS) Version did not contain directories. It was all a flat file system where there was room for a maximum of 128 files in the “root”. Since there were only floppy-disks with 360kB disk space this was not a big problem.

In the same time (Start of the 1980’s) there were other systems, one of them was CP/M. They already had directories, although very primitive. You had 26 directories (You can guess…. ‘A’-‘Z’…)

You already had UNIX at that time which was far more advanced then MS-DOS or CP/M, that had real directories. The Bell Lab guys had thought of that. You could type in paths with a ‘/’ (slash) as separator character.

I think that Bill Gates and his staff just stole the concept from Unix without really understanding the true meaning and working (As they would repeat many many times after that) and exchanged the ‘/’ with ‘\’. So no-one would notice that it was stolen (duh…) and not grasping the concept of the ‘\’ (escape character)

Spaces

Since the MS-DOS file system was an early version of FAT, the filenames were limited to 8.3, 8 characters for the filenames, 3 for the extension. Many versions later Microsoft introduced the concept of long filenames. They were “hacked” into the file system, there was a flag indicating that there was a long filename. The short filename was built up from the long name, removing characters and adding a ‘~’. So we jokingly said that the name of the company should have been changed to “Micros~1”

Nowadays most modern tools can handle decent filenames up to 256 characters and long paths. But Windows would not be Windows if it did not have a couple of unpleasant surprises. For compatibility, a lot of old (partly ancient) API calls are still part of Windows and will still work. So some older tools have “side-effects” that show up when you least expect it.

What does this have to do with Rhapsody? Well.. also Rhapsody is sometimes (indirectly) influenced by old Microsoft behavior. If you want to create a path while creating a new project you will notice that Rhapsody cannot create a directory for you directly in the root of your drive… The error message is cryptic ( “No rights to write” or something similar ) so it takes a while to figure that out. Is basically the problem with using the old (but still present) Windows API calls.

Other issues

Further, Rhapsody is mostly not the only tool involved in the development, (certainly not for Willert Customers, I will make sure they use code generation! ) mostly there are other tools. Often called via command line. And this is where the “Microsoft Moments” come up. (A Microsoft Moment: the moment you realize the world can be saved by destroying Redmond WA)
Because the command line has issues, depending on what version. We have searched and searched for inexplicable errors multiple times just to find out that on one machine Windows would not accept the “/” in a path or a space.
Let me not shout too much at Microsoft. The days of “If Microsoft ever makes something that doesn’t suck it will be a vacuum cleaner ” are behind us. Their hardware has actually always been good. And they improved a lot lately. This opposed to Apple who are definitely loosing it with every new OS version.

2019

The first weeks have been quite but 2019 already promises a lot of trips for your traveling modeler. I will be blogging! Happy modeling with Rhapsody!

Walter van der Heiden (wvdheiden@willert.de)

« Older posts Newer posts »

© 2025 Rhapsody TechBlog

Theme by Anders NorenUp ↑