You can import your own C-code in 20-sim 4C, but the easiest way to get code running on a target is to generate it with 20-sim. 20-sim 4C will be opened automatically with the C-code loaded.
1.Open 20-sim and load your model.
2.Start the Simulator.
3.In the Simulator from the Tools menu select the Real Time Toolbox command and C-code Generation.
4.Select the 20-sim 4C Target and select the submodel to generate code from.
5.Click OK to generate the C-code.
20-sim 4C will automatically start and the generated C-code will be loaded.
The name 4C stands for Configure, Connect, Compile and Command and that is the correct working order to get code running on external targets. You can click the buttons at the top of the window in the button bar from left to right.
1.Configure: specify target specific settings.
2.Connect: connect model inputs and outputs with hardware inputs and outputs.
3.Compile: compile the model (C-code) for the target.
4.Command: run the compiled model and do e.g. measurements.
All the buttons and icons use color to reflect the state of the tasks. The following colors are used:
•Grey: The item is currently not available.
•Red: The item has failed an action. (See the output or process log at the bottom of the screen for details.)
•Orange: The item is out of date and needs user action.
•Green: The item is ok and needs no further attention.
Click the buttons at the top of the window, from left to right.