Using the S-Function Target with MATLAB R13 - dSPACE
Using the S-Function Target with MATLAB R13 - dSPACE
Using the S-Function Target with MATLAB R13 - dSPACE
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
FAQ 200<br />
<strong>Using</strong> <strong>the</strong> S-<strong>Function</strong> <strong>Target</strong> <strong>with</strong> <strong>MATLAB</strong> <strong>R13</strong><br />
Keywords<br />
<strong>MATLAB</strong> ® <strong>R13</strong>, S-<strong>Function</strong> <strong>Target</strong><br />
Question<br />
<strong>Using</strong> <strong>the</strong> S-<strong>Function</strong> <strong>Target</strong> <strong>with</strong> <strong>MATLAB</strong> <strong>R13</strong><br />
FAQ Version: 1 / 2010-12-29<br />
Page 1<br />
<strong>dSPACE</strong> FAQ 200<br />
Why is <strong>the</strong> compiling process of generated code aborted <strong>with</strong> <strong>the</strong> error message<br />
#error 'Code was generated for compiler <strong>with</strong> different sized .'<br />
if <strong>the</strong> model contains an S-<strong>Function</strong> generated by Real-Time Workshop ® 's S-<strong>Function</strong> <strong>Target</strong>?<br />
Solution<br />
Due to a limitation in Real-Time Workshop, S-<strong>Function</strong>s generated by <strong>the</strong> Real-Time Workshop S-<br />
<strong>Function</strong> block (S-<strong>Function</strong> <strong>Target</strong>) are no longer target-independent and, <strong>the</strong>refore, cannot be<br />
compiled for <strong>the</strong> <strong>dSPACE</strong> platforms DS1003, DS1102 and <strong>the</strong> AlphaCombo (DS1003+DS1004). This<br />
is because Real-Time Workshop always uses <strong>the</strong> data type definitions of <strong>the</strong> host computer (where<br />
<strong>MATLAB</strong> ® and <strong>the</strong> code generation process are executed), and not <strong>the</strong> data type definitions that are<br />
valid for <strong>the</strong> chosen real-time target.<br />
As a consequence <strong>the</strong> compiler issues <strong>the</strong> above-mentioned error message. This is necessary<br />
because <strong>the</strong> generated S-function code probably would not execute correctly on <strong>the</strong> real-time target.<br />
To get a workaround for <strong>the</strong> S-<strong>Function</strong> <strong>Target</strong><br />
1. Download <strong>the</strong> rtwsfcn_rtw_info_hook.m file (rtwsfcn_rtw_info_hook.zip)<br />
2. Copy <strong>the</strong> file to each %DSPACE_ROOT%\<strong>MATLAB</strong>\RTI\M folder of your installation.<br />
This file is needed for correct code generation <strong>with</strong> <strong>the</strong> S-<strong>Function</strong> target for <strong>the</strong><br />
<strong>dSPACE</strong> platforms listed above. It is not sufficient to copy this file to your<br />
<strong>dSPACE</strong> installation after <strong>the</strong> S-<strong>Function</strong> has already been built.<br />
To check whe<strong>the</strong>r <strong>MATLAB</strong> finds <strong>the</strong> correct file, enter <strong>the</strong> command<br />
which rtwsfcn_rtw_info_hook<br />
This should display <strong>the</strong> folder you copied <strong>the</strong> downloaded M file to, i.e.,<br />
%DSPACE_ROOT%\<strong>MATLAB</strong>\RTI\M.
How to Contact <strong>dSPACE</strong> Support<br />
<strong>dSPACE</strong> GmbH<br />
Ra<strong>the</strong>naustr. 26<br />
D-33102 Paderborn<br />
Germany<br />
++49 5251 1638-941<br />
mailto:support@dspace.de<br />
http://www.dspace.com/support<br />
<strong>Using</strong> <strong>the</strong> S-<strong>Function</strong> <strong>Target</strong> <strong>with</strong> <strong>MATLAB</strong> <strong>R13</strong><br />
FAQ Version: 1 / 2010-12-29<br />
Page 2<br />
<strong>dSPACE</strong> FAQ 200<br />
<strong>dSPACE</strong> recommends that you use <strong>the</strong> support request form on <strong>the</strong> internet to contact<br />
<strong>dSPACE</strong> support.<br />
It is available under<br />
http://www.dspace.com/goto?supportrequest<br />
Software Updates and Patches<br />
FAQ<br />
<strong>dSPACE</strong> strongly recommends that you download and install <strong>the</strong> most recent patches for your<br />
current <strong>dSPACE</strong> installation. Visit http://www.dspace.com/goto?patches for software updates<br />
and patches.<br />
FAQ documents are available under http://www.dspace.com/goto?faq.<br />
Important Notice<br />
This document contains proprietary information that is protected by copyright. All rights are<br />
reserved. Nei<strong>the</strong>r <strong>the</strong> documentation nor software may be copied, photocopied, reproduced,<br />
translated, or reduced to any electronic medium or machine-readable form, in whole or in part,<br />
<strong>with</strong>out <strong>the</strong> prior written consent of <strong>dSPACE</strong> GmbH.<br />
© Copyright 2010 by:<br />
<strong>dSPACE</strong> GmbH<br />
Ra<strong>the</strong>naustr. 26<br />
D-33102 Paderborn<br />
Germany<br />
This publication and <strong>the</strong> contents hereof are subject to change <strong>with</strong>out notice.<br />
For a list of registered trademarks of <strong>dSPACE</strong> products refer to<br />
http://www.dspace.com/goto?Trademarks