Sync Simulink -> SysML.

This section describes the process for syncing changes in Simulink back to the connected block in SysML.

  1. 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.



  2. Click Yes.



  3. Comparison Results tab should show that all elements are in sync.



  4. Open the System Simulink model in MATLAB/Simulink environment.



  5. Add the following to System Simulink model then save:
    1. Port out3 with type boolean – as a shortcut: copy/paste existing out2



    2. 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)



    3. Lines [pC.out2 – pD.in1] & [pD.out1 – out3]



  6. Delete the following from System Simulink model:
    1. Lines to and from pB
    2. Model Reference Block pB : PartB
    3. Inport in2



  7. Compare SysML & Target



  8. Sync Target -> SysML

  9. Compare again in the dashboard, and note that all changes were synced correctly.



  10. 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.



  11. 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.