The documentation explaining how to connect bus signals to the S-Function Builder block has been omitted in Simulink 7.3 (R2009a). A link to download an updated version of the documentation section titled "Writing S-Function in C" is provided below.
To connect a bus signal to the Input or Output port of the S-Function Builder follow these steps:
1. Create a bus object in the MATLAB workspace. This can be done from interactively using the Simulink Bus Editor, or from the command line by typing:
More information about bus objects can be found at this link:
2. In the S-Function block, go to the "Data Properties" tab and add an Input port.
3. You will notice that the input port has two properties related to bus signals, "Bus" and "Bus Name". Set the "Bus" property to "on" and the "Bus Name" to the bus object created in the MATLAB workspace.
4. You can repeat the same operations for other input and output ports.
It is now possible to access the bus elements in the Outputs, Continuous Derivatives and Discrete Update section of the S-Function Builder.
An example model using bus signals with the S-Function Builder can be reached in MATLAB 7.7 (R2009a) by executing this command: