Double-click the Data Exchanger component icon . The Data Exchanger Component Editor appears.
From the Data Exchanger Component Editor, click the large button
in the center of the editor to begin defining a data source.
The Exchanger Wizard appears with the Select
File screen displayed.
Click Read a File.
-
In the Sample file to use when designing Data Exchange
text box, enter the name of the file that has a sample of the type of
data to read when the model runs. You can also click Browse
to locate the file.
-
In the File to Read at Runtime list, enter the
name of the file to read at run time. This is the name the file will
have in the run-time working directory. If you enter a new file name,
the Data Exchanger component creates a parameter with the file name and
converts any periods to underscores. If you browsed to the file, this
box is automatically filled with the name of the specified file. Instead
of entering a file name, you can select an existing file parameter. The
file specified by the file parameter is used.
Note:
If you entered the name of a file, an input file parameter
is created that references the named file. This file parameter can be
mapped from an earlier component in the simulation process flow that
produced the file.
In the Encoding list, select the type of encoding
that you want to use.
You can use this option to explicitly specify the encoding the file
parameter is to use when converting between bytes and characters. In
a Locale (a system setting that includes the language, number formats,
and character set in use) that uses multibyte characters (Japanese, Chinese,
Korean), there is a default encoding used to convert bytes into characters.
Most text files are written using this encoding, but sometimes it is
necessary to specify this encoding. For additional information on encoding,
see File Type and Encoding in the Isight Development Guide.
Note:
This setting is visible only if the Show
File Type Encoding option on the Files tab is selected on
the Preferences dialog box. For more information
about Preferences, see Setting Files and Directories Preferences in the Isight User’s Guide.
Click Next.
The File Format screen appears.
Select one of the following:
Option |
Description |
General Text |
Text with no particular structure. Fields are located by
searching for words or phrases. |
Name/Value |
Data organized as a list of name/value pairs, where the
name is the first word on the line and there is a delimiter (space or
some punctuation) between the name and the value. Fields are located
by matching names. This format is used only with specially formatted
data; however, it does allow the variable names to be automatically selected
based on the field names. |
Table |
Tables and lists of numbers. Fields are identified by row number
(line) and column number. This format can be used with files in any format
as long as the line numbers never change; the number of entries on each
line do not have to be the same. The cells in the table can be separated
by delimiters (e.g., space, comma, etc.), or the table columns can be
defined by absolute character position (sometimes useful for reading
packed Fortran formatted data). The Table format
allows whole columns, rows, and arrays to be read into array parameters
in one action. |
Vector |
Data organized as a list of values separated by spaces or punctuation.
Fields are numbered sequentially through the whole section. The Vector
format allows one-dimensional arrays to be read in one operation. The
values can span multiple lines. This option is often used for Fortran
list-directed input. |
If you selected the Name/Value format, do the
following:
-
Click Next, and select the delimiter that you
want to use.
Delimiters are characters that delimit multiple name/value pairs on
a line; if Allow comments after Value is selected,
delimiters indicate the start of a comment. For more information, see
About Delimiters.
Once you make a selection, the highlighted information in the Sample
Text area is updated: the name fields are highlighted in
orange, and the value fields are highlighted in green.
-
Click More to set additional formatting options,
as desired.
-
Click Next, and determine how you want entries
to be read from parameters.
-
Edit the parameter information, as desired.
For more information, see About Editing Parameters.
Click Finish.
The file appears in the Data Source area as a
new tab.
Click OK to save your changes and to close the
Data Exchanger Component Editor.
|