You can use the Quick Data Source Configuration option or the Exchanger Wizard to define the ASCII input file that will be updated by the Simcode component during the input procedure.
You then specify regions from the
file that will be used to define an Isight
parameter and its value.
Before you begin: To use Quick Data Source Configuration, you must select Data Exchanger as the default parser and select the Show Quick Data Source Configuration preference (see Setting Simcode Component Preferences).
Configure the Input Using Quick Data Source Configuration
You can use the Quick Data Source Configuration option to configure the input.
Double-click the Simcode component icon .
The Simcode Component Editor icon appears.
From the Simcode Component Editor, select the Input tab.
Click the box labeled Click here to open a new Data Source in the center of the dialog box.
The Quick Data Source Configuration dialog box appears.
In the Template File text box, enter the path to the template file, or click Browse to locate the file.
Select the Line Ending:
Option
Description
Default
Select this option to leave the line endings as they were found in the input file. Isight does not attempt to change the line endings. If the file has to be copied for some reason, local line endings are used.
Local
Select this option to write the file with the local line endings for the computer on which the model is running. This is the location of the Isight Gateway and the SIMULIA Execution Engine station. This means CR-LF on Windows and LF on Linux. The file will always be copied in text mode and the line endings updated, even if the line endings already appear to be correct.
Linux
Select this option to always separate lines with LF, even if the model is running on Windows.
Windows
Select this option to always separate lines with CR-LF, even if the model is running on Linux.
Choose the format of the file.
Option
Description
General Text
Use this format for text with no particular structure. Fields are located by searching for words or phrases.
Name/Value
Use this format for 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
Use this format for 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). This format allows whole columns, rows, and arrays to be read into array parameters in one action.
Vector
This format is for data organized as a list of values separated by spaces or punctuation. Fields are numbered sequentially through the whole section. This 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 Name/Value as the format, you can specify a Delimiter (Space, Tab, Colon, Equal Sign).
Click OK.
From the Simcode Component Editor, select regions of the input file that will be used to define a parameter and its value and specify if the parameter will be used for reading or writing.
Configure the Input Using the Exchanger Wizard
You can use the Exchanger Wizard to configure the input.
Double-click the Simcode component icon .
The Simcode Component Editor icon appears.
From the Simcode Component Editor, select the Input tab.
Click the box labeled Click here to open a new Data Source in the center of the dialog box.
The Exchanger Wizard appears.
Select the data source (Java String or Text File).
Click Next.
The Select Data Source screen appears.
Select the location of the data that you want to update after Isight has parsed the input file, as follows:
To update an existing template file at run time, select Update a template file and click Next.
Note:
An input file parameter is created for the template file. While the template file is usually fixed, it is possible to map another file parameter to the template file parameter, allowing the template to vary at run time.
The Select Template File screen appears.
Enter the name of the template file, or click Browse to locate the file.
Select one of the following:
Store contents of the template in the model
Allows the model to be self-contained; it can be run even if the file is subsequently deleted. However, the file must be explicitly reloaded (using the Files tab on the Design Gateway) to pick up any changes made to the file after the model is created.
Read template from this file for every run
Allows the model to reference the file on disk every time the Simcode component executes. This option is faster than the above option, saves space for large files, and causes the model to see any changes to the file the next time it is run. However, it can prevent distributed execution of the model, and the model becomes unusable if the file is deleted.
Click Next.
The Select Local File Name screen appears.
To create a new file at run time, select Write a new file from scratch and click Next.
The Select Local File Name screen appears.
To modify an existing file parameter at run time, select Modify an existing file parameter and click Next.
The Select File Parameter screen appears.
Select the file parameter that will provide the template data that will be updated by the input file parse. This file parameter can already be part of the Simcode component, or it can be an output from another component earlier in the simulation process flow.
Click Next.
The Select Local File Name screen appears.
Enter the name of the local file that will be read by the command or click Browse to locate the file.
If you want to create a file that will receive a copy of the updated input file after the Simcode component completes, click Save generated file to output file parameter. This can be useful for checking that the input file is updated correctly. The file is written to the database. The template file is still updated, and the input file parameter is still used in the command or script.
Note:
The input and output file parameters are associated with each other by having the same local file name (the destination of the input file parameter is the same as the source of the output file parameter).
Click Next.
The File Format options screen appears.
Choose the format of the output file.
Click Finish to exit the Exchanger Wizard.
From the Simcode Component Editor, select regions of the input file that will be used to define a parameter and its value and specify if the parameter will be used for reading or writing.