EBSILON®Professional Online Documentation
EbsScript / EbsScript Interface Units / InterfaceUnit-Timeseries
In This Topic
    InterfaceUnit-Timeseries
    In This Topic

    Time Series

    There is a "Time Series" interface unit that can be used to access the time series calculation from EbsScript.

    In the time series, you can enter commands in the field B4 to execute an EbsScript and to select a profile where the calculation is to take place.
    The syntax for this is:

    ebsscript:"EbsScript-Name";profile:Profile-Id

     

    Name

    Purpose

    Arguments

    Return value

    Example

     

    tsGetTableCount

    Returns the number of time series created in the model

    no arguments

    INTEGER: Number of time series created in the model

    tsAddTable

    Create a new time series

    no arguments

    INTEGER: Index of the newly created time series

    tsRemoveTable

    Deletes the time series with the specified index

    Input:

    INTEGER: Index of the time series

    BOOLEAN: true, if the execution succeeds, otherwise false

    tsGetName

    Returns the name of the time series with the specified index

    Input:

    INTEGER: Index of the time series

    STRING: Name of the time series

    tsSetName

    Sets the default name for the time series with the specified index

    Input:

    1.INTEGER: Index of the time series

    2.STRING: Name

    BOOLEAN: true, if the execution succeeds, otherwise false

    tsGetRowCount

    Returns the number of rows in the time series with the specified index (?)

    Input:

    INTEGER: Index of the time series

    INTEGER: number of lines

    tsSetRowCount

    Sets the desired number of rows in the time series with the given index (?)

    Input:

    1.INTEGER: Index of the time series

    2.INTEGER: the desired number of lines

    BOOLEAN: true, if the execution succeeds, otherwise false

    tsGetColumnCount

    Returns the number of columns in the time series with the specified index (?)

    Input:

    INTEGER: Index of the time series

    INTEGER: number of columns

    tsSetColumnCount

    Sets the desired number of columns in the time series with the specified index (?)

    Input:

    1.INTEGER: Index of the time series

    2.INTEGER: the desired number of columns

    BOOLEAN: true, if the execution succeeds, otherwise false

    tsGetCell

    Returns the contents of the cell with the specified row and column index in the time series with the specified index (?)

    Input:

    1.INTEGER: Index of the time series

    2.INTEGER: Row index of the cell

    3. INTEGER: Column index of the cell

    VARIANT: Content of the cell

    tsSetCell

    Sets the content of the cell with the specified row and column index in the time series with the specified index to the desired data content

    Input:

    1.INTEGER: Index of the time series

    2.INTEGER: Row index of the cell

    3.INTEGER: Column index of the cell

    4.const VARIANT: The desired data content

    BOOLEAN:true, if the execution succeeds, otherwise false

    tsCalculate

    Performs the calculation of the time series with the specified index for optional lines

    Input:

    1.INTEGER: Index of the time series

    2.INTEGER=0: Number of the line from which the calculation must start

    3.INTEGER=-1: Number of the line in which the calculation must stop

    BOOLEAN: true, if the execution succeeds, otherwise false

    tsDeleteAutoLines

    Deletes all lines inserted in a previous calculation (x in column B)

    Input:

    1.INTEGER: Index of the time series

    BOOLEAN: true, if the execution succeeds, otherwise false

    tsInitHeader

    Initializes the head cells of the time series with the specified index

    Input:

    1.INTEGER: Index of the time series

    BOOLEAN: true, if the execution succeeds, otherwise false

    tsGenerateTimes

    Creates the cells with the timestamps in the time series with the specified index

    Input:

    1.INTEGER: Index of the time series

    2.REAL: Start-Time

    3.REAL: end-Time

    4.REAL: time interval

    5.BOOLEAN; true, if the superfluous lines must be deleted, otherwise false

    BOOLEAN: true, if the execution succeeds, otherwise false

    tsInsertColumn

    Inserts Columns

    Input:

    1.INTEGER: Index of the timeseries

    2.INTEGER: Column before which is inserted

    3.INTEGER: Number of columns to insert

    BOOLEAN: true, if the execution succeeds, otherwise false

    tsAppendColumn

    Appends Columns

    Input:

    1.INTEGER:  Index of the timeseries

    2.INTEGER: Number of columns to append

    BOOLEAN: true, if the execution succeeds, otherwise false

    tsInsertRow

    Inserts Rows

    Input:

    1.INTEGER:  Index of the timeseries

    2.INTEGER: Line before which is inserted

    3.INTEGER: Number of rows to insert

    BOOLEAN: true, if the execution succeeds, otherwise false

    tsAppendRow

    Appends Rows

    Input:

    1.INTEGER:  Index of the timeseries

    2.INTEGER: Number of rows to append

    BOOLEAN: true, if the execution succeeds, otherwise false

    tsCopyDependentValues

    Copies all timedependent specification values : results of last time step as specifications values of next time step (e.g. BT 118 LEVNEW->LEVACT)

    -

    -

    tsIsInTimeSeriesCalculation

    Indicates if a time-series-calculation is running

    -

    BOOLEAN: true, if yes

     

    Searches the time series for the first occurrence of a certain name (case-sensitive), beginning with the index "start_index" based on “zero“, and returns the index of the time series or -1 if the name was not found:

    Name

    Purpose

    Arguments

    Return value

    Example

     

    tsFindTableIndex

    see above

    Input:

    1.STRING: name

    2,BOOLEAN=false:case_sensitive

    3.INTEGER=0: start_index

    INTEGER: Index of the time series

     


    During a time series calculation, the next function returns the index of the time series and the current calculated line:

    Name

    Purpose

    Arguments

    Return value

    Example

     

    tsGetCurrentPosition

    see above

    Output:

    1: INTEGER: var index

    2: INTEGER: var row

    BOOLEAN: true, if the execution succeeds, otherwise false

     

    Auxiliary functions to enable Excel-like coordinates for addressing cells:  

    Name

    Purpose

    Arguments

    Return value

    Example

     

    tsIndexColumnToXlColumn

    Converts the default column index to the Excel column name

    Input:

    1.INTEGER: Column index in the time series

    Output:

    2.STRING: Column name in Excel

    BOOLEAN: true, if the execution succeeds, otherwise false

    tsXlColumnToIndexColumn

    Converts the default Excel column name into the column index

    Input:

    1.STRING: Column name in Excel

    Output:

    2.INTEGER: Column index in the time series

    INTEGER: Number of read characters in the given STRING

    tsRowColumnToXlPos

    Number of read characters in the given STRING

    Input:

    1.INTEGER: Row index in the time series

    2.INTEGER: Column index in the time series

    Output:

    3.STRING: Excel position

    BOOLEAN: true, if the execution succeeds, otherwise false

    tsXlPosToRowColumn

    Computes the default Excel position as STRING (for example, A26) into the column and row indexes in the time series

    Input:

    1.STRING: Excel position

    Output:

    2.INTEGER: Row index in the time series

    3.INTEGER: Column index in the time series

    BOOLEAN: true, if the execution succeeds, otherwise false

    tsGetCellXl

    Computes the default Excel position as STRING (for example, A26) into the column and row indexes in the time series, and calls the tsGetCell function for the time series with the specified index

    Input:

    1.INTEGER: Index of the time series

    2.STRING: Excel position

    VARIANT: Content of the cell

    tsSetCellXl

    Computes the default Excel position as STRING (for example, A26) into the column and row indexes in the time series, and calls the tsSetCell function for the time series with the specified index

    Input:

    1.INTEGER: Index of time series

    2.STRING: Excel-Position

    3.const VARIANT: the desired output

    BOOLEAN: true, if the execution succeeds, otherwise false

    Implementation see


     Ebsilon-Menu : EbsScript-Editor -->EbsScript -->Open Interface Unit --> TimeSeries