MATLAB: How to reference a value from a bus within a Stateflow chart? (coder error in Stateflow)

busbus componentcoder errorerrorstateflowStateflow Coder

I've created a test Stateflow chart (with an embedded PID controller in the chart). Within my model, I have defined a bus type SIGNALBUS to bus together some inputs to the PID controller chart. I also created the bus SIGNALBUS in the base workspace with matching inputs.
Within the chart, I reference a component/value within the bus with the syntax "busname.busfield". When I run the model, however, I get the error "Referencing a component from array of non-scalar values is not supported for code generation." See attachment for model. The attached file SIGNALBUS must be loaded to the bus editor before running the model.
Snapshot of chart and error:
If I look at the "sfbus_demo" example, though, it uses that same syntax that I've used. See below link for description of sfbus_demo:
Any thoughts on what I'm doing wrong? Thanks for the help.

Best Answer

I got help from MATLAB technical support. I was defining the variable TestInput to be of size 4. The size is for the structure, and should have been 1. With a size of 4, MATLAB was expecting an array of structures.