Commit 84bb6d68 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Added Demo_ABB

parent d2f7b19f
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* File: Operate_lift_private.h
*
* Real-Time Workshop code generated for Simulink model Operate_lift.
*
* Model version : 1.7
* Real-Time Workshop file version : 7.4 (R2009b) 29-Jun-2009
* Real-Time Workshop file generated on : Wed Jun 29 09:22:33 2011
* TLC version : 7.4 (Jul 14 2009)
* C/C++ source code generated on : Wed Jun 29 09:22:35 2011
*
* Target selection: ert.tlc
* Embedded hardware selection: 32-bit Generic
* Code generation objectives: Unspecified
* Validation result: Not run
*/
#ifndef RTW_HEADER_Operate_lift_private_h_
#define RTW_HEADER_Operate_lift_private_h_
#include "rtwtypes.h"
#define CALL_EVENT (-1)
/* Private macros used by the generated code to access rtModel */
#ifndef rtmIsMajorTimeStep
# define rtmIsMajorTimeStep(rtm) (((rtm)->Timing.simTimeStep) == MAJOR_TIME_STEP)
#endif
#ifndef rtmIsMinorTimeStep
# define rtmIsMinorTimeStep(rtm) (((rtm)->Timing.simTimeStep) == MINOR_TIME_STEP)
#endif
#ifndef rtmGetTPtr
# define rtmGetTPtr(rtm) ((rtm)->Timing.t)
#endif
#ifndef rtmSetTPtr
# define rtmSetTPtr(rtm, val) ((rtm)->Timing.t = (val))
#endif
#ifndef __RTWTYPES_H__
#error This file requires rtwtypes.h to be included
#else
#ifdef TMWTYPES_PREVIOUSLY_INCLUDED
#error This file requires rtwtypes.h to be included before tmwtypes.h
#else
/* Check for inclusion of an incorrect version of rtwtypes.h */
#ifndef RTWTYPES_ID_C08S16I32L32N32F1
#error This code was generated with a different "rtwtypes.h" than the file included
#endif /* RTWTYPES_ID_C08S16I32L32N32F1 */
#endif /* TMWTYPES_PREVIOUSLY_INCLUDED */
#endif /* __RTWTYPES_H__ */
/*
* UNUSED_PARAMETER(x)
* Used to specify that a function parameter (argument) is required but not
* accessed by the function body.
*/
#ifndef UNUSED_PARAMETER
# if defined(__LCC__)
# define UNUSED_PARAMETER(x) /* do nothing */
# else
/*
* This is the semi-ANSI standard way of indicating that an
* unused function parameter is required.
*/
# define UNUSED_PARAMETER(x) (void) (x)
# endif
#endif
/* private model entry point functions */
extern void Operate_lift_derivatives(void);
#endif /* RTW_HEADER_Operate_lift_private_h_ */
/*
* File trailer for Real-Time Workshop generated code.
*
* [EOF]
*/
/*
* File: Operate_lift_types.h
*
* Real-Time Workshop code generated for Simulink model Operate_lift.
*
* Model version : 1.7
* Real-Time Workshop file version : 7.4 (R2009b) 29-Jun-2009
* Real-Time Workshop file generated on : Wed Jun 29 09:22:33 2011
* TLC version : 7.4 (Jul 14 2009)
* C/C++ source code generated on : Wed Jun 29 09:22:35 2011
*
* Target selection: ert.tlc
* Embedded hardware selection: 32-bit Generic
* Code generation objectives: Unspecified
* Validation result: Not run
*/
#ifndef RTW_HEADER_Operate_lift_types_h_
#define RTW_HEADER_Operate_lift_types_h_
#include "rtwtypes.h"
#ifndef _DEFINED_TYPEDEF_FOR_Lift_control_
#define _DEFINED_TYPEDEF_FOR_Lift_control_
typedef struct {
int32_T direction;
int32_T motor;
int32_T brake;
int32_T door;
} Lift_control;
#endif
#ifndef _DEFINED_TYPEDEF_FOR_Lift_sensor_
#define _DEFINED_TYPEDEF_FOR_Lift_sensor_
typedef struct {
boolean_T door_open;
boolean_T door_closed;
boolean_T floor_detected;
real_T pos_x;
} Lift_sensor;
#endif
/* Parameters (auto storage) */
typedef struct Parameters_Operate_lift_ Parameters_Operate_lift;
/* Forward declaration for rtModel */
typedef struct RT_MODEL_Operate_lift RT_MODEL_Operate_lift;
#endif /* RTW_HEADER_Operate_lift_types_h_ */
/*
* File trailer for Real-Time Workshop generated code.
*
* [EOF]
*/
% Values for UpDown:
UpDown_value_up = 1;
UpDown_value_down = 0;
UpDown = Simulink.AliasType;
UpDown.BaseType = 'int32';
UpDown.Description = 'values of ENUMERATED UpDown';
Flag = Simulink.AliasType;
Flag.BaseType = 'boolean';
Flag.Description = 'A simple BOOLEAN';
% Values for Floors:
Floors_value_floor_0 = 10;
Floors_value_floor_1 = 20;
Floors_value_floor_2 = 30;
Floors_value_floor_3 = 40;
Floors_value_floor_4 = 50;
Floors_value_floor_5 = 60;
Floors = Simulink.AliasType;
Floors.BaseType = 'int32';
Floors.Description = 'values of ENUMERATED Floors';
Cabin_button_elem01=Simulink.BusElement;
Cabin_button_elem01.name='choiceIdx';
Cabin_button_elem01.DataType='uint8';
Cabin_button_elem01.dimensions=1;
Cabin_button_elem02=Simulink.BusElement;
Cabin_button_elem02.name='emergency_stop';
Cabin_button_elem02.DataType='boolean';
Cabin_button_elem02.dimensions=1;
Cabin_button_elem03=Simulink.BusElement;
Cabin_button_elem03.name='floor';
Cabin_button_elem03.DataType='int32';
Cabin_button_elem03.dimensions=1;
Cabin_button = Simulink.Bus;
Cabin_button.Elements = [Cabin_button_elem01 Cabin_button_elem02 Cabin_button_elem03 ];
% Values for OpenClose:
OpenClose_value_door_open = 1;
OpenClose_value_door_close = 0;
OpenClose = Simulink.AliasType;
OpenClose.BaseType = 'int32';
OpenClose.Description = 'values of ENUMERATED OpenClose';
% Values for OnOff:
OnOff_value_on = 1;
OnOff_value_off = 0;
OnOff = Simulink.AliasType;
OnOff.BaseType = 'int32';
OnOff.Description = 'values of ENUMERATED OnOff';
Lift_control_elem01=Simulink.BusElement;
Lift_control_elem01.name='direction';
Lift_control_elem01.DataType='int32';
Lift_control_elem01.dimensions=1;
Lift_control_elem02=Simulink.BusElement;
Lift_control_elem02.name='motor';
Lift_control_elem02.DataType='int32';
Lift_control_elem02.dimensions=1;
Lift_control_elem03=Simulink.BusElement;
Lift_control_elem03.name='brake';
Lift_control_elem03.DataType='int32';
Lift_control_elem03.dimensions=1;
Lift_control_elem04=Simulink.BusElement;
Lift_control_elem04.name='door';
Lift_control_elem04.DataType='int32';
Lift_control_elem04.dimensions=1;
Lift_control = Simulink.Bus;
Lift_control.Elements = [Lift_control_elem01 Lift_control_elem02 Lift_control_elem03 Lift_control_elem04 ];
Start_condition_elem01=Simulink.BusElement;
Start_condition_elem01.name='choiceIdx';
Start_condition_elem01.DataType='uint8';
Start_condition_elem01.dimensions=1;
Start_condition_elem02=Simulink.BusElement;
Start_condition_elem02.name='forever';
Start_condition_elem02.DataType='boolean';
Start_condition_elem02.dimensions=1;
Start_condition_elem03=Simulink.BusElement;
Start_condition_elem03.name='nb_of_cycle';
Start_condition_elem03.DataType='uint8';
Start_condition_elem03.dimensions=1;
Start_condition = Simulink.Bus;
Start_condition.Elements = [Start_condition_elem01 Start_condition_elem02 Start_condition_elem03 ];
Position = Simulink.AliasType;
Position.BaseType = 'double';
Position.Description = 'range is [0.0, 100.0]';
Lift_sensor_elem01=Simulink.BusElement;
Lift_sensor_elem01.name='door_open';
Lift_sensor_elem01.DataType='boolean';
Lift_sensor_elem01.dimensions=1;
Lift_sensor_elem02=Simulink.BusElement;
Lift_sensor_elem02.name='door_closed';
Lift_sensor_elem02.DataType='boolean';
Lift_sensor_elem02.dimensions=1;
Lift_sensor_elem03=Simulink.BusElement;
Lift_sensor_elem03.name='floor_detected';
Lift_sensor_elem03.DataType='boolean';
Lift_sensor_elem03.dimensions=1;
Lift_sensor_elem04=Simulink.BusElement;
Lift_sensor_elem04.name='pos_x';
Lift_sensor_elem04.DataType='double';
Lift_sensor_elem04.dimensions=1;
Lift_sensor = Simulink.Bus;
Lift_sensor.Elements = [Lift_sensor_elem01 Lift_sensor_elem02 Lift_sensor_elem03 Lift_sensor_elem04 ];
Floor_button_elem01=Simulink.BusElement;
Floor_button_elem01.name='floor';
Floor_button_elem01.DataType='int32';
Floor_button_elem01.dimensions=1;
Floor_button_elem02=Simulink.BusElement;
Floor_button_elem02.name='direction';
Floor_button_elem02.DataType='int32';
Floor_button_elem02.dimensions=1;
Floor_button = Simulink.Bus;
Floor_button.Elements = [Floor_button_elem01 Floor_button_elem02 ];
/*
* Copyright 1994-2002 The MathWorks, Inc.
*
* File: bio_sig.h $Revision: 1.10 $
*
* Abstract:
* typedef for BlockIOSignals, included by *rt_main.c and MODEL.bio
*/
#ifndef _BIO_SIG_H_
# define _BIO_SIG_H_
typedef struct BlockIOSignals_tag {
char_T *blockName; /* Block's full path name (RTW mangled version) */
char_T *signalName; /* Signal label (unmangled, or NULL if not present) */
uint_T portNumber; /* Block output port number (starting at 0) */
uint_T signalWidth; /* Signal's width */
void *signalAddr; /* Signal's Address in the block I/O vector */
char_T *dtName; /* The C-language data type name */
uint_T dtSize; /* The size in # of bytes for the data type */
} BlockIOSignals;
#endif
This diff is collapsed.
This diff is collapsed.
/* Copyright 1994-2002 The MathWorks, Inc.
*
* File : cg_matrx.h $Revision: 1.1.10.1 $ $Date: 2007/03/03 04:17:35 $
* Abstract:
* Provided for backwards compatibility. See rt_matrx.h for details.
*/
#include "rt_matrx.h"
/* [EOF] cg_matrx.h */
/* cg_sfun.h
*
* Entry point for user-written S-Functions when compiled for
* use with the Simulink C-Code Generator. This file should
* be conditionally included at the bottom of any user-written
* S-Function so as to enable the static functions within it
* to be registered at startup. Also, the macro S_FUNCTION_NAME
* should be declared within the S-Function to specify the
* entry point name--that is the name by which the S-Function
* is to be known to the outside world.
*
* Copyright 1994-2005 The MathWorks, Inc.
* $Revision: 1.15.4.9 $
*/
#ifdef __cplusplus
extern "C"
#endif
void S_FUNCTION_NAME(SimStruct *S)
{
#if S_FUNCTION_LEVEL == 1
/* level 1 */
ssSetmdlInitializeSizes(S, mdlInitializeSizes);
ssSetmdlInitializeSampleTimes(S, mdlInitializeSampleTimes);
ssSetmdlInitializeConditionsLevel1(S, mdlInitializeConditions);
ssSetmdlOutputsLevel1(S, mdlOutputs);
ssSetmdlUpdateLevel1(S, mdlUpdate);
ssSetmdlDerivativesLevel1(S, mdlDerivatives);
ssSetmdlTerminate(S, mdlTerminate);
#else
/* user level 2 */
ssSetmdlInitializeSizes(S, mdlInitializeSizes);
ssSetmdlInitializeSampleTimes(S, mdlInitializeSampleTimes);
# if defined(MDL_INITIALIZE_CONDITIONS)
ssSetmdlInitializeConditions(S, mdlInitializeConditions);
# endif
# if defined(MDL_START)
ssSetmdlStart(S, mdlStart);
# endif
# if defined(RTW_GENERATED_ENABLE)
ssSetRTWGeneratedEnable(S, mdlEnable);
# endif
# if defined(RTW_GENERATED_DISABLE)
ssSetRTWGeneratedDisable(S, mdlDisable);
# endif
# if defined(MDL_ENABLE)
ssSetmdlEnable(S, mdlEnable);
# endif
# if defined(MDL_DISABLE)
ssSetmdlDisable(S, mdlDisable);
# endif
ssSetmdlOutputs(S, mdlOutputs);
# if defined(MDL_GET_TIME_OF_NEXT_VAR_HIT)
ssSetmdlGetTimeOfNextVarHit(S, mdlGetTimeOfNextVarHit);
# endif
# if defined(MDL_UPDATE)
ssSetmdlUpdate(S, mdlUpdate);
# endif
# if defined(MDL_DERIVATIVES)
ssSetmdlDerivatives(S, mdlDerivatives);
# endif
# if defined(MDL_PROJECTION)
ssSetmdlProjection(S, mdlProjection);
# endif
# if defined(MDL_FORCINGFUNCTION)
ssSetmdlForcingFunction(S, mdlForcingFunction);
# endif
# if defined(MDL_MASSMATRIX)
ssSetmdlMassMatrix(S, mdlMassMatrix);
# endif
# if defined(MDL_RTWCG)
ssSetmdlRTWCG(S, mdlRTWCG);
# endif
# if defined(MDL_ZERO_CROSSINGS) && (defined(MATLAB_MEX_FILE) || defined(NRT))
ssSetmdlZeroCrossings(S, mdlZeroCrossings);
# endif
ssSetmdlTerminate(S, mdlTerminate);
#endif
}
/*
* Copyright 1994-2002 The MathWorks, Inc.
*
* $RCSfile: dt_info.h,v $
* $Revision: 1.17 $
*
* Abstract:
* typedef for data type transitions vectors. Included by MODEL.dt
*/
#ifndef _DTINFO_H_
#define _DTINFO_H_
/* Data type transition */
typedef struct DataTypeTransition_tag {
char_T *baseAddr; /* starting address of the transition */
int_T dataType;
int_T isComplex; /* elements of this region are complex */
int_T nEls;
} DataTypeTransition;
/* Data type transition table */
typedef struct DataTypeTransitionTable_tag {
uint_T numTransitions; /* number of transitions in table */
DataTypeTransition *transitions; /* base address of transition table*/
} DataTypeTransitionTable;
/*
* The model's data type transition info structure is attached
* to the SimStruct:
*
* DataTypeTransInfo *dtInfo = ssGetModelMappingInfo(S);
*
* Additional information is accessed via:
*
* uint_T NumDataTypes = dtGetNumDataTypes(dtInfo);
* uint_T DataTypeSizes[] = dtGetDataTypeSizes(dtInfo);
* char_T *DataTypeNames[] = dtGetDataTypeNames(dtInfo);
*
* DataTypeTransTable *B = dtGetBIODataTypeTrans(dtInfo);
* DataTypeTransTable *P = dtGetParamDataTypeTrans(dtInfo);
* DataTypeTransTable *DWork = dtGetDWorkDataTypeTrans(dtInfo);
* DataTypeTransTable *Xd = dtGetDiscStatesDataTypeTrans(dtInfo);
* DataTypeTransTable *U = dtGetExternalInputsDataTypeTrans(dtInfo);
* DataTypeTransTable *Y = dtGetExternalOutputsDataTypeTrans(dtInfo);
*
* And, using the block outputs as an example
*
* uint_T NumBIOTransitions = dtGetNumTransitions(B);
* DataTypeTransition *BIOTransitions = dtGetTransitions(B);
* char_T *address = dtTransGetAddress(B, idx);
* int_T dataType = dtTransGetDataType(B, idx);
* int_T isComplex = dtTransGetComplexFlag(B, idx);
*
* where, idx is the index into the block outputs transition table.
* For example, dtTransGetComplexFlag(B, 5) indicates whether the fifth
* transition represents a complex region of the block outputs structure
* structure and dtTransGetAddress(B, 5) is the absolute base address of
* the region.
*/
typedef struct DataTypeTransInfo_tag {
uint_T numDataTypes; /* number of data types in model */
uint_T *dataTypeSizes; /* data types (bytes) of data types */
char_T const **dataTypeNames; /* names of data types */
DataTypeTransitionTable *B; /* block outputs */
DataTypeTransitionTable *P; /* parameters */
DataTypeTransitionTable *DWork; /* data type work vector */
DataTypeTransitionTable *Xd; /* discrete states */
DataTypeTransitionTable *U; /* model inputs */
DataTypeTransitionTable *Y; /* model outputs */
} DataTypeTransInfo;
#define dtGetNumDataTypes(dtInfo) ((uint_T)((dtInfo)->numDataTypes))
#define dtGetDataTypeSizes(dtInfo) ((dtInfo)->dataTypeSizes)
#define dtGetDataTypeNames(dtInfo) ((dtInfo)->dataTypeNames)
#define dtGetBIODataTypeTrans(dtInfo) ((dtInfo)->B)
#define dtGetParamDataTypeTrans(dtInfo) ((dtInfo)->P)
#define dtGetDWorkDataTypeTrans(dtInfo) ((dtInfo)->DWork)
#define dtGetDiscStatesDataTypeTrans(dtInfo) ((dtInfo)->Xd)
#define dtGetExternalInputsDataTypeTrans(dtInfo) ((dtInfo)->U)
#define dtGetExternalOutputsDataTypeTrans(dtInfo) ((dtInfo)->Y)
#define dtGetNumTransitions(dtTable) \
((dtTable)->numTransitions)
#define dtGetTransitions(dtTable) \
((dtTable)->transitions)
#define dtTransGetAddress(dtTable, idx) \
((dtTable)->transitions[(idx)].baseAddr)
#define dtTransGetDataType(dtTable, idx) \
((dtTable)->transitions[(idx)].dataType)
#define dtTransNEls(dtTable, idx) \
((dtTable)->transitions[(idx)].nEls)
#define dtTransGetComplexFlag(dtTable, idx) \
((dtTable)->transitions[(idx)].isComplex)
#endif /* _DTINFO_ */
This diff is collapsed.
/*
* @(#)engine.h generated by: makeheader 5.1.5 Mon Jun 29 16:01:41 2009
*
* built from: ../../src/include/copyright.h
* ../../src/include/pragma_interface.h
* engapi.cpp
* fengapi.cpp
* fengapi_stdcall.cpp
*/
#if defined(_MSC_VER)
# pragma once
#endif
#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3))
# pragma once
#endif
#ifndef engine_h
#define engine_h
/*
* Copyright 1984-2003 The MathWorks, Inc.
* All Rights Reserved.
*/
/* Copyright 2003-2006 The MathWorks, Inc. */
/* Only define EXTERN_C if it hasn't been defined already. This allows
* individual modules to have more control over managing their exports.
*/
#ifndef EXTERN_C
#ifdef __cplusplus
#define EXTERN_C extern "C"
#else
#define EXTERN_C extern
#endif
#endif
#include "matrix.h" /* mx Routines used in module */
typedef struct engine Engine; /* Incomplete definition for Engine */
/*
* Execute matlab statement
*/
EXTERN_C int engEvalString(
Engine *ep, /* engine pointer */
const char *string /* string for matlab t execute */
);
/*
* Start matlab process for single use.
* Not currently supported on UNIX.
*/
EXTERN_C Engine *engOpenSingleUse(
const char *startcmd, /* exec command string used to start matlab */
void *reserved, /* reserved for future use, must be NULL */
int *retstatus /* return status */
);
/*
* SetVisible, do nothing since this function is only for NT
*/
EXTERN_C int engSetVisible(
Engine *ep, /* engine pointer */
bool newVal
);
/*
* GetVisible, do nothing since this function is only for NT
*/
EXTERN_C int engGetVisible(
Engine *ep, /* engine pointer */
bool* bVal
);
/*
* Start matlab process
*/
EXTERN_C Engine *engOpen(
const char *startcmd /* exec command string used to start matlab */
);
/*
* Close down matlab server
*/
EXTERN_C int engClose(
Engine *ep /* engine pointer */
);
/*
* Get a variable with the specified name from MATLAB's workspace
*/
EXTERN_C mxArray *engGetVariable(
Engine *ep, /* engine pointer */
const char *name /* name of variable to get */
);
/*
* Put a variable into MATLAB's workspace with the specified name
*/
EXTERN_C int engPutVariable(
Engine *ep, /* engine pointer */
const char *var_name,
const mxArray *ap /* array pointer */
);
/*
* register a buffer to hold matlab text output
*/
EXTERN_C int engOutputBuffer(
Engine *ep, /* engine pointer */
char *buffer, /* character array to hold output */
int buflen /* buffer array length */
);
#endif /* engine_h */