CONST ee_event peEeAbortDeactA1:=[EE_START,"EvAbortDeactAll1","",255,255];
2020-07-29 10:43:36:WARNING:root:DeactStn1
2020-07-29 10:43:36:WARNING:root:DeactStn2
2020-07-29 10:43:37:WARNING:root:ActInterch1
2020-07-29 10:43:38:WARNING:root:DeactInterch1

CONST ee_event peEvIndexToStn1:=[EE_INDEX,"EvIndexToStn1","",1,GAP_STN_1];
2020-07-29 10:43:45:WARNING:root:ActInterch1         EvIndexToStn1
2020-07-29 10:43:47:WARNING:root:IndexToStn1         IndexToStn1
2020-07-29 10:43:49:WARNING:root:DeactInterch1       IndexToStn1
2020-07-29 10:44:10:WARNING:root:DeactInterch1       EvIndexToStn1

CONST ee_event peEvActStn1:=[EE_PRE_PART,"EvActStn1","",1,GAP_STN_1];
2020-07-29 10:44:10:WARNING:root:ActStn1

CONST ee_event peEvDeactStn1:=[EE_POST_PART,"EvDeactStn1","",1,GAP_STN_1];
2020-07-29 10:44:12:WARNING:root:DeactStn1

变位机工位切换

变位机工位切换(Index To Station)有两种方式,一种是使用机器人Irbp1EEv->peEvIndexToStn1切换,一种是PLC使用Irbp1Mnu->mdIntchStn1切换。

机器人Irbp1EEv->peEvIndexToStn1切换

机器人的partdata中有一个变量validStation用于设置该Part对应的Station编号(byte类型,按位对应),如1对应STN1,2对应STN2,4对应STN3,3对应STN1和STN2,这个变量只用于校验变位机是否转到接下来运行程序所适用的工位,不作为转动变位机的指令使用,也就是说partdata对应的程序可以只限制单个station使用,也可以在多个station中都可以使用。那么机器人如果判断接下来的part需要需要转到哪个station运行吗?是通过siGap_NextStnX判断的,所以如果PLC控制机器人运行程序是,需要同时发送siGap_NextStnX信号给机器人,机器人会根据这个信号自动转到对应的工位,然后在运行partdata中指定的程序,当然在运行partdata中程序前,会先核验一下工位有没有转到为。

TASK PERS partdata pdProgStn1:=["ProgStn1","Program station 1","T_ROB1:T_ROB2:T_POS1",1,0,"GapEmptyPart200.gif","pdvProgStn1"];
TASK PERS partdata pdProgStn2:=["ProgStn2","Program station 2","T_ROB1:T_ROB2:T_POS1",2,0,"GapEmptyPart200.gif","pdvProgStn2"];

PLC使用Irbp1Mnu->mdIntchStn1切换

如果PLC使用menudata主动切换变位机(Irbp1Mnu->mdIntchStn1),不希望机器人运行partdata时,自动切换变位机,可以禁用Irbp1Mnu->mdIntchStn1程序,然后把siGap_AtStn_1关联到soGap_NextStn_1上,因为在运行partdata时,变位机已经切换到位,所以可以直接使用该方法实现。

EIO_CROSS:

      -Name "Cross_soGap_NextStn_1" -Res "soGap_NextStn_1" -Act1 "siGap_AtStn_1"

      -Name "Cross_soGap_NextStn_2" -Res "soGap_NextStn_2" -Act1 "siGap_AtStn_2"


%%%
  VERSION:1
  LANGUAGE:ENGLISH
%%%

MODULE gapMain
    !
    PROC main()
        !Michael, 2020-9-25, The peEvIndexToStn1 and peEvIndexToStn2 must be disabled.
        !If the two ee_events are enabled after restore backup,
        !the user needs to disable them by reloading the system module "Irbp1EEv.sys" with the new module in
        !"Home:\\RAATCfg\\RAPID\\TASK5\\SYSMOD\\Irbp1EEv.sys"
        WHILE CheckpeEvIndexToStn() DO
            UIMsgBox\Header:="Replace Irbp1EEv.sys","Please replace the T_POS1's system module 'Irbp1EEv.sys'"\MsgLine3:="with the new module stored in"\MsgLine5:="'Home:\\RAATCfg\\RAPID\\TASK5\\SYSMOD\\Irbp1EEv.sys'"\Buttons:=btnOK\Icon:=iconError;
            Stop;
        ENDWHILE

        ExecEngine;
    ENDPROC

    FUNC bool CheckpeEvIndexToStn()
        VAR ee_event ee_eventTemp;
        GetDataVal "peEvIndexToStn1",ee_eventTemp;
        GetDataVal "peEvIndexToStn2",ee_eventTemp;
        RETURN TRUE;
    ERROR
        IF ERRNO=ERR_SYM_ACCESS THEN
            SkipWarn;
            RETURN FALSE;
        ENDIF
    ENDFUNC

ENDMODULE