MATLAB: Does the xPC Target application crash when using an xPC Target Scope block in which ‘Scope mode’ is set to ‘Numerical’

formatnumericalscopesegmentationsegvSimulink Real-Timestringtargetviolationxpc

I have created a model containing an xPC Target Scope block with 'Scope mode' is set to 'Numerical', and 'Numerical format' set to '%15.6f,%15.6f ThisIsALongFormatString,%15.6f'. After building the model and downloading it to the target, I run the real-time application. The application crashes and I receive the following segmentation violation:
------------------------------------------------------------------------
Segmentation violation detected at Fri May 13 13:59:12 2005
------------------------------------------------------------------------
Configuration:
MATLAB Version: 7.0.4.365 (R14) Service Pack 2
MATLAB License: unknown
Operating System: Microsoft Windows 2000
Window System: Version 5.0 (Build 2195: Service Pack 4)
Processor ID: x86 Family 15 Model 1 Stepping 2, GenuineIntel
Virtual Machine: Java 1.5.0 with Sun Microsystems Inc. Java
HotSpot(TM) Client VM
(mixed mode)
Default Charset: ibm-5348_P100-1997
Register State:
EAX = 303d7367 EBX = 00000000
ECX = 00cd7e58 EDX = 00000005
ESI = 00000000 EDI = 00000001
EBP = 00cd82b4 ESP = 00cd7ee8
EIP = 20373534 FLG = 00010202
Stack Trace:
[0] 0x20373534(1, 0x00cd89e0, 0, 0)
[1] libmex.dll:_mexRunMexFile(1, 0x00cd89e0, 2, 0x00cd8a40) + 103 bytes
[2] libmex.dll:public: virtual void __thiscall
Mfh_mex::dispatch_file(int,struct mxArray_tag * *,int,struct mxArray_tag
* *)(1, 0x00cd89e0, 2, 0x00cd8a40) + 157 bytes
[3] m_dispatcher.dll:public: virtual void __thiscall
Mfh_file::dispatch_fh(int,struct mxArray_tag * *,int,struct mxArray_tag
* *)(1, 0x00cd89e0, 2, 0x00cd8a40) + 271 bytes
[4] m_interpreter.dll:int __cdecl mdDispatch(int,char const
*,int,struct mxArray_tag * *,int,struct mxArray_tag * *,class
Mfh_MATLAB_fn * *)(685, 0x11ac27f4 "xpcgate", 1, 0x00cd89e0) + 88 bytes
[5] m_interpreter.dll:_inDispatchFromStack(685, 0x11ac27f4 "xpcgate",
1, 0x01fffffe) + 801 bytes
<snip>

Best Answer

This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
There is a bug in xPC Target in the way that the xPC Target Scope block handles 'Numerical format' specifications that are longer than 20 characters in length.
To work around this issue, download the following patch. Here are the required steps:
1. Quit MATLAB
2. Download and execute the attached executable: xpcfix.exe
3. Specify the MATLAB root directory
(where $MATLAB is the MATLAB root directory on your machine, as returned by typing
matlabroot
at the MATLAB command prompt.)
and "Unzip" the files.
4. Restart MATLAB
5. Execute the following command at the MATLAB command prompt:
rehash toolboxcache
6. Create a new xPC Target boot disk and reboot target PC using the new boot disk. This is necessary in order to see the effects of the patch.