Page 780 - ExtendSim User Guide
P. 780

754
Data Management and Exchange
ExtendSim databases for internal data storage
3) IntheLinkdialog,selectLinkTo:Database Table.
4) Chooseadatabasefromthepopupmenuof available databases.
5) SelectatablefromthelistofTableNames.
6) Forparametersonly,chooseafieldfromthe Field Name popup, then enter a number in the Record # field. Or, select the field and record by clicking on a cell in the table viewer at the bot- tom of the Link dialog.
☞ The table viewer displays the contents of the data- base table you are linking to. It is also useful for selecting the database field and record for a parame- ter.
Dynamic linking should be used judiciously. Avoid
overloading models with dynamic links to data
sources that get frequently updated; it could slow
simulation performance as messages are sent to linked blocks every time their linked data source is modified.
Read and Write blocks for accessing a database
Instead of dynamically linking a dialog’s parameter or data table to a database cell or table, the Read and Write blocks (Value library) and Read(I) and Write(I) blocks (Item library) can access a database cell, row, or column for use in a model. These data access blocks are useful when you don’t want to, can’t, or shouldn’t dynamically link a dialog item. The advantages of using these blocks rather than dynamic linking is:
• Usingdataaccessblocksgivesmorecontroloverwhichdatabasevaluesgetused,andwhere and when they are used.
• Database usage is clarified visually. For example, instead of a blue outline around a parame- ter field inside a block’s dialog, it is more obvious when the database value is coming from a Read block.
• Dynamiclinkingisfixedpoint-to-point.Whileyoucanchangethevalueatthedatasource, you can’t dynamically control which database or table is accessed during a simulation run or in a series of runs.
• In some blocks there is no dialog parameter or data table you can directly link to,
• It is easier to perform mathematical calculations on the database values.
• The data can be more easily accessed at several places in the model.
• It is more convenient for hierarchical blocks, allowing access to a different record for each instance of the hierarchical block in a model.
The Monte Carlo model, located at \Examples\Continuous\Standard Block Models and described on page 49 is an example of using Read and Write blocks to exchange data with an ExtendSim database. For more information about these blocks, see “Read and Write blocks” on page 773.
Link dialog for Database Table
How To


































































































   778   779   780   781   782