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 [pA.out1 – 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. Current workaround needed: Display related elements on the new IBD by right-clicking the diagram and selecting Related Elements > Display Ports, expand pD : PartD, check the boxes for in1 : Real and out2 : ~Boolean, and click OK.



  10. At this point, later versions of MagicDraw may show an incorrect validation error for the new delegation connector between pD.out2 and out3 as shown below. To clear this, close the dashboard, save the model, close it, and reopen:



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



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