Skip to main content
Skip table of contents

Add DRL Component

Check the below for the details on the function of each component.

Mandatory WCI Action

  • Mandatory function gripper related to WCI → Grasp/Release
  • It is the default setting: The contents of the Grasp/Release functions vary according to the WCI selected.



Global Function

Add 3 functions to skill after registering as a global function and connect each user input value to the ‘Parameter’ values.

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


Check the following for the details on the Global Function and example codes.

  1. Add a Global Function.


  2. Click ‘...’ button of Select Global Function in Property of Global Function.

  3. Select ‘CaloffsetPos’ from Global Function List and click Confirm button.


  4. Connect the user input value to the ‘Parameter’ of the selected Global Function.

    • When changing the Global Function, the connection between 'Parameter' and user input is initialized and must be reconnected.
      • When editing the Global Function code, the Global Function previously registered in the DRL Component is maintained with the previous version code, and the 'Parameter' values ​​are also maintained

    • To apply changes to the previously registered Global Function, reload the Global Function.

      1.  If you press the '…' button, a popup to select a global function is displayed.
      2. If you select Global Function again in the pop-up, it is updated with the changed Global Function.

    1. ref_Pos: Move L > ref_Pos
    2. offset_Dist: Line Edit > app_ret_Dist
    3. offset_Frame: DR_TOOL(Can be input after checking the check box)
    4. Move L > ref_Frame

  5. After adding the Global Function, select ‘MoveFn’ from the Global Function List in the same way as in No. 2~3 and click Confirm button.

  6. Connect the user input value to the ‘Parameter’ of the selected Global Function.

    1. mType: "movel”(Can be input after checking the check box)
    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(Can be input after checking the check box)
    11. ref_Sol: None(Can be input after checking the check box)
    12. sync_Mode: "sync”(Can be input after checking the check box)

  7. After adding the Global Function, select 'AppRet_Motion' from the Global Function List in the same way as in No. 2~3 and click Confirm button.

  8. Connect the user input value to the ‘Parameter’ of the selected Global Function. Set the Component Name of all 'Parameter' to 'None'.

    In the case of a global function in which all arguments are connected in the user function corresponding to the main function, it is okay to enter all as ‘None’ after checking the check box.

User Function

In order for the created skill to run normally, a User Function that plays the role of the Main function must be added.

Fill out the main function of ‘Sample_Pick’ in the User Function. The Pick function planned in Skill Planning is implemented as a User Function.

  1. Add a User Function.


  2. Enter the ‘User Function Name’ in Property.

    • User Function Name: Sample_Pick

  3. Click ‘Edit Parameter & Return’ button.

  4. Click ‘Add New Parameter’ button.


  5. Enter ‘Parameter’ values as the following and click the Confirm button.

    • In the case of parameter connected to UI component (such as TCP_Name), connection is possible only when the Variable Name of the UI component is set. For details, see Skill Setting.
    • The name of the parameter and the variable name of the UI component do not have to be the same.
    • The global function must be connected to the parameter of the user function in the same way as the user input value (refer to 'AppRet_Motion', 'MoveFn' in the figure below).
    • It is recommended to keep the value set as the default value (Select) for the Variable Type of the parameter.

    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 is registered as below.


  7. Enter DRL ‘Sample_Pick’ Code in ‘Enter DRL Code’ input window as below.

    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) 

You can add option functions related to the WCI with User Defined Workcell Item Action. The next example demonstrate how to add Rest+IO function, a special function of gripper.

  1. Add a User Defined Workcell Item Action.


  2. Click ‘...’ button in Property.


  3. Select 'Reset I/O’ and click Confirm button.


  4. User Defined Workcell Item Action is registered as the following.
JavaScript errors detected

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

If this problem persists, please contact our support.