Sync Simulink -> SysML.
This section describes the process for syncing changes in Simulink back to the connected block in SysML.
- Open Syndeia Simulink Examples model with connections saved after following steps in tutorial Generating Simulink model from SysML block and launch Syndeia from Model Generation::Basic Models::Blocks package, then navigate to the Connection Browser tab and expand the System block to see the connection and right-click > Compare SysML & Target.
- Click Yes.
- Comparison Results tab should show that all elements are in sync.
- Open the System Simulink model in MATLAB/Simulink environment.
- Add the following to System Simulink model then save:
- Port out3 with type boolean – as a shortcut: copy/paste existing out2
- Model Reference Block pD : PartD – Copy/Paste Simulink model PartC in the folder, rename to PartD, open, and delete all elements except for in1 and out2. Then in Simulink model, copy/paste pC, change name to pD, open its Parameters window and change Model name to PartD)
- Lines [pC.out2 – pD.in1] & [pD.out1 – out3]
- Port out3 with type boolean – as a shortcut: copy/paste existing out2
- Delete the following from System Simulink model:
- Lines to and from pB
- Model Reference Block pB : PartB
- Inport in2
- Compare SysML & Target
- Sync Target -> SysML
- Compare again in the dashboard, and note that all changes were synced correctly.
- To view the new part property and connectors on the diagram, simply drag the new part property pD onto it and the connectors will display automatically as shown below.
- If you have changes made in a multi-level block structure, you should sync leaf-level blocks BEFORE syncing parent models (except in the case of a new child being added that is not yet connected as shown with pD : PartD above). For instance, if you add and/or delete ports on PartC block, which is used as part property pC in System, you should compare and sync PartC to resolve changes, then compare and sync the parent block, System.