<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Bus Signals in the Generated Code</title>
	<link>http://blogs.mathworks.com/seth/2008/05/07/bus-signals-in-the-generated-code/</link>
	<description>This blog is about Simulink.</description>
	<pubDate>Mon, 08 Sep 2008 06:34:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Seth</title>
		<link>http://blogs.mathworks.com/seth/2008/05/07/bus-signals-in-the-generated-code/#comment-219</link>
		<dc:creator>Seth</dc:creator>
		<pubDate>Thu, 15 May 2008 16:04:54 +0000</pubDate>
		<guid>http://blogs.mathworks.com/seth/2008/05/07/bus-signals-in-the-generated-code/#comment-219</guid>
		<description>@Bob - I chose to specify the name because I wanted to shorten things up for the blog post.  When I used the Auto or Subsystem Name option I got this:

&lt;code&gt;
   19   /* Output and update for atomic system: '&#60;Root&#62;/ReusableFcn' */
   20   void simplebusdemo_nv_ReusableFcn(const main_bus *rtu_0,
   21     rtB_ReusableFcn_simplebusdemo_n *localB)
   22   {
&lt;/code&gt;

I was just trying to avoid the line wrap.

Regarding parameterization using bus signals, this is a limitation of the current behavior of bus signals.  Currently, bus signals can not inherit the Inf sample time, so they end up in the step function even if the inputs are constant.  It should be possible to use a custom storage class to control the generation of the code for the bus and put the code into the initialization section.</description>
		<content:encoded><![CDATA[<p>@Bob - I chose to specify the name because I wanted to shorten things up for the blog post.  When I used the Auto or Subsystem Name option I got this:</p>
<p><code><br />
   19   /* Output and update for atomic system: &#8216;&lt;Root&gt;/ReusableFcn&#8217; */<br />
   20   void simplebusdemo_nv_ReusableFcn(const main_bus *rtu_0,<br />
   21     rtB_ReusableFcn_simplebusdemo_n *localB)<br />
   22   {<br />
</code></p>
<p>I was just trying to avoid the line wrap.</p>
<p>Regarding parameterization using bus signals, this is a limitation of the current behavior of bus signals.  Currently, bus signals can not inherit the Inf sample time, so they end up in the step function even if the inputs are constant.  It should be possible to use a custom storage class to control the generation of the code for the bus and put the code into the initialization section.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob</title>
		<link>http://blogs.mathworks.com/seth/2008/05/07/bus-signals-in-the-generated-code/#comment-213</link>
		<dc:creator>Bob</dc:creator>
		<pubDate>Thu, 08 May 2008 13:00:38 +0000</pubDate>
		<guid>http://blogs.mathworks.com/seth/2008/05/07/bus-signals-in-the-generated-code/#comment-213</guid>
		<description>Occasionally we've used busses to parameterize a model.  To cut down on function interface overhead, the non-virtual bus makes sense.  But if you use a set of Constant blocks to feed a Bus Creator outputting a non-virtual bus, the generated code looks like:
rtb_bus.bus1.Parameter1 = 7;
rtb_bus.bus1.Parameter2 = FRED;
rtb_bus.bus2.Parameter3 = 8;
instead of:
rtb_bus = { {7, FRED}, {8} };
And this usually appears in the step, not the initialize.

Is there a way to get the preferred output?</description>
		<content:encoded><![CDATA[<p>Occasionally we&#8217;ve used busses to parameterize a model.  To cut down on function interface overhead, the non-virtual bus makes sense.  But if you use a set of Constant blocks to feed a Bus Creator outputting a non-virtual bus, the generated code looks like:<br />
rtb_bus.bus1.Parameter1 = 7;<br />
rtb_bus.bus1.Parameter2 = FRED;<br />
rtb_bus.bus2.Parameter3 = 8;<br />
instead of:<br />
rtb_bus = { {7, FRED}, {8} };<br />
And this usually appears in the step, not the initialize.</p>
<p>Is there a way to get the preferred output?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob</title>
		<link>http://blogs.mathworks.com/seth/2008/05/07/bus-signals-in-the-generated-code/#comment-212</link>
		<dc:creator>Bob</dc:creator>
		<pubDate>Thu, 08 May 2008 12:56:13 +0000</pubDate>
		<guid>http://blogs.mathworks.com/seth/2008/05/07/bus-signals-in-the-generated-code/#comment-212</guid>
		<description>Any particular reason you chose to specify the name of the atomic subsystem?  I try to avoid that in case I've used the block twice with different I/O data types, and usually find the name in the generated code comes close enough to the subsystem name to make traceability possible.</description>
		<content:encoded><![CDATA[<p>Any particular reason you chose to specify the name of the atomic subsystem?  I try to avoid that in case I&#8217;ve used the block twice with different I/O data types, and usually find the name in the generated code comes close enough to the subsystem name to make traceability possible.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
