Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Papyrus for Real Time » Unable to add log port in the middle of the capsule
Unable to add log port in the middle of the capsule [message #1794301] Tue, 28 August 2018 15:30 Go to next message
hey you is currently offline hey youFriend
Messages: 11
Registered: July 2018
Junior Member
Hello everyone,

I just started using Papyrus-RT and I tried to follow this tutorial: https://wiki.eclipse.org/Papyrus-RT/User/User_Guide/Getting_Started, however I have encountered 2 problems:

1) I cannot add log port inside the capsule diagram.
In the tutorial under chapter Add a log port it says:
"Select the Port tool and create a port in the middle of the capsule
In the resulting dialog, select the "Log" entry"

As you can see from the picture attached "PRT_log" I do not have such an option.

2) I cannot add statemachine diagram inside the PRT_adding_statemachine_to_capsule . Under section Create Pinger's state machine it is stated:
"Right-click on the Pinger capsule in the Model Explorer and select "New UML-RT Child > StateMachine" to create the state machine."

When I right-click on the Pinger capsule, there is no option "New UML-RT Child", as you can see from the picture "PRT_adding_statemachine_to_capsule" attached.

I am using Win10, 64-bit. I have attached photo with Papyrus-RT plugins that are installed ("PRT_version").

Thank you in advance.

Ivan
Re: Unable to add log port in the middle of the capsule [message #1794305 is a reply to message #1794301] Tue, 28 August 2018 16:14 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 351
Registered: March 2011
Senior Member
This happens when you create a model without specifying the "UMT-RT for C++" template in the model creation wizard as described in the Getting Started guide this is described under "Provide model initialization information".

Nevertheless, you don't have to start a new model to fix it. Just select the root model element in the Model Explorer and in the Properties view select the "Language" tab and in the Language field, select C++. Save. Then in the Model Explorer you should see two new Model Libraries: UMLRT-RTS and AnsiCLibrary. The first one is the one that enables the log service (as well as the timing and frame services).

To be able to use state machines, select again the root element, and in the Properties View select the "Profile" tab. Then click the "Apply registered profile" button (on the top-right corner of the Properties view, the third from the left). Then select UML-RT State Machines, click OK and in the next dialog, select the checkbox and click OK.

See the attached screenshots.

None of these are necessary if you select the UML-RT C++ template in the creation wizard.
Re: Unable to add log port in the middle of the capsule [message #1794306 is a reply to message #1794305] Tue, 28 August 2018 16:39 Go to previous messageGo to next message
hey you is currently offline hey youFriend
Messages: 11
Registered: July 2018
Junior Member
Hey Ernesto,

thank you for fast your replay.

Also thank you for your screenshots and explanation. Now I managed to make it work following your explanations.

Best regards,
Ivan

[Updated on: Tue, 28 August 2018 16:42]

Report message to a moderator

Re: Unable to add log port in the middle of the capsule [message #1794307 is a reply to message #1794306] Tue, 28 August 2018 16:48 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 351
Registered: March 2011
Senior Member
Oh, I see. You are running an extremely old version (0.9). This version is no longer supported. Where did you get that version from?

You should download and install version 1.0 from https://www.eclipse.org/papyrus-rt/content/download.php.

I strongly recommend to install Papyrus-RT using either the RCP or the Papyrus-RT installer. Use the other only if you are experienced with installing Eclipse plugins and chasing down dependencies. If you try to install from the update site, you will have to search for dependencies on your own.
Re: Unable to add log port in the middle of the capsule [message #1794311 is a reply to message #1794307] Tue, 28 August 2018 19:10 Go to previous messageGo to next message
hey you is currently offline hey youFriend
Messages: 11
Registered: July 2018
Junior Member
Ernesto Posse wrote on Tue, 28 August 2018 16:48
Oh, I see. You are running an extremely old version (0.9). This version is no longer supported. Where did you get that version from?

You should download and install version 1.0 from https://www.eclipse.org/papyrus-rt/content/download.php.

I strongly recommend to install Papyrus-RT using either the RCP or the Papyrus-RT installer. Use the other only if you are experienced with installing Eclipse plugins and chasing down dependencies. If you try to install from the update site, you will have to search for dependencies on your own.


I actually tried to install Papyrus-RT using EMF. I am using version:
Eclipse Modeling Tools
Version: Oxygen.3a Release (4.7.3a)

I followed steps as described here:
https://www.eclipse.org/papyrus-rt/content/download.php
Only 1st step Papyrus-RT RCP worked for me, that's where I got this 0.9 version.

For the 3rd step I was experiencing error. I did the following "help->install new software->add" Under "location" field I used this link http://download.eclipse.org/papyrus-rt/updates/releases/oxygen/1.0.0/
However I was getting errors (see attachments PPR_EMF_install_new_sw and PPR_EMF_install_new_sw_2 and PPT_installation_fail_1 )

I also tried 4th step with manual installation. I downloaded file under "Papyrus-RT all-in-one RCP" under this link: https://www.eclipse.org/papyrus-rt/content/download.php#EclipseInstaller
I tried to install using "help->install new software->add", and tried with both "archive" and "local" options (of course for "local" I unzipped the folder). But I was getting error (see attachment: PPT_manual_installation)

Regards,
Ivan
Re: Unable to add log port in the middle of the capsule [message #1794312 is a reply to message #1794311] Tue, 28 August 2018 19:23 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 351
Registered: March 2011
Senior Member
The downloads page at at https://www.eclipse.org/papyrus-rt/content/download.php shows four different options:

1) All-in-one RCP
2) The Papyrus-RT installer
3) The Eclipse installer
4) Manual installation.

The all-in-one RCP is, as the name says, all in one: you do not install it on top of an existing Eclipse install as an update site, you just unzip it and execute it (in Windows you will see an executable file in the folder extracted) and it comes with all dependencies.

The "Install New Software..." option is only when you use update sites explicitly. The RCP is not an update site, but a self contained application. That is different from the Eclipse installer, the Papyrus-RT installer or update sites. Therefore, you do not have to use the "Install New Software..." option to install Papyrus-RT if you downloaded the RCP.

Like I said in my previous message, I strongly recommend installing the RCP, and not from an update site if you are not very familiar with installing Eclipse plugins and their dependencies. As mentioned in the download page, if you need to install it on top of an existing Eclipse installation from an update site, you will have to manually install dependencies, and this is not trivial.

By the way, the 0.9 appears in that page near the bottom under the title "Older releases". If you read carefully, you'll see the 1.0 version under "Current releases" before the section on older releases.

Re: Unable to add log port in the middle of the capsule [message #1794348 is a reply to message #1794312] Wed, 29 August 2018 10:36 Go to previous messageGo to next message
hey you is currently offline hey youFriend
Messages: 11
Registered: July 2018
Junior Member
Hey Ernesto I downloaded now Papyrus for Real-Time 1.0.

however I again cannot add again state diagram to my capsule. I tried to undertake steps from your 1st steps, but it did not work. See attachments on how I created the project and on what is configured under "profile" and "language" tabs.

EDIT: I have managed to resolve it, I should have created new state-diagram under most top model, not under capsule.

Regards,
Ivan

[Updated on: Wed, 29 August 2018 14:43]

Report message to a moderator

Re: Unable to add log port in the middle of the capsule [message #1794357 is a reply to message #1794348] Wed, 29 August 2018 14:15 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 351
Registered: March 2011
Senior Member
The screenshot in "PRT_fsm.png" suggests that in the Model Explorer you are right-clicking the *capsule diagram* element (the yellow icon), rather than the *capsule* element itself (the icon with the <<Capsule>> stereotype). To create elements in a capsule (or any other UML element), you have to select and right-click the UML model element, not the diagram element.
Re: Unable to add log port in the middle of the capsule [message #1794365 is a reply to message #1794357] Wed, 29 August 2018 15:25 Go to previous messageGo to next message
hey you is currently offline hey youFriend
Messages: 11
Registered: July 2018
Junior Member
Ernesto Posse wrote on Wed, 29 August 2018 14:15
The screenshot in "PRT_fsm.png" suggests that in the Model Explorer you are right-clicking the *capsule diagram* element (the yellow icon), rather than the *capsule* element itself (the icon with the <<Capsule>> stereotype). To create elements in a capsule (or any other UML element), you have to select and right-click the UML model element, not the diagram element.


Yes I realized that later on, I edited post ... did not refresh the website so I did not see your post. Anyways I managed to generate the code now. I followed instruction on how to compile and execute code as stated on the link but I am getting error when executing makefile.

Also link doesn't work under:
"Using an OS other than Linux
If you are using an operating system other than Linux, you can still compile and run your model. Go to Compiling and running Papyrus for Real Time applications for alternatives"

Is it possible to compile and execute code inside the papyrus on win10?
I will also try to install papyrus-rt on linux, the screenshot I sent was from Virtual Machine running Ubuntu on it, so I basically generated code on win10 and copy pasted it on VM. I guess problem with executing makefile is due to missing includes from Papyrus-RT libraries.

[Updated on: Wed, 29 August 2018 15:31]

Report message to a moderator

Re: Unable to add log port in the middle of the capsule [message #1794367 is a reply to message #1794365] Wed, 29 August 2018 15:34 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 351
Registered: March 2011
Senior Member
There is no support for compiling code directly from within the IDE (which by the way, Papyrus-RT is not the same as Papyrus) in any platfrom.

For Windows, you'll need to install and setup Cygwin as described in https://wiki.eclipse.org/Papyrus-RT/User_Guide/Cygwin_Setup and then follow the instructions as https://wiki.eclipse.org/Papyrus-RT/User_Guide/Compiling_and_running_Papyrus_for_Real_Time_applications.

By the way, once you install Cygwin, quit Papyrus-RT first, and make sure to install (in Cygwin) make, cmake and gcc, and add the Cygwin bin path to the Windows system PATH. Then you can start Papyrus-RT. If you install Cygwin without quiting and restarting Papyrus-RT, then when you generate C++ projects you'll see errors as the CDT is unable to find the compiler and its libraries.
Re: Unable to add log port in the middle of the capsule [message #1794377 is a reply to message #1794367] Wed, 29 August 2018 19:21 Go to previous messageGo to next message
hey you is currently offline hey youFriend
Messages: 11
Registered: July 2018
Junior Member
I managed to compile the files using Cygwin, but I was getting errors. I set Cygwin up using this step: https://wiki.eclipse.org/Papyrus-RT/User_Guide/Cygwin_Setup
So I run commands as described under "Building your applications on Linux or Windows or macOS with Vagrant" here: https://wiki.eclipse.org/Papyrus-RT/User_Guide/Compiling_and_running_Papyrus_for_Real_Time_applications
When I invoke command "4. Invoke CMake pointing to the src folder:" I get errors that I attached in the files.

However I compiled files under Ubuntu on my VM. When I ran executable, I got following output: ivan@ubuntu:~/Documents/Papyrus/PingPongV2_CDTProject/src$ ./TopMain
Controller "DefaultController" running.
Starting game
ping sent!
Ponger is ready
Unexpected message to capsule instance Top.ponger role ponger on port pongPort protocol PingPongProtocol signal ping
  • Attachment: CMakeError.log
    (Size: 0.72KB, Downloaded 5 times)
  • Attachment: CMakeOutput.log
    (Size: 0.88KB, Downloaded 5 times)
  • Attachment: PRT_1.JPG
    (Size: 179.46KB, Downloaded 10 times)
  • Attachment: PRT_2.JPG
    (Size: 176.44KB, Downloaded 6 times)
  • Attachment: PRT_3.JPG
    (Size: 185.24KB, Downloaded 6 times)

[Updated on: Wed, 29 August 2018 19:26]

Report message to a moderator

Re: Unable to add log port in the middle of the capsule [message #1794383 is a reply to message #1794377] Wed, 29 August 2018 21:38 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 351
Registered: March 2011
Senior Member
When you installed Cygwin, did you install the latest version? The 32 bit or the 64 bit version?

Which versions of gcc, make and cmake did you install?

Did you install cmake from Cygwin rather than http://cmake.org/? (You should use cmake from Cygwin, not from http://cmake.org/)

When building with Cygwin did you follow the instructions at https://wiki.eclipse.org/Papyrus-RT/User_Guide/Compiling_and_running_Papyrus_for_Real_Time_applications#Building_your_applications_on_Windows_with_Cygwin exactly? In particular, did you try to run the commands from a *Cygwin* terminal, rather than a Windows terminal? Did you run cmake before running make? Also note that the instructions ask you to move into the (newly created) 'build' directory and then, in that directory, invoke 'cmake ../src'. If you call this command in another directory you might get errors like the ones you are seeing.


Re: Unable to add log port in the middle of the capsule [message #1794444 is a reply to message #1794383] Thu, 30 August 2018 16:32 Go to previous messageGo to next message
hey you is currently offline hey youFriend
Messages: 11
Registered: July 2018
Junior Member
I installed Cygwin setup-x86_64.exe (64-bit installation) from this website: https://www.cygwin.com/

$ cmake --version
cmake version 3.6.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).

$ gcc --version
gcc (GCC) 7.3.0

GNU Make 3.82
Built for x86_64-w64-mingw32
This program is built by Equation Solution <http://www.Equation.com>
for Windows.

I have installed cmake from Cygwin setup-x86_64.exe file.

Things is I cannot event compile the files from ...\plugins\org.eclipse.papyrusrt.rts_1.0.0.201707181457\umlrts folder, under step Building the runtime system from tutorial. This is the output when I run make command:
Johnny@DESKTOP-EAEO31B ~/Desktop/org.eclipse.papyrusrt.rcp.product-win32.win32.x 86_64/Papyrus-RT/plugins/org.eclipse.papyrusrt.rts_1.0.0.201707181457/umlrts
$ make
Makefile:63: warning: TARGETOS not defined. Choosing linux
Makefile:69: warning: BUILDTOOLS not defined. Choosing x86-gcc-4.6.3
g++ umlrt/src/umlrtgetopt.cc -c -Wall -I./util/include -I./include -I./umlr t/src/include -I./os/linux/include -oobj/linux.x86-gcc-4.6.3/umlrt/src/umlrtget opt.o
make: [obj/linux.x86-gcc-4.6.3/umlrt/umlrtapi.o] Error 1 (ignored)
g++ umlrt/umlrtapi.cc -c -Wall -I./util/include -I./include -I./umlrt/src/i nclude -I./os/linux/include -oobj/linux.x86-gcc-4.6.3/umlrt/umlrtapi.o
make: [obj/linux.x86-gcc-4.6.3/umlrt/umlrtbasicthread.o] Error 1 (ignored)
g++ umlrt/umlrtbasicthread.cc -c -Wall -I./util/include -I./include -I./uml rt/src/include -I./os/linux/include -oobj/linux.x86-gcc-4.6.3/umlrt/umlrtbasict hread.o
make: [obj/linux.x86-gcc-4.6.3/umlrt/umlrtcapsule.o] Error 1 (ignored)
g++ umlrt/umlrtcapsule.cc -c -Wall -I./util/include -I./include -I./umlrt/s rc/include -I./os/linux/include -oobj/linux.x86-gcc-4.6.3/umlrt/umlrtcapsule.o
make: [obj/linux.x86-gcc-4.6.3/umlrt/umlrtcapsuleid.o] Error 1 (ignored)
g++ umlrt/umlrtcapsuleid.cc -c -Wall -I./util/include -I./include -I./umlrt /src/include -I./os/linux/include -oobj/linux.x86-gcc-4.6.3/umlrt/umlrtcapsulei d.o
make: [obj/linux.x86-gcc-4.6.3/umlrt/umlrtcapsuletocontrollermap.o] Error 1 (ign ored)
g++ umlrt/umlrtcapsuletocontrollermap.cc -c -Wall -I./util/include -I./inclu de -I./umlrt/src/include -I./os/linux/include -oobj/linux.x86-gcc-4.6.3/umlrt/ umlrtcapsuletocontrollermap.o
umlrt/umlrtcapsuletocontrollermap.cc: In static member function 'static bool UML
RTCapsuleToControllerMap::parseCapsuleControllerLine(char*)':
umlrt/umlrtcapsuletocontrollermap.cc:205:55: error: 'strtok_r' was not declared in this scope
capsuleName = strtok_r( line, " =\n\r\t", &saveptr);
^
make: *** [obj/linux.x86-gcc-4.6.3/umlrt/umlrtcapsuletocontrollermap.o] Error 1

[Updated on: Thu, 30 August 2018 16:35]

Report message to a moderator

Re: Unable to add log port in the middle of the capsule [message #1794446 is a reply to message #1794444] Thu, 30 August 2018 17:15 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 351
Registered: March 2011
Senior Member
Ok, perhaps the instructions are not clear enough, but if you are building under Cygwin, you do not have to build the RTS manually as you seem to be trying to do. Building the RTS explicitly is only for Linux, not for Windows+Cygwin. The instructions at https://wiki.eclipse.org/Papyrus-RT/User_Guide/Compiling_and_running_Papyrus_for_Real_Time_applications under the section Building the runtime system begin with a note that reads:

Quote:
Cygwin users
If you are on Windows using the Cygwin setup, skip this section and go directly to Building your applications on Windows with Cygwin


So, you only need to follow the instructions at https://wiki.eclipse.org/Papyrus-RT/User_Guide/Compiling_and_running_Papyrus_for_Real_Time_applications#Building_your_applications_on_Windows_with_Cygwin:

1) open a Cygwin terminal
2) navigate to the generated project
3) create a build folder if it doesn't already exist and move into it
4) type 'cmake ../src'

That's it. The call top cmake will automatically build the RTS and the generated application.

As for the exception in the linux version, that depends on your particular model. The exception reads:

Quote:
Unexpected message to capsule instance Top.ponger role ponger on port pongPort protocol PingPongProtocol signal ping


This means precisely that the ponger capsule is in a state where it received a message 'ping' and there where no outgoing transitions from that state that had 'ping' in a trigger. So either you didn't create a transition from that state, or you created and didn't add a trigger or added a trigger and selected the wrong message to trigger the transition.

The exception is not linux-specific. You will get the same exception on Windows, because there the exception indicates a problem with the model, not the generated code.


Re: Unable to add log port in the middle of the capsule [message #1794454 is a reply to message #1794446] Thu, 30 August 2018 18:53 Go to previous messageGo to next message
hey you is currently offline hey youFriend
Messages: 11
Registered: July 2018
Junior Member
I am getting error when making generated code:
$ cmake ../src
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/share/cmake-3.6.2/Modules/CMakeTestCCompiler.cmake:61 (messa ge):
The C compiler "/usr/bin/cc" is not able to compile a simple test program.

It fails with the following output:

Change Dir: /cygdrive/c/Users/Johnny/workspace-papyrusrt/PingPongV2_CDTProjec t/build/CMakeFiles/CMakeTmp



Run Build Command:"/cygdrive/c/users/johnny/gcc/bin/make.exe"
"cmTC_885e3/fast"

C:/users/johnny/gcc/bin/make -f CMakeFiles/cmTC_885e3.dir/build.make
CMakeFiles/cmTC_885e3.dir/build

make[1]: Entering directory
`C:/Users/Johnny/workspace-papyrusrt/PingPongV2_CDTProject/build/CMakeFiles/CM akeTmp'


The system cannot find the path specified.

make[1]: *** [CMakeFiles/cmTC_885e3.dir/testCCompiler.c.o] Error 1

make[1]: Leaving directory
`C:/Users/Johnny/workspace-papyrusrt/PingPongV2_CDTProject/build/CMakeFiles/CM akeTmp'


make: *** [cmTC_885e3/fast] Error 2





CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:5 (project)


-- Configuring incomplete, errors occurred!
See also "/cygdrive/c/Users/Johnny/workspace-papyrusrt/PingPongV2_CDTProject/bui ld/CMakeFiles/CMakeOutput.log".
See also "/cygdrive/c/Users/Johnny/workspace-papyrusrt/PingPongV2_CDTProject/bui ld/CMakeFiles/CMakeError.log".


However on Linux it works just fine. So will just compile and execute it on linux. And I fixed that weird error when executing generated code.

Last thing I would like to ask, does Papyrus-RT has language reference manual?
Re: Unable to add log port in the middle of the capsule [message #1794667 is a reply to message #1794454] Tue, 04 September 2018 16:53 Go to previous message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 351
Registered: March 2011
Senior Member
No, there is no language reference manual for Papyrus-RT. The language is UML-RT, which is essentially the same as ROOM for which there is a prominent reference book. UML-RT is essentially a UML 2.0 profile of ROOM, which inherits a lot of the semantics of UML 2.0 in relation to composite structure diagrams and state machines, but is not exactly the same and includes concepts different from UML 2.0, such as optional and plug-in capsule parts, service ports, port binding detection, and simplified state machines (no OR-states, no shallow history, only deep history). Nevertheless, in spite of these difference, the official OMG UML 2.x spec can be used as a reference.

Previous Topic:Unable to add log port in the middle of the capsule
Next Topic:Define an attribute typed with a class without the default constructor
Goto Forum:
  


Current Time: Sun Sep 23 17:40:59 GMT 2018

Powered by FUDForum. Page generated in 0.02493 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top