Thread Subject: Activate/deactivate, enable/disable Simulink Blocks

Subject: Activate/deactivate, enable/disable Simulink Blocks

From: James Pau

Date: 4 Nov, 2009 21:50:19

Message: 1 of 3

Hi there, I have tried looking online but there doesn't seem to be a solution or workaround for this that is readily available. What I want to do is disable or deactivate a simulink block that is causing an error when trying to run a simulation. This is because i have a model that can either take an input from a file or from an external device that is connected to the PC. Which input is determined by a manual switch block. When the device is not connected it's corresponding input block brings up an error that says the device is not connected and the model does not run - even if I am trying to read from a file and do not need the external device to be connected. Is there a way for me to suppress this error? I want to maintain all of this in a single model and the only workaround i can see is to duplicate it and have one with input from file and the other with input from external device.

Thanks for your help!
James

Subject: Activate/deactivate, enable/disable Simulink Blocks

From: Praetorian

Date: 4 Nov, 2009 22:36:01

Message: 2 of 3

On Nov 4, 2:50 pm, "James Pau" <the_manti...@hotmail.com> wrote:
> Hi there, I have tried looking online but there doesn't seem to be a solution or workaround for this that is readily available. What I want to do is disable or deactivate a simulink block that is causing an error when trying to run a simulation. This is because i have a model that can either take an input from a file or from an external device that is connected to the PC. Which input is determined by a manual switch block. When the device is not connected it's corresponding input block brings up an error that says the device is not connected and the model does not run - even if I am trying to read from a file and do not need the external device to be connected. Is there a way for me to suppress this error?  I want to maintain all of this in a single model and the only workaround i can see is to duplicate it and have one with input from file and the other with input from external device.
>
> Thanks for your help!
> James

Take a look at the help documentation for "Configurable
Subsystem" (under the Simlink -> Ports & Subsystems library). You
should be able to create a masked block on which you select which
version of your block you want to use (reading from file or from the
device) and the configurable subsystem will select the appropriate
subsystem that contains your choice. I realize that my explanation
sucks, but read the help and examples for that block and it'll make
more sense.

HTH,
Ashish.

Subject: Activate/deactivate, enable/disable Simulink Blocks

From: James Pau

Date: 5 Nov, 2009 21:16:02

Message: 3 of 3

Praetorian <ashish.sadanandan@gmail.com> wrote in message <f55ae5e6-b0b3-4d9c-bda6-981bfd06b2ea@g31g2000vbr.googlegroups.com>...
> On Nov 4, 2:50 pm, "James Pau" <the_manti...@hotmail.com> wrote:
> > Hi there, I have tried looking online but there doesn't seem to be a solution or workaround for this that is readily available. What I want to do is disable or deactivate a simulink block that is causing an error when trying to run a simulation. This is because i have a model that can either take an input from a file or from an external device that is connected to the PC. Which input is determined by a manual switch block. When the device is not connected it's corresponding input block brings up an error that says the device is not connected and the model does not run - even if I am trying to read from a file and do not need the external device to be connected. Is there a way for me to suppress this error? I want to maintain all of this in a single model and the only workaround i can see is to duplicate it and have one with input from file and the other with input from external
device.
> >
> > Thanks for your help!
> > James
>
> Take a look at the help documentation for "Configurable
> Subsystem" (under the Simlink -> Ports & Subsystems library). You
> should be able to create a masked block on which you select which
> version of your block you want to use (reading from file or from the
> device) and the configurable subsystem will select the appropriate
> subsystem that contains your choice. I realize that my explanation
> sucks, but read the help and examples for that block and it'll make
> more sense.
>
> HTH,
> Ashish.

Hi Ashish,

I get you. Your explanation was fine and I managed to get it working. Thanks heaps!

James

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
simulink James Pau 4 Nov, 2009 16:54:04
blocks James Pau 4 Nov, 2009 16:54:04
hide James Pau 4 Nov, 2009 16:54:04
deactivate James Pau 4 Nov, 2009 16:54:04
disable James Pau 4 Nov, 2009 16:54:04
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com