ExternalProgram

The ExternalProgram object executes an external program when it receives an entity.  Model execution is suspended until the external program terminates.  The external program can be written in Python or any other language.

ExternalProgram Inputs

Keyword

Description

Key Inputs

 

Description

A free-form string describing the object.

NextComponent

The next object to which the processed entity is passed.

ProgramFile

The executable file for the external program.  If the external program is written in Python, the program file is the executable for Python interpreter (python.exe).

InputFile

Optional input file for the external program.  If the external program is written in Python, the input file is the python code file (*.py)

DataSource

A list of expressions that provide the parameters to the external program. The inputs must be provided in the order in which they are to be entered in the external program's command line.

InitialValue

The Value output prior to receiving the first entity.

TimeOut

Maximum time in milliseconds for the external program to finish executing.

Options

 

AttributeDefinitionList, CustomOutputList

See Section 6.2.

StateAssignment

The state to be assigned to each entity on arrival at this object.  No state is assigned if the entry is blank.

Graphics

 

Position, Alignment, Size, Orientation, Region, RelativeEntity, DisplayModel, Show, Movable, VisibleViews, DrawRange

See Section 11.1.

ExternalProgram Outputs

Output Name

Description

Entity and DisplayEntity

 

Name, ObjectType, SimTime, Parent, Attributes, Custom Outputs, Position, Size, Orientation, Alignment, GraphicalLength, ObserverList, NextList, PreviousList

See Section 10.1.

StateEntity

 

State, WorkingState, WorkingTime, StateTimes, TotalTime

Not used.

LinkedComponent

 

obj, NumberAdded, NumberProcessed, NumberInProgress, ProcessingRate, ReleaseTime

See Section 16.

ExternalProgram

 

Value

An array of values returned by the external program after parsing.  Returned strings are converted automatically to numbers, times, or entities, if appropriate.  For example, if the external program returns a single number, its value is 'this.Value(1)'.