任务序列(三)
上次小编为大家介绍的任务序列中代码编写中LOAD参数中有一个port指的是从哪一个端口出发,在整个案例中,当操作员从暂存区取走货物之后会触发暂存区的一个离开触发,触发离开触发就会给出一个离开触发的端口号,是临时实体流中发送至端口的具体端口。
InthetasksequencethatIintroducedtoyoulasttime,thereisaportintheLOADparameterinthecodewritingthatreferstowhichporttostartfrom。Inthewholecase,whentheoperatortakesthegoodsfromthetemporarystoragearea,thetemporarystorageareawillbetriggered。Ifaleavetriggeristriggered,aleavetriggerportnumberwillbegiven,whichisthespecificportsenttotheportintheflowitemflow。
Opipno命令是获取输出端口的输入端口号的命令,对应的还有ipopno命令表示输入端口的输出端口号,cpcpno互为中间端口的输出端口,可根据需求选择使用。
TheOpipnocommandisacommandtoobtaintheinputportnumberoftheoutputport,andthecorrespondingipopnocommandindicatestheoutputportnumberoftheinputport。cpcpnoistheoutputportoftheintermediateport,whichcanbeselectedaccordingtotheneeds。
接下来我们将处理器的处理时间换成变化的状态,设置为5到25的随机值,那么这时候就不能使用DELAY参数了,这样就会发生运行时候的货物错乱。
Next,wechangetheprocessingtimeoftheprocessortoachangingstateandsetittoarandomvaluefrom5to25。ThentheDELAYparametercannotbeusedatthistime,sothatthegoodswillbedisorderedduringoperation。
所以这时候将运用到UTILIZE任务来进行如下代码修改
Soatthistime,theUTILIZEtaskwillbeusedtomodifythefollowingcode
这时再来观察运行状态会发现操作员一直处于waitting状态
Atthistime,lookattherunningstatusagainandyouwillfindthattheoperatorhasbeeninthewaitingstate。
因此需要进行释放操作员的任务来让其结束占用,在处理器的加工结束触发中添加释放操作员任务。
Therefore,itisnecessarytoperformthetaskofreleasingtheoperatortoletitendtheoccupation,andaddthereleasingoperatortaskintheprocessingendtriggeroftheprocessor。
或者直接选择释放操作员触发,使用小吸管吸取操作员使货物加工完成后被释放停止占用
Ordirectlychoosetoreleasetheoperatortrigger,useasmallstrawtosucktheoperatorsothatthegoodswillbereleasedandstopoccupiedafterthegoodsareprocessed。
观察运行过程如下,无论加工时间有多长,都会在加工结束后由操作员送至目的地。
Observetheoperationprocessasfollows,nomatterhowlongtheprocessingtimeis,itwillbesenttothedestinationbytheoperatoraftertheprocessingiscompleted。
那么如何实现多人多设备任务序列的操作呢?
Sohowtorealizetheoperationofmultipersonandmultidevicetasksequence?
基本布局如下
Thebasiclayoutisasfollows
有一个非常便捷的操作,就是选用标记运输工具,在保持选项中如果还有后续操作就选择true,直至最后一项任务改成false,这样就能保证一个操作员完成一整个运送流程,互不干扰。具体设置如下:
Thereisaveryconvenientoperation,whichistoselectthemarkedtransportationtool。Inthemaintenanceoption,ifthereisafollowupoperation,selecttrueuntilthelasttaskischangedtofalse,soastoensurethatoneoperatorcompletestheentiretransportationprocesswithouteachother。interference。Thespecificsettingsareasfollows:
运行结果如下:
Theresultsareasfollows:
最后任务可以简单的分为以下几个类型,行进类有travel前往一个指定下游,traveltoloc前往一个具体的地方,travelrelative相对移动;装卸类有装载、卸载、pickoffset拾取,placeoffset放置;延迟类包括延迟和占用;跳出类包括中断和子任务也是指当前任务的跳出;代码类就是指执行代码的一种操作,之后在为大家具体介绍。
Thefinaltaskscanbesimplypidedintothefollowingtypes。Thetraveltypeincludestraveltoadesignateddownstream,traveltoloctoaspecificplace,andtravelrelativemoves;theloadingandunloadingtypesincludeloading,unloading,pickoffsetpicking,placeoffsetplacement;delaytypeIncludingdelayandoccupancy;thejumpoutcategoryincludinginterruptsandsubtasksalsoreferstothejumpoutofthecurrenttask;thecodecategoryreferstoanoperationofexecutingthecode,andIwillintroduceitindetaillater。
希望今天的文章对你们有一定的作用!
Ihopetodaysarticlewillhaveacertaineffectonyou!
参考资料:腾讯课堂《从小白到大神》
英文翻译:Google翻译
本文由LearningYard学苑原创,若有侵权请联系删除。