Elapsed minutes Calculation (in: DateTime type A/ DateTime type B, out: Numeric C)

Calculates the elapsed time (minutes) from the two specified date time types and stores it in the data item

    A. Select DATETIME DATA [e.g.2016-09-01 11:00]Data selectDatetimeRequired
    B. Select DATETIME DATA [e.g.2016-09-01 13:30]Data selectDatetimeRequired
    C. Select ELAPSED TIME DATA [150 min] (update)Data selectNumericRequired
    -variable namevariable label
    Aconf_DataIdASelect DATETIME DATA [e.g.2016-09-01 11:00]
    Bconf_DataIdBSelect DATETIME DATA [e.g.2016-09-01 13:30]
    Cconf_DataIdCSelect ELAPSED TIME DATA [150 min] (update)
    //// == 自動工程コンフィグの参照 / Config Retrieving ==
    var dataIdA = configs.get( "conf_DataIdA" ); // (returns Number)
    var dataIdB = configs.get( "conf_DataIdB" ); // (returns Number)
    var dataIdC = configs.get( "conf_DataIdC" ); // (returns Number)
    
    //// == ワークフローデータの参照 / Data Retrieving ==
    var dayA = data.get( dataIdA );
    var dayB = data.get( dataIdB );
    
    //// == 演算 / Calculating ==
    var msec = dayB.getTime() - dayA.getTime();
    var mins = Math.round( msec / 1000 / 60 );
    
    //// == ワークフローデータへの代入 / Data Updating ==
    retVal.put( dataIdC, java.math.BigDecimal( mins ) );
    

    • A’: Time stored in the Data Item selected in config A
    • B’: Time stored in the Data Item selected in config B
    • The number of minutes elapsed from A’ until B’ (an integer value) will be stored in the Data Item selected in config C