system.mes.getLineStateHistory

Sepasoft MES Module Suite

system.mes.getLineStateHistory

Script function that returns a dataset of downtime events on a production line.

 

Downtime Event Dataset

This is the data that populates the OEE Downtime Table.

See:

For more information, see Line Data Points.

Datapoint Name
Description
Line State Event Begin Begin Time/Date to return
 Line State Event End End Time/Date to return
 Line State Duration

 The line or cell group (sub line) downtime event duration in minutes.

Note Line state event duration will respect the group by for the analysis query. This means that the line state duration will be constrained to be within the time slice represented by the row, even if the line state event begin time is before the from time for the row or the line state event end time is after the to time for the row.
 Line Downtime Equipment Path The equipment path of the line that is down.
 Line Downtime Original Equipment PathThe original path of the equipment that caused the line downtime before being reassigned to differed equipment.
 Line Downtime Equipment Name Name of the equipment that is responsible for causing line downtime.
 Line Downtime Reason

 The line or cell group (sub line) downtime reason.

Note
  • When the line is down the Line Downtime Reason is the same as the Line State Name.
  • When the line is up the Line Downtime Reason is blank.
 Line Downtime Reason PathThe line or cell group (sub line) original downtime reason.
 Equipment Note String - Any note that has been recorded for this piece of equipment through the Note tag collector path in the Production model.
 Line State Value The line or cell group (sub line) downtime state code. See Setting Up Equipment - State Code for more details.
 Line Downtime State Time Stamp The time stamp for the equipment state change of the cell group (sub line) or cell that caused the line downtime events.
 Line Downtime End State Time Stamp 
 Line Downtime Reason Split The line downtime reason split indicator. True is current downtime event has been split into multiple downtime events.
 Line Downtime Can Revert Split True if the line downtime reason split can be reverted.
 Line Downtime Event Sequence Every downtime event on the line is provided with an incrementing sequence number.
 Line Downtime Occurrence Count Number of downtime events for the selected period.
 Line State Override Type The state override type for a line or cell group (sub line). See Setting Up Equipment - Override for more details.
 Line State Override Scope The state override scope for a line or cell group (sub line). See Setting Up Equipment - Override Scope for more details.
 Line State Overridden When Key Reason Detection is set or Cell Groups are used, overriding the State must happen at the Line level.

Scripting Function Options


system.mes.getLineStateHistory(equipmentPath, beginDateTime, endDateTime, rollupTimeSpan, lookbackHours, constrainLineStateDurationToRow)

Return line state history.

Syntax

system.mes.getLineStateHistory(equipmentPath, beginDateTime, endDateTime, rollupTimeSpan, lookbackHours, constrainLineStateDurationToRow, lookbackHours, constrainLineStateDurationToRow)

  • Parameters

String equipmentPath - The equipment path of the line.

Date beginDateTime - The begin date time.

Date endDateTime - The end date time.

Integer rollupTimeSpan - If greater than zero, rollup like downtime events that repeat within this value.

Integer lookbackHours - A number of hours to lookback for finding blame in events that happened prior to the begin date time. Value must be a positive integer to be used.

Boolean constrainLineStateDurationToRow If set to True, the Line State Event Duration is constrained to the time range returned. If False, the duration uses the actual begin and end times ignoring the analysis time range.

  • Returns

Dataset getLineStateHistory - A dataset containing the state history for the line.

  • Scope

All

Python
equipmentPath = event.source.parent.getComponent('MES Object Selector').equipmentItemPath
runLookBackCount = 2
rollupTimeSpan = 0
dataset = system.mes.getLineStateHistory(equipmentPath, runLookBackCount, rollupTimeSpan)
print dataset.getColumnNames()
for row in range(dataset.getRowCount()):
    s = `row` + ': '
    for column in dataset.getColumnNames():
        s += `column` + ": " + `dataset.getValueAt(row, column)` + " || "
    print s

Output

Python
[Line State Event Begin, Line State Event End, Line State Duration, Line Downtime Equipment Path, Line Downtime Original Equipment Path, Line Downtime Equipment Name, Line Downtime Reason, Line Downtime Reason Path, Equipment Note, Line State Value, Line Downtime State Time Stamp, Line Downtime End State Time Stamp, Line Downtime Reason Split, Line Downtime Can Revert Split, Line Downtime Event Sequence, Line Downtime Occurrence Count, Line State Override Type, Line State Override Scope, Line State Overridden]
0: u'Line State Event Begin': Fri Sep 07 18:53:21 UTC 2018 || u'Line State Event End': Fri Sep 07 19:00:00 UTC 2018 || u'Line State Duration': 6.65 || u'Line Downtime Equipment Path': u'New Enterprise\New Site\New Area\New Line' || u'Line Downtime Original Equipment Path': u'New Enterprise\New Site\New Area\New Line' || u'Line Downtime Equipment Name': u'New Line' || u'Line Downtime Reason': u'Unplanned Downtime' || u'Line Downtime Reason Path': u'Default/Unplanned Downtime' || u'Equipment Note': None || u'Line State Value': 3 || u'Line Downtime State Time Stamp': Fri Sep 07 18:50:00 UTC 2018 || u'Line Downtime End State Time Stamp': Fri Sep 07 18:50:00 UTC 2018 || u'Line Downtime Reason Split': False || u'Line Downtime Can Revert Split': False || u'Line Downtime Event Sequence': 1 || u'Line Downtime Occurrence Count': 1 || u'Line State Override Type': u'Optional' || u'Line State Override Scope': u'Detected Equipment State' || u'Line State Overridden': False || 

system.mes.getLineStateHistory(equipmentPath, runLookBackCount, rollupTimeSpan, lookbackHours, constrainLineStateDurationToRow)

Return line state history.

Syntax

system.mes.getLineStateHistory(equipmentPath, runLookBackCount, rollupTimeSpan, lookbackHours, constrainLineStateDurationToRow)

  • Parameters

String equipmentPath - The equipment path of the line.

Integer runLookBackCount - The number of runs to return downtime events for from the current date and time. Set to 1 to return only the current / last run.".

Integer rollupTimeSpan - If greater than zero, rollup like downtime events that repeat within this value.

Integer lookbackHours - A number of hours to lookback for finding blame in events that happened prior to the begin date time. Value must be a positive integer to be used.

Boolean constrainLineStateDurationToRow If set to True, the Line State Event Duration is constrained to the time range returned. If False, the duration uses the actual begin and end times ignoring the analysis time range.

  • Returns

Dataset getLineStateHistory - A dataset containing the state history for the line.

  • Scope

All

Python
equipmentPath = event.source.parent.getComponent('MES Object Selector').equipmentItemPath
runLookBackCount = 2
rollupTimeSpan = 0
dataset = system.mes.getLineStateHistory(equipmentPath, runLookBackCount, rollupTimeSpan)
print dataset.getColumnNames()
for row in range(dataset.getRowCount()):
    s = `row` + ': '
    for column in dataset.getColumnNames():
        s += `column` + ": " + `dataset.getValueAt(row, column)` + " || "
    print s

 Output

Python
[Line State Event Begin, Line State Event End, Line State Duration, Line Downtime Equipment Path, Line Downtime Original Equipment Path, Line Downtime Equipment Name, Line Downtime Reason, Line Downtime Reason Path, Equipment Note, Line State Value, Line Downtime State Time Stamp, Line Downtime End State Time Stamp, Line Downtime Reason Split, Line Downtime Can Revert Split, Line Downtime Event Sequence, Line Downtime Occurrence Count, Line State Override Type, Line State Override Scope, Line State Overridden]
0: u'Line State Event Begin': Fri Sep 07 18:53:21 UTC 2018 || u'Line State Event End': Fri Sep 07 19:00:00 UTC 2018 || u'Line State Duration': 6.65 || u'Line Downtime Equipment Path': u'New Enterprise\New Site\New Area\New Line' || u'Line Downtime Original Equipment Path': u'New Enterprise\New Site\New Area\New Line' || u'Line Downtime Equipment Name': u'New Line' || u'Line Downtime Reason': u'Unplanned Downtime' || u'Line Downtime Reason Path': u'Default/Unplanned Downtime' || u'Equipment Note': None || u'Line State Value': 3 || u'Line Downtime State Time Stamp': Fri Sep 07 18:50:00 UTC 2018 || u'Line Downtime End State Time Stamp': Fri Sep 07 18:50:00 UTC 2018 || u'Line Downtime Reason Split': False || u'Line Downtime Can Revert Split': False || u'Line Downtime Event Sequence': 1 || u'Line Downtime Occurrence Count': 1 || u'Line State Override Type': u'Optional' || u'Line State Override Scope': u'Detected Equipment State' || u'Line State Overridden': False || 

system.mes.getLineStateHistory(equipmentPath, runLookBackCount, rollupTimeSpan, includeShortStops, unknownStateAsUnplannedDowntime, lookbackHours, constrainLineStateDurationToRow)

Return line state history.

Syntax

system.mes.getLineStateHistory(equipmentPath, runLookBackCount, rollupTimeSpan, includeShortStops, unknownStateAsUnplannedDowntime, lookbackHours, constrainLineStateDurationToRow)

  • Parameters

String equipmentPath - The equipment path of the line.

Integer runLookBackCount - The number of runs to return downtime events for from the current date and time. Set to 1 to return only the current / last run.".

Integer rollupTimeSpan - If greater than zero, rollup like downtime events that repeat within this value.

Boolean includeShortStops - Set to True to include short stop downtime events in the result.

Boolean unknownStateAsUnplannedDowntime - If true, treat any unknown equipment states as unplanned downtime. This will cause them to be reflected in the OEE availability (when the OEE module is installed).

Integer lookbackHours - A number of hours to lookback for finding blame in events that happened prior to the begin date time. Value must be a positive integer to be used.

Boolean constrainLineStateDurationToRow If set to True, the Line State Event Duration is constrained to the time range returned. If False, the duration uses the actual begin and end times ignoring the analysis time range.

  • Returns

Dataset getLineStateHistory - A dataset containing the state history for the line.

  • Scope

All

system.mes.getLineStateHistory(equipmentPath, beginDateTime, endDateTime, rollupTimeSpan, includeShortStops, unknownStateAsUnplannedDowntime, lookbackHours, constrainLineStateDurationToRow)

Return line state history.

Syntax

system.mes.getLineStateHistory(equipmentPath, beginDateTime, endDateTime, rollupTimeSpan, includeShortStops, unknownStateAsUnplannedDowntime, lookbackHours, constrainLineStateDurationToRow)

  • Parameters

String equipmentPath - The equipment path of the line.

Date beginDateTime - The begin date time.

Date endDateTime - The end date time.

Integer rollupTimeSpan - If greater than zero, rollup like downtime events that repeat within this value.

Boolean includeShortStops - Set to True to include short stop downtime events in the result.

Boolean unknownStateAsUnplannedDowntime - If true, treat any unknown equipment states as unplanned downtime. This will cause them to be reflected in the OEE availability (when the OEE module is installed).

Integer lookbackHours - A number of hours to lookback for finding blame in events that happened prior to the begin date time. Value must be a positive integer to be used.

Boolean constrainLineStateDurationToRow If set to True, the Line State Event Duration is constrained to the time range returned. If False, the duration uses the actual begin and end times ignoring the analysis time range.

  • Returns

Dataset getLineStateHistory - A dataset containing the state history for the line.

  • Scope

All


Sepasoft MES Module Suite