SysML Blocks_Instances → Excel tables_rows.
The objective of this exercise is to generate a table in an Excel workbook from a collection of blocks in Rhapsody and then update that table when values change in the SysML model. The following exercise shows this process in reverse. We will use the collection of blocks in the Tutorial_2_08 package in the Rhapsody model supplied, Syndeia Tutorial Testbed. the figure below we see a component block with 12 specializations. We will use the parent component block to generate the table structure, using the value properties as column headers, and the specialized blocks to generate the table rows, with the default values as the column entries in each row.
- Launch the Syndeia dashboard from the Tutorial_2_08 package in the SysML model.
- Set up the repository link to the file folder holding the Excel file using the Repository Manager. In our example, this is named Syndeia Excel Files.
- In the Repository Manager tab, right-click on Local Files System Repository and select Add…
Give the repository link a descriptive name and browse to set the Root to the folder that will contain the Excel file.
- Create an empty Excel file in this folder (in our example, Excel_Testbed.xlsx). Close this file. Syndeia cannot write to an open Excel file.
- The Syndeia Dashboard Connection Manager should appear similar to the figure below.
- The first step is to create the table in Excel. Set the Connection Type to Model Transform, as shown. Drag the parent block, component, from SysML to the workbook, Excel_Testbed.
- When complete, the Connection Manager should show a new table, component, in a new worksheet, component, in the Excel file, Excel_Testbed.
- The Connection Summary shows the connection created between the SysML block and the Excel table. The connection number assigned may be different in your exercise.
Discussion: Tables are created in MS Excel using the Named Cell feature. If you open the Excel file, the worksheet component. The cells comprising B2:D3 have been identified with the name component and Syndeia recognizes them as a table. When initially created by Syndeia, the table will always start in cell B2.
When initially formed, the table has a header row and one empty row. Additional rows are added automatically by Syndeia as the table is filled with data, or they can be added to the named cells manually using the Excel Names Manager.
Alternatively, the table could have been created in an existing worksheet by dragging the block component onto, for example, Sheet1. Note that two tables created in the same worksheet in this fashion will overlap starting at B2, so it is safer to create each new table in its own worksheet.
Close the Excel file before proceeding. The next step is to create a row in the table in Excel. Set the Connection Type to Data Map. Drag the child block, Atmospheric Sensor, from SysML to the table component in Excel.
When complete, the Connection Manager will appear as shown.
- The table viewed Excel should appear. Be sure to close the Excel file again before proceeding.
Before completing the table, we will demonstrate how to compare and synchronize the parameter values between the SysML model and the Excel table. In Rhapsody, modify the initial value of the cost value property of the Atmospheric Sensor block, from 100 to 50. In the Connection Browser, right click on the connection from the Atmospheric Sensor block and select Compare SysML & Target.
To update the parameter value in Excel, right-click on the same connection and select Synch SysML to Target and confirm. When complete, the Comparison Summary will appear. The changed value of Atmospheric Sensor.Mass can also be observed directly using Excel.
The remaining SysML specialized blocks can be dragged over in one step by multiple-selecting the blocks on the left side of the Connection Manager tab and dragging them onto the component table on the right. When complete, the Connection Manager will appear.
Figure below shows the final table in Excel. The Defined Name reference to component now comprises B2:D14 to include all the table rows. Note the warnings on each value that numbers are being stored as text. This is normal for Rhapsody which stores all initial values as text.