Communication Between Isight and External Executable Approximation Plug-ins

All communication and data exchange between Isight and the external executable approximation plug-in is done by writing and reading special files. This communication is less efficient than the standard plug-in and can be especially noticeable when viewing approximation graphs created in the Approximation Viewer because the graphs require a large number of approximation evaluations.

There are four actions that the external executable program must be able to perform:

Initializing the Approximation

The following is the sequence of events that occur when Isight initializes the approximation. Isight executes all sampling points using the built-in sampling mechanism and creates the following files in the execution directory (see File Formats Used by External Executable Approximation Plug-ins):

  • technique options file
  • input matrix file
  • output matrix file

Isight calls the external executable program using the following command syntax:

my.exe  initialize  
-techniqueOptionsFile techniqueOptionsFileName  
-inputMatrixFile inputMatrixFileName  
-outputMatrixFile outputMatrixFileName   
-internalDataFile internalDataFileName

where:

  • my.exe is the name of the external executable program,

  • techniqueOptionsFileName is the name (full path) of the technique options file,

  • inputMatrixFileName is the name (full path) of the file with input values for all sampling points executed,

  • outputMatrixFileName is the name (full path) of the file with output values for all sampling points executed, and

  • internalDataFileName is the name (full path) of the file where the external executable program must write its internal data that represent the initialized state of the approximation.

The external executable program does the following:

  • reads the technique options file,

  • reads the input matrix file,

  • reads the output matrix file,

  • initializes the approximation, and

  • creates a file with internal data with the name specified as internalDataFileName.

Isight reads the internal data file created by the external executable program and stores its contents in memory. The approximation is considered initialized at this time. Isight provides the internal data again as a local file when the approximation is evaluated or exported.

Evaluating the Approximation

The following is the sequence of events that occur when Isight evaluates the approximation. Isight creates the following files in the execution directory (see File Formats Used by External Executable Approximation Plug-ins):

  • input matrix file
  • output matrix file
  • internal data file
  • input values file

Isight calls the external executable program using the following command syntax:

my.exe evaluate
-inputMatrixFile inputMatrixFileName
-outputMatrixFile outputMatrixFileName
-internalDataFile internalDataFileName
-inputValuesFile inputValuesFileName
-outputValuesFile outputValuesFileName

where:

  • my.exe is the name of the external executable program,

  • inputMatrixFileName is the name (full path) of the file with input values for all sampling points used for initialization,

  • outputMatrixFileName is the name (full path) of the file with output values for all sampling points used for initialization,

  • internalDataFileName is the name (full path) of the file with the internal data that represent the initialized state of the approximation (the same data that were written by the external executable program after initialization),

  • inputValuesFileName is the name (full path) of the file with the input values for the evaluation points, and

  • outputValuesFileName is the name (full path) where the external executable program is expected to write the output values for the evaluated points.

The external executable approximation program does the following:

  • reads the input matrix file,

  • reads the output matrix file,

  • reads the internal data file,

  • reads the input values file,

  • evaluates each point in the input values file, and

  • creates an output values file (outputValuesFileName) containing output values for all evaluated points.

Isight reads the output values from the specified output values file.

Exporting the Approximation Coefficient Data

The following is the sequence of events that occur when Isight exports the approximation coefficient data to a readable format file. Isight creates an internal data file in the execution directory (see File Formats Used by External Executable Approximation Plug-ins).

Isight calls the external executable program using the following command syntax:

my.exe export   
-exportToFile exportFileName  
-internalDataFile internalDataFileName

where:

  • my.exe is the name of the external executable program,

  • exportFileName is the name (full path) of the file where the external executable program must write its coefficient data in a readable format. These data will be shown on the Approximation Initialization dialog box in the Design Gateway and on the Visual Design tab in the Runtime Gateway, and

  • internalDataFileName is the name (full path) of the file with the internal data that represents the initialized state of the approximation (the same data that were written by the external executable program after initialization).

The external executable program reads the internal data file and writes its coefficient data to a file (exportFileName) in a readable format.

When writing the approximation’s coefficient data, it is recommended that you start with an easily recognizable title string (e.g., "MY APPROXIMATION COEFFICIENTS"), so that the external executable program can easily find this string when performing the reverse operation of loading approximation coefficient data from a file.

Isight reads the exported coefficient data from the specified file and appends it to the standard text data to be shown on the Approximation Initialization dialog box in the Design Gateway or on the Visual Design tab in the Runtime Gateway.

Loading the Approximation Coefficient Data

The following is the sequence of events that occur when Isight loads the approximation coefficient data from a file to a readable format: Isight copies the coefficient data file into a local directory (see File Formats Used by External Executable Approximation Plug-ins).

Isight calls the external executable program using the following command syntax:

my.exe load
-loadFromFile coefficientDataFileName  
-internalDataFile internalDataFileName

where:

  • my.exe is the name of the external executable program,

  • coefficientDataFileName is the name (full path) of the file with the approximation’s coefficient data in a readable format, and

  • internalDataFileName is the name (full path) of the file where the external executable program writes its internal data representing the initialized state of the approximation.

The external executable program reads the coefficient data file, and creates a file with its internal data (internalDataFileName) in the same format that was used during initialization.

The coefficient data file provided by Isight contains various standard information at the beginning of the file, including parameter names, input matrix, and output matrix, as can be seen when viewing any initialized approximation in the Approximation Initialization dialog box in the Design Gateway. The external executable program must find the coefficient data section at the end of the file. This section will be exactly the same as written by your external executable program during the export action (see Exporting the Approximation Coefficient Data).

Isight reads the internal data file created by the external executable program and stores its contents in memory. The approximation is considered initialized at this time. Isight provides the internal data again as a local file when the approximation is evaluated or exported.