simulink scope display blank

18 views (last 30 days)
Alex Beavan
Alex Beavan on 30 Dec 2016
Answered: Prashant Arora on 18 Jan 2017
When I run my Simulink model with the scope open the scope window goes mostly grey and I get the following error output.
No target definition was found. Assuming this will be compiled as a lib used as a referenced model No target definition was found Warning: Error occurred while executing callback: Error using uiservices.getContrastColor (line 8) Simulink model 'mean' was called with incorrect number of arguments
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) updateDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) renderDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) this.WindowMotionListener = addlistener(hFig, 'WindowMouseMotion', @this.windowMotionCallback);
this is on a 2016b installation on Windows 7 x64.
Thanks alex

Answers (5)

David Ding
David Ding on 3 Jan 2017
Hi Alex,
Without knowing your exact workflow, it is difficult to triage the issue. From the error message you are receiving, it appears that you have created some callback functions in your model that is not passed with the correct number of arguments. You can double check this and see if modifying the callbacks would resolve the issue. If not, if possible, you can share the model and the detailed workflow to reproduce the issue and I will be happy to take a look at it.
Thanks,
David

David Ding
David Ding on 4 Jan 2017
Hi Alex,
Thank you for sending me the model. I ran it on my machine using R2016b and it seemed to be working, as the scope is displaying a constant signal of value 1.
However, I did notice that there is a callback function in "PostLoadFcn" with code populated inside. As the error is complaining about contents in the callback, I suggest to try and remove the code inside that callback, such that the model does not contain any callback functions and see if that resolves the issue. To access callback functions, follow the steps below:
  1. Right click on any whitespace in the model
  2. Select "Model Properties"
  3. Click on the "Callbacks" tab
  4. Under the list of model callbacks, any function with an asterisk at the end contains code. Remove all pieces of code from all callback functions
  5. Click "apply". There should not be any asterisks on any of the callback functions. Then click "okay"
  6. Save the model. Then, run it.
Hope this helps!
David

Alex Beavan
Alex Beavan on 5 Jan 2017
I'm still having problems. Even with the callback deleted it still won't work.
Here is a new error log. Any ideas?:
Warning: MATLAB has disabled some advanced graphics rendering features by switching to software OpenGL. For more information, click here.
Error in uiservices.getContrastColor (line 8) if mean(color) > 128/255
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl>@(varargin)this.updateDynamicWidgetsControl(varargin{:}) (line 34) addlistener(h.visualizationPanel, 'SizeChanged', @this.updateDynamicWidgetsControl);
Error in slmsgviewer
Error in slmsgviewer/PersistentInstance
Error in slmsgviewer.processRecord
Error in uiservices.getContrastColor (line 8) if mean(color) > 128/255
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) updateDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) renderDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) this.WindowMotionListener = addlistener(hFig, 'WindowMouseMotion', @this.windowMotionCallback);
> In slmsgviewer In slmsgviewer/PersistentInstance In slmsgviewer.processRecord In uiservices.getContrastColor (line 8) In matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) In matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) In matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) In matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) Warning: Error occurred while executing callback: Trying to load file "C:\Users\Oxbotica\Documents\MATLAB\shell-microautobox\Implementation\Subsystems\mean.slx" while it is being loaded.
Error in uiservices.getContrastColor (line 8) if mean(color) > 128/255
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl>@(varargin)this.updateDynamicWidgetsControl(varargin{:}) (line 34) addlistener(h.visualizationPanel, 'SizeChanged', @this.updateDynamicWidgetsControl);
Error in slmsgviewer
Error in slmsgviewer/PersistentInstance
Error in slmsgviewer.processRecord
Error in uiservices.getContrastColor (line 8) if mean(color) > 128/255
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) updateDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) renderDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) this.WindowMotionListener = addlistener(hFig, 'WindowMouseMotion', @this.windowMotionCallback);
> In slmsgviewer In slmsgviewer/PersistentInstance In slmsgviewer.processRecord In uiservices.getContrastColor (line 8) In matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) In matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) In matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) In matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) Warning: Error occurred while executing callback: Trying to load file "C:\Users\Oxbotica\Documents\MATLAB\shell-microautobox\Implementation\Subsystems\mean.slx" while it is being loaded.
Error in uiservices.getContrastColor (line 8) if mean(color) > 128/255
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl>@(varargin)this.updateDynamicWidgetsControl(varargin{:}) (line 34) addlistener(h.visualizationPanel, 'SizeChanged', @this.updateDynamicWidgetsControl);
Error in slmsgviewer
Error in slmsgviewer/PersistentInstance
Error in slmsgviewer.processRecord
Error in uiservices.getContrastColor (line 8) if mean(color) > 128/255
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) updateDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) renderDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) this.WindowMotionListener = addlistener(hFig, 'WindowMouseMotion', @this.windowMotionCallback);
> In slmsgviewer In slmsgviewer/PersistentInstance In slmsgviewer.processRecord In uiservices.getContrastColor (line 8) In matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) In matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) In matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) In matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) Warning: Error occurred while executing callback: Trying to load file "C:\Users\Oxbotica\Documents\MATLAB\shell-microautobox\Implementation\Subsystems\mean.slx" while it is being loaded.
Error in uiservices.getContrastColor (line 8) if mean(color) > 128/255
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl>@(varargin)this.updateDynamicWidgetsControl(varargin{:}) (line 34) addlistener(h.visualizationPanel, 'SizeChanged', @this.updateDynamicWidgetsControl);
Error in slmsgviewer
Error in slmsgviewer/PersistentInstance
Error in slmsgviewer.processRecord
Error in uiservices.getContrastColor (line 8) if mean(color) > 128/255
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) updateDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) renderDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) this.WindowMotionListener = addlistener(hFig, 'WindowMouseMotion', @this.windowMotionCallback);
> In slmsgviewer In slmsgviewer/PersistentInstance In slmsgviewer.processRecord In uiservices.getContrastColor (line 8) In matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) In matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) In matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) In matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) Warning: Error occurred while executing callback: Trying to load file "C:\Users\Oxbotica\Documents\MATLAB\shell-microautobox\Implementation\Subsystems\mean.slx" while it is being loaded.
Error in uiservices.getContrastColor (line 8) if mean(color) > 128/255
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl>@(varargin)this.updateDynamicWidgetsControl(varargin{:}) (line 34) addlistener(h.visualizationPanel, 'SizeChanged', @this.updateDynamicWidgetsControl);
Error in slmsgviewer
Error in slmsgviewer/PersistentInstance
Error in slmsgviewer.processRecord
Error in uiservices.getContrastColor (line 8) if mean(color) > 128/255
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) updateDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) renderDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) this.WindowMotionListener = addlistener(hFig, 'WindowMouseMotion', @this.windowMotionCallback);
> In slmsgviewer In slmsgviewer/PersistentInstance In slmsgviewer.processRecord In uiservices.getContrastColor (line 8) In matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) In matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) In matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) In matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) Warning: Error occurred while executing callback: Trying to load file "C:\Users\Oxbotica\Documents\MATLAB\shell-microautobox\Implementation\Subsystems\mean.slx" while it is being loaded.
Error in uiservices.getContrastColor (line 8) if mean(color) > 128/255
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl>@(varargin)this.updateDynamicWidgetsControl(varargin{:}) (line 34) addlistener(h.visualizationPanel, 'SizeChanged', @this.updateDynamicWidgetsControl);
Error in slmsgviewer
Error in slmsgviewer/PersistentInstance
Error in slmsgviewer.processRecord
Error in uiservices.getContrastColor (line 8) if mean(color) > 128/255
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) updateDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) renderDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) this.WindowMotionListener = addlistener(hFig, 'WindowMouseMotion', @this.windowMotionCallback);
> In slmsgviewer In slmsgviewer/PersistentInstance In slmsgviewer.processRecord In uiservices.getContrastColor (line 8) In matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) In matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) In matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) In matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) Warning: Error occurred while executing callback: Trying to load file "C:\Users\Oxbotica\Documents\MATLAB\shell-microautobox\Implementation\Subsystems\mean.slx" while it is being loaded.
Error in uiservices.getContrastColor (line 8) if mean(color) > 128/255
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl>@(varargin)this.updateDynamicWidgetsControl(varargin{:}) (line 34) addlistener(h.visualizationPanel, 'SizeChanged', @this.updateDynamicWidgetsControl);
Error in slmsgviewer
Error in slmsgviewer/PersistentInstance
Error in slmsgviewer.processRecord
Error in uiservices.getContrastColor (line 8) if mean(color) > 128/255
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) updateDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) renderDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) this.WindowMotionListener = addlistener(hFig, 'WindowMouseMotion', @this.windowMotionCallback);
> In slmsgviewer In slmsgviewer/PersistentInstance In slmsgviewer.processRecord In uiservices.getContrastColor (line 8) In matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) In matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) In matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) In matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) Warning: Error occurred while executing callback: Trying to load file "C:\Users\Oxbotica\Documents\MATLAB\shell-microautobox\Implementation\Subsystems\mean.slx" while it is being loaded.
Error in uiservices.getContrastColor (line 8) if mean(color) > 128/255
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl>@(varargin)this.updateDynamicWidgetsControl(varargin{:}) (line 34) addlistener(h.visualizationPanel, 'SizeChanged', @this.updateDynamicWidgetsControl);
Error in slmsgviewer
Error in slmsgviewer/PersistentInstance
Error in slmsgviewer.processRecord
Error in uiservices.getContrastColor (line 8) if mean(color) > 128/255
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) updateDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) renderDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) this.WindowMotionListener = addlistener(hFig, 'WindowMouseMotion', @this.windowMotionCallback);
> In slmsgviewer In slmsgviewer/PersistentInstance In slmsgviewer.processRecord In uiservices.getContrastColor (line 8) In matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) In matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) In matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) In matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) Warning: Error occurred while executing callback: Error using uiservices.getContrastColor (line 8) Simulink model 'mean' was called with incorrect number of arguments
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl (line 37) updateDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope/windowMotionCallback (line 8) renderDynamicWidgetsControl(this);
Error in matlabshared.scopes.UnifiedScope>@(varargin)this.windowMotionCallback(varargin{:}) (line 277) this.WindowMotionListener = addlistener(hFig, 'WindowMouseMotion', @this.windowMotionCallback);
Warning: Error occurred while executing callback: Error using uiservices.getContrastColor (line 8) Simulink model 'mean' was called with incorrect number of arguments
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl>@(varargin)this.updateDynamicWidgetsControl(varargin{:}) (line 34) addlistener(h.visualizationPanel, 'SizeChanged', @this.updateDynamicWidgetsControl);
Warning: Error occurred while executing callback: Error using uiservices.getContrastColor (line 8) Simulink model 'mean' was called with incorrect number of arguments
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl>@(varargin)this.updateDynamicWidgetsControl(varargin{:}) (line 34) addlistener(h.visualizationPanel, 'SizeChanged', @this.updateDynamicWidgetsControl);
Warning: Error occurred while executing callback: Error using uiservices.getContrastColor (line 8) Simulink model 'mean' was called with incorrect number of arguments
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl>@(varargin)this.updateDynamicWidgetsControl(varargin{:}) (line 34) addlistener(h.visualizationPanel, 'SizeChanged', @this.updateDynamicWidgetsControl);
Warning: Error occurred while executing callback: Error using uiservices.getContrastColor (line 8) Simulink model 'mean' was called with incorrect number of arguments
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl>@(varargin)this.updateDynamicWidgetsControl(varargin{:}) (line 34) addlistener(h.visualizationPanel, 'SizeChanged', @this.updateDynamicWidgetsControl);
Warning: Error occurred while executing callback: Error using uiservices.getContrastColor (line 8) Simulink model 'mean' was called with incorrect number of arguments
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl>@(varargin)this.updateDynamicWidgetsControl(varargin{:}) (line 34) addlistener(h.visualizationPanel, 'SizeChanged', @this.updateDynamicWidgetsControl);
Warning: Error occurred while executing callback: Error using uiservices.getContrastColor (line 8) Simulink model 'mean' was called with incorrect number of arguments
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl>@(varargin)this.updateDynamicWidgetsControl(varargin{:}) (line 34) addlistener(h.visualizationPanel, 'SizeChanged', @this.updateDynamicWidgetsControl);
Warning: Error occurred while executing callback: Error using uiservices.getContrastColor (line 8) Simulink model 'mean' was called with incorrect number of arguments
Error in matlabshared.scopes.UnifiedScope/updateDynamicWidgetsControl (line 43) fg = uiservices.getContrastColor(bg);
Error in matlabshared.scopes.UnifiedScope/renderDynamicWidgetsControl>@(varargin)this.updateDynamicWidgetsControl(varargin{:}) (line 34) addlistener(h.visualizationPanel, 'SizeChanged', @this.updateDynamicWidgetsControl);

David Ding
David Ding on 5 Jan 2017
Hi Alex,
From your latest information, it appears that the main issue lies in your graphics card. It seems that the hardware configuration you have does not provide the necessary graphical support for displaying the scope. You may try restarting MATLAB in openGL software mode by typing
>> opengl software
Upon starting a new MATLAB session (Windows machine only). If this is not possible or if you continue to see the error, you need to contact your graphics card maker for further assistance.
One way to determine the graphics card information on your machine is to type the following command in MATLAB:
>> opengl info
Thanks,
David

Prashant Arora
Prashant Arora on 18 Jan 2017
It seems like your model named "mean" is shadowing the MATLAB function "mean". Rename the model to see if the error is resolved.

Tags

Community Treasure Hunt

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

Start Hunting!