Page 763 - ExtendSim User Guide
P. 763

Data Management and Exchange 737
User interfaces for data exchange
reading and writing are the Read and Write blocks in the Value library and the Read(I) and Write(I) blocks in the Item library. The Read and Write blocks read data from or write data to ExtendSim databases, global arrays, Excel workbooks, and text files. The Read(I) and Write(I) blocks read data from or write data to ExtendSim databases.
The Query Equation and Query Equation(I) can use an equation to search an ExtendSim data- base table for the highest ranking record available during the run.
These blocks are powerful tools for reading data from internal and external sources and writing data into internal or external data destinations.
• Incontrasttotheimporting/exportingdescribedabove,theReadandWriteblocksareusu- ally used to exchange data piece-by-piece as required during the run, rather than by one exchange of the entire data set. Even though it may slow simulation speed, models may need to write and read data while a model is running if the data that is written is in turn read and used in another part of the model.
• TheReadandWriteblockscancreateaone-waylivelinkbetweenthetargetandthesource. If you write to a location in an ExtendSim database or global array, ExtendSim will send update messages to all the Read blocks in the model linked to that location. When the Read block receives the alert message, it will act on the fact that the data value changed, making the link 'live'. Writing to a cell in an Excel spreadsheet, or to a text file, will not have the same effect.
A potential disadvantage of using the Read and Write blocks is that reading and writing the data each time the block is calculated can have an impact on simulation speed. If the data to be read or written will not change over the course of the simulation, you should import/export the data as a local copy in the block before or after the run. If the data is not going to change at all, consider using another method, like a one-time copy/paste or import/export.
For more information, see “Read and Write blocks” on page 773 and “Query Equation and Query Equation(I) blocks” on page 775.
Dynamic linking to internal data structures
ExtendSim supports a comprehensive proprietary internal data linking method called dynamic data linking (DDL). This application-level protocol tracks which dialog items (parameters and data tables) are linked to which internal data structures. The internal structures that dialog items can be dynamically linked to are:
• ExtendSimdatabasetables • Global arrays
• Dynamic arrays
The DDL technology has a user interface so you can easily link data tables and parameters in any part of a model to ExtendSim database tables or global arrays. Dynamic arrays can only be linked to dialog items through ModL code.
☞ Dynamic data links are live and bidirectional, so the value of a linked dialog item can change immediately when the value of the data source changes, and vice versa.
You can use menu commands to dynamically link a dialog parameter or data table to an ExtendSim database or global array. The clone of a parameter or data table can also be dynam- ically linked. Linking a clone has the same effect as linking the original dialog item - both the original and the clone will be linked to the data structure.
How To


































































































   761   762   763   764   765