MATLAB: Use “Fixed step” in a block diagram, which contains continuous states

fixed-stepvariable step

I am working with MATLAB 2015a and Simulink 8.5. Furthermore I use the construction stones from B&R ("B&R Automation Studio Target for Simulink 4.5"). For them I need the "FixedStepDiscrete".
Since I am working with a block diagram, which contains continuous states (SimMechanics 2nd generation), I get the following error if I try to build my model: "The "FixedStepDiscrete" solver cannot be used to simulate block diagram —- because it contains continuous states". On the other hand If I change the Model Configuration Parameters from the type "Fixed-step" to "Variable-step" I get this message: "The specified code generator target for model —- cannot be used with a variable-step solver. You must either configure the solver options for a fixed-step solver with an appropriate integration algorithm, or select a target that supports a variable-step solver, such as rsim.tlc. Click Open to launch the configuration dialog. Modify either the solver options on the Solver page or the system target file on the Code Generation page."
Unfortunately I need both – the B&R construction stones as well as the blocks which contains continuous states. If anyone has a solution or a suggestion for this problem please let me know.
I would be thankful for any help I can get!

Best Answer

You can go to the "Solver Configuration" block connected to the SimMechanics model and enable the "Use local solver" option. This will discretize your SimMechanics network at the sample time specified in that block.
That should do the trick, though finding a good sample time/other solver settings may be tricky if you want the results to match the continuous simulation.
- Sebastian