Reference to non-existent field 'xData'

I use a model called 'demonstration' on Simulink/dSpace made by someone else a few years ago (we use version R2009a). When I try to incremental build, this Model error appears: "Error building Real-Time Workshop target for block diagram 'demonstration'. MATLAB error message: Error due to multiple causes: --> Reference to non-existent field 'xData'. --> Error in 'demonstration/Wind speed': Initialization commands cannot be evaluated."
Subsequently I tried to click on the signal builder block 'Wind speed', but then the following error appears: "Error due to multiple causes: -->Reference to non-existent field 'xData'. -->Error evaluating 'OpenFcn' callback of Sigbuilder block block (mask) 'Wind speed'. Reference to non-existent field 'xData'."
Does anyone have a clue what's going wrong here? I thank you very much.
EDIT: this is the code of the block 'Wind speed':
Block {
BlockType SubSystem
Name "Wind speed"
Tag "STV Subsys"
Ports [0, 1]
Position [295, 275, 370, 315]
CopyFcn "sigbuilder_block('copy');"
DeleteFcn "sigbuilder_block('delete');"
LoadFcn "sigbuilder_block('load');"
ModelCloseFcn "sigbuilder_block('modelClose');"
PreSaveFcn "sigbuilder_block('preSave');"
StartFcn "sigbuilder_block('start');"
StopFcn "sigbuilder_block('stop');"
NameChangeFcn "sigbuilder_block('namechange');"
ClipboardFcn "sigbuilder_block('clipboard');"
OpenFcn "sigbuilder_block('open',[49.5 50.25 519.75 399.75 ]);"
CloseFcn "sigbuilder_block('close');"
MinAlgLoopOccurrences off
PropExecContextOutsideSubsystem off
RTWSystemCode "Auto"
FunctionWithSeparateData off
Opaque off
RequestExecContextInheritance off
MaskHideContents on
MaskType "Sigbuilder block"
MaskInitialization "if ~strcmp(get_param(bdroot(gcb),'SimulationStatus'),'stopped') tuvar = sigbuilder_bloc"
"k('maskInit'); end"
MaskDisplay "plot(0,0,100,100,[10,10,40,40,10],[80,20,20,80,80],[40,10],[50,50], [40,27,10],[65,72,56],[40"
",25,25,10],[28,28,43,43]);"
MaskIconFrame on
MaskIconOpaque off
MaskIconRotate "port"
MaskPortRotate "default"
MaskIconUnits "autoscale"
Port {
PortNumber 1
Name "Vvent"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
System {
Name "Wind speed"
Location [480, 93, 1016, 386]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
TiledPaperMargins [1.270000, 1.270000, 1.270000, 1.270000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
Block {
BlockType Demux
Name "Demux"
Tag "STV Demux"
Ports [1, 1]
Position [150, 15, 160, 35]
Outputs "1"
}
Block {
BlockType FromWorkspace
Name "FromWs"
Tag "STV FromWs"
Position [30, 300, 115, 350]
VariableName "tuvar"
SampleTime "0"
SigBuilderData "DataTag0"
VnvData "DataTag1"
}
Block {
BlockType Outport
Name "Signal 1"
Tag "STV Outport"
Position [250, 20, 270, 30]
IconDisplay "Port number"
}
Line {
SrcBlock "Demux"
SrcPort 1
DstBlock "Signal 1"
DstPort 1
}
Line {
SrcBlock "FromWs"
SrcPort 1
DstBlock "Demux"
DstPort 1
}
}
}

5 Comments

Somewhere inside the code for "demonstration", there is a variable which has fields: one of those fields "xData" does not exist when it is expected to exist. You need to debug the code.
Try setting a breakpoint where the error occurs. The line will probably contain a reference to an xData field like this:
someStructure.xData
You will need to look at previous lines of code to see where xData was supposed to be created. Try to determine why it was not created in your case.
Arthur Fieuws
Arthur Fieuws on 11 Feb 2016
Edited: Arthur Fieuws on 11 Feb 2016
Thank you for the fast reply. Probably a stupid question, but how can one see the code of a Simulink model? When I actually click on the error, it sends me to the model "the drawing" itself, not referring to any code.
Kirby Fears
Kirby Fears on 11 Feb 2016
Edited: Kirby Fears on 11 Feb 2016
I actually don't use Simulink, so I'm sorry if I this doesn't help:
You should be able to get the source code from whoever made the "demonstration" block. There's also supposed to be ways to see source code, such as this: http://www.mathworks.com/help/stateflow/ug/look-under-a-mask.html
Note that some built-in Simulink blocks (owned by MathWorks) have hidden source code that you can't see: http://www.mathworks.com/matlabcentral/answers/33679-the-source-code-of-the-library-componenta
XData is commonly a property of graphic objects, not a field. However, if the code did something like,
s = get(SomeHandle);
then if it tried to access s.XData when SomeHandle had no XData property then that would be an attempt to access a field rather than attempting to access a property.
We would need to dig into the code to really see.
@Kirby @Walter Hi, I think this is the code you mean? (this is the code for the problem causing block 'Wind speed') Strange enough there is no trace of 'xData'
Block {
BlockType SubSystem
Name "Wind speed"
Tag "STV Subsys"
Ports [0, 1]
Position [295, 275, 370, 315]
CopyFcn "sigbuilder_block('copy');"
DeleteFcn "sigbuilder_block('delete');"
LoadFcn "sigbuilder_block('load');"
ModelCloseFcn "sigbuilder_block('modelClose');"
PreSaveFcn "sigbuilder_block('preSave');"
StartFcn "sigbuilder_block('start');"
StopFcn "sigbuilder_block('stop');"
NameChangeFcn "sigbuilder_block('namechange');"
ClipboardFcn "sigbuilder_block('clipboard');"
OpenFcn "sigbuilder_block('open',[49.5 50.25 519.75 399.75 ]);"
CloseFcn "sigbuilder_block('close');"
MinAlgLoopOccurrences off
PropExecContextOutsideSubsystem off
RTWSystemCode "Auto"
FunctionWithSeparateData off
Opaque off
RequestExecContextInheritance off
MaskHideContents on
MaskType "Sigbuilder block"
MaskInitialization "if ~strcmp(get_param(bdroot(gcb),'SimulationStatus'),'stopped') tuvar = sigbuilder_bloc"
"k('maskInit'); end"
MaskDisplay "plot(0,0,100,100,[10,10,40,40,10],[80,20,20,80,80],[40,10],[50,50], [40,27,10],[65,72,56],[40"
",25,25,10],[28,28,43,43]);"
MaskIconFrame on
MaskIconOpaque off
MaskIconRotate "port"
MaskPortRotate "default"
MaskIconUnits "autoscale"
Port {
PortNumber 1
Name "Vvent"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
System {
Name "Wind speed"
Location [480, 93, 1016, 386]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
TiledPaperMargins [1.270000, 1.270000, 1.270000, 1.270000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
Block {
BlockType Demux
Name "Demux"
Tag "STV Demux"
Ports [1, 1]
Position [150, 15, 160, 35]
Outputs "1"
}
Block {
BlockType FromWorkspace
Name "FromWs"
Tag "STV FromWs"
Position [30, 300, 115, 350]
VariableName "tuvar"
SampleTime "0"
SigBuilderData "DataTag0"
VnvData "DataTag1"
}
Block {
BlockType Outport
Name "Signal 1"
Tag "STV Outport"
Position [250, 20, 270, 30]
IconDisplay "Port number"
}
Line {
SrcBlock "Demux"
SrcPort 1
DstBlock "Signal 1"
DstPort 1
}
Line {
SrcBlock "FromWs"
SrcPort 1
DstBlock "Demux"
DstPort 1
}
}
}

Sign in to comment.

Answers (1)

It is most likely due to compatibility issues between different versions of Simulink version. You might be using R2009a to open a model that is created by a Simulink version later than R2009a. SignalBuilder block is a masked block. It does contain some graphical element. If there is no other error, you can drag the SignalBuilder block from your Simulink library and try to duplicate the parameters. Otherwise, I would advise to find out the version difference and try to use a newer version if possible.

5 Comments

The model is created in the version R2009a so that can't be the problem. Where can I see the parameters, as you can see here http://imgur.com/sfPwf1Q I can't click on everything. I tried to use the R2015a version, but then there were problems with dSpace card.
Your error message is: Error evaluating 'OpenFcn' callback of Sigbuilder block block (mask) 'Wind speed'. Reference to non-existent field 'xData'.
If you right click the SignalBuilder block, click "Block Properties...", then click the "Callbacks" tab at the top, click the "OpenFcn*" at the left column below, you will see "sigbuilder_block('open',[437.6 199.2 550.4 400 ]);" in the right column. It is calling the "sigbuilder_block" function with the 'open' action. "sigbuilder_block" function is a .p file so there is no way to debug it. But I can tell you that 'xData' means the x-axle data of the customized signals that have been established in the SignalBuilder block. If the 'xData' can't be found, it is most likely that your "Wind speed" SignalBuilder block has been corrupted.
Arthur Fieuws
Arthur Fieuws on 18 Feb 2016
Edited: Arthur Fieuws on 18 Feb 2016
It actually says "sigbuilder_block('open',[49.5 50.25 519.75 399.75]);" What do those numbers mean? I can't find any reference in any document to 'xData'.
If I copy only the block 'Wind speed', in the R2009a version it generates the same errors, but in the R2015a none. However, the problem with R2015a is that the dSPACE blocks aren't compatible anymore and I have no idea how I could solve that.
I now copied -what I think is the "real"- code of the block 'Wind speed'
If you can open the SignalBuilder block in R2015a, just open it and see what type of signals are there. I assume "Wind speed" is just one signal. Then drag a new SignalBuilder block in R2009a and duplicate the signal. This would be the easiest way to resolve the issue. As last attempt, could yo check if you need a workspace variable called "tuvar"? It is specified in the model text you copied.
Thank you, I think that worked, although the code is slightly different.

Sign in to comment.

Categories

Products

Asked:

on 11 Feb 2016

Commented:

on 18 Feb 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!