if Store4.numMU > 0
wait 2:00
var portal := MultiPortalCrane7.portal1
waituntil portal.state ="waiting" or portal.state="idle"
var o: object := Store4.findPart("PalletMachine") // 查找存储Store4中某个部件
portal.moveToObject(o)
waituntil portal.state ="waiting" or portal.state="idle"
portal.moveHook(2)
waituntil portal.state ="waiting" or portal.state="idle"
Store4.cont.move(portal)
waituntil portal.state ="waiting" or portal.state="idle"
portal.moveHook(2)
waituntil portal.state ="waiting" or portal.state="idle"
portal.moveToObject(Store21)
waituntil portal.state ="waiting" or portal.state="idle"
portal.moveHook(4.8)
waituntil portal.state ="waiting" or portal.state="idle"
if portal.cont /= VOID
portal.cont.move(Store21)
end
waituntil portal.state ="waiting" or portal.state="idle"
portal.moveHook(2)
waituntil portal.state ="waiting" or portal.state="idle"
portal.endSequence
end
startsysDate:=sysDate
portal1.moveToPosition(targetSP1.x, targetSP1.y)
waituntil portal1.state="waiting"
// 天车移动吊具
portal1.moveHook(5)
waituntil portal1.state="waiting"
// 物品移动到天车上
@.move(portal1)
waituntil portal1.state="waiting"
portal1.moveHook(1)
var endMU:object
/*for var y := 1 to AreaTable.yDim
if (AreaTable[4,y] = VOID or AreaTable[4,y].dim <65) and AreaTable[1,y] /= 库位22
//TargetPosition := .ApplicationObjects.CranesAndMore.Internal.Methods.getTargetPosition(MultiPortalCrane,AreaTable[1,y])
// 将世界坐标转换为天车坐标
//CranePosition := MultiPortalCrane.calculateTargetPosition(portal1, TargetPosition)
//print AreaTable[4,y],"--",AreaTable[1,y],TargetPosition,CranePosition
//portal1.movePortalTo(CranePosition)
targetSP1 := portal1.~._3D.getPositionOfObject(AreaTable[1,y])
endMU:=AreaTable[1,y]
portal1.moveToPosition(targetSP1.x, targetSP1.y)
waituntil portal1.state="waiting"
portal1.moveHook(5)
waituntil portal1.state="waiting"
portal1.cont.move(AreaTable[1,y])
waituntil portal1.state="waiting"
portal1.moveHook(1)
if AreaTable[4,y] = VOID
var l: list[object]
l.create
l.insert(1, @)
AreaTable[4,y]:= l
AreaTable[4,y].insert(1, @)
else
AreaTable[4,y].insert(1, @)
end
exitloop
end
next*/
targetSP1 := portal1.~._3D.getPositionOfObject(存储11)
portal1.moveToPosition(targetSP1.x, targetSP1.y)
waituntil portal1.state="waiting"
portal1.moveHook(5)
waituntil portal1.state="waiting"
portal1.cont.move(存储11)
waituntil portal1.state="waiting"
portal1.moveHook(1)
portal1.endSequence
endsysDate:=sysDate
// 存入任务表
var spendTime:integer:=endsysDate - startsysDate
// 天车,起点库位,终点库位,时间,耗时
TaskTable.appendRow(portal1, @,存储11,startsysDate,endsysDate,spendTime)
更新:
var portal = MultiPortalCrane.portal1
print portal
var startTime = sysDate
waituntil portal.state ="waiting" or portal.state="idle"
var o: object := 存储.findPart("零件")
portal.moveToObject(o)
waituntil portal.state ="waiting" or portal.state="idle"
portal.moveHook(3)
waituntil portal.state ="waiting" or portal.state="idle"
存储.cont.move(portal)
waituntil portal.state ="waiting" or portal.state="idle"
portal.moveHook(2)
waituntil portal.state ="waiting" or portal.state="idle"
portal.moveToObject(上料口)
waituntil portal.state ="waiting" or portal.state="idle"
portal.moveHook(3)
waituntil portal.state ="waiting" or portal.state="idle"
wait 20
if portal.cont /= VOID
portal.cont.move(上料口)
end
waituntil portal.state ="waiting" or portal.state="idle"
portal.moveHook(2)
waituntil portal.state ="waiting" or portal.state="idle"
portal.endSequence
var endTime:=sysDate
var spendTime=endTime - startTime
// 天车,起点库位,终点库位,时间,耗时
调度表.appendRow(portal, startTime,endTime,o,上料口,spendTime)