Comments on: New Blocks in Simulink R2010a https://blogs.mathworks.com/simulink/2010/03/15/new-blocks-in-simulink-r2010a/?s_tid=feedtopost Guy Rouleau is an Application Engineer for MathWorks. He writes here about Simulink and other MathWorks tools used in Model-Based Design. Fri, 30 Dec 2016 19:48:53 +0000 hourly 1 https://wordpress.org/?v=6.2.2 By: Seth https://blogs.mathworks.com/simulink/2010/03/15/new-blocks-in-simulink-r2010a/#comment-5070 Thu, 03 Jan 2013 13:38:23 +0000 https://blogs.mathworks.com/seth/2010/03/15/new-blocks-in-simulink-r2010a/#comment-5070 @MikeT – Thanks for providing the direct link…

@John Dzielski – Happy New Year! I checked into the support case you mentioned, and it looks like we got back to you yesterday. We had a 4 day weekend at MathWorks, so our support team was off. Thanks for your patience and understanding!

]]>
By: MikeT https://blogs.mathworks.com/simulink/2010/03/15/new-blocks-in-simulink-r2010a/#comment-4942 Thu, 03 Jan 2013 02:42:33 +0000 https://blogs.mathworks.com/seth/2010/03/15/new-blocks-in-simulink-r2010a/#comment-4942 Hi John,

Try this link to the doc on structure parameters,

https://www.mathworks.com/help/simulink/ug/using-structure-parameters.html

Mike

]]>
By: John Dzielski https://blogs.mathworks.com/simulink/2010/03/15/new-blocks-in-simulink-r2010a/#comment-4090 Sun, 30 Dec 2012 16:03:10 +0000 https://blogs.mathworks.com/seth/2010/03/15/new-blocks-in-simulink-r2010a/#comment-4090 I am trying to figure out how to pass a structure as an argument to a model reference block. This post suggests that it’s possible starting with r2010a. The links to the release notes and what seems to be an example in this post are broken. I called tech. support, but after several days haven’t gotten the answer. Can you point me to something that show me how to do this? I am working with r2010a.

]]>
By: Mike Tocci https://blogs.mathworks.com/simulink/2010/03/15/new-blocks-in-simulink-r2010a/#comment-1074 Tue, 04 May 2010 23:42:49 +0000 https://blogs.mathworks.com/seth/2010/03/15/new-blocks-in-simulink-r2010a/#comment-1074 The documentation for Model variants limitations is not correct, there is no restriction on continuous states. This restriction only applies to one specific part of the Model variants feature, using preprocessor conditions in RTW code.

]]>
By: Mike Tocci https://blogs.mathworks.com/simulink/2010/03/15/new-blocks-in-simulink-r2010a/#comment-1067 Tue, 27 Apr 2010 01:06:46 +0000 https://blogs.mathworks.com/seth/2010/03/15/new-blocks-in-simulink-r2010a/#comment-1067 Hi Paul,

Thanks for pointing out these issues, here’s some more info:

1. I agree the doc section on Model Arguments needs to be updated to reflect the support for structures. I’ll see if this can be updated for 10b.

2. Your experiment is correct, you do not need a Simulink.Parameter to wrap a structure parameter.

3. Arrays of structures are not allowed in 10a. Structure parameters can be thought of as an analogue of bus signals, and arrays of buses are not currently allowed in Simulink.

4. I think the documentation for Model variants limitations may be incorrect, continuous states are allowed in variant models. They are only not allowed when using the preprocessor conditionals option when generating Real-Time Workshop code. I will double check this and let you know.

Mike

]]>
By: Paul J. https://blogs.mathworks.com/simulink/2010/03/15/new-blocks-in-simulink-r2010a/#comment-1066 Mon, 26 Apr 2010 22:02:03 +0000 https://blogs.mathworks.com/seth/2010/03/15/new-blocks-in-simulink-r2010a/#comment-1066 After some experimentation, it appears that I don’t have to use Simulink.Parameter objects, but it also seems that a model reference argument that is a structure is not allowed to contain a field that is itself a structure array. Is that a constraint on structure parameters in general?

Also, in looking through the documentation I came across the concept of Model Reference Variant. This seemed promising until I saw that a variant Model block can’t contain continuous states. Why is this constraint necessary when it’s not applicable to a non-variant Model block?

]]>
By: Paul J. https://blogs.mathworks.com/simulink/2010/03/15/new-blocks-in-simulink-r2010a/#comment-1062 Thu, 22 Apr 2010 02:46:47 +0000 https://blogs.mathworks.com/seth/2010/03/15/new-blocks-in-simulink-r2010a/#comment-1062 Mike,

I’ve started to explore using structures as model reference arguments in 2010a and I’m running into some problems, even though it seems like the process should be very straightforward. The documentation is not very helpful in this area, IMHO.

So let me ask very basic questions:

1. Can a structure used as a model argument be a naked Matlab structure variable (just like one can used a scalar Matlab variable) or does it have to be encapsulated in the Value field of a Simulink.Parameter object?

2. Does the answer to 1 depend on the contents of the structure argument, such as whether or not the structure argument contains a field that is itself a structure or structure array?

3. For that matter, can a structure array be used as a parameter (the doc is silent on this question as far as I can tell)? Can a model argument be a structure array or have a field that is a structure array?

Thanks,
Paul

]]>
By: lorri https://blogs.mathworks.com/simulink/2010/03/15/new-blocks-in-simulink-r2010a/#comment-1036 Tue, 30 Mar 2010 01:44:16 +0000 https://blogs.mathworks.com/seth/2010/03/15/new-blocks-in-simulink-r2010a/#comment-1036 how did they create the square root block, especially using simulink??

]]>
By: Mike Tocci https://blogs.mathworks.com/simulink/2010/03/15/new-blocks-in-simulink-r2010a/#comment-1035 Sat, 27 Mar 2010 01:37:45 +0000 https://blogs.mathworks.com/seth/2010/03/15/new-blocks-in-simulink-r2010a/#comment-1035 Hi Paul,

1. The key addition is tunability, which in turn allows structure parameters to be model arguments. You’re right that you could do all you say in R2009a, but you couldn’t mark these variables as tunable, which particularly affects Real-Time Workshop code. I noticed that the release note I pointed you to is misleading about this, it should say that tunability is the new feature, I’ll check if this should be updated.

2. The easiest way to add struct variables to the model workspace is to create them in the base workspace and copy them over to the model workspace using the Model Explorer.

Mike

]]>
By: Paul J. https://blogs.mathworks.com/simulink/2010/03/15/new-blocks-in-simulink-r2010a/#comment-1033 Fri, 26 Mar 2010 17:18:27 +0000 https://blogs.mathworks.com/seth/2010/03/15/new-blocks-in-simulink-r2010a/#comment-1033 Mike,

With respect to structure parameters I’m confused as to what’s actually new. I’m still back on 2009a, and in this version (and previous ones too) I’ve been able to put numerical data into a struct and then dereference the fields in block parameter expressions. I could also send the entire struct into a masked subsystem dialog and then dereference it inside the subsystem blocks as needed. Have I been using an undocumented feature all this time?

Paul

]]>