note that, in this paper it is assumed that in the stat-
echart, an action is executed upon receiving a trigger
(i.e., an event).
Let us consider our example event evRelease (e
1
1
)
with corresponding tag value as Tag e
1
1
EvtoSi =
{ADCValue = 20}. Given this input, the algo-
rithm 1 creates an object/wrapper class (step 2) and
a new state chart with default state and transition
(step 3). The wrapper class and the state chart cre-
ated inside the wrapper class are represented as W =
setterForSignals and St
W
respectively.
In the next step (step 4), new events are added to
the statechart created in the previous step. The events
are created based on the tag values of the events given
as input. For example, for the event e
1
1
= evRelease}
with tag Tag
e
1
1
EvtoSi = {ADCValue = 20}, the
newly created event is evSetADCValue.
In step 5, the algorithm creates setter method
in the action field of the newly created event
ev
SetADCValue. The action field value for
ev SetADCValue is ADCValue = 20. Thus algorithm
1 creates setter methods for the events in UML do-
main, for setting the corresponding signal values in
Matlab/Simulink domain. It is up to the end-user to
make use of these setter methods in the UML domain
to invoke exchange of data values in the Matlab do-
main. For example, the event ev
SetPWMValue can
be invoked in the action field of evRelease to set the
signal value on button press on the target board.
4.3 Signal to Event Conversion
In the proposed approach, the required boundary con-
dition for signal to event conversion is specified in the
tag value (Tag
e
n
n
SitoEv) of an event (e
n
n
) in the UML
domain. A procedure for signal to event conversion
is shown in algorithm 2. The inputs for this algo-
rithm are the events e
1
n
,e
2
n
,..., e
n
n
(UML domain) and
their respective signal to event tag, Tag
e
1
n
SitoEv,
Tag e
2
n
SitoEv, ..., Tag e
n
n
SitoEv. The output of this
algorithm is the respective call to fire events, which
are inserted inside of the step functions. This achieves
signal to event conversion, in a simple but effective
way.
As seen in algorithm 2, in step 1, the
tag values of the signal to event tag in each
event in the given UML sub-system is parsed.
In our example, this can be represented as
e
2
1
= evReset} (event) with Tag e
2
1
SitoEv =
{FIRE IF RISING systemInput 20} (tag value). The
meaning of this tag is the following: fire an event
(evReset) when the threshold value of the variable
systemInput in UML domain (represents the value of
the signal PWMValue) increases above the value 20.
Algorithm 2: Signal to Event Conversion.
Input: SS
UML
n
= {e
1
n
,e
2
n
,..., e
n
n
} and Tag e
1
n
SitoEv,
Tag e
2
n
SitoEv, ..., Tag e
n
n
SitoEv ;events and
tags
Output: Function calls to fire respective events
(e.g. FIRE
IF RISING(destination, event, signal,
threshold))
1: if SS
UML
n
6= 0 then
2: parse the value of signal to event tag,
Tag
e
n
n
SitoEv
3: create function calls based on tokens parsed
4: Insert function call (inside step function) in
UML domain, to fire respective events;
5: else
6: exit
7: end if
Note that, as a first step in the prototype im-
plementation, only two types of macros such as
FIRE IF RISING(destination, event, signal, thresh-
old) and FIRE
IF FALLING(destination, event, sig-
nal, threshold) are implemented. These are used to
support invocation of firing of events when the thresh-
old of signals rise or fall below a specified threshold.
In step 2, function calls based on the tokens parsed
in the previous step is created. For our example, the
function call created is FIRE IF RISING(destination
(self), evReset, PWMValue, 20). In the final step, the
function call thus created as a result of parsing the tag
value is inserted in the the appropriate step function
to facilitate signal to event conversion.
5 CONCLUSION AND FUTURE
WORK
This paper describes a simple, but effective method-
ology for event to signal conversion and vice versa,
allowing the coupling between heterogenous embed-
ded software sub-systems. A generic notation for de-
scribing a heterogenous embedded software system is
introduced. A set of procedures based on the generic
notation are described, proposing a simple but effec-
tive mechanism for data exchange between UML (dis-
crete events) and Matlab/Simulink (continuous sig-
nals) domains. A prototype of the proposed generic
methodology and algorithms is implemented in the
programming language Java with the aid of APIs (Ra-
tional Rhapsody API Reference Manual, 2014) in the
MDD tool used (IBM Rational Rhapsody Developer,
Ver 8.4, 2014). The prototype is evaluated in a seesaw
model real-world embedded software system applica-
tion scenario, modeled using heterogenous modeling
AMechanismforDataInterchangeBetweenEmbeddedSoftwareSub-systemsDevelopedusingHeterogenousModeling
Domains
423