Page 767 - ExtendSim User Guide
P. 767

Data Management and Exchange 741
User interfaces for data exchange
at field 1, record 1 (the top, leftmost cell) or the global array cell at row 0, column 0 (also the top leftmost cell). For detailed information, see “Indexing and organization” on page 782.
How to dynamically link a data table to a database table
The following example uses the ReservoirDBLink model from the previous section that showed how to dynamically link a parameter to a database. This example shows how to link a data table to a database table. (So you can concentrate on learning how to do this, the model already has a database table with the necessary data. For information on creating a database, see “How to create an ExtendSim database” on page 748.)
In the ReservoirDBLink model you created on page 740, open the Lookup Table block’s dialog.
Open the Link dialog either by clicking the Link button in the lower left corner of the data table or by selecting the data table and giving the command Edit > Create/Edit Dynamic Link.
In the Link dialog (shown at right):
Select Link to: Database Table.
In the popup menu that appears choose Database name: Example Database.
Select the table named Example Data 2 from the list of tables.
Notice that the data for the selected table is displayed in the viewer pane at the bottom of the Link dialog. This is the information that will populate the Lookup Table block’s data table.
Click the Link button to close the Link dia- log and establish the link.
Save the model.
In the Lookup Table dialog notice that the
upper left corner of the data table now displays
the initials “DB”, indicating that the data table
is linked to a database table. Mousing over that
corner displays information about which database and table it is linked to.
When the simulation is run, the model will get rainfall data from a live link with a database.
☞ Since this is a two-way live link, changing the value of one or more cells in the block’s data table will change the values in the database table. To disable that behavior, select the Read Only Link checkbox in the Link dialog when you create the link.
How to link a data table to a global array
The example that follows uses the ReservoirGALink model from the earlier section that showed how to dynamically link a parameter to a global array. This example shows how to link a data table to a global array. (So you can focus on learning how to do this, the model already has a global array with the necessary data. For information on creating a global array, see “How to create and use a global array” on page 766.)
In the ReservoirGALink model, open the Lookup Table block’s dialog.
Link dialog for Database Table
How To


































































































   765   766   767   768   769