Skip to main content
Skip table of contents

DRL Component 추가하기

각 Component의 기능에 대한 자세한 내용은 아래를 확인하십시오.

Mandatory WCI Action

  • WCI와 관련된 필수 기능 Gripper → Grasp/Release
  • 기본 설정이며: 선택한 WCI에 따라 Grasp/Release 함수의 내용은 달라짐.



Global Function

Global Function으로 등록한 다음 3개의 함수를 Skill에 추가하고 'Parameter' 값들에 사용자 입력 값들을 각각 연결해야 합니다.

  1. CaloffsetPos()
  2. MoveFn()
  3. AppRet_Motion_v2()


Global Function에 대한 자세한 내용과 예제 코드는 다음을 확인하십시오.

  1. Global Function을 추가하십시오.


  2. Global Function의 Property에서 Select Global Function의 '...' 버튼을 누르십시오.

  3. Global Function List에서 'CaloffsetPos'를 선택하고 확인(Confirm) 버튼을 누르십시오.


  4. 선택한 Global Function의 'Parameter'에 사용자 입력 값을 연결하십시오.

    • Global Function을 변경하는 경우, 'Parameter'와 사용자 입력의 연결이 초기화 되어 재 연결해야 합니다.
      • Global Function의 코드를 편집하는 경우, 기존에 DRL Component에 등록된 Global Function은 이전의 버전 코드로 유지되며, 'Parameter'의 값들도 그대로 유지됩니다. 

    • 기존에 등록된 Global Function의 변경 사항을 적용하려면, Global Function을 다시 로드하십시오.

      1. '…' 버튼을 누르면, Global Function을 선택할 수 있는 팝업이 표시됩니다.
      2. 해당 팝업에서 Global Function을 다시 선택하면, 변경된 Global Function으로 업데이트 됩니다.

    1. ref_Pos: Move L > ref_Pos
    2. offset_Dist: Line Edit > app_ret_Dist
    3. offset_Frame: DR_TOOL(체크박스 체크 후 입력 가능)
    4. Move L > ref_Frame

  5. Global Function을 추가한 후, 2~3번과 동일한 방법으로 Global Function List에서 'MoveFn'을 선택하고 확인(Confirm) 버튼을 누르십시오.

  6. 선택한 Global Function의 'Parameter'에 사용자 입력 값을 연결하십시오.

    1. mType: "movel"(체크박스 체크 후 입력 가능)
    2. ref_Pos: Move L > ref_Pos
    3. ref_Vel: Move L > ref_Vel
    4. ref_Acc: Move L > ref_Acc
    5. ref_Time: Move L > ref_Time
    6. ref_Radius: Move L > ref_Radius
    7. ref_Frame: Move L > ref_Frame
    8. ref_Mod: Move L > ref_Mod
    9. ref_Ractive: Move L > ref_Ractive
    10. ref_Apptype: None(체크박스 체크 후 입력 가능)
    11. ref_Sol: None(체크박스 체크 후 입력 가능)
    12. sync_Mode: "sync"(체크박스 체크 후 입력 가능)

  7. Global Function을 추가한 후, 2~3번과 동일한 방법으로 Global Function List에서 'AppRet_Motion'을 선택하고 확인(Confirm) 버튼을 누르십시오.

  8. 선택한 Global Function의 'Parameter'에 사용자 입력 값을 연결하십시오. 모든 'Parameter'의 Component Name을 'None'으로 설정하십시오.

    Main 문에 해당하는 User Function에서 모든 인자가 연결되는 Global Function의 경우, 체크 박스 체크 후 모두 'None'으로 입력하여 사용해도 무방합니다.

User Function

생성된 Skill이 정상적으로 실행되기 위해서는 반드시 Main 함수의 역할을 하는 User Function이 추가되어야 합니다.

'Sample_Pick' Skill의 Main 함수를 User Function에 작성해야 합니다. Skill 기획하기에서 기획한 Pick 함수를 User Function으로 구현합니다. 

  1. User Function을 추가하십시오.


  2. Property에서 'User Function Name'을 입력하십시오.

    • User Function Name: Sample_Pick

  3. 'Edit Parameter & Return' 버튼을 누르십시오.

  4. 'Add New Parameter' 버튼을 누르십시오.


  5. 다음과 같이 'Parameter' 값들을 입력하고 확인(Confirm) 버튼을 누르십시오.

    • TCP_Name과 같이 UI Component와 연결되는 Parameter의 경우, UI Component의 Variable Name이 설정되어 있어야만 연결이 가능합니다. 자세한 내용은 Skill 설정하기(Skill Setting)를 참고하십시오.
    • Parameter의 이름과 UI Component의 Variable Name이 동일할 필요는 없습니다.
    • Global function은 사용자 입력 값과 마찬가지로 User Function의 Parameter에 연결해야만 합니다(아래 그림에서 'AppRet_Motion', 'MoveFn' 참고).

    • Parameter의 Variable Type은 기본 값으로 설정된 값(Select)을 유지하는 것을 권장합니다.

    1. Parameter Name: ref_Pos
      • Variable Type: Pose
      • UI Component: Move L > ref_Pos
    2. Parameter Name: ref_Vel
      • Variable Type: Variable
      • UI Component: Move L > ref_Vel
    3. Parameter Name: ref_Acc
      • Variable Type: Variable
      • UI Component: Move L > ref_Acc
    4. Parameter Name: ref_Time
      • Variable Type: Variable
      • UI Component: Move L > ref_Time
    5. Parameter Name: ref_Radius
      • Variable Type: Variable
      • UI Component: Move L > ref_Radius
    6. Parameter Name: ref_Mod
      • Variable Type: Variable
      • UI Component: Move L > ref_Mod
    7. Parameter Name: ref_Ractive
      • Variable Type: Variable
      • UI Component: Move L > ref_Ractive
    8. Parameter Name: ref_Frame
      • Variable Type: Variable
      • UI Component: Move L > ref_Frame
    9. Parameter Name: ReleaseBefore_Pick
      • Variable Type: Variable
      • UI Component: Toggle Switch > ReleaseBefore_Pick
    10. Parameter Name: gripper_wait_Time
      • Variable Type: Variable
      • UI Component: Line Edit > gripper_wait_Time
    11. Parameter Name: App_Ret_Setting_Flag
      • Variable Type: Variable
      • UI Component: Accordion Toggle > App_Ret_Setting_Flag
    12. Parameter Name: app_ret_Dist
      • Variable Type: Array
      • UI Component: Line Edit > app_ret_Dist
    13. Parameter Name: app_ret_Vel
      • Variable Type: Variable
      • UI Component: Line Edit > app_ret_Vel
    14. Parameter Name: app_ret_Acc
      • Variable Type: Variable
      • UI Component: Line Edit > app_ret_Acc
    15. Parameter Name: AppRet_Motion
      • Variable Type: Select(선택 없음)
      • UI Component: Global Function > AppRet_Motion_v2
    16. Parameter Name: MoveFn
      • Variable Type: Select(선택 없음)
      • UI Component: Global Function > MoveFn
    17. Parameter Name: TCP_Setting_Flag
      • Variable Type: Variable
      • UI Component: Toggle Switch > TCP_Setting_Flag
    18. Parameter Name: TCP_Name
      • Variable Type: Array
      • UI Component: Workcell Item Selection > wci_name

  6. 아래와 같이 Parameter가 등록됩니다.


  7. 'Enter DRL Code' 입력 창에 DRL 'Sample_Pick' Code를 아래와 같이 입력하십시오.

    Sample_Pick

    PY
    # Sample Pick Skill 
    def Sample_Pick(ref_Pos, ref_Vel, ref_Acc, ref_Time, ref_Radius, ref_Mod, ref_Ractive, ref_Frame, ReleaseBefore_Pick, gripper_wait_Time, TCP_Setting_Flag, TCP_Name, App_Ret_Setting_Flag, app_ret_Dist, app_ret_Vel, app_ret_Acc, AppRet_Motion, MoveFn):
        # Initial setting
        if TCP_Setting_Flag == True:
            set_tcp(TCP_Name)
        app_ret_Time = ref_Time
        app_ret_Radius = ref_Radius
        ref_Apptype = None 
        ref_Sol = None
        if App_Ret_Setting_Flag == False:
            app_ret_Dist = [0, 0, 0] 
            app_ret_Vel = ref_Vel
            app_ret_Acc = ref_Acc
        # Approach/Retract Motion Setting
        if App_Ret_Setting_Flag == True: 
            AppRet_Motion(app_ret_Dist, ref_Pos, app_ret_Vel, app_ret_Acc, app_ret_Time, app_ret_Radius, ref_Frame, ref_Mod, ref_Ractive, CaloffsetPos, MoveFn)
        # ReleaseBefore_Pick Setting
        if ReleaseBefore_Pick == True:
            Release()
            wait(gripper_wait_Time)
        # Pick Motion
        MoveFn(mType, ref_Pos, ref_Vel, ref_Acc, ref_Time, ref_Radius, ref_Frame, ref_Mod, ref_Ractive, ref_Apptype, ref_Sol, sync_Mode)
        Grasp()
        wait(gripper_wait_Time)
        # Retract/Retract Motion Setting
        if App_Ret_Setting_Flag == True:
            AppRet_Motion(app_ret_Dist, ref_Pos, app_ret_Vel, app_ret_Acc, app_ret_Time, app_ret_Radius, ref_Frame, ref_Mod, ref_Ractive, CaloffsetPos, MoveFn)
    

User Defined Workcell Item Action(Optional) 

User Defined Workcell Item Action으로 WCI와 관련된 옵션 기능을 추가할 수 있습니다. 다음 예제에서는 그리퍼의 특수 기능인 Reset_IO 기능을 추가합니다.

  1. User Defined Workcell Item Action을 추가하십시오.


  2. Property에서 '...' 버튼을 누르십시오.


  3. 'Reset I/O'를 선택하고 확인(Confirm) 버튼을 누르십시오.


  4. 다음와 같이 User Defined Workcell Item Action이 등록됩니다.
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.