system.mes.oee.endCellChangeover
Sepasoft MES Module Suite
Description
End the changeover segment that is currently running at the specified equipment. After the changeover segment is ended, the production segment will begin.
Syntax
system.mes.oee.endCellChangeover(equipmentPath)
String equipmentPath - The equipment path of the cell or cell group to end the changeover segment for.
Nothing
All
Code Examples
Code Snippet
|
import time
shared.oee_test.utils.abort_all_active_segments()
# Get line object with more than 1 child
line_with_children = '[global]\Enterprise\Site\Area\Line 2'
print "
Running Rolling Changeover on line:
\t" + line_with_children
# Get available materials to selected line
print '
Getting Materials for:%s' % line_with_children
available_materials = system.mes.oee.getEquipmentAvailableMaterial(line_with_children, '*')
print '
Materials Available:'
for individual_material in available_materials:
print individual_material.getName()
# Is there more than 1 available material for the line?
assert (len(available_materials) > 1)
# Get cells of line
mes_cell_collection = system.mes.loadMESObjectByEquipmentPath(line_with_children).getChildCollection()
# Creating a dict to store equipment cell order as key and equipment path as value
cell_dict = {}
print "
Equipment on line:"
for py_cell in mes_cell_collection.getList():
print "\t" + py_cell.getMESObject().getName()
equipment_path = py_cell.getMESObject().getPropertyValue("EquipmentPath")
cell_order = py_cell.getMESObject().getPropertyValue("EquipmentCellOrder")
cell_dict[cell_order] = equipment_path
min_cell_order_val = min(cell_dict.keys())
cell_dict_len = len(cell_dict.keys())
print "
Order of Execution:"
for i in range(min_cell_order_val + 1, min_cell_order_val + cell_dict_len):
cell_path = cell_dict.get(i)
print "\t" + cell_path
#######################################################
# time.sleep is simulating actually running changeover and production
#######################################################
# Begin 1st OEE run
res_seg_1 = system.mes.oee.beginOEERun(available_materials[0].getName(), line_with_children)
print "
Response Segment 1:
\t%s" % str(res_seg_1)
time.sleep(2)
system.mes.oee.endOEEChangeover(line_with_children)
time.sleep(2)
# Begin 2nd OEE run
res_seg_2 = system.mes.oee.beginOEERun(available_materials[1].getName(), line_with_children)
print "
Response Segment 2:
\t%s" % str(res_seg_2)
time.sleep(2)
system.mes.oee.endOEEChangeover(line_with_children)
# Begin rolling changeover
print "
Running Rolling Changeover on:"
for i in range(min_cell_order_val + 1, min_cell_order_val + cell_dict_len):
cell_path = cell_dict.get(i)
print "\t%s" % str(cell_path)
time.sleep(2)
system.mes.oee.indexCellProduct(cell_path, False)
time.sleep(2)
system.mes.oee.endCellChangeover(cell_path)
time.sleep(2)
print "
Ending Production on:
\t%s" % str(line_with_children)
system.mes.oee.endOEEProduction(line_with_children)
|
Output
|
>>>
Running Rolling Changeover on line:
[global]\Enterprise\Site\Area\Line 2
Getting Materials for:[global]\Enterprise\Site\Area\Line 2
Materials Available:
MatDef1
MatDef2
Equipment on line:
Casepacker
Filler
Inspection
Labeler
Palletizer
Sealer
Order of Execution:
Enterprise\Site\Area\Line 2\Sealer
Enterprise\Site\Area\Line 2\Labeler
Enterprise\Site\Area\Line 2\Inspection
Enterprise\Site\Area\Line 2\Casepacker
Enterprise\Site\Area\Line 2\Palletizer
Response Segment 1:
ResponseSegment (a6818715-f71b-4336-8eb4-3967dcac31a8, MatDef1-Enterprise:Site:Area:Line 2_CO, 0 parents, 0 children, 0 custom properties, 7 complex properties)
Response Segment 2:
ResponseSegment (d2cdaeaf-8624-4aa8-a5f2-1fac7ecf7837, MatDef2-Enterprise:Site:Area:Line 2_CO, 0 parents, 0 children, 0 custom properties, 7 complex properties)
Running Rolling Changeover on:
Enterprise\Site\Area\Line 2\Sealer
Enterprise\Site\Area\Line 2\Labeler
Enterprise\Site\Area\Line 2\Inspection
Enterprise\Site\Area\Line 2\Casepacker
Enterprise\Site\Area\Line 2\Palletizer
Ending Production on:
[global]\Enterprise\Site\Area\Line 2
>>>
|
Sepasoft MES Module Suite