Skip to main content
Jump to: navigation, search

Difference between revisions of "Papyrus-RT/User/User Guide/Tips"

(Reorganized into sub-sections, added warnings for Windows)
(Logging: Corrected and updated)
 
(One intermediate revision by the same user not shown)
Line 10: Line 10:
  
 
==Modeling==
 
==Modeling==
===Logging===
+
===Runtime===
 
You may know that Papyrus-RT provides a logging mechanism, the "'''Log'''" service, that can be used within your model to output information from you model. By default, this information is sent to the standard error output, e.g., "stderr." So to see the output of the log, you can simply run your application from the command line and look at the output, e.g.,
 
You may know that Papyrus-RT provides a logging mechanism, the "'''Log'''" service, that can be used within your model to output information from you model. By default, this information is sent to the standard error output, e.g., "stderr." So to see the output of the log, you can simply run your application from the command line and look at the output, e.g.,
  
Line 27: Line 27:
 
{{Note | Note | This will redirect logging, but only for that specific log port. Other log ports will not be affected. }}
 
{{Note | Note | This will redirect logging, but only for that specific log port. Other log ports will not be affected. }}
  
==Code generation, building, and running==
+
====Command Line Flags====
{{warning | Building with Cygwin (Windows) | When building generated code on Windows with Cygwin, users must install and use cmake from Cygwin, rather than CMake from https://cmake.org, otherwise the build fails with several CMake errors, such as being unable to load several of the RTS .cmake files even if they exist and are in the correct location. See bug 519052 for more information. }}
+
:: Bug[https://bugs.eclipse.org/bugs/show_bug.cgi?id=519052 519052]
+
  
{{warning | Cygwin and MingW (Windows) | We have received reports of potential conflicts between MinGW and Cygwin compilers when installed separately in the same environment. As we use Cygwin for our testing, we recommend that users install only Cygwin and ensure that the ''Path'' environment variable correctly to point to the Cygwin 'bin' directory. See bug 519052 for more information. }}
+
there are other flags that can be used form the command line to have access to runtime service library information. These are accessed through command line paramater to the executable generated by the tool from the generated code. Here is the general format for the command line, followed by the list of flags.
:: Bug[https://bugs.eclipse.org/bugs/show_bug.cgi?id=519052 519052]
+
 
 +
====Usage====
 +
 
 +
<pre>
 +
  ./TopMain [-h] [-u] [-l] [-c<controllers-file>] [-D0/1] [-C0/1] [-s] [-T<type>] [-t<type>] [-M] [-S0/1] [-N0/1] [-F0/1] [-L0/1] [-n0/1] [-r0/1] [-m0/1]
 +
</pre>
 +
 
 +
 
 +
 
 +
{| class="wikitable"
 +
! Short Flag !! Long Flag !! Description
 +
|-
 +
|[-h] || [--help]    || Print usage and exit
 +
|-
 +
|[-u] || [--userargs] || Marks the start of application options
 +
|-
 +
|[-l] || or [--logmsg] || Enable capsule logMsg output of injected signals
 +
|-
 +
|[-c ''<controllers-file>''] || [--controllers=''<controllers-file>''] || Specify a capsule-to-controller map file
 +
|-
 +
|}
 +
 
 +
====Debug Features====
 +
 
 +
 
 +
{| class="wikitable"
 +
! Short Flag !! Long Flag !! Description
 +
|-
 +
|[-D 0/1] || [--debug=0/1] ||  Overall debug log enable.
 +
|-
 +
|[-C 0/1] || [--debugcolor=0/1] || Disable/enable terminal text color escape sequences.
 +
|-
 +
|[-s] || [--debugsummary] || Output debug summary.
 +
|-
 +
|[-T <''type''>] || [--debugtypeon=<''type''>] || Enable debug types. See <''type''> below.
 +
|-
 +
|[-t <''type>''] || [--debugtypeoff=<''type''>] || Disable debug types. See <t''ype''> below.
 +
|-
 +
|[-M] || [--debugmodel] || Output instance UML-RT model after startup. (Usually also requires '-T model')
 +
|-
 +
|}
 +
 
 +
====Enabling invidual log message components====
 +
 
 +
{| class="wikitable"
 +
! Short Flag !! Long Flag !! Description
 +
|-
 +
|[-S 0/1] || or [--debugtime=0/1] || Disable/enable log time-stamp.
 +
|-
 +
|[-N 0/1] || or [--debugname=0/1] || Disable/enable log type name.
 +
|-
 +
|[-F 0/1] || or [--debugfile=0/1] || Disable/enable log file-name.
 +
|-
 +
|[-L 0/1] || or [--debugline=0/1] || Disable/enable log file line #.
 +
|-
 +
|[-n 0/1] || or [--debugthread=0/1] || Disable/enable log thread name (or id).
 +
|-
 +
|[-r 0/1] || or [--debugmethod=0/1] || Disable/enable log method name.
 +
|-
 +
|[-m 0/1] || or [--debugmsg=0/1] || Disable/enable log application message.
 +
|-
 +
|}
 +
 
 +
====Types====
 +
<''type''> is a string that matches (case-insensitive) one of the following debug-types:
 +
{| class="wikitable"
 +
|BIND || BINDDEBUG || BINDFAIL || COMMAND
 +
|-
 +
|CONNECT || CONTROLLER || CONTROLLERMAP || DESTROY
 +
|-
 +
|ERROR || HASHMAP || IMPORT || INJECT
 +
|-
 +
|INSTANTIATE || LOCK || LOGMSG || MAIN
 +
|-
 +
|MODEL || MSG || MSGALLOC || PARAMETER
 +
|-
 +
|SAP || SEND || SERIALIZE || SIGNAL
 +
|-
 +
|SIGNALDATA || SIGNALREF || SIGNALINIT || SIGNALALLOC
 +
|-
 +
|SWERR || TIMER || TIMERALLOC
 +
|-
 +
|}

Latest revision as of 13:29, 31 July 2017

PapyrusForRealTime-Logo-Icon.png




Tips & Tricks




Overview

This page contains usage tips and tricks for Papyrus for Real Time.

Modeling

Runtime

You may know that Papyrus-RT provides a logging mechanism, the "Log" service, that can be used within your model to output information from you model. By default, this information is sent to the standard error output, e.g., "stderr." So to see the output of the log, you can simply run your application from the command line and look at the output, e.g.,

./MyApp

You can also redirect the output to a file:

./MyApp >& myAppLog.log

You can also turn this on programmatically, in cases where you can not change the command line, e.g., for an application running on an embedded platform or if you want to selectively log parts of the execution.

This is done by using the "redirect" method (message) on the port:

log.redirect("mylog.log"); (where ""mylog.log" is the name of the file where the log will be written.)

Note.png
Note
This will redirect logging, but only for that specific log port. Other log ports will not be affected.


Command Line Flags

there are other flags that can be used form the command line to have access to runtime service library information. These are accessed through command line paramater to the executable generated by the tool from the generated code. Here is the general format for the command line, followed by the list of flags.

Usage

  ./TopMain [-h] [-u] [-l] [-c<controllers-file>] [-D0/1] [-C0/1] [-s] [-T<type>] [-t<type>] [-M] [-S0/1] [-N0/1] [-F0/1] [-L0/1] [-n0/1] [-r0/1] [-m0/1] 


Short Flag Long Flag Description
[-h] [--help] Print usage and exit
[-u] [--userargs] Marks the start of application options
[-l] or [--logmsg] Enable capsule logMsg output of injected signals
[-c <controllers-file>] [--controllers=<controllers-file>] Specify a capsule-to-controller map file

Debug Features

Short Flag Long Flag Description
[-D 0/1] [--debug=0/1] Overall debug log enable.
[-C 0/1] [--debugcolor=0/1] Disable/enable terminal text color escape sequences.
[-s] [--debugsummary] Output debug summary.
[-T <type>] [--debugtypeon=<type>] Enable debug types. See <type> below.
[-t <type>] [--debugtypeoff=<type>] Disable debug types. See <type> below.
[-M] [--debugmodel] Output instance UML-RT model after startup. (Usually also requires '-T model')

Enabling invidual log message components

Short Flag Long Flag Description
[-S 0/1] or [--debugtime=0/1] Disable/enable log time-stamp.
[-N 0/1] or [--debugname=0/1] Disable/enable log type name.
[-F 0/1] or [--debugfile=0/1] Disable/enable log file-name.
[-L 0/1] or [--debugline=0/1] Disable/enable log file line #.
[-n 0/1] or [--debugthread=0/1] Disable/enable log thread name (or id).
[-r 0/1] or [--debugmethod=0/1] Disable/enable log method name.
[-m 0/1] or [--debugmsg=0/1] Disable/enable log application message.

Types

<type> is a string that matches (case-insensitive) one of the following debug-types:

BIND BINDDEBUG BINDFAIL COMMAND
CONNECT CONTROLLER CONTROLLERMAP DESTROY
ERROR HASHMAP IMPORT INJECT
INSTANTIATE LOCK LOGMSG MAIN
MODEL MSG MSGALLOC PARAMETER
SAP SEND SERIALIZE SIGNAL
SIGNALDATA SIGNALREF SIGNALINIT SIGNALALLOC
SWERR TIMER TIMERALLOC

Back to the top