Page 793 - ExtendSim User Guide
P. 793

Data Management and Exchange 767
Other internal data storage and management methods
Place a Data Source Create block (Value library) at any convenient loca- tion on the model worksheet.
Creating the global array
In the dialog of the Data Source Create block:
Choose Type: Global array.
In the “Create a new array” frame, click the Integer Array button, indicating that you want the values to be integer.
ReservoirGA model
In the three dialogs that appear, name the array My Array, give it 12 rows, and give it 2 columns. Click OK after each dialog entry.
Notice that Viewer for the selected array in the Data Source Create block now displays 12 rows and 2 columns. The table’s upper left cor- ner is light blue, indicating that it is a data source, and it has the initials “GA”, indicating that the data source is a global array.
Populating the array with data
Global arrays can be used as inputs to a model or to store model results.
• Acommonmethodofpopulatingan array with data for use in a model is to enter values or copy data directly into the Data Source Create block’s Viewer table when the array is cre- ated. You can also use the Data Import Export block (Value library) to import data to the array from a spreadsheet or external database, the web, or a text file.
Data Source Create after creating myArray
• Tostoremodelresults,itismostcommontouseaWriteblock(Valuelibrary)tosenddatato a global array.
☞ The Data Init block (Value library) can be used to initialize a global array table, column, row, or cell; it is described on page 781. The Data Specs block (Value library) gathers information about the global array and puts it into a report; it is discussed in page 782.
Exchanging data with a global array
ExtendSim provides the following methods for models to interact with global arrays:
1) Throughtheuserinterface,usingdynamiclinkingtoestablishlivelinksbetweendialog items and global arrays. See the examples “How to link a parameter to a global array” on page 739 or “How to link a data table to a global array” on page 741.
How To

   791   792   793   794   795