Commit 4c39e52d authored by Maxime Perrotin's avatar Maxime Perrotin

Add Demo_ABB

parent 5cd1c9fc
......@@ -55,13 +55,11 @@
extern "C" {
#endif
@@IF@@ @_Language_@ = "C" or @_Language_@ = "CPP"
@@IF@@ @_Language_@ = C or @_Language_@ = CPP or @_Language_@ = GUI
#include "@_LOWER:Name_@.h"
@@ELSIF@@ @_Language_@ = "GUI"
#include "@_LOWER:Name_@.h"
@@ELSIF@@ @_Language_@ = "RTDS"
@@ELSIF@@ @_Language_@ = RTDS
#include "glue_@_LOWER:Name_@.h"
@@ELSIF@@ @_Language_@ = "MicroPython"
@@ELSIF@@ @_Language_@ = MicroPython
#include "@_LOWER:Name_@_mpy_bindings.h"
@@END_IF@@
......
This diff is collapsed.
Lift-dataview DEFINITIONS ::=
BEGIN
UpDown ::= ENUMERATED { up (1), down (0) }
OnOff ::= ENUMERATED { on (1), off (0) }
OpenClose ::= ENUMERATED { door-open (1), door-close (0) }
Position ::= REAL (0.0 .. 100.0)
--Flag ::= BOOLEAN
Floors ::= ENUMERATED {
floor-0 (10),
floor-1 (20),
floor-2 (30),
floor-3 (40),
floor-4 (50),
floor-5 (60)
}
-- Types used for the interfacing with the Simulink model
Lift-control ::= SEQUENCE {
direction UpDown DEFAULT down,
motor OnOff DEFAULT on,
brake OnOff DEFAULT off,
door OpenClose
}
Lift-sensor ::= SEQUENCE {
door-open BOOLEAN,
door-closed BOOLEAN,
floor-detected BOOLEAN,
pos-x Position
}
-- Types used for the user interaction
Floor-button ::= SEQUENCE {
floor Floors,
direction UpDown
}
Cabin-button ::= CHOICE {
emergency-stop BOOLEAN,
floor Floors
}
Start-condition ::= CHOICE {
forever BOOLEAN,
nb-of-cycle INTEGER (50 .. 255)
}
END
---------------------------------------------------
-- AADL2.2
-- TASTE type deploymentview
--
-- generated code: do not edit
---------------------------------------------------
PACKAGE deploymentview::DV::Node1
PUBLIC
WITH Taste;
WITH Deployment;
WITH TASTE_DV_Properties;
PROCESS demo
END demo;
PROCESS IMPLEMENTATION demo.others
END demo.others;
END deploymentview::DV::Node1;
PACKAGE deploymentview::DV
PUBLIC
WITH interfaceview::IV::Controller;
WITH interfaceview::IV::Lift_Model;
WITH interfaceview::IV::User;
WITH ocarina_processors_x86;
WITH deploymentview::DV::Node1;
WITH Taste;
WITH Deployment;
WITH interfaceview::IV;
WITH TASTE_DV_Properties;
SYSTEM Node1
END Node1;
SYSTEM IMPLEMENTATION Node1.others
SUBCOMPONENTS
IV_Controller : SYSTEM interfaceview::IV::Controller::Controller.others {
Taste::FunctionName => "Controller";
};
IV_Lift_Model : SYSTEM interfaceview::IV::Lift_Model::Lift_Model.others {
Taste::FunctionName => "Lift_Model";
};
IV_User : SYSTEM interfaceview::IV::User::User.others {
Taste::FunctionName => "User";
};
demo : PROCESS deploymentview::DV::Node1::demo.others {
Taste::coordinates => "1011 1056 1399 1417";
Deployment::Port_Number => 0;
};
x86_linux : PROCESSOR ocarina_processors_x86::x86.linux {
Taste::coordinates => "962 953 1448 1468";
};
PROPERTIES
Taste::APLC_Binding => (reference (demo)) APPLIES TO IV_Controller;
Taste::APLC_Binding => (reference (demo)) APPLIES TO IV_Lift_Model;
Taste::APLC_Binding => (reference (demo)) APPLIES TO IV_User;
Actual_Processor_Binding => (reference (x86_linux)) APPLIES TO demo;
END Node1.others;
SYSTEM deploymentview
END deploymentview;
SYSTEM IMPLEMENTATION deploymentview.others
SUBCOMPONENTS
Node1 : SYSTEM Node1.others {
Taste::coordinates => "901 806 1509 1542";
};
interfaceview : SYSTEM interfaceview::IV::interfaceview.others;
END deploymentview.others;
PROPERTIES
Taste::coordinates => "0 0 2970 2100";
Taste::version => "2.2";
Taste::interfaceView => "InterfaceView.aadl";
Taste::HWLibraries => ("../../../../tool-inst/share/ocarina/AADLv2/ocarina_components.aadl");
END deploymentview::DV;
This diff is collapsed.
KAZOO=../../kazoo
all: c
c: test-parse-c # Polyorb_HI_C output
cp controller/controller/* output.pohic/controller/RTDS/src
cp lift_model/* output.pohic/lift_model/SIMULINK/src
make -C output.pohic
test-parse-c: clean-c
$(KAZOO) -p --gw \
-o output.pohic \
--glue -g
buildsupport_pohic:
buildsupport -o output.buildsupport.pohic -p --aadlv2 --glue -i InterfaceView.aadl -c DeploymentView.aadl -d DataView.aadl ../common/ocarina_components.aadl ../common/TASTE_IV_Properties.aadl ../common/TASTE_DV_Properties.aadl
buildsupport_pohiada:
buildsupport -o output.buildsupport.ada --aadlv2 --glue -i InterfaceView.aadl -c DeploymentView.aadl -d DataView.aadl ../common/ocarina_components.aadl ../common/TASTE_IV_Properties.aadl ../common/TASTE_DV_Properties.aadl
gdb: clean
gdb --args $(KAZOO) --gw -p \
-o output.pohic \
--glue \
--debug
clean-c:
rm -rf output.pohic
skeletons:
$(KAZOO) -p --gw --glue -o code && make -C code dataview
clean-skeletons:
rm -rf code
clean: clean-c clean-skeletons
.PHONY: clean clean-c gdb test-parse-c buildsupport_pohic buildsupport_pohiada c skeletons clean-skeletons
Demo_ABB
Implementation of a demonstrator showing the integration of RTDS and Simulink on a complex lift system (implemented and provided by ABB).
This system also shows the plot and GUI. It can be used for MSC tracing as well.
A video (video-abb.avi) is available showing how to use this system
Author of the Simulink model of the lift system: Stein-Erik Ellevseth (ABB)
#!/bin/bash -e
# This script will build your TASTE system.
# You should not change this file as it was automatically generated.
# If you need additional preprocessing, there are three hook files
# that you can provide and that are called dring the build:
# user_init_pre.sh, user_init_post.sh and user_init_last.sh
# These files will never get overwritten by TASTE.'
# Inside these files you may set some environment variables:
# C_INCLUDE_PATH=/usr/include/xenomai/analogy/:${C_INCLUDE_PATH}
# unset USE_POHIC
mkdir -p .cache
export PROJECT_CACHE=$HOME/.taste_AST_cache
CWD=$(pwd)
if [ -t 1 ] ; then
COLORON="\e[1m\e[32m"
COLOROFF="\e[0m"
else
COLORON=""
COLOROFF=""
fi
INFO="${COLORON}[INFO]${COLOROFF}"
if [ -f user_init_pre.sh ]
then
echo -e "${INFO} Executing user-defined init script"
source user_init_pre.sh
fi
# Set up the cache to limit the calls to ASN1SCC in DMT tools
mkdir -p .cache
export PROJECT_CACHE=$HOME/.taste_AST_cache
# Use PolyORB-HI-C runtime
USE_POHIC=1
# Set Debug mode by default
DEBUG_MODE=--debug
# Detect models from Ellidiss tools v2, and convert them to 1.3
INTERFACEVIEW=InterfaceView.aadl
grep "version => \"2" InterfaceView.aadl >/dev/null && {
echo -e "${INFO} Converting interface view from V2 to V1.3"
TASTE --load-interface-view InterfaceView.aadl --export-interface-view-to-1_3 __iv_1_3.aadl
INTERFACEVIEW=__iv_1_3.aadl
};
if [ -z "$DEPLOYMENTVIEW" ]
then
DEPLOYMENTVIEW=DeploymentView.aadl
fi
# Detect models from Ellidiss tools v2, and convert them to 1.3
grep "version => \"2" "$DEPLOYMENTVIEW" >/dev/null && {
echo -e "${INFO} Converting deployment view from V2 to V1.3"
TASTE --load-deployment-view "$DEPLOYMENTVIEW" --export-deployment-view-to-1_3 __dv_1_3.aadl
DEPLOYMENTVIEW=__dv_1_3.aadl
};
SKELS="./"
# Check if Dataview references existing files
mono $(which taste-extract-asn-from-design.exe) -i "$INTERFACEVIEW" -j /tmp/dv.asn
cd "$SKELS" && rm -f lift_model.zip && zip lift_model lift_model/* && cd $OLDPWD
[ ! -z "$CLEANUP" ] && rm -rf binary*
if [ -f ConcurrencyView.pro ]
then
ORCHESTRATOR_OPTIONS+=" -w ConcurrencyView.pro "
elif [ -f ConcurrencyView_Properties.aadl ]
then
ORCHESTRATOR_OPTIONS+=" -w ConcurrencyView_Properties.aadl "
fi
if [ -f user_init_post.sh ]
then
echo -e "${INFO} Executing user-defined post-init script"
source user_init_post.sh
fi
if [ -f additionalCommands.sh ]
then
source additionalCommands.sh
fi
if [ ! -z "$USE_POHIC" ]
then
OUTPUTDIR=binary.c
ORCHESTRATOR_OPTIONS+=" -p "
elif [ ! -z "$USE_POHIADA" ]
then
OUTPUTDIR=binary.ada
else
OUTPUTDIR=binary
fi
cd "$CWD" && assert-builder-ocarina.py \
--fast \
$DEBUG_MODE \
--aadlv2 \
--keep-case \
--interfaceView "$INTERFACEVIEW" \
--deploymentView "$DEPLOYMENTVIEW" \
-o "$OUTPUTDIR" \
--subRTDS controller:"$SKELS"/controller/controller.zip \
--subSIMULINK lift_model:"$SKELS"/lift_model.zip \
$ORCHESTRATOR_OPTIONS
if [ -f user_init_last.sh ]
then
echo -e "${INFO} Executing user-defined post-build script"
source user_init_last.sh
fi
Lift-dataview DEFINITIONS ::=
BEGIN
UpDown ::= ENUMERATED { up (1), down (0) }
OnOff ::= ENUMERATED { on (1), off (0) }
OpenClose ::= ENUMERATED { door-open (1), door-close (0) }
Position ::= REAL (0.0 .. 100.0)
Flag ::= BOOLEAN
Floors ::= ENUMERATED {
floor-0 (10),
floor-1 (20),
floor-2 (30),
floor-3 (40),
floor-4 (50),
floor-5 (60),
floor-above (70)
}
-- Types used for the interfacing with the Simulink model
Lift-control ::= SEQUENCE {
direction UpDown,
motor OnOff,
brake OnOff,
door OpenClose
}
Lift-sensor ::= SEQUENCE {
door-open Flag,
door-closed Flag,
floor-detected Flag,
pos-x Position
}
-- Types used for the user interaction
Floor-button ::= SEQUENCE {
floor Floors,
direction UpDown
}
Cabin-button ::= CHOICE {
emergency-stop Flag,
floor Floors
}
Start-condition ::= CHOICE {
forever BOOLEAN,
nb-of-cycle INTEGER (1..255)
}
END
RTDS_GEN_DIR=/home/assert/extra-space/tool-src/testSuites/Regression_AADLv2/Demo_ABB/controller/controller
RTDS_CLASSES_DIR=/home/assert/extra-space/tool-src/testSuites/Regression_AADLv2/Demo_ABB/controller/controller
RTDS_TEMPLATES_DIR=/home/assert/extra-space/tool-src/testSuites/Regression_AADLv2/Demo_ABB/controller/profile
RTDS_CC=gcc
RTDS_LNK=$(RTDS_CC)
RTDS_CC_INCLUDES=-I"." -I"${RTDS_TEMPLATES_DIR}" -I"${RTDS_HOME}/share/ccg/cscheduler" -I"${RTDS_HOME}/share/ccg/common" -I"$(RTDS_CLASSES_DIR)" -I"../../../common"
RTDS_CC_OPTIONS=-I"." -I"${RTDS_TEMPLATES_DIR}" -I"${RTDS_HOME}/share/ccg/cscheduler" -I"${RTDS_HOME}/share/ccg/common" -I"$(RTDS_CLASSES_DIR)" -DRTDS_SOCKET_IP_ADDRESS=127.0.1.1 -DRTDS_SOCKET_PORT=49250 -IRTDS-RTOS-adaptation -I ../../../common/
RTDS_LNK_OPTIONS=
RTDS_RM=rm -f
RTDS_OBJECTS = \
controller_p.o \
RTDS_controller_project_comp_functions.o \
RTDS_String.o \
RTDS_Proc.o \
RTDS_Scheduler.o
RTDS_ADDL_OBJECTS =
RTDS_EXT_OBJECTS =
RTDS_TARGET_BASE_NAME=controller
RTDS_TARGET_EXTENSION=.exe
all: $(RTDS_TARGET_BASE_NAME)$(RTDS_TARGET_EXTENSION)
$(RTDS_TARGET_BASE_NAME)$(RTDS_TARGET_EXTENSION): $(RTDS_OBJECTS) $(RTDS_ADDL_OBJECTS) $(RTDS_EXT_OBJECTS)
$(RTDS_LNK) $(RTDS_LNK_OPTIONS) -o "$@" $(RTDS_OBJECTS) $(RTDS_ADDL_OBJECTS) $(RTDS_EXT_OBJECTS)
controller_p.o: $(RTDS_GEN_DIR)/controller_p.c $(RTDS_GEN_DIR)/controller_p.h $(RTDS_GEN_DIR)/RTDS_controller_project_messages.h $(RTDS_GEN_DIR)/RTDS_gen.h $(RTDS_GEN_DIR)/controller_p_decl.h $(RTDS_GEN_DIR)/controller.h $(RTDS_GEN_DIR)/RTDS-RTOS-adaptation/RTDS_CommonTypes.h $(RTDS_GEN_DIR)/RTDS-RTOS-adaptation/RTDS_String.h $(RTDS_GEN_DIR)/RTDS-RTOS-adaptation/RTDS_Set.h $(RTDS_GEN_DIR)/RTDSdataView.h Makefile
$(RTDS_CC) $(RTDS_CC_OPTIONS) -c -o "$@" "$<"
RTDS_controller_project_comp_functions.o: $(RTDS_GEN_DIR)/RTDS_controller_project_comp_functions.c Makefile
$(RTDS_CC) $(RTDS_CC_OPTIONS) -c -o "$@" "$<"
RTDS_String.o: $(RTDS_GEN_DIR)/RTDS-RTOS-adaptation/RTDS_String.c Makefile
$(RTDS_CC) $(RTDS_CC_OPTIONS) -c -o "$@" "$<"
RTDS_Proc.o: $(RTDS_HOME)/share/ccg/cscheduler/RTDS_Proc.c Makefile
$(RTDS_CC) $(RTDS_CC_OPTIONS) -c -o "$@" "$<"
RTDS_Scheduler.o: $(RTDS_HOME)/share/ccg/cscheduler/RTDS_Scheduler.c Makefile
$(RTDS_CC) $(RTDS_CC_OPTIONS) -c -o "$@" "$<"
RTDS_clean:
$(RTDS_RM) $(RTDS_TARGET_BASE_NAME)$(RTDS_TARGET_EXTENSION)
$(RTDS_RM) "controller_p.o"
$(RTDS_RM) "RTDS_controller_project_comp_functions.o"
$(RTDS_RM) "RTDS_String.o"
$(RTDS_RM) "RTDS_Proc.o"
$(RTDS_RM) "RTDS_Scheduler.o"
RTDS_mrproper: RTDS_clean
$(RTDS_RM) "controller_p_decl.h"
$(RTDS_RM) "RTDSdataView.h"
$(RTDS_RM) "controller_p.c"
$(RTDS_RM) "RTDS_controller_project_messages.h"
$(RTDS_RM) "controller_p.h"
$(RTDS_RM) "RTDS_gen.h"
$(RTDS_RM) "controller.h"
$(RTDS_RM) "RTDS_controller_project_comp_functions.c"
$(RTDS_RM) RTDS_gen.ini
$(RTDS_RM) Makefile
#define RTDS_SETUP_CURRENT_CONTEXT
#define RTDS_FORGET_INSTANCE_INFO
typedef int RTDS_RtosQueueId;
typedef int RTDS_RtosTaskId;
typedef int RTDS_TimerState;
#define RTDS_GLOBAL_PROCESS_INFO_ADDITIONNAL_FIELDS
#define RTDS_MESSAGE_HEADER_ADDITIONNAL_FIELDS
#ifndef _RTDS_COMMON_H_
#define _RTDS_COMMON_H_
#include "RTDS_BasicTypes.h"
/*
* TYPE RTDS_SdlInstanceId:
* ---------------------
* Identifier for a process instance in the running system.
*/
typedef struct RTDS_SdlInstanceId
{
RTDS_RtosQueueId queueId; /* Queue id for the process or its scheduler if scheduled */
int instanceNumber; /* Numerical identifier for instance if in a scheduler */
} RTDS_SdlInstanceId;
/*
* TYPE RTDS_PID:
* --------------
* New type for process identifiers. This type should now be used instead of RTDS_QueueId
*/
typedef RTDS_SdlInstanceId * RTDS_PID;
/*
* TYPE RTDS_QueueId:
* ------------------
* Only for compatibility: old RTDS_QueueId type is defined as a RTDS_PID
* NB: THIS TYPE SHOULD NO MORE BE USED!
*/
#define RTDS_QueueId RTDS_PID
/*
* STRUCT RTDS_MESSAGE.HEADER:
* ---------------------------
* Type for a message descriptor
* Don't invert fields !!! This would mess up the gopher scripts used in:
* - getMessageInformation in wtxmodule.c
*/
typedef struct RTDS_MessageHeader
{
RTDS_MESSAGE_HEADER_ADDITIONNAL_FIELDS /* OSE requires the first field to be sigNo */
long messageNumber; /* The integer value for the message or the timer */
long timerUniqueId; /* If 0, normal message; otherwise unique id. for timer if message is a timer */
#ifdef RTDS_SIMULATOR
unsigned long messageUniqueId; /* Used by simulator to trace messages */
#endif
RTDS_SdlInstanceId * sender; /* The SDL instance id of the sender */
RTDS_SdlInstanceId * receiver; /* The SDL instance id of the receiver */
long dataLength; /* Length of data */
unsigned char * pData; /* Pointer to message data */
struct RTDS_MessageHeader * next; /* Next message if used as a message queue */
} RTDS_MessageHeader;
/*
* STRUCT RTDS_GLOBAL.PROCESS.INFO:
* -------------------------------
* Type for the list of processes in the system with their information
* Offset displayed for Tornado gopher script
*/
typedef struct RTDS_GlobalProcessInfo
{
RTDS_RtosTaskId myRtosTaskId; /* 0x00 The PID of the RTOS task */
int sdlProcessNumber; /* 0x04 Name of the process as a number defined in RTDS_gen.h */
RTDS_SdlInstanceId * mySdlInstanceId; /* 0x08 The SDL instance id for the current process */
RTDS_SdlInstanceId * parentSdlInstanceId; /* 0x0C The SDL instance id for the parent process */
RTDS_SdlInstanceId * offspringSdlInstanceId; /* 0x10 The SDL instance id for the child process */
int sdlState; /* 0x14 Current SDL state of the process */
RTDS_MessageHeader * currentMessage; /* 0x18 Last message read */
RTDS_TimerState * timerList; /* 0x1C Pointer to the list of current active timers */
RTDS_MessageHeader * readSaveQueue; /* 0x20 Save queue chained list entry point when reading saved messages */
RTDS_MessageHeader * writeSaveQueue; /* 0x24 Save queue chained list entry point when saving messages */
struct RTDS_GlobalProcessInfo * next; /* 0x28 Next processInfo */
RTDS_GLOBAL_PROCESS_INFO_ADDITIONNAL_FIELDS /* 0x30 OS dependant */
} RTDS_GlobalProcessInfo;
/*
* ENUM RTDS_EVENT.TYPE:
* -------------------------------
* Enum of event types the simulator can be warned about
*/
enum RTDS_EventType
{
RTDS_messageSent = 0,
RTDS_messageReceived = 1,
RTDS_timerStarted = 2,
RTDS_timerCancelled = 3,
RTDS_processCreated = 4,
RTDS_processDied = 5,
RTDS_semTakeAttempt = 6,
RTDS_semTakeSucceded = 7,
RTDS_semGive = 8,
RTDS_sdlStateSet = 9,
RTDS_initDone = 10,
RTDS_semTakeTimedOut = 11,
RTDS_systemError = 12,
RTDS_semaphoreCreated = 13,
RTDS_semaphoreDeleted = 14,
RTDS_messageSaved = 15,
RTDS_information = 16
} ;
/*
* STRUCT RTDS_GLOBAL.TRACE.INFO:
* -------------------------------
* Structure containing the event information red by the simulator
*/
#if defined( RTDS_SIMULATOR ) || defined( RTDS_MSC_TRACER ) || defined( RTDS_FORMAT_TRACE )
typedef struct RTDS_GlobalTraceInfo
{
enum RTDS_EventType event;
void * eventParameter1;
long eventParameter2;
RTDS_GlobalProcessInfo * currentContext;
} RTDS_GlobalTraceInfo;
#endif
#endif
#ifndef _RTDS_COMMON_TYPES_H_
#define _RTDS_COMMON_TYPES_H_
/* Boolean type */
#ifndef _RTDS_BOOLEAN_
#define _RTDS_BOOLEAN_
#undef FALSE
#undef TRUE
typedef enum _RTDS_BOOLEAN { FALSE=0, TRUE=1 } RTDS_BOOLEAN;
#endif
#endif
#define RTDS_MSG_INPUT_ERROR 1
#define RTDS_TIMER_CLEAN_UP
#define RTDS_START_SYNCHRO_WAIT
#include <stdlib.h>
#include "RTDS_Common.h"
#include "RTDS_MACRO.h"
#include "RTDS_ADDL_MACRO.h"
#include "RTDS_Scheduler.h"
#include "RTDS_Proc.h"
/*
** FUNCTION RTDS_Proc_createInstance:
** ----------------------------------
** Initializes a descriptor for an instance.
** NB: This function is never called directly, as it handles only the initializations of the fields in RTDS_Proc. To create an instance
** of process p, the function RTDS_p_createInstance should be used, which will in turn call this one.
*/
void RTDS_Proc_createInstance(
RTDS_Proc * instanceDescriptor, /* Preallocated descriptor for instance */
RTDS_Scheduler * parentScheduler, /* Scheduler inside which the instance will run if any. If NULL, the instance is created outside of any scheduler */
RTDS_GlobalProcessInfo * instanceContext, /* Context for new instance if it has been allocated previously. If NULL, a new context is created */
RTDS_GlobalProcessInfo * creatorContext /* Context for the instance creating the new one if any. If NULL, it means the new instance is created at system startup */
)
{
/* If instance context already exists, just record it */
if ( instanceContext != NULL )
{
instanceDescriptor->RTDS_currentContext = instanceContext;
}
/* If instance context does not yet exist */
else
{
/* Get or create a new context */
#ifdef RTDS_MALLOC
instanceDescriptor->RTDS_currentContext = (RTDS_GlobalProcessInfo*)RTDS_MALLOC(sizeof(RTDS_GlobalProcessInfo));
#else
/* Don't really know what to do here: context *must* be passed if dynamic memory allocation is forbidden */
instanceDescriptor->RTDS_currentContext = NULL;
return;
#endif
instanceDescriptor->RTDS_currentContext->next = NULL;
}
/* Set all fields in context */
/* NB: myRtosTaskId cannot be set, as the type RTDS_RtosTaskId depends on the actual profile */
instanceDescriptor->RTDS_currentContext->sdlProcessNumber = -1; /* Default; set 'for real' in the creation functions for individual processes */
instanceDescriptor->RTDS_currentContext->mySdlInstanceId = NULL; /* Default; set 'for real' when/if instance is registered in a scheduler */
if ( creatorContext == NULL )
instanceDescriptor->RTDS_currentContext->parentSdlInstanceId = NULL;
else
instanceDescriptor->RTDS_currentContext->parentSdlInstanceId = creatorContext->mySdlInstanceId;
instanceDescriptor->RTDS_currentContext->offspringSdlInstanceId = NULL;
instanceDescriptor->RTDS_currentContext->sdlState = 0;
instanceDescriptor->RTDS_currentContext->currentMessage = NULL;
instanceDescriptor->RTDS_currentContext->timerList = NULL;
instanceDescriptor->RTDS_currentContext->readSaveQueue = NULL;
instanceDescriptor->RTDS_currentContext->writeSaveQueue = NULL;
/* Set all fields in descriptor, except 'is procedure' indicator, which is set before the call */
instanceDescriptor->RTDS_initialMessage = NULL;
instanceDescriptor->RTDS_senderId = NULL;
instanceDescriptor->RTDS_calledProcedure = NULL;
instanceDescriptor->RTDS_nextLabelId = 0;
instanceDescriptor->RTDS_sdlStatePrev = 0;
instanceDescriptor->nextScheduledInstance = NULL;
/* Record new instance in parent scheduler if needed */
if ( parentScheduler == NULL )
{
instanceDescriptor->RTDS_parentScheduler = NULL;
instanceDescriptor->RTDS_currentContext->mySdlInstanceId = NULL;